~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Lee
  • Date: 2009-01-11 03:58:01 UTC
  • mfrom: (784 drizzle)
  • mto: This revision was merged to the branch mainline in revision 786.
  • Revision ID: lbieber@lbieber-desktop-20090111035801-qitvmwd560wy70i1
merge with latest from the trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 
4
4
AC_PREREQ(2.59)dnl              Minimum Autoconf version required.
5
5
 
6
 
AC_INIT(drizzle, [7.0.0], [http://bugs.launchpad.net/drizzle])
 
6
AC_INIT([drizzle],[7.0.0],[http://bugs.launchpad.net/drizzle])
7
7
AC_CONFIG_SRCDIR([drizzled/drizzled.cc])
8
8
AC_CONFIG_AUX_DIR(config)
9
9
AC_CONFIG_HEADERS([config.h])
92
92
# The port should be constant for a LONG time
93
93
DRIZZLE_TCP_PORT_DEFAULT=4427
94
94
 
 
95
# We need to hack in some of the non-standard locations that solaris sticks
 
96
# stuff in. This makes me very sad.
 
97
case "$host_os" in
 
98
  solaris*)
 
99
    CPPFLAGS="${CPPFLAGS} -I/opt/csw/include -I/opt/local/include"
 
100
    LDFLAGS="${LDFLAGS} -L/opt/csw/lib -L/opt/csw/lib"
 
101
    ;;
 
102
esac
 
103
 
95
104
m4_include(m4/dtrace.m4)
96
105
 
97
106
m4_include(m4/character_sets.m4)
98
107
AC_SUBST(AVAILABLE_LANGUAGES)
99
108
 
100
109
m4_include(m4/gettext.m4)
101
 
AM_GNU_GETTEXT([external])
 
110
AM_GNU_GETTEXT(external, need-formatstring-macros)
102
111
AM_CONDITIONAL([BUILD_GETTEXT],[test "x$MSGMERGE" != "x" -a "x$MSGMERGE" != "x:"])
103
112
 
104
113
# Set this for plugins to use
220
229
# We use libtool
221
230
AC_PROG_LIBTOOL
222
231
 
223
 
# Ensure that we have --preserve-dup-deps defines, otherwise we get link
224
 
# problems of 'mysql' with CXX=g++
225
 
LIBTOOL="$LIBTOOL --preserve-dup-deps"
226
 
AC_SUBST(LIBTOOL)dnl
227
 
 
228
232
AC_SUBST(NM)dnl
229
233
 
230
234
AC_PROG_INSTALL
243
247
  AC_MSG_ERROR(["bison is required for Drizzle to build from a bzr branch"])
244
248
fi
245
249
 
246
 
AC_PATH_PROG(uname_prog, uname, no)
247
 
 
248
 
# We should go through this and put all the explictly system dependent
249
 
# stuff in one place
250
 
AC_MSG_CHECKING(operating system)
251
 
AC_CACHE_VAL(mysql_cv_sys_os,
252
 
[
253
 
if test "$uname_prog" != "no"; then
254
 
  mysql_cv_sys_os="`uname`"
255
 
else
256
 
  mysql_cv_sys_os="Not Solaris"
257
 
fi
258
 
])
259
 
AC_MSG_RESULT($mysql_cv_sys_os)
260
 
 
261
250
 
262
251
# The following is required for portable results of floating point calculations
263
252
# on PowerPC. The same must also be done for IA-64, but this options is missing
366
355
fi
367
356
AC_SUBST(LD_VERSION_SCRIPT)
368
357
 
 
358
AC_LIB_PREFIX
 
359
 
369
360
#--------------------------------------------------------------------
370
361
# Check for Google Proto Buffers
371
362
#--------------------------------------------------------------------
372
363
 
373
364
AC_LANG_PUSH([C++])
374
 
SEARCH_FOR_LIB(protobuf, printf, google/protobuf/message.h,
375
 
               AC_MSG_ERROR([protobuf is required for Drizzle]))
 
365
AC_LIB_HAVE_LINKFLAGS(protobuf,,
 
366
[#include <google/protobuf/descriptor.h>
 
367
#if GOOGLE_PROTOBUF_VERSION < 2000002
 
368
# error Your version of Protobuf is too old
 
369
#endif
 
370
],
 
371
[google::protobuf::FileDescriptor* file;])
 
372
AS_IF([test x$ac_cv_libprotobuf = xno],
 
373
      AC_MSG_ERROR([protobuf is required for Drizzle]))
376
374
 
377
 
AC_PATH_PROG([PROTOC],[protoc],[no],[$PROTOBUF_PATH])
 
375
AC_PATH_PROG([PROTOC],[protoc],[no],[$LIBPROTOBUF_PREFIX/bin:$PATH])
378
376
if test "x$PROTOC" = "xno"
379
377
then
380
378
  AC_MSG_ERROR([Couldn't find protoc. Try installing Google Protocol Buffer.])
386
384
# Check for libuuid
387
385
#--------------------------------------------------------------------
388
386
 
389
 
dnl Do this by hand instead of with SEARCH_FOR_LIB, because uuid is weird.
 
387
dnl Do this by hand. Need to check for uuid/uuid.h, but uuid may or may
 
388
dnl not be a lib is weird.
 
389
 
390
390
AC_CHECK_HEADERS(uuid/uuid.h)
391
391
if test "x$ac_cv_header_uuid_uuid_h" = "xno"
392
392
then
393
393
  AC_MSG_ERROR([Couldn't find uuid/uuid.h. Try installing libuuid development packages])
394
394
fi
395
 
AC_CHECK_LIB(uuid, uuid_generate)
 
395
AC_LIB_HAVE_LINKFLAGS(uuid,,
 
396
[
 
397
#include <uuid/uuid.h>
 
398
],
 
399
[
 
400
  uuid_t uout;
 
401
  uuid_generate(uout);
 
402
])
396
403
 
397
404
#--------------------------------------------------------------------
398
405
# Check for libevent
399
406
#--------------------------------------------------------------------
400
407
 
401
 
SEARCH_FOR_LIB(event, event_loop, event.h, 
402
 
               AC_MSG_ERROR([libevent is required for Drizzle]))
403
 
 
404
 
 
405
 
AC_CACHE_CHECK([for bufferevent in libevent], ac_cv_libevent_works, [
406
 
  save_CPPFLAGS="$CPPFLAGS"
407
 
  save_LIBS="$LIBS"
408
 
  CPPFLAGS="$EVENT_CFLAGS"
409
 
  LIBS="$EVENT_LIBS"
410
 
  AC_TRY_LINK([
 
408
AC_LIB_HAVE_LINKFLAGS(event,,
 
409
[
411
410
#include <sys/types.h>
412
411
#include <sys/time.h>
413
412
#include <stdlib.h>
414
 
#include <event.h>],[
415
 
        struct bufferevent bev;
416
 
        bufferevent_settimeout(&bev, 1, 1);
417
 
  ], ac_cv_libevent_works=yes, [
418
 
        AC_MSG_ERROR([you need to install a more recent version of libevent,
419
 
        check http://www.monkey.org/~provos/libevent/])
420
 
  ])
 
413
#include <event.h>
 
414
],[
 
415
  struct bufferevent bev;
 
416
  bufferevent_settimeout(&bev, 1, 1);
 
417
  event_init();
 
418
  event_loop(EVLOOP_ONCE);
 
419
]) 
 
420
AS_IF([test x$ac_cv_libevent = xno],
 
421
      AC_MSG_ERROR([A recent libevent is required for Drizzle. Check http://www.monkey.org/~provos/libevent ]))
421
422
 
422
 
  CPPFLAGS="$save_CPPFLAGS"
423
 
  LIBS="$save_LIBS"
424
 
])
425
423
 
426
424
 
427
425
#--------------------------------------------------------------------
428
426
# Check for libpthread
429
427
#--------------------------------------------------------------------
430
428
 
431
 
AC_CHECK_HEADERS(pthread.h)
432
 
if test "x$ac_cv_header_pthread_h" != "xyes"
433
 
then
434
 
  AC_MSG_ERROR([Couldn't find pthread.h.])
435
 
fi
436
 
AC_CHECK_LIB(pthread, pthread_create, [], [AC_MSG_ERROR(could not find libpthread)])
 
429
ACX_PTHREAD(,AC_MSG_ERROR(could not find libpthread))
 
430
LIBS="$PTHREAD_LIBS $LIBS"
 
431
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
 
432
CC="$PTHREAD_CC"
437
433
 
438
434
#--------------------------------------------------------------------
439
435
# Check for tcmalloc/mtmalloc
455
451
  AC_CHECK_LIB(mtmalloc,malloc,[],[])
456
452
fi
457
453
 
 
454
 
458
455
#--------------------------------------------------------------------
459
456
# Check for libz
460
457
#--------------------------------------------------------------------
461
458
 
462
 
SEARCH_FOR_LIB(z, crc32, zlib.h, 
463
 
               AC_MSG_ERROR([libz is required for Drizzle]))
 
459
AC_LIB_HAVE_LINKFLAGS(z,,
 
460
[#include <zlib.h>],
 
461
[
 
462
  crc32(0, Z_NULL, 0);
 
463
])
 
464
AS_IF([test x$ac_cv_libz = xno],
 
465
      AC_MSG_ERROR([libz is required for Drizzle]))
464
466
 
465
467
#--------------------------------------------------------------------
466
468
# Check for libreadline or compatible (libedit on Mac OS X)
467
469
#--------------------------------------------------------------------
468
470
 
469
 
dnl First, search for readline. If that fails, search for ncurses then
470
 
dnl search for readline again... on some platforms *cough* solaris *cough*
471
 
dnl you need to link with ncurses directly to get readline to work
472
 
 
473
 
SEARCH_FOR_LIB(readline, rl_initialize, readline/readline.h,[
474
 
        SEARCH_FOR_LIB(ncurses, tgetent, ncurses/ncurses.h, [
475
 
                SEARCH_FOR_LIB(tinfo, tgetent, ncurses/ncurses.h,
476
 
                        AC_MSG_ERROR([Couldn't find ncurses])
477
 
                )
478
 
                ]
479
 
        )
480
 
        SEARCH_FOR_LIB(readline, rl_initialize, readline/readline.h,
481
 
               AC_MSG_ERROR([libreadline is required for Drizzle]),
482
 
               [$NCURSES_LIBS]) 
483
 
        ]
484
 
)
485
 
 
486
 
save_CPPFLAGS="$CPPFLAGS"
487
 
CPPFLAGS="$CPPFLAGS $READLINE_CFLAGS"
488
 
AC_CHECK_HEADERS(readline/history.h)
489
 
AC_CHECK_TYPES([HIST_ENTRY], [], [], [AC_INCLUDES_DEFAULT[
490
 
#ifdef HAVE_READLINE_HISTORY_H
491
 
#include <readline/history.h>
492
 
#endif
493
 
#include <readline/readline.h>
494
 
]])
495
 
AC_CHECK_DECLS([completion_matches], [], [], [AC_INCLUDES_DEFAULT[
496
 
#ifdef HAVE_READLINE_HISTORY_H
497
 
#include <readline/history.h>
498
 
#endif
499
 
#include <readline/readline.h>
500
 
]])
 
471
save_LIBS="${LIBS}"
 
472
LIBS=""
 
473
VL_LIB_READLINE
 
474
READLINE_LIBS="${LIBS}"
 
475
LIBS="${save_LIBS}"
 
476
AC_SUBST(READLINE_LIBS)
501
477
 
502
478
DRIZZLE_CHECK_NEW_RL_INTERFACE
503
 
CPPFLAGS="$save_CPPFLAGS"
504
 
 
505
479
 
506
480
#--------------------------------------------------------------------
507
481
# Check for libpcre
512
486
 
513
487
if test "$found_pcre" = "no"
514
488
then
515
 
  SEARCH_FOR_LIB(pcre, pcre_compile, pcre.h, 
516
 
                 AC_MSG_ERROR([libpcre is required for Drizzle]))
 
489
  save_LIBS="${LIBS}"
 
490
  AC_LIB_HAVE_LINKFLAGS(pcre,, [#include <pcre.h>], [pcre *re= NULL])
 
491
  AS_IF([test "x$ac_cv_libpcre" = "xno"],
 
492
        AC_MSG_ERROR([libpcre is required for Drizzle]))
 
493
  PCRE_LIBS="${LTLIBPCRE}"
 
494
  LIBS="${save_LIBS}"
517
495
fi
518
496
AC_SUBST(PCRE_LIBS)
519
497
AC_SUBST(PCRE_CFLAGS)
520
498
 
 
499
 
521
500
dnl Find paths to some shell programs
522
501
AC_PATH_PROG(LN, ln, ln)
523
502
# This must be able to take a -f flag like normal unix ln.
899
878
DRIZZLE_CHECK_GETPW_FUNCS
900
879
DRIZZLE_HAVE_TIOCGWINSZ
901
880
DRIZZLE_HAVE_TIOCSTAT
902
 
DRIZZLE_TYPE_SIGHANDLER
903
 
if test "$with_named_curses" = "no"
904
 
then
905
 
  DRIZZLE_CHECK_LIB_TERMCAP
906
 
else
907
 
  TERMCAP_LIBS="$with_named_curses"
908
 
fi
909
 
AC_SUBST(TERMCAP_LIBS)
910
881
 
911
 
# End of readline/libedit stuff
912
882
#########################################################################
913
883
 
914
884
dnl Checks for library functions.
915
885
 
916
 
#
917
 
# The following code disables intrinsic function support while we test for
918
 
# library functions.  This is to avoid configure problems with Intel ecc
919
 
# compiler
920
 
 
921
 
ORG_CFLAGS="$CFLAGS"
922
 
if test "$GCC" != "yes"; then
923
 
  AC_SYS_COMPILER_FLAG(-nolib_inline,nolib_inline,CFLAGS,[],[])
924
 
fi
925
 
 
926
 
#AC_FUNC_MMAP
927
 
AC_TYPE_SIGNAL
928
 
DRIZZLE_TYPE_QSORT
929
886
AC_FUNC_UTIME_NULL
930
887
AC_FUNC_VPRINTF
931
888
 
1327
1284
 
1328
1285
  NO_EXCEPTIONS="-fno-exceptions"
1329
1286
  W_EXCEPTIONS="-fexceptions"
1330
 
  NO_UNUSED_MACROS="-Wno-unused-macros"
1331
1287
  NO_REDUNDANT_DECLS="-Wno-redundant-decls"
1332
1288
  # Disable exceptions as they seams to create problems with gcc and threads.
1333
1289
  # drizzled doesn't use run-time-type-checking, so we disable it.
1351
1307
 
1352
1308
AC_SUBST(NO_EXCEPTIONS)
1353
1309
AC_SUBST(W_EXCEPTIONS)
1354
 
AC_SUBST(NO_UNUSED_MACROS)
1355
1310
AC_SUBST(NO_REDUNDANT_DECLS)
1356
1311
 
1357
1312
AC_SUBST([GLOBAL_CPPFLAGS],['-I$(top_srcdir) -I$(top_builddir)'])