4
4
AC_PREREQ(2.59)dnl Minimum Autoconf version required.
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
95
# We need to hack in some of the non-standard locations that solaris sticks
96
# stuff in. This makes me very sad.
99
CPPFLAGS="${CPPFLAGS} -I/opt/csw/include -I/opt/local/include"
100
LDFLAGS="${LDFLAGS} -L/opt/csw/lib -L/opt/csw/lib"
95
104
m4_include(m4/dtrace.m4)
97
106
m4_include(m4/character_sets.m4)
98
107
AC_SUBST(AVAILABLE_LANGUAGES)
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:"])
104
113
# Set this for plugins to use
243
247
AC_MSG_ERROR(["bison is required for Drizzle to build from a bzr branch"])
246
AC_PATH_PROG(uname_prog, uname, no)
248
# We should go through this and put all the explictly system dependent
250
AC_MSG_CHECKING(operating system)
251
AC_CACHE_VAL(mysql_cv_sys_os,
253
if test "$uname_prog" != "no"; then
254
mysql_cv_sys_os="`uname`"
256
mysql_cv_sys_os="Not Solaris"
259
AC_MSG_RESULT($mysql_cv_sys_os)
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
367
356
AC_SUBST(LD_VERSION_SCRIPT)
369
360
#--------------------------------------------------------------------
370
361
# Check for Google Proto Buffers
371
362
#--------------------------------------------------------------------
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
371
[google::protobuf::FileDescriptor* file;])
372
AS_IF([test x$ac_cv_libprotobuf = xno],
373
AC_MSG_ERROR([protobuf is required for Drizzle]))
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"
380
378
AC_MSG_ERROR([Couldn't find protoc. Try installing Google Protocol Buffer.])
386
384
# Check for libuuid
387
385
#--------------------------------------------------------------------
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.
390
390
AC_CHECK_HEADERS(uuid/uuid.h)
391
391
if test "x$ac_cv_header_uuid_uuid_h" = "xno"
393
393
AC_MSG_ERROR([Couldn't find uuid/uuid.h. Try installing libuuid development packages])
395
AC_CHECK_LIB(uuid, uuid_generate)
395
AC_LIB_HAVE_LINKFLAGS(uuid,,
397
#include <uuid/uuid.h>
397
404
#--------------------------------------------------------------------
398
405
# Check for libevent
399
406
#--------------------------------------------------------------------
401
SEARCH_FOR_LIB(event, event_loop, event.h,
402
AC_MSG_ERROR([libevent is required for Drizzle]))
405
AC_CACHE_CHECK([for bufferevent in libevent], ac_cv_libevent_works, [
406
save_CPPFLAGS="$CPPFLAGS"
408
CPPFLAGS="$EVENT_CFLAGS"
408
AC_LIB_HAVE_LINKFLAGS(event,,
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/])
415
struct bufferevent bev;
416
bufferevent_settimeout(&bev, 1, 1);
418
event_loop(EVLOOP_ONCE);
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 ]))
422
CPPFLAGS="$save_CPPFLAGS"
427
425
#--------------------------------------------------------------------
428
426
# Check for libpthread
429
427
#--------------------------------------------------------------------
431
AC_CHECK_HEADERS(pthread.h)
432
if test "x$ac_cv_header_pthread_h" != "xyes"
434
AC_MSG_ERROR([Couldn't find pthread.h.])
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"
438
434
#--------------------------------------------------------------------
439
435
# Check for tcmalloc/mtmalloc
455
451
AC_CHECK_LIB(mtmalloc,malloc,[],[])
458
455
#--------------------------------------------------------------------
460
457
#--------------------------------------------------------------------
462
SEARCH_FOR_LIB(z, crc32, zlib.h,
463
AC_MSG_ERROR([libz is required for Drizzle]))
459
AC_LIB_HAVE_LINKFLAGS(z,,
464
AS_IF([test x$ac_cv_libz = xno],
465
AC_MSG_ERROR([libz is required for Drizzle]))
465
467
#--------------------------------------------------------------------
466
468
# Check for libreadline or compatible (libedit on Mac OS X)
467
469
#--------------------------------------------------------------------
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
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])
480
SEARCH_FOR_LIB(readline, rl_initialize, readline/readline.h,
481
AC_MSG_ERROR([libreadline is required for Drizzle]),
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>
493
#include <readline/readline.h>
495
AC_CHECK_DECLS([completion_matches], [], [], [AC_INCLUDES_DEFAULT[
496
#ifdef HAVE_READLINE_HISTORY_H
497
#include <readline/history.h>
499
#include <readline/readline.h>
474
READLINE_LIBS="${LIBS}"
476
AC_SUBST(READLINE_LIBS)
502
478
DRIZZLE_CHECK_NEW_RL_INTERFACE
503
CPPFLAGS="$save_CPPFLAGS"
506
480
#--------------------------------------------------------------------
507
481
# Check for libpcre
513
487
if test "$found_pcre" = "no"
515
SEARCH_FOR_LIB(pcre, pcre_compile, pcre.h,
516
AC_MSG_ERROR([libpcre is required for Drizzle]))
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}"
518
496
AC_SUBST(PCRE_LIBS)
519
497
AC_SUBST(PCRE_CFLAGS)
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"
905
DRIZZLE_CHECK_LIB_TERMCAP
907
TERMCAP_LIBS="$with_named_curses"
909
AC_SUBST(TERMCAP_LIBS)
911
# End of readline/libedit stuff
912
882
#########################################################################
914
884
dnl Checks for library functions.
917
# The following code disables intrinsic function support while we test for
918
# library functions. This is to avoid configure problems with Intel ecc
922
if test "$GCC" != "yes"; then
923
AC_SYS_COMPILER_FLAG(-nolib_inline,nolib_inline,CFLAGS,[],[])
929
886
AC_FUNC_UTIME_NULL
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.