~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: mordred
  • Date: 2008-11-01 00:33:11 UTC
  • mto: (572.1.1 devel) (575.1.1 devel)
  • mto: This revision was merged to the branch mainline in revision 573.
  • Revision ID: mordred@opensolaris-20081101003311-qe94clpg1lmn4yxg
Fixed configure.ac to work cleanly on Solaris - and define some good compile flags.

Show diffs side-by-side

added added

removed removed

Lines of Context:
275
275
AC_PROG_MAKE_SET
276
276
 
277
277
 
278
 
# Print version of CC and CXX compiler (if they support --version)
279
 
case $SYSTEM_TYPE in
 
278
case "$target_os" in
 
279
  *linux*)
 
280
  TARGET_LINUX="true"
 
281
  AC_SUBST(TARGET_LINUX)
 
282
  AC_DEFINE([TARGET_OS_LINUX], [1], [Whether we build for Linux])
 
283
    ;;
280
284
  *apple-darwin*)
 
285
    TARGET_OSX="true"
 
286
    AC_SUBST(TARGET_OSX)
281
287
    AC_DEFINE([TARGET_OS_OSX], [1], [Whether we build for OSX])
282
288
    ;;
 
289
  *solaris*)
 
290
    TARGET_SOLARIS="true"
 
291
    AC_SUBST(TARGET_SOLARIS)
 
292
    AC_DEFINE([TARGET_OS_SOLARIS], [1], [Whether we are building for Solaris])
 
293
    ;;
283
294
  *)
284
 
CC_VERSION=`$CC --version | sed 1q`
285
295
    ;;
286
296
esac
287
 
if test $? -eq "0"
288
 
then
289
 
  AC_MSG_CHECKING("C Compiler version")
290
 
  AC_MSG_RESULT("$CC $CC_VERSION")
291
 
else
292
 
CC_VERSION=""
293
 
fi
294
 
AC_SUBST(CC_VERSION)
295
297
 
296
298
dnl AC_CANONICAL_HOST thinks it's a good idea to just set CFLAGS to 
297
299
dnl -g -O2 if you're running gcc. We would like to use something else, thanks.
304
306
  CXXFLAGS=
305
307
fi
306
308
 
 
309
DRIZZLE_CHECK_C_VERSION
307
310
DRIZZLE_CHECK_CXX_VERSION
308
311
 
309
312
AC_PROG_AWK
317
320
fi
318
321
 
319
322
dnl TODO: This needs to go away and be replaced with _ISOC99_SOURCE
320
 
if test "$ac_cv_compiler_gnu" = "yes" -o "$target_os" = "linux-gnu"
 
323
if test "$ac_cv_c_compiler_gnu" = "yes" -o "$target_os" = "linux-gnu"
321
324
then
322
325
  AC_DEFINE([_GNU_SOURCE],[1],[Fix problem with S_ISLNK() on Linux])
323
326
fi
386
389
])
387
390
AC_MSG_RESULT($mysql_cv_sys_os)
388
391
 
389
 
# This should be rewritten to use $target_os
390
 
case "$target_os" in
391
 
  *solaris*)
392
 
    TARGET_SOLARIS="true"
393
 
    AC_DEFINE([TARGET_OS_SOLARIS], [1], [Whether we are building for Solaris])
394
 
    AC_SUBST(TARGET_SOLARIS)
395
 
  ;;
396
 
esac
397
392
 
398
393
# The following is required for portable results of floating point calculations
399
394
# on PowerPC. The same must also be done for IA-64, but this options is missing
425
420
fi
426
421
if test "$SUNCC" = "yes"
427
422
then
428
 
  SYMBOLS_CLAGS="-g"
 
423
  dnl I'm cheating here and sticking C99 support in SYMBOLS_FLAGS
 
424
  SYMBOLS_FLAGS=""
429
425
  DEBUG_OPTIMIZE_CC=""
430
 
  OPTIMIZE_CFLAGS="-xO4 -xlibmil -xdepend -Xa -xstrcont -mt -D_FORTEC_"
 
426
  OPTIMIZE_CFLAGS="-xO4 -xlibmil -xdepend -Xa -xstrconst -mt -D_FORTEC_"
431
427
  DEBUG_OPTIMIZE_CXX=""
432
428
  OPTIMIZE_CXXFLAGS="-xO4 -xlibmil -library=stlport4 -mt -D_FORTEC_"
433
429
fi
489
485
DRIZZLE_PROG_AR
490
486
 
491
487
# libdrizzle versioning when linked with GNU ld.
492
 
if $LD --version 2>/dev/null|grep -q GNU; then
 
488
if test "$GCC" = "yes" -a $LD --version 2>/dev/null|grep -q GNU; then
493
489
  LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_srcdir)/libdrizzle/libdrizzle.ver"
494
490
fi
495
491
AC_SUBST(LD_VERSION_SCRIPT)
967
963
AC_CHECK_HEADERS(limits.h pwd.h select.h linux/config.h)
968
964
AC_CHECK_HEADERS(sys/fpu.h utime.h sys/utime.h )
969
965
AC_CHECK_HEADERS(synch.h sys/mman.h sys/socket.h netinet/in.h arpa/inet.h)
970
 
AC_CHECK_HEADERS(sys/timeb.h sys/vadvise.h sys/wait.h term.h)
 
966
AC_CHECK_HEADERS(sys/timeb.h sys/vadvise.h sys/wait.h)
 
967
AC_CHECK_HEADERS([curses.h term.h],[],[],
 
968
[[#ifdef HAVE_CURSES_H
 
969
# include <curses.h>
 
970
#endif
 
971
]])
971
972
AC_CHECK_HEADERS(termio.h termios.h sched.h alloca.h)
972
973
AC_CHECK_HEADERS(sys/ioctl.h malloc.h sys/malloc.h sys/ipc.h sys/shm.h)
973
974
AC_CHECK_HEADERS(sys/prctl.h sys/resource.h sys/param.h port.h ieeefp.h)
1053
1054
AC_DEFINE_UNQUOTED([COMPILATION_COMMENT],["$COMPILATION_COMMENT"],
1054
1055
                   [Comment about compilation environment])
1055
1056
 
1056
 
if expr "$target_os" : "[[Ll]]inux.*" > /dev/null
1057
 
then
1058
 
  TARGET_LINUX="true"
1059
 
  AC_DEFINE([TARGET_OS_LINUX], [1], [Whether we build for Linux])
1060
 
else
1061
 
  TARGET_LINUX="false"
1062
 
fi
1063
 
 
1064
1057
dnl Checks for typedefs, structures, and compiler characteristics.
1065
1058
AC_C_CONST
1066
1059
AC_C_INLINE
1101
1094
DRIZZLE_CXX_BOOL
1102
1095
AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>])
1103
1096
AC_CHECK_TYPES([size_t], [], [], [#include <stdio.h>])
 
1097
AC_CHECK_TYPES([uint ulong])
1104
1098
 
1105
1099
DRIZZLE_PTHREAD_YIELD
1106
1100
 
1132
1126
 
1133
1127
# Already-done: stdlib.h string.h unistd.h termios.h
1134
1128
AC_CHECK_HEADERS(stdarg.h dirent.h locale.h ndir.h sys/dir.h \
1135
 
 sys/file.h sys/ndir.h sys/ptem.h sys/pte.h sys/select.h sys/stream.h \
1136
 
 sys/mman.h curses.h termcap.h termio.h termbits.h asm/termbits.h grp.h \
 
1129
 sys/file.h sys/ndir.h sys/pte.h sys/select.h sys/stream.h \
 
1130
 sys/mman.h termcap.h termio.h termbits.h asm/termbits.h grp.h \
1137
1131
paths.h semaphore.h)
1138
1132
 
1139
1133
# Already-done: strcasecmp
1264
1258
# Sanity check: We chould not have any fseeko symbol unless
1265
1259
# large_file_support=yes
1266
1260
AC_CHECK_FUNC(fseeko,
1267
 
[if test "$large_file_support" = no -a "$TARGET_LINUX" = "true";
 
1261
[if test "$large_file_support" = no -a "x$TARGET_LINUX" = "xtrue";
1268
1262
then
1269
1263
  AC_MSG_ERROR("Found fseeko symbol but large_file_support is not enabled!")
1270
1264
fi]
1601
1595
fi
1602
1596
if test "$SUNCC" = "yes"
1603
1597
then
1604
 
  AM_CFLAGS="-v ${AM_CFLAGS}"
 
1598
  AM_CFLAGS="-v -xc99=all ${AM_CFLAGS}"
1605
1599
  AM_CXXFLAGS="-v ${AM_CXXFLAGS}"
1606
1600
fi
1607
1601
 
1626
1620
AC_SUBST(MAKE_BINARY_DISTRIBUTION_OPTIONS)
1627
1621
 
1628
1622
dnl GCC Precompiled Header Support
1629
 
AM_CONDITIONAL([GCC_PCH],[test "x$GCC" = "xyes"])
 
1623
AM_CONDITIONAL([GCC_PCH],[test "$GCC" = "yes"])
1630
1624
 
1631
1625
AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl
1632
1626
 mystrings/Makefile storage/Makefile dnl