~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Monty Taylor
  • Date: 2008-11-01 00:11:07 UTC
  • mfrom: (520.4.42 devel)
  • mto: (520.4.45 devel)
  • mto: This revision was merged to the branch mainline in revision 573.
  • Revision ID: monty@inaugust.com-20081101001107-hyuzapp3fa73kr04
Merged from myself.

Show diffs side-by-side

added added

removed removed

Lines of Context:
147
147
 
148
148
sinclude(m4/dtrace.m4)
149
149
sinclude(m4/character_sets.m4)
 
150
sinclude(m4/gettext.m4)
150
151
 
151
152
AM_GNU_GETTEXT([external])
152
153
AM_GNU_GETTEXT_VERSION(0.17)
274
275
AC_PROG_MAKE_SET
275
276
 
276
277
 
277
 
# Print version of CC and CXX compiler (if they support --version)
278
 
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
    ;;
279
284
  *apple-darwin*)
 
285
    TARGET_OSX="true"
 
286
    AC_SUBST(TARGET_OSX)
280
287
    AC_DEFINE([TARGET_OS_OSX], [1], [Whether we build for OSX])
281
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
    ;;
282
294
  *)
283
 
CC_VERSION=`$CC --version | sed 1q`
284
295
    ;;
285
296
esac
286
 
if test $? -eq "0"
287
 
then
288
 
  AC_MSG_CHECKING("C Compiler version")
289
 
  AC_MSG_RESULT("$CC $CC_VERSION")
290
 
else
291
 
CC_VERSION=""
292
 
fi
293
 
AC_SUBST(CC_VERSION)
294
297
 
295
298
dnl AC_CANONICAL_HOST thinks it's a good idea to just set CFLAGS to 
296
299
dnl -g -O2 if you're running gcc. We would like to use something else, thanks.
303
306
  CXXFLAGS=
304
307
fi
305
308
 
 
309
DRIZZLE_CHECK_C_VERSION
306
310
DRIZZLE_CHECK_CXX_VERSION
307
311
 
308
312
AC_PROG_AWK
316
320
fi
317
321
 
318
322
dnl TODO: This needs to go away and be replaced with _ISOC99_SOURCE
319
 
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"
320
324
then
321
325
  AC_DEFINE([_GNU_SOURCE],[1],[Fix problem with S_ISLNK() on Linux])
322
326
fi
385
389
])
386
390
AC_MSG_RESULT($mysql_cv_sys_os)
387
391
 
388
 
# This should be rewritten to use $target_os
389
 
case "$target_os" in
390
 
  *solaris*)
391
 
    TARGET_SOLARIS="true"
392
 
    AC_DEFINE([TARGET_OS_SOLARIS], [1], [Whether we are building for Solaris])
393
 
    AC_SUBST(TARGET_SOLARIS)
394
 
  ;;
395
 
esac
396
392
 
397
393
# The following is required for portable results of floating point calculations
398
394
# on PowerPC. The same must also be done for IA-64, but this options is missing
407
403
    ;;
408
404
  esac
409
405
fi
 
406
# Build optimized or debug version ?
 
407
# First check for gcc and g++
 
408
SYMBOLS_FLAGS="-g"
 
409
DEBUG_OPTIMIZE_CC=""
 
410
OPTIMIZE_CFLAGS="-O"
 
411
DEBUG_OPTIMIZE_CXX=""
 
412
OPTIMIZE_CXXFLAGS="-O"
 
413
if test "$GCC" = "yes"
 
414
then
 
415
  SYMBOLS_FLAGS="-ggdb3"
 
416
  DEBUG_OPTIMIZE_CC="-O0"
 
417
  OPTIMIZE_CFLAGS="-O3"
 
418
  DEBUG_OPTIMIZE_CXX="-O0"
 
419
  OPTIMIZE_CXXFLAGS="-O3"
 
420
fi
 
421
if test "$SUNCC" = "yes"
 
422
then
 
423
  dnl I'm cheating here and sticking C99 support in SYMBOLS_FLAGS
 
424
  SYMBOLS_FLAGS=""
 
425
  DEBUG_OPTIMIZE_CC=""
 
426
  OPTIMIZE_CFLAGS="-xO4 -xlibmil -xdepend -Xa -xstrconst -mt -D_FORTEC_"
 
427
  DEBUG_OPTIMIZE_CXX=""
 
428
  OPTIMIZE_CXXFLAGS="-xO4 -xlibmil -library=stlport4 -mt -D_FORTEC_"
 
429
fi
 
430
 
 
431
dnl TODO: Remove this define once we are using 2.61 across the board.
 
432
# AX_HEADER_ASSERT
 
433
# ----------------
 
434
# Check whether to enable assertions.
 
435
AC_DEFUN([AX_HEADER_ASSERT],
 
436
[
 
437
  AC_MSG_CHECKING([whether to enable assertions])
 
438
  AC_ARG_ENABLE([assert],
 
439
    [AS_HELP_STRING([--disable-assert],
 
440
       [Turn off assertions])],
 
441
    [ac_cv_assert="no"],
 
442
    [ac_cv_assert="yes"])
 
443
  AC_MSG_RESULT([$ac_cv_assert])
 
444
])
 
445
 
 
446
AX_HEADER_ASSERT
 
447
 
 
448
CFLAGS="${SYMBOLS_FLAGS} ${CFLAGS}"
 
449
CXXFLAGS="${SYMBOLS_FLAGS} ${CXXFLAGS}"
 
450
 
 
451
AC_ARG_WITH([debug],
 
452
    [AS_HELP_STRING([--with-debug],
 
453
       [Add debug code/turns off optimizations (yes|no) @<:@default=no@:>@])],
 
454
    [with_debug=$withval],
 
455
    [with_debug=no])
 
456
if test "$with_debug" = "yes"
 
457
then
 
458
  # Medium debug.
 
459
  CFLAGS="$DEBUG_OPTIMIZE_CC -DDEBUG $CFLAGS ${SAVE_CFLAGS}"
 
460
  CXXFLAGS="$DEBUG_OPTIMIZE_CXX -DDEBUG $CXXFLAGS ${SAVE_CXXFLAGS}"
 
461
else
 
462
  # Optimized version. No debug
 
463
  CFLAGS="${OPTIMIZE_CFLAGS} ${CFLAGS} ${SAVE_CFLAGS}"
 
464
  CXXFLAGS="$OPTIMIZE_CXXFLAGS $CXXFLAGS ${SAVE_CXXFLAGS}"
 
465
fi
410
466
 
411
467
AC_SUBST(CC)
412
468
AC_SUBST(CFLAGS)
429
485
DRIZZLE_PROG_AR
430
486
 
431
487
# libdrizzle versioning when linked with GNU ld.
432
 
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
433
489
  LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_srcdir)/libdrizzle/libdrizzle.ver"
434
490
fi
435
491
AC_SUBST(LD_VERSION_SCRIPT)
438
494
# Check for Google Proto Buffers
439
495
#--------------------------------------------------------------------
440
496
 
 
497
AC_MSG_CHECKING(for Google Protocol Buffers)
 
498
AC_ARG_WITH(protobuf,
 
499
  [AS_HELP_STRING([--with-protobuf],
 
500
       [Use protobuf directory])],
 
501
  [ with_protobuf=$withval ],
 
502
  [ with_protobuf=yes ])
 
503
 
 
504
save_CPPFLAGS="$CPPFLAGS"
 
505
save_LIBS="$LIBS"
 
506
 
 
507
if test "$with_protobuf" = "yes"
 
508
then
 
509
  CPPFLAGS=""
 
510
  LIBS="-lprotobuf"
 
511
else
 
512
  CPPFLAGS="-I$withval/include"
 
513
  LIBS="-L$withval/lib -lprotobuf"
 
514
fi 
 
515
 
441
516
AC_LANG_PUSH([C++])
442
517
AC_CHECK_HEADERS([google/protobuf/message.h])
443
518
if test "x$ac_cv_header_google_protobuf_message_h" != "xyes"
444
519
then
445
520
  AC_MSG_ERROR([Couldn't find message.h. Try installing Google Protocol Buffer development packages])
446
521
fi
447
 
 
448
 
save_CFLAGS="$CFLAGS"
449
 
save_LIBS="$LIBS"
450
 
CFLAGS=""
451
 
LIBS="-lprotobuf"
 
522
AC_MSG_RESULT("$wthval")
452
523
 
453
524
AC_CACHE_CHECK([for Message in libprotobuf], ac_libprotobuf_works, [
454
525
  AC_TRY_LINK([
462
533
])
463
534
 
464
535
PROTOBUF_LIBS="${LIBS}"
 
536
PROTOBUF_CPPFLAGS="${CPPFLAGS}"
465
537
AC_SUBST(PROTOBUF_LIBS)
466
 
CFLAGS="$save_CFLAGS"
 
538
AC_SUBST(PROTOBUF_CPPFLAGS)
 
539
CPPFLAGS="$save_CPPFLAGS"
467
540
LIBS="$save_LIBS"
468
541
AC_LANG_POP()
469
542
 
890
963
AC_CHECK_HEADERS(limits.h pwd.h select.h linux/config.h)
891
964
AC_CHECK_HEADERS(sys/fpu.h utime.h sys/utime.h )
892
965
AC_CHECK_HEADERS(synch.h sys/mman.h sys/socket.h netinet/in.h arpa/inet.h)
893
 
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
]])
894
972
AC_CHECK_HEADERS(termio.h termios.h sched.h alloca.h)
895
973
AC_CHECK_HEADERS(sys/ioctl.h malloc.h sys/malloc.h sys/ipc.h sys/shm.h)
896
974
AC_CHECK_HEADERS(sys/prctl.h sys/resource.h sys/param.h port.h ieeefp.h)
976
1054
AC_DEFINE_UNQUOTED([COMPILATION_COMMENT],["$COMPILATION_COMMENT"],
977
1055
                   [Comment about compilation environment])
978
1056
 
979
 
if expr "$target_os" : "[[Ll]]inux.*" > /dev/null
980
 
then
981
 
  TARGET_LINUX="true"
982
 
  AC_DEFINE([TARGET_OS_LINUX], [1], [Whether we build for Linux])
983
 
else
984
 
  TARGET_LINUX="false"
985
 
fi
986
 
 
987
1057
dnl Checks for typedefs, structures, and compiler characteristics.
988
1058
AC_C_CONST
989
1059
AC_C_INLINE
1024
1094
DRIZZLE_CXX_BOOL
1025
1095
AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>])
1026
1096
AC_CHECK_TYPES([size_t], [], [], [#include <stdio.h>])
 
1097
AC_CHECK_TYPES([uint ulong])
1027
1098
 
1028
1099
DRIZZLE_PTHREAD_YIELD
1029
1100
 
1055
1126
 
1056
1127
# Already-done: stdlib.h string.h unistd.h termios.h
1057
1128
AC_CHECK_HEADERS(stdarg.h dirent.h locale.h ndir.h sys/dir.h \
1058
 
 sys/file.h sys/ndir.h sys/ptem.h sys/pte.h sys/select.h sys/stream.h \
1059
 
 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 \
1060
1131
paths.h semaphore.h)
1061
1132
 
1062
1133
# Already-done: strcasecmp
1187
1258
# Sanity check: We chould not have any fseeko symbol unless
1188
1259
# large_file_support=yes
1189
1260
AC_CHECK_FUNC(fseeko,
1190
 
[if test "$large_file_support" = no -a "$TARGET_LINUX" = "true";
 
1261
[if test "$large_file_support" = no -a "x$TARGET_LINUX" = "xtrue";
1191
1262
then
1192
1263
  AC_MSG_ERROR("Found fseeko symbol but large_file_support is not enabled!")
1193
1264
fi]
1350
1421
AC_SUBST(mysql_plugin_libs)
1351
1422
AC_SUBST(mysql_plugin_defs)
1352
1423
 
1353
 
# Build optimized or debug version ?
1354
 
# First check for gcc and g++
1355
 
SYMBOLS_FLAGS="-g"
1356
 
DEBUG_OPTIMIZE_CC=""
1357
 
OPTIMIZE_CFLAGS="-O"
1358
 
DEBUG_OPTIMIZE_CXX=""
1359
 
OPTIMIZE_CXXFLAGS="-O"
1360
 
if test "$GCC" = "yes"
1361
 
then
1362
 
  SYMBOLS_FLAGS="-ggdb3"
1363
 
  DEBUG_OPTIMIZE_CC="-O0"
1364
 
  OPTIMIZE_CFLAGS="-O3"
1365
 
  DEBUG_OPTIMIZE_CXX="-O0"
1366
 
  OPTIMIZE_CXXFLAGS="-O3"
1367
 
fi
1368
 
if test "$SUNCC" = "yes"
1369
 
then
1370
 
  SYMBOLS_CLAGS="-g"
1371
 
  DEBUG_OPTIMIZE_CC=""
1372
 
  OPTIMIZE_CFLAGS="-xO4 -xlibmil -xdepend"
1373
 
  DEBUG_OPTIMIZE_CXX=""
1374
 
  OPTIMIZE_CXXFLAGS="-xO4 -xlibmil"
1375
 
fi
1376
 
 
1377
 
dnl TODO: Remove this define once we are using 2.61 across the board.
1378
 
# AX_HEADER_ASSERT
1379
 
# ----------------
1380
 
# Check whether to enable assertions.
1381
 
AC_DEFUN([AX_HEADER_ASSERT],
1382
 
[
1383
 
  AC_MSG_CHECKING([whether to enable assertions])
1384
 
  AC_ARG_ENABLE([assert],
1385
 
    [AS_HELP_STRING([--disable-assert],
1386
 
       [Turn off assertions])],
1387
 
    [ac_cv_assert="no"],
1388
 
    [ac_cv_assert="yes"])
1389
 
  AC_MSG_RESULT([$ac_cv_assert])
1390
 
])
1391
 
 
1392
 
AX_HEADER_ASSERT
1393
 
 
1394
 
CFLAGS="${SYMBOLS_FLAGS} ${CFLAGS}"
1395
 
CXXFLAGS="${SYMBOLS_FLAGS} ${CXXFLAGS}"
1396
 
 
1397
 
AC_ARG_WITH([debug],
1398
 
    [AS_HELP_STRING([--with-debug],
1399
 
       [Add debug code/turns off optimizations (yes|no) @<:@default=no@:>@])],
1400
 
    [with_debug=$withval],
1401
 
    [with_debug=no])
1402
 
if test "$with_debug" = "yes"
1403
 
then
1404
 
  # Medium debug.
1405
 
  CFLAGS="$DEBUG_OPTIMIZE_CC -DDEBUG $CFLAGS ${SAVE_CFLAGS}"
1406
 
  CXXFLAGS="$DEBUG_OPTIMIZE_CXX -DDEBUG $CXXFLAGS ${SAVE_CXXFLAGS}"
1407
 
else
1408
 
  # Optimized version. No debug
1409
 
  CFLAGS="${OPTIMIZE_CFLAGS} ${CFLAGS} ${SAVE_CFLAGS}"
1410
 
  CXXFLAGS="$OPTIMIZE_CXXFLAGS $CXXFLAGS ${SAVE_CXXFLAGS}"
1411
 
fi
1412
1424
 
1413
1425
AC_ARG_ENABLE([profiling],
1414
1426
    [AS_HELP_STRING([--enable-profiling],
1583
1595
fi
1584
1596
if test "$SUNCC" = "yes"
1585
1597
then
1586
 
  AM_CFLAGS="-v ${AM_CFLAGS}"
 
1598
  AM_CFLAGS="-v -xc99=all ${AM_CFLAGS}"
1587
1599
  AM_CXXFLAGS="-v ${AM_CXXFLAGS}"
1588
1600
fi
1589
1601
 
1608
1620
AC_SUBST(MAKE_BINARY_DISTRIBUTION_OPTIONS)
1609
1621
 
1610
1622
dnl GCC Precompiled Header Support
1611
 
AM_CONDITIONAL([GCC_PCH],[test "x$GCC" = "xyes"])
 
1623
AM_CONDITIONAL([GCC_PCH],[test "$GCC" = "yes"])
1612
1624
 
1613
1625
AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl
1614
1626
 mystrings/Makefile storage/Makefile dnl