~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Brian Aker
  • Date: 2009-11-18 06:11:12 UTC
  • mfrom: (1220.1.10 staging)
  • Revision ID: brian@gaz-20091118061112-tyf4qrfr5v7i946b
Monty + Brian Merge.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
 
20
20
AC_PREREQ(2.59)dnl              Minimum Autoconf version required.
21
 
AC_INIT([drizzle],[RELEASE_VERSION],[http://bugs.launchpad.net/drizzle])
 
21
dnl Version from the AC_INIT call below is overridden later
 
22
dnl So don't update it here
 
23
AC_INIT([drizzle],[7],[http://bugs.launchpad.net/drizzle])
22
24
AC_CONFIG_SRCDIR([drizzled/drizzled.cc])
23
25
AC_CONFIG_AUX_DIR(config)
24
26
AC_CONFIG_HEADERS([config.h])
25
27
AC_CONFIG_MACRO_DIR([m4])
26
28
 
27
29
PANDORA_CANONICAL_TARGET(less-warnings, warnings-always-on, use-gnulib, require-cxx, force-gcc42)
 
30
PANDORA_VC_VERSION
28
31
 
29
 
# Version with no dots
30
 
AC_DEFINE([DRIZZLE_VERSION_ID],RELEASE_ID,
31
 
          [Version ID that can be easily used for numeric comparison])
32
32
 
33
33
# The port that was assigned by IANA.
34
34
DRIZZLE_TCP_PORT_DEFAULT=4427
42
42
      AC_MSG_ERROR("Drizzle requires gperf to build."))
43
43
 
44
44
AC_CHECK_PROGS(YACC, ['bison -y'])
45
 
AS_IF([test "x$YACC" = "x" -a "$building_from_bzr" = "yes"],[
 
45
AS_IF([test "x$YACC" = "x" -a "$ac_cv_building_from_bzr" = "yes"],[
46
46
  AC_MSG_ERROR(["bison is required for Drizzle to build from a bzr branch"])
47
47
])
48
48
 
49
49
 
50
 
AM_GNU_GETTEXT(external, need-formatstring-macros)
51
 
if test "x$MSGMERGE" = "x" -o "x$MSGMERGE" = "x:"
52
 
then
53
 
  AM_PATH_PROG_WITH_TEST(GMSGMERGE, gmsgmerge,
54
 
    [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
55
 
  MSGMERGE="${GMSGMERGE}"
56
 
fi
57
 
AM_CONDITIONAL([BUILD_GETTEXT],[test "x$MSGMERGE" != "x" -a "x$MSGMERGE" != "x:"])
58
 
 
 
50
PANDORA_WITH_GETTEXT
59
51
 
60
52
dnl We need to turn on our CXXFLAGS to make sure it shows up correctly
61
53
save_CXXFLAGS="${CXXFLAGS}"
330
322
AC_SUBST(LIBDL_LIBS)
331
323
 
332
324
 
333
 
AC_ARG_WITH([atomic-ops],
334
 
    [AS_HELP_STRING([--with-atomic-ops=rwlocks|smp|up],
335
 
       [Implement atomic operations using pthread rwlocks or atomic CPU
336
 
        instructions for multi-processor or uniprocessor
337
 
        configuration. By default gcc built-in sync functions are used,
338
 
        if available and 'smp' configuration otherwise.])],
339
 
    [with_atomic_ops="$withval"],
340
 
    [with_atomic_ops=smp])
341
 
 
342
 
case "$with_atomic_ops" in
343
 
  "up") AC_DEFINE([MY_ATOMIC_MODE_DUMMY], [1],
344
 
                  [Assume single-CPU mode, no concurrency]) ;;
345
 
  "rwlocks") AC_DEFINE([MY_ATOMIC_MODE_RWLOCKS], [1],
346
 
                  [Use pthread rwlocks for atomic ops]) ;;
347
 
  "smp") 
348
 
    AC_CACHE_CHECK(
349
 
      [whether the compiler provides atomic builtins],
350
 
      [ac_cv_gcc_atomic_builtins],
351
 
      [AC_RUN_IFELSE(
352
 
        [AC_LANG_PROGRAM([],[[
353
 
          int foo= -10; int bar= 10;
354
 
          if (!__sync_fetch_and_add(&foo, bar) || foo)
355
 
            return -1;
356
 
          bar= __sync_lock_test_and_set(&foo, bar);
357
 
          if (bar || foo != 10)
358
 
            return -1;
359
 
          bar= __sync_val_compare_and_swap(&bar, foo, 15);
360
 
          if (bar)
361
 
            return -1;
362
 
          return 0;
363
 
        ]])],
364
 
       [ac_cv_gcc_atomic_builtins=yes],
365
 
       [ac_cv_gcc_atomic_builtins=no])])
366
 
 
367
 
    if test "x$ac_cv_gcc_atomic_builtins" = "xyes"; then
368
 
      AC_DEFINE(HAVE_GCC_ATOMIC_BUILTINS, 1,
369
 
                [Define to 1 if compiler provides atomic builtins.])
370
 
    fi
371
 
   ;;
372
 
   *) AC_MSG_ERROR(["$with_atomic_ops" is not a valid value for --with-atomic-ops]) ;;
373
 
esac
 
325
AC_CACHE_CHECK(
 
326
  [whether the compiler provides atomic builtins],
 
327
  [ac_cv_gcc_atomic_builtins],
 
328
  [AC_RUN_IFELSE(
 
329
    [AC_LANG_PROGRAM([],[[
 
330
      int foo= -10; int bar= 10;
 
331
      if (!__sync_fetch_and_add(&foo, bar) || foo)
 
332
        return -1;
 
333
      bar= __sync_lock_test_and_set(&foo, bar);
 
334
      if (bar || foo != 10)
 
335
        return -1;
 
336
      bar= __sync_val_compare_and_swap(&bar, foo, 15);
 
337
      if (bar)
 
338
        return -1;
 
339
      return 0;
 
340
      ]])],
 
341
    [ac_cv_gcc_atomic_builtins=yes],
 
342
    [ac_cv_gcc_atomic_builtins=no])])
 
343
 
 
344
AS_IF([test "x$ac_cv_gcc_atomic_builtins" = "xyes"],[
 
345
  AC_DEFINE(HAVE_GCC_ATOMIC_BUILTINS, 1,
 
346
            [Define to 1 if compiler provides atomic builtins.])
 
347
])
374
348
 
375
349
 
376
350
AC_ARG_WITH([comment],
382
356
then
383
357
  COMPILATION_COMMENT=$with_comment
384
358
else
385
 
  COMPILATION_COMMENT="Source distribution (RELEASE_COMMENT)"
 
359
  COMPILATION_COMMENT="Source distribution (${PANDORA_RELEASE_COMMENT})"
386
360
fi
387
361
AC_DEFINE_UNQUOTED([COMPILATION_COMMENT],["$COMPILATION_COMMENT"],
388
362
                   [Comment about compilation environment])
473
447
  localtime_r log log2 gethrtime gmtime_r \
474
448
  madvise \
475
449
  mkstemp mlockall poll pread pthread_attr_create mmap mmap64 \
476
 
  pthread_attr_getstacksize pthread_attr_setprio pthread_attr_setschedparam \
477
 
  pthread_attr_setstacksize pthread_condattr_create pthread_getsequence_np \
478
 
  pthread_key_delete pthread_rwlock_rdlock pthread_setprio \
479
 
  pthread_setprio_np pthread_setschedparam pthread_sigmask readlink \
 
450
  readlink \
480
451
  realpath rename rwlock_init setupterm \
481
452
  sigaction \
482
453
  sigthreadmask \
509
480
)
510
481
 
511
482
# Check definition of pthread_getspecific
512
 
AC_CACHE_CHECK([args to pthread_getspecific], [mysql_cv_getspecific_args],
 
483
AC_CACHE_CHECK([args to pthread_getspecific], [pandora_cv_getspecific_args],
513
484
  [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
514
485
#if !defined(_REENTRANT)
515
486
#define _REENTRANT
522
493
void *pthread_getspecific(pthread_key_t key);
523
494
pthread_getspecific((pthread_key_t) NULL);
524
495
   ]])],
525
 
    [mysql_cv_getspecific_args=POSIX],
526
 
    [mysql_cv_getspecific_args=other])])
527
 
  if test "$mysql_cv_getspecific_args" = "other"
 
496
    [pandora_cv_getspecific_args=POSIX],
 
497
    [pandora_cv_getspecific_args=other])])
 
498
  if test "$pandora_cv_getspecific_args" = "other"
528
499
  then
529
500
    AC_DEFINE([HAVE_NONPOSIX_PTHREAD_GETSPECIFIC], [1],
530
501
              [For some non posix threads])
531
502
  fi
532
503
 
533
504
  # Check definition of pthread_mutex_init
534
 
  AC_CACHE_CHECK([args to pthread_mutex_init], [mysql_cv_mutex_init_args],
 
505
  AC_CACHE_CHECK([args to pthread_mutex_init], [pandora_cv_mutex_init_args],
535
506
    [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
536
507
#ifndef _REENTRANT
537
508
#define _REENTRANT
543
514
  pthread_mutexattr_t attr;
544
515
  pthread_mutex_t mp;
545
516
  pthread_mutex_init(&mp,&attr); ]])],
546
 
      [mysql_cv_mutex_init_args=POSIX],
547
 
      [mysql_cv_mutex_init_args=other])])
548
 
  if test "$mysql_cv_mutex_init_args" = "other"
 
517
      [pandora_cv_mutex_init_args=POSIX],
 
518
      [pandora_cv_mutex_init_args=other])])
 
519
  if test "$pandora_cv_mutex_init_args" = "other"
549
520
  then
550
521
    AC_DEFINE([HAVE_NONPOSIX_PTHREAD_MUTEX_INIT], [1],
551
522
              [For some non posix threads])
554
525
 
555
526
#---START: Used in for client configure
556
527
# Check definition of readdir_r
557
 
AC_CACHE_CHECK([args to readdir_r], [mysql_cv_readdir_r],
 
528
AC_CACHE_CHECK([args to readdir_r], [pandora_cv_readdir_r],
558
529
  [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
559
530
#ifndef _REENTRANT
560
531
#define _REENTRANT
565
536
#include <pthread.h>
566
537
#include <dirent.h>]], [[ int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result);
567
538
readdir_r((DIR *) NULL, (struct dirent *) NULL, (struct dirent **) NULL); ]])],
568
 
    [mysql_cv_readdir_r=POSIX],
569
 
    [mysql_cv_readdir_r=other])])
570
 
if test "$mysql_cv_readdir_r" = "POSIX"
 
539
    [pandora_cv_readdir_r=POSIX],
 
540
    [pandora_cv_readdir_r=other])])
 
541
if test "$pandora_cv_readdir_r" = "POSIX"
571
542
then
572
543
  AC_DEFINE([HAVE_READDIR_R], [1], [POSIX readdir_r])
573
544
fi
574
545
 
575
546
# Check definition of posix sigwait()
576
 
AC_CACHE_CHECK([style of sigwait], [mysql_cv_sigwait],
 
547
AC_CACHE_CHECK([style of sigwait], [pandora_cv_sigwait],
577
548
  [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
578
549
#ifndef _REENTRANT
579
550
#define _REENTRANT
590
561
sigwait(&set,&sig);
591
562
#endif
592
563
      ]])],
593
 
    [mysql_cv_sigwait=POSIX],
594
 
    [mysql_cv_sigwait=other])])
595
 
if test "$mysql_cv_sigwait" = "POSIX"
 
564
    [pandora_cv_sigwait=POSIX],
 
565
    [pandora_cv_sigwait=other])])
 
566
if test "$pandora_cv_sigwait" = "POSIX"
596
567
then
597
568
  AC_DEFINE([HAVE_SIGWAIT], [1], [POSIX sigwait])
598
569
fi
599
570
 
600
 
if test "$mysql_cv_sigwait" != "POSIX"
 
571
if test "$pandora_cv_sigwait" != "POSIX"
601
572
then
602
 
unset mysql_cv_sigwait
 
573
unset pandora_cv_sigwait
603
574
# Check definition of posix sigwait()
604
 
AC_CACHE_CHECK([style of sigwait], [mysql_cv_sigwait],
 
575
AC_CACHE_CHECK([style of sigwait], [pandora_cv_sigwait],
605
576
  [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
606
577
#ifndef _REENTRANT
607
578
#define _REENTRANT
616
587
int sig;
617
588
sigwait(&set);
618
589
      ]])],
619
 
    [mysql_cv_sigwait=NONPOSIX],
620
 
    [mysql_cv_sigwait=other])])
621
 
if test "$mysql_cv_sigwait" = "NONPOSIX"
 
590
    [pandora_cv_sigwait=NONPOSIX],
 
591
    [pandora_cv_sigwait=other])])
 
592
if test "$pandora_cv_sigwait" = "NONPOSIX"
622
593
then
623
594
  AC_DEFINE([HAVE_NONPOSIX_SIGWAIT], [1], [sigwait with one argument])
624
595
fi
626
597
#---END:
627
598
 
628
599
# Check if pthread_attr_setscope() exists
629
 
AC_CACHE_CHECK([for pthread_attr_setscope], [mysql_cv_pthread_attr_setscope],
 
600
AC_CACHE_CHECK([for pthread_attr_setscope], [pandora_cv_pthread_attr_setscope],
630
601
  [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
631
602
#ifndef _REENTRANT
632
603
#define _REENTRANT
639
610
pthread_attr_t thr_attr;
640
611
pthread_attr_setscope(&thr_attr,0);
641
612
      ]])],
642
 
    [mysql_cv_pthread_attr_setscope=yes],
643
 
    [mysql_cv_pthread_attr_setscope=no])])
644
 
if test "$mysql_cv_pthread_attr_setscope" = "yes"
 
613
    [pandora_cv_pthread_attr_setscope=yes],
 
614
    [pandora_cv_pthread_attr_setscope=no])])
 
615
if test "$pandora_cv_pthread_attr_setscope" = "yes"
645
616
then
646
617
  AC_DEFINE([HAVE_PTHREAD_ATTR_SETSCOPE], [1], [pthread_attr_setscope])
647
618
fi
648
619
 
649
620
AC_LANG_PUSH([C++])
650
621
AC_CHECK_HEADERS(cxxabi.h)
651
 
AC_CACHE_CHECK([checking for abi::__cxa_demangle], mysql_cv_cxa_demangle,
 
622
AC_CACHE_CHECK([checking for abi::__cxa_demangle], pandora_cv_cxa_demangle,
652
623
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <cxxabi.h>]], [[
653
624
  char *foo= 0; int bar= 0;
654
625
  foo= abi::__cxa_demangle(foo, foo, 0, &bar);
655
 
]])],[mysql_cv_cxa_demangle=yes],[mysql_cv_cxa_demangle=no])])
 
626
]])],[pandora_cv_cxa_demangle=yes],[pandora_cv_cxa_demangle=no])])
656
627
AC_LANG_POP([])
657
628
 
658
 
if test "x$mysql_cv_cxa_demangle" = xyes; then
 
629
if test "x$pandora_cv_cxa_demangle" = xyes; then
659
630
  AC_DEFINE(HAVE_ABI_CXA_DEMANGLE, 1,
660
631
            [Define to 1 if you have the `abi::__cxa_demangle' function.])
661
632
fi
707
678
AC_OUTPUT
708
679
 
709
680
echo "---"
710
 
echo "Configuration summary for $PACKAGE_NAME version $VERSION RELEASE_COMMENT"
 
681
echo "Configuration summary for $PACKAGE_NAME version $VERSION $PANDORA_RELEASE_COMMENT"
711
682
echo ""
712
683
echo "   * Installation prefix:       $prefix"
713
684
echo "   * System type:               $host_vendor-$host_os"