4
4
AC_PREREQ(2.59)dnl Minimum Autoconf version required.
7
AC_CONFIG_SRCDIR([server/drizzled.cc])
7
AC_CONFIG_SRCDIR([drizzled/drizzled.cc])
8
8
AC_CONFIG_AUX_DIR(config)
9
AC_CONFIG_HEADERS([include/config.h:config.h.in])
9
AC_CONFIG_HEADERS([config.h])
10
10
AC_CANONICAL_TARGET
11
11
AM_INIT_AUTOMAKE(drizzle, 7.0.0, no-define)
49
49
sinclude(config/ac-macros/readline.m4)
50
50
sinclude(config/ac-macros/ssl.m4)
51
51
sinclude(config/ac-macros/pkg.m4)
52
sinclude(config/ac-macros/ac_cxx_header_stdcxx_98.m4)
53
# Remember to add a directory server/share/LANGUAGE
54
# Remember to add a directory drizzled/share/LANGUAGE
54
55
AVAILABLE_LANGUAGES="\
55
56
czech danish dutch english estonian french german greek hungarian \
56
57
italian japanese korean norwegian norwegian-ny polish portuguese \
155
156
CXXFLAGS="$CXXFLAGS $C_EXTRA_FLAGS "
157
158
dnl Checks for programs.
160
ifdef([AC_PROG_CC_C99],[
161
AC_PROG_CC_C99([],[AC_MSG_ERROR([C99 support required for compiling Drizzle])])
163
],[C99_SUPPORT_HACK="-std=gnu99"])
165
AC_CXX_HEADER_STDCXX_98
166
if test "$ac_cv_cxx_stdcxx_98" = "no"
168
AC_MSG_ERROR([C++ Compiler required to compile Drizzle])
285
296
# Check for libevent
286
297
#--------------------------------------------------------------------
288
AC_CHECK_HEADERS(event.h)
289
if test "x$ac_cv_header_event_h" != "xyes"
299
AC_MSG_CHECKING(for libevent)
300
AC_ARG_WITH(libevent,
301
[AS_HELP_STRING([--with-libevent],
302
[Use libevent build directory]),
303
[ with_libevent=$withval ],
304
[ with_libevent=yes ])
306
if test "$withval" = "yes"
291
AC_MSG_ERROR([Couldn't find event.h. Try installing libevent development packages])
308
AC_CHECK_HEADERS(event.h)
309
if test "x$ac_cv_header_event_h" != "xyes"
311
AC_MSG_ERROR([Couldn't find event.h. Try installing libevent development packages])
315
AC_CHECK_LIB(event, event_loop, [], [AC_MSG_ERROR(could not find libevent)])
316
LIBEVENT_LIBS="${LIBS}"
317
LIBS="${my_save_LIBS}"
320
AC_MSG_RESULT($withval)
321
if test -f $withval/event.h -a -f $withval/libevent.a; then
323
if cd $withval; then withval=`pwd`; cd $owd; fi
324
LIBEVENT_CFLAGS="-I$withval"
325
LIBEVENT_LIBS="-L$withval -levent"
326
elif test -f $withval/include/event.h -a -f $withval/lib/libevent.a; then
328
if cd $withval; then withval=`pwd`; cd $owd; fi
329
LIBEVENT_CFLAGS="-I$withval/include"
330
LIBEVENT_LIBS="-L$withval/lib -levent"
332
AC_ERROR(event.h or libevent.a not found in $withval)
293
AC_CHECK_LIB(event, event_loop, [], [AC_MSG_ERROR(could not find libevent)])
336
AC_SUBST(LIBEVENT_CFLAGS)
337
AC_SUBST(LIBEVENT_LIBS)
339
AC_CACHE_CHECK([for bufferevent in libevent], ac_libevent_works, [
340
save_CFLAGS="$CFLAGS"
342
CFLAGS="$LIBEVENT_CFLAGS"
343
LIBS="$LIBEVENT_LIBS"
345
#include <sys/types.h>
346
#include <sys/time.h>
348
#include <event.h>],[
349
struct bufferevent bev;
350
bufferevent_settimeout(&bev, 1, 1);
351
], ac_libevent_works=yes, [
352
AC_ERROR([you need to install a more recent version of libevent,
353
check http://www.monkey.org/~provos/libevent/])
356
CFLAGS="$save_CFLAGS"
295
361
#--------------------------------------------------------------------
296
362
# Check for libpthread
310
376
AC_ARG_ENABLE([tcmalloc],
311
377
[AS_HELP_STRING([--enable-tcmalloc],
312
378
[Enable linking with tcmalloc @<:@default=off@:>@])],
313
[ac_warn_strict_aliasing="$enableval"],
314
[ac_warn_strict_aliasing="no"])
379
[ac_enable_tcmalloc="$enableval"],
380
[ac_enable_tcmalloc="no"])
316
if test "x$ac_warn_strict_aliasing" = "xyes"
382
if test "x$ac_enable_tcmalloc" = "xyes"
318
384
AC_CHECK_LIB(tcmalloc,malloc,[],[])
323
389
#--------------------------------------------------------------------
325
393
AC_CHECK_HEADERS(zlib.h)
326
394
if test "x$ac_cv_header_zlib_h" != "xyes"
328
396
AC_MSG_ERROR([Couldn't find zlib.h. Try installing zlib development packages])
330
398
AC_CHECK_LIB(z, crc32, [], [AC_MSG_ERROR(could not find libz)])
333
AC_CHECK_HEADERS([readline/readline.h])
404
#--------------------------------------------------------------------
405
# Check for libreadline or compatible (libedit on Mac OS X)
406
#--------------------------------------------------------------------
408
AC_CHECK_HEADERS(readline/history.h readline/readline.h)
334
409
if test "x$ac_cv_header_readline_readline_h" != "xyes"
336
411
AC_MSG_ERROR([Couldn't find readline/readline.h. Try installing readline development packages.])
413
AC_CHECK_TYPES([HIST_ENTRY], [], [], [AC_INCLUDES_DEFAULT[
414
#ifdef HAVE_READLINE_HISTORY_H
415
#include <readline/history.h>
417
#include <readline/readline.h>
419
AC_CHECK_DECLS([completion_matches], [], [], [AC_INCLUDES_DEFAULT[
420
#ifdef HAVE_READLINE_HISTORY_H
421
#include <readline/history.h>
423
#include <readline/readline.h>
426
MYSQL_CHECK_NEW_RL_INTERFACE
430
AC_CHECK_LIB(readline, rl_initialize, [],
431
[AC_CHECK_LIB(ncurses, tgetent, [], [AC_MSG_ERROR(Couldn't find ncurses)])
432
AC_SEARCH_LIBS(rl_initialize, readline, [],
433
[AC_MSG_ERROR(Couldn't find libreadline.)])])
434
READLINE_LIBS="$LIBS"
436
AC_SUBST(READLINE_LIBS)
339
438
#--------------------------------------------------------------------
340
439
# Check for libpcre
354
453
# We can't search for these well, but we sure do need them!
355
PCRE_LIBS="-lpcrecpp -lpcre"
454
PCRE_CFLAGS="`$PKG_CONFIG libpcrecpp --cflags`"
455
PCRE_LIBS="`$PKG_CONFIG libpcrecpp --libs`"
358
458
if test "x$found_pcre" != "xyes"
523
618
AC_MSG_CHECKING(if we should use assembler functions)
524
619
# For now we only support assembler on i386 and sparc systems
525
AM_CONDITIONAL(ASSEMBLER_x86, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "i386" && $AS strings/strings-x86.s -o checkassembler >/dev/null 2>&1 && test -f checkassembler && (rm -f checkassembler; exit 0;))
620
AM_CONDITIONAL(ASSEMBLER_x86, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "i386" && $AS mystrings/strings-x86.s -o checkassembler >/dev/null 2>&1 && test -f checkassembler && (rm -f checkassembler; exit 0;))
526
621
AM_CONDITIONAL(ASSEMBLER_sparc32, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "sparc")
527
622
AM_CONDITIONAL(ASSEMBLER_sparc64, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "sparcv9")
528
623
AM_CONDITIONAL(ASSEMBLER, test "$ASSEMBLER_x86_TRUE" = "" -o "$ASSEMBLER_sparc32_TRUE" = "")
615
710
AC_CHECK_HEADERS(sys/fpu.h utime.h sys/utime.h )
616
711
AC_CHECK_HEADERS(synch.h sys/mman.h sys/socket.h netinet/in.h arpa/inet.h)
617
712
AC_CHECK_HEADERS(sys/timeb.h sys/vadvise.h sys/wait.h term.h)
618
AC_CHECK_HEADERS(termio.h termios.h sched.h crypt.h alloca.h)
713
AC_CHECK_HEADERS(termio.h termios.h sched.h alloca.h)
619
714
AC_CHECK_HEADERS(sys/ioctl.h malloc.h sys/malloc.h sys/ipc.h sys/shm.h)
620
715
AC_CHECK_HEADERS(sys/prctl.h sys/resource.h sys/param.h port.h ieeefp.h)
621
716
AC_CHECK_HEADERS(execinfo.h)
710
805
DEBUG_OPTIMIZE_CXX=""
808
dnl TODO: Remove this define once we are using 2.61 across the board.
811
# Check whether to enable assertions.
812
ifdef([AC_HEADER_ASSERT],[],AC_DEFUN([AC_HEADER_ASSERT],
814
AC_MSG_CHECKING([whether to enable assertions])
815
AC_ARG_ENABLE([assert],
816
[ --disable-assert turn off assertions],
818
AC_DEFINE(NDEBUG, 1, [Define to 1 if assertions should be disabled.])],
819
[AC_MSG_RESULT(yes)])
713
824
CFLAGS="${SYMBOLS_CFLAGS} ${CFLAGS}"
714
825
CXXFLAGS="${SYMBOLS_CXXFLAGS} ${CXXFLAGS}"
828
[AS_HELP_STRING([--with-debug],
829
[Add debug code/turns off optimizations (yes|no) @<:@default=no@:>@])],
830
[with_debug=$withval],
832
if test "$with_debug" = "yes"
835
CFLAGS="$DEBUG_OPTIMIZE_CC $CFLAGS"
836
CXXFLAGS="$DEBUG_OPTIMIZE_CXX $CXXFLAGS"
838
# Optimized version. No debug
839
CFLAGS="$OPTIMIZE_CFLAGS $CFLAGS"
840
CXXFLAGS="$OPTIMIZE_CXXFLAGS $CXXFLAGS"
716
844
AC_ARG_WITH([fast-mutexes],
717
845
[AS_HELP_STRING([--with-fast-mutexes],
718
846
[Compile with fast mutexes @<:@default=off@:>@])],
827
955
MYSQL_PTHREAD_YIELD
829
######################################################################
830
# For readline/libedit (We simply move the mimimum amount of stuff from
831
# the readline/libedit configure.in here)
833
958
dnl Checks for header files.
834
959
AC_CHECK_HEADERS(malloc.h sys/cdefs.h)
922
1047
AC_MSG_ERROR("Drizzle requires fcntl.")
925
AC_CHECK_FUNCS(bcmp bfill bmove bsearch bzero \
1050
AC_CHECK_FUNCS(bsearch \
926
1051
cuserid fchmod \
927
1052
fdatasync finite fpresetsticky fpsetmask fsync ftruncate \
928
1053
getcwd getpass getpassphrase getpwnam \
929
1054
getpwuid getrlimit getrusage getwd index initgroups isnan \
930
1055
localtime_r gethrtime gmtime_r \
931
locking longjmp lrand48 madvise mallinfo memcpy memmove \
1056
locking longjmp lrand48 madvise mallinfo \
932
1058
mkstemp mlockall perror poll pread pthread_attr_create mmap mmap64 getpagesize \
933
1059
pthread_attr_getstacksize pthread_attr_setprio pthread_attr_setschedparam \
934
1060
pthread_attr_setstacksize pthread_condattr_create pthread_getsequence_np \
1205
1331
BASE_WARNINGS="-W -Wall -Wextra"
1206
GCC_WARNINGS="${BASE_WARNINGS} -std=gnu99 ${GCC_PEDANTIC} ${W_UNREACHABLE} ${W_FAIL} ${GPROF_PROFILING} ${GPROF_COVERAGE}"
1207
GXX_WARNINGS="${BASE_WARNINGS} -std=gnu++98 ${GXX_PEDANTIC} ${W_UNREACHABLE} ${W_FAIL} ${GPROF_PROFILING} ${GPROF_COVERAGE}"
1332
GCC_WARNINGS="${C99_SUPPORT_HACK} ${BASE_WARNINGS} ${GCC_PEDANTIC} ${W_UNREACHABLE} ${W_FAIL} ${GPROF_PROFILING} ${GPROF_COVERAGE}"
1333
GXX_WARNINGS="${BASE_WARNINGS} ${GXX_PEDANTIC} ${W_UNREACHABLE} ${W_FAIL} ${GPROF_PROFILING} ${GPROF_COVERAGE}"
1209
1335
CXXFLAGS="$CXXFLAGS ${GXX_WARNINGS}"
1210
1336
CFLAGS="$CFLAGS ${GCC_WARNINGS} "
1339
AC_SUBST([GLOBAL_CPPFLAGS],['-I$(top_srcdir) -I$(top_builddir)'])
1340
AC_SUBST([AM_CPPFLAGS],['${GLOBAL_CPPFLAGS}'])
1213
1342
# Some usefull subst
1226
1355
AC_SUBST(MAKE_BINARY_DISTRIBUTION_OPTIONS)
1228
1357
AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile mysys/tests/Makefile dnl
1229
strings/Makefile strings/tests/Makefile storage/Makefile dnl
1358
mystrings/Makefile mystrings/tests/Makefile storage/Makefile dnl
1230
1359
vio/Makefile dnl
1231
1360
libdrizzle/Makefile client/Makefile dnl
1232
server/Makefile server/share/Makefile dnl
1233
server/sql_builtin.cc dnl
1234
include/Makefile dnl
1361
drizzled/Makefile dnl
1362
drizzled/field/Makefile dnl
1363
drizzled/share/Makefile dnl
1364
drizzled/sql_builtin.cc dnl
1235
1365
support-files/Makefile dnl
1236
1366
tests/Makefile tests/install_test_db dnl
1237
include/drizzle_version.h plugin/Makefile dnl
1238
server/drizzled_safe support-files/libdrizzle.pc dnl
1367
drizzled/version.h plugin/Makefile dnl
1368
drizzled/drizzled_safe support-files/libdrizzle.pc dnl
1239
1369
support-files/drizzle.server support-files/drizzle-log-rotate)
1241
1371
AC_CONFIG_COMMANDS([default], , test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h)