2
2
dnl Process this file with autoconf to produce a configure script.
4
AC_PREREQ(2.59)dnl Minimum Autoconf version required.
4
AC_PREREQ(2.61)dnl Minimum Autoconf version required.
6
AC_INIT(drizzle, [7.0.0], [http://bugs.launchpad.net/drizzle])
7
AC_CONFIG_SRCDIR([drizzled/drizzled.cc])
7
AC_CONFIG_SRCDIR([sql/mysqld.cc])
8
8
AC_CONFIG_AUX_DIR(config)
9
AC_CONFIG_HEADERS([config.h])
11
# Setting CFLAGS here prevents AC_CANONICAL_TARGET from injecting them
13
SAVE_CXXFLAGS=${CXXFLAGS}
9
AC_CONFIG_HEADERS([include/config.h:config.h.in])
17
10
AC_CANONICAL_TARGET
20
CXXFLAGS=${SAVE_CXXFLAGS}
22
AM_INIT_AUTOMAKE(nostdinc -Wall -Werror)
23
if test "x${enable_dependency_tracking}" = "x"
25
enable_dependency_tracking=yes
11
AM_INIT_AUTOMAKE(mysql, 7.0.0, no-define)
29
15
# See the libtool docs for information on how to do shared lib versions.
30
SHARED_LIB_MAJOR_VERSION=1
16
SHARED_LIB_MAJOR_VERSION=16
31
17
SHARED_LIB_VERSION=$SHARED_LIB_MAJOR_VERSION:0:0
32
AC_SUBST(SHARED_LIB_MAJOR_VERSION)
33
AC_SUBST(SHARED_LIB_VERSION)
36
dnl Checks for programs.
39
ACX_USE_SYSTEM_EXTENSIONS
41
AC_CXX_HEADER_STDCXX_98
42
if test "$ac_cv_cxx_stdcxx_98" = "no"
44
AC_MSG_ERROR([C++ Compiler required to compile Drizzle])
49
AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
50
ifdef([AC_PROG_CC_C99],[
51
AC_PROG_CC_C99([$1],[$2],[$3])
55
C99_SUPPORT_HACK="-std=gnu99"
59
C99_SUPPORT_HACK="-xc99"
67
23
# We take some made up examples
69
25
# VERSION 5.1.40sp1-alpha 5.0.34a
70
# DRIZZLE_NO_DASH_VERSION 5.1.40sp1 5.0.34a
71
# DRIZZLE_NUMERIC_VERSION 5.1.40 5.0.34
72
# DRIZZLE_BASE_VERSION 5.1 5.0
73
# DRIZZLE_VERSION_ID 50140 50034
26
# MYSQL_NO_DASH_VERSION 5.1.40sp1 5.0.34a
27
# MYSQL_NUMERIC_VERSION 5.1.40 5.0.34
28
# MYSQL_BASE_VERSION 5.1 5.0
29
# MYSQL_VERSION_ID 50140 50034
75
DRIZZLE_NO_DASH_VERSION=`echo $VERSION | sed -e "s|-.*$||"`
76
DRIZZLE_NUMERIC_VERSION=`echo $DRIZZLE_NO_DASH_VERSION | sed -e "s|[[a-z]][[a-z0-9]]*$||"`
77
DRIZZLE_BASE_VERSION=`echo $DRIZZLE_NUMERIC_VERSION | sed -e "s|\.[[^.]]*$||"`
78
DRIZZLE_VERSION_ID=`echo $DRIZZLE_NUMERIC_VERSION | \
31
MYSQL_NO_DASH_VERSION=`echo $VERSION | sed -e "s|-.*$||"`
32
MYSQL_NUMERIC_VERSION=`echo $MYSQL_NO_DASH_VERSION | sed -e "s|[[a-z]][[a-z0-9]]*$||"`
33
MYSQL_BASE_VERSION=`echo $MYSQL_NUMERIC_VERSION | sed -e "s|\.[[^.]]*$||"`
34
MYSQL_VERSION_ID=`echo $MYSQL_NUMERIC_VERSION | \
79
35
awk -F. '{printf "%d%0.2d%0.2d", $1, $2, $3}'`
80
AC_DEFINE_UNQUOTED(DRIZZLE_BASE_VERSION,["$DRIZZLE_BASE_VERSION"],
81
[Major and minor version])
82
AC_DEFINE_UNQUOTED([DRIZZLE_VERSION_ID],[$DRIZZLE_VERSION_ID],
83
[Version ID that can be easily used for numeric comparison])
85
37
# The port should be constant for a LONG time
86
DRIZZLE_TCP_PORT_DEFAULT=4427
88
sinclude(m4/dtrace.m4)
90
sinclude(m4/character_sets.m4)
38
MYSQL_TCP_PORT_DEFAULT=3306
41
sinclude(config/ac-macros/alloca.m4)
42
sinclude(config/ac-macros/check_cpu.m4)
43
sinclude(config/ac-macros/character_sets.m4)
44
sinclude(config/ac-macros/compiler_flag.m4)
45
sinclude(config/ac-macros/dtrace.m4)
46
sinclude(config/ac-macros/plugins.m4)
47
sinclude(config/ac-macros/large_file.m4)
48
sinclude(config/ac-macros/misc.m4)
49
sinclude(config/ac-macros/readline.m4)
50
sinclude(config/ac-macros/ssl.m4)
52
# Remember to add a directory sql/share/LANGUAGE
53
AVAILABLE_LANGUAGES="\
54
czech danish dutch english estonian french german greek hungarian \
55
italian japanese korean norwegian norwegian-ny polish portuguese \
56
romanian russian serbian slovak spanish swedish ukrainian"
61
AC_SUBST(MYSQL_NO_DASH_VERSION)
62
AC_SUBST(MYSQL_BASE_VERSION)
63
AC_SUBST(MYSQL_VERSION_ID)
64
AC_SUBST(MYSQL_PREVIOUS_BASE_VERSION)
65
AC_SUBST(PROTOCOL_VERSION)
66
AC_DEFINE_UNQUOTED([PROTOCOL_VERSION], [$PROTOCOL_VERSION],
67
[mysql client protocol version])
68
AC_SUBST(DOT_FRM_VERSION)
69
AC_DEFINE_UNQUOTED([DOT_FRM_VERSION], [$DOT_FRM_VERSION],
70
[Version of .frm files])
71
AC_SUBST(SHARED_LIB_MAJOR_VERSION)
72
AC_SUBST(SHARED_LIB_VERSION)
91
73
AC_SUBST(AVAILABLE_LANGUAGES)
93
sinclude(m4/gettext.m4)
94
AM_GNU_GETTEXT([external])
95
AM_CONDITIONAL([BUILD_GETTEXT],[test "x$MSGMERGE" != "x" -a "x$MSGMERGE" != "x:"])
97
# Set this for plugins to use
98
ac_build_drizzle="yes"
101
76
# Canonicalize the configuration name.
124
99
i?86) BASE_MACHINE_TYPE=i386 ;;
102
# Save some variables and the command line options for mysqlbug
105
SAVE_ASFLAGS="$ASFLAGS"
106
SAVE_CFLAGS="$CFLAGS"
107
SAVE_CXXFLAGS="$CXXFLAGS"
108
SAVE_LDFLAGS="$LDFLAGS"
109
SAVE_CXXLDFLAGS="$CXXLDFLAGS"
110
CONF_COMMAND="$0 $ac_configure_args"
111
AC_SUBST(CONF_COMMAND)
114
AC_SUBST(SAVE_ASFLAGS)
115
AC_SUBST(SAVE_CFLAGS)
116
AC_SUBST(SAVE_CXXFLAGS)
117
AC_SUBST(SAVE_LDFLAGS)
118
AC_SUBST(SAVE_CXXLDFLAGS)
128
122
# This is needed is SUBDIRS is set
135
AC_SUBST(TARGET_LINUX)
136
AC_DEFINE([TARGET_OS_LINUX], [1], [Whether we build for Linux])
141
AC_DEFINE([TARGET_OS_OSX], [1], [Whether we build for OSX])
144
TARGET_SOLARIS="true"
145
AC_SUBST(TARGET_SOLARIS)
146
AC_DEFINE([TARGET_OS_SOLARIS], [1], [Whether we are building for Solaris])
152
dnl AC_CANONICAL_HOST thinks it's a good idea to just set CFLAGS to
153
dnl -g -O2 if you're running gcc. We would like to use something else, thanks.
154
if test "x${CFLAGS}" = "x-g -O2"
158
if test "x${CXXFLAGS}" = "x-g -O2"
163
DRIZZLE_CHECK_C_VERSION
164
DRIZZLE_CHECK_CXX_VERSION
125
##############################################################################
126
# The below section needs to be done before AC_PROG_CC
127
##############################################################################
129
if test "x${CFLAGS-}" = x ; then
135
if test "x${CPPFLAGS-}" = x ; then
141
if test "x${LDFLAGS-}" = x ; then
147
################ End of section to be done before AC_PROG_CC #################
149
# The following hack should ensure that configure doesn't add optimizing
150
# or debugging flags to CFLAGS or CXXFLAGS
151
# C_EXTRA_FLAGS are flags that are automaticly added to both
152
# CFLAGS and CXXFLAGS
153
CFLAGS="$CFLAGS $C_EXTRA_FLAGS "
154
CXXFLAGS="$CXXFLAGS $C_EXTRA_FLAGS "
156
dnl Checks for programs.
163
# Print version of CC and CXX compiler (if they support --version)
166
CC_VERSION=`$CC -version | grep -i version`
169
CC_VERSION=`$CC --version | sed 1q`
174
AC_MSG_CHECKING("C Compiler version")
175
AC_MSG_RESULT("$CC $CC_VERSION")
180
MYSQL_CHECK_CXX_VERSION
170
182
if test "$ac_cv_c_compiler_gnu" = "yes"
175
187
AC_PATH_PROG(AS, as, as)
178
dnl TODO: This needs to go away and be replaced with _ISOC99_SOURCE
179
if test "$ac_cv_c_compiler_gnu" = "yes" -o "$target_os" = "linux-gnu"
181
AC_DEFINE([_GNU_SOURCE],[1],[Fix problem with S_ISLNK() on Linux])
184
dnl Solaris 9 include file <sys/feature_tests.h> refers to X/Open document
186
dnl System Interfaces and Headers, Issue 5
188
dnl saying we should define _XOPEN_SOURCE=500 to get POSIX.1c prototypes,
189
dnl but apparently other systems (namely FreeBSD) don't agree.
191
dnl On a newer Solaris 10, the above file recognizes also _XOPEN_SOURCE=600.
192
dnl Furthermore, it tests that if a program requires older standard
193
dnl (_XOPEN_SOURCE<600 or _POSIX_C_SOURCE<200112L) it cannot be
194
dnl run on a new compiler (that defines _STDC_C99) and issues an #error.
195
dnl It's also an #error if a program requires new standard (_XOPEN_SOURCE=600
196
dnl or _POSIX_C_SOURCE=200112L) and a compiler does not define _STDC_C99.
198
dnl To add more to this mess, Sun Studio C compiler defines _STDC_C99 while
199
dnl C++ compiler does not!
201
dnl TODO: Can _ISOC99_SOURCE be defined on all platforms and remove the
202
dnl Need for all of this?
203
if test "$GCC" = "yes"
207
CFLAGS="${CFLAGS} -D_XOPEN_SOURCE=600"
208
CXXFLAGS="${CXXFLAGS} -D__C99FEATURES__"
190
# Still need ranlib for readline; local static use only so no libtool.
193
#AC_LIBTOOL_WIN32_DLL
216
196
# Ensure that we have --preserve-dup-deps defines, otherwise we get link
264
239
case "$host_cpu" in
265
240
*ppc* | *powerpc*)
266
AM_CFLAGS="$CFLAGS -mno-fused-madd"
267
AM_CXXFLAGS="$CXXFLAGS -mno-fused-madd"
241
CFLAGS="$CFLAGS -mno-fused-madd"
242
CXXFLAGS="$CXXFLAGS -mno-fused-madd"
271
# Build optimized or debug version ?
272
# First check for gcc and g++
276
DEBUG_OPTIMIZE_CXX=""
277
OPTIMIZE_CXXFLAGS="-O"
278
if test "$GCC" = "yes"
280
SYMBOLS_FLAGS="-ggdb3"
281
DEBUG_OPTIMIZE_CC="-O0"
282
OPTIMIZE_CFLAGS="-O3"
283
DEBUG_OPTIMIZE_CXX="-O0"
284
OPTIMIZE_CXXFLAGS="-O3"
286
if test "$SUNCC" = "yes"
288
dnl I'm cheating here and sticking C99 support in SYMBOLS_FLAGS
291
if test "$target_cpu" = "sparc"
293
MEMALIGN_FLAGS="-xmemalign=8s"
295
OPTIMIZE_CFLAGS="-xO4 -xlibmil -xdepend -Xa -mt -xstrconst -D_FORTEC_ ${MEMALIGN_FLAGS}"
296
DEBUG_OPTIMIZE_CXX=""
297
#Put back in once isnan is figured out
298
OPTIMIZE_CXXFLAGS="-xO4 -xlibmil -mt -D_FORTEC_ -xlang=c99 -compat=5 -library=stlport4 ${MEMALIGN_FLAGS}"
301
dnl TODO: Remove this define once we are using 2.61 across the board.
304
# Check whether to enable assertions.
305
AC_DEFUN([AX_HEADER_ASSERT],
307
AC_MSG_CHECKING([whether to enable assertions])
308
AC_ARG_ENABLE([assert],
309
[AS_HELP_STRING([--disable-assert],
310
[Turn off assertions])],
312
[ac_cv_assert="yes"])
313
AC_MSG_RESULT([$ac_cv_assert])
318
CFLAGS="${SYMBOLS_FLAGS} ${CFLAGS}"
319
CXXFLAGS="${SYMBOLS_FLAGS} ${CXXFLAGS}"
322
[AS_HELP_STRING([--with-debug],
323
[Add debug code/turns off optimizations (yes|no) @<:@default=no@:>@])],
324
[with_debug=$withval],
326
if test "$with_debug" = "yes"
329
CFLAGS="$DEBUG_OPTIMIZE_CC -DDEBUG $CFLAGS ${SAVE_CFLAGS}"
330
CXXFLAGS="$DEBUG_OPTIMIZE_CXX -DDEBUG $CXXFLAGS ${SAVE_CXXFLAGS}"
332
# Optimized version. No debug
333
CFLAGS="${OPTIMIZE_CFLAGS} ${CFLAGS} ${SAVE_CFLAGS}"
334
CXXFLAGS="$OPTIMIZE_CXXFLAGS $CXXFLAGS ${SAVE_CXXFLAGS}"
346
256
export CC CXX CFLAGS LD LDFLAGS AR ARFLAGS
355
# libdrizzle versioning when linked with GNU ld.
356
if test "x$EGREP" != "x"
258
if test "$GCC" = "yes"
358
if test "$lt_cv_prog_gnu_ld" = "yes" -a $LD --version 2>/dev/null|${EGREP} -q GNU
360
LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_srcdir)/libdrizzle/libdrizzle.ver"
260
# mysqld requires -fno-implicit-templates.
261
# Disable exceptions as they seams to create problems with gcc and threads.
262
# mysqld doesn't use run-time-type-checking, so we disable it.
263
# We should use -Wno-invalid-offsetof flag to disable some warnings from gcc
264
# regarding offset() usage in C++ which are done in a safe manner in the
266
CXXFLAGS="$CXXFLAGS ${GCC_WARNINGS} -fno-implicit-templates -fno-exceptions -fno-rtti"
267
CFLAGS="$CFLAGS ${GCC_WARNINGS} "
268
AC_DEFINE([HAVE_EXPLICIT_TEMPLATE_INSTANTIATION],
269
[1], [Defined by configure. Use explicit template instantiation.])
274
# libmysqlclient versioning when linked with GNU ld.
275
if $LD --version 2>/dev/null|grep -q GNU; then
276
LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_builddir)/libmysql/libmysql.ver"
277
AC_CONFIG_FILES(libmysql/libmysql.ver)
363
279
AC_SUBST(LD_VERSION_SCRIPT)
365
#--------------------------------------------------------------------
366
# Check for Google Proto Buffers
367
#--------------------------------------------------------------------
370
SEARCH_FOR_LIB(protobuf, printf, google/protobuf/message.h,
371
AC_MSG_ERROR([protobuf is required for Drizzle]))
373
AC_PATH_PROG([PROTOC],[protoc],[no],[$PROTOBUF_PATH])
374
if test "x$PROTOC" = "xno"
376
AC_MSG_ERROR([Couldn't find protoc. Try installing Google Protocol Buffer.])
381
#--------------------------------------------------------------------
383
#--------------------------------------------------------------------
385
dnl Do this by hand instead of with SEARCH_FOR_LIB, because uuid is weird.
386
AC_CHECK_HEADERS(uuid/uuid.h)
387
if test "x$ac_cv_header_uuid_uuid_h" = "xno"
389
AC_MSG_ERROR([Couldn't find uuid/uuid.h. Try installing libuuid development packages])
391
AC_CHECK_LIB(uuid, uuid_generate)
393
#--------------------------------------------------------------------
395
#--------------------------------------------------------------------
397
SEARCH_FOR_LIB(event, event_loop, event.h,
398
AC_MSG_ERROR([libevent is required for Drizzle]))
401
AC_CACHE_CHECK([for bufferevent in libevent], ac_cv_libevent_works, [
402
save_CPPFLAGS="$CPPFLAGS"
404
CPPFLAGS="$EVENT_CFLAGS"
407
#include <sys/types.h>
408
#include <sys/time.h>
410
#include <event.h>],[
411
struct bufferevent bev;
412
bufferevent_settimeout(&bev, 1, 1);
413
], ac_cv_libevent_works=yes, [
414
AC_MSG_ERROR([you need to install a more recent version of libevent,
415
check http://www.monkey.org/~provos/libevent/])
418
CPPFLAGS="$save_CPPFLAGS"
423
#--------------------------------------------------------------------
424
# Check for libpthread
425
#--------------------------------------------------------------------
427
AC_CHECK_HEADERS(pthread.h)
428
if test "x$ac_cv_header_pthread_h" != "xyes"
430
AC_MSG_ERROR([Couldn't find pthread.h.])
432
AC_CHECK_LIB(pthread, pthread_create, [], [AC_MSG_ERROR(could not find libpthread)])
434
#--------------------------------------------------------------------
435
# Check for tcmalloc/mtmalloc
436
#--------------------------------------------------------------------
438
AC_ARG_ENABLE([tcmalloc],
439
[AS_HELP_STRING([--enable-tcmalloc],
440
[Enable linking with tcmalloc @<:@default=off@:>@])],
441
[ac_enable_tcmalloc="$enableval"],
442
[ac_enable_tcmalloc="no"])
444
if test "x$ac_enable_tcmalloc" != "xno"
446
AC_CHECK_LIB(tcmalloc,malloc,[],[])
449
if test "x$ac_cv_lib_tcmalloc_malloc" != "xyes"
451
AC_CHECK_LIB(mtmalloc,malloc,[],[])
454
#--------------------------------------------------------------------
456
#--------------------------------------------------------------------
458
SEARCH_FOR_LIB(z, crc32, zlib.h,
459
AC_MSG_ERROR([libz is required for Drizzle]))
461
#--------------------------------------------------------------------
462
# Check for libncurses
463
#--------------------------------------------------------------------
466
SEARCH_FOR_LIB(ncurses, tgetent, ncurses/ncurses.h, [
467
SEARCH_FOR_LIB(tinfo, tgetent, ncurses/ncurses.h,
468
AC_MSG_ERROR([Couldn't find ncurses])
473
#--------------------------------------------------------------------
474
# Check for libreadline or compatible (libedit on Mac OS X)
475
#--------------------------------------------------------------------
478
SEARCH_FOR_LIB(readline, rl_initialize, readline/readline.h,
479
AC_MSG_ERROR([libreadline is required for Drizzle]),
482
save_CPPFLAGS="$CPPFLAGS"
483
CPPFLAGS="$CPPFLAGS $READLINE_CFLAGS"
484
AC_CHECK_HEADERS(readline/history.h)
485
AC_CHECK_TYPES([HIST_ENTRY], [], [], [AC_INCLUDES_DEFAULT[
486
#ifdef HAVE_READLINE_HISTORY_H
487
#include <readline/history.h>
489
#include <readline/readline.h>
491
AC_CHECK_DECLS([completion_matches], [], [], [AC_INCLUDES_DEFAULT[
492
#ifdef HAVE_READLINE_HISTORY_H
493
#include <readline/history.h>
495
#include <readline/readline.h>
498
DRIZZLE_CHECK_NEW_RL_INTERFACE
499
CPPFLAGS="$save_CPPFLAGS"
502
#--------------------------------------------------------------------
504
#--------------------------------------------------------------------
506
AC_PATH_PROG(PKG_CONFIG, pkg-config, AC_MSG_ERROR([pkg-config wasn't found.]))
507
PKG_CHECK_MODULES(PCRE, [libpcre >= 3], [found_pcre="yes"],[found_pcre="no"])
509
if test "$found_pcre" = "no"
511
SEARCH_FOR_LIB(pcre, pcre_compile, pcre.h,
512
AC_MSG_ERROR([libpcre is required for Drizzle]))
515
AC_SUBST(PCRE_CFLAGS)
282
# Avoid bug in fcntl on some versions of linux
283
AC_MSG_CHECKING([if we should use 'skip-external-locking' as default for $target_os])
284
# Any variation of Linux
285
if expr "$target_os" : "[[Ll]]inux.*" > /dev/null
287
MYSQLD_DEFAULT_SWITCHES="--skip-external-locking"
290
AC_DEFINE([TARGET_OS_LINUX], [1], [Whether we build for Linux])
292
MYSQLD_DEFAULT_SWITCHES=""
296
AC_SUBST(MYSQLD_DEFAULT_SWITCHES)
297
AC_SUBST(TARGET_LINUX)
517
299
dnl Find paths to some shell programs
518
300
AC_PATH_PROG(LN, ln, ln)
639
420
if test "$am_cv_prog_cc_stdc" = "no"
641
AC_MSG_ERROR([Drizzle requires an ANSI C compiler (and a C++ compiler). Try gcc. See the Installation chapter in the Reference Manual.])
422
AC_MSG_ERROR([MySQL requires an ANSI C compiler (and a C++ compiler). Try gcc. See the Installation chapter in the Reference Manual.])
430
# Check if we are using Linux and a glibc compiled with static nss
431
# (this is true on the MySQL build machines to avoid NSS problems)
434
if test "$TARGET_LINUX" = "true" -a "$static_nss" = ""
436
tmp=`nm /usr/lib*/libc.a | grep _nss_files_getaliasent_r`
439
STATIC_NSS_FLAGS="-lc -lnss_files -lnss_dns -lresolv"
440
STATIC_NSS_FLAGS="$STATIC_NSS_FLAGS $STATIC_NSS_FLAGS"
645
445
AC_ARG_WITH([server-suffix],
646
446
[AS_HELP_STRING([--with-server-suffix],
647
447
[Append value to the version string.])],
648
[ DRIZZLE_SERVER_SUFFIX=`echo "$withval" | sed -e 's/^\(...................................\)..*$/\1/'` ],
649
[ DRIZZLE_SERVER_SUFFIX= ]
448
[ MYSQL_SERVER_SUFFIX=`echo "$withval" | sed -e 's/^\(...................................\)..*$/\1/'` ],
449
[ MYSQL_SERVER_SUFFIX= ]
651
AC_DEFINE_UNQUOTED([DRIZZLE_SERVER_SUFFIX],[$DRIZZLE_SERVER_SUFFIX],
652
[Append value to the version string])
451
AC_SUBST(MYSQL_SERVER_SUFFIX)
654
453
# Force use of a curses libs
655
454
AC_ARG_WITH([named-curses-libs],
660
459
[ with_named_curses=no ]
462
# compile with strings functions in assembler
463
AC_ARG_ENABLE([assembler],
464
[AS_HELP_STRING([--enable-assembler],
465
[Use assembler versions of some string functions if available.])],
466
[ ENABLE_ASSEMBLER=$enableval ],
467
[ ENABLE_ASSEMBLER=no ]
470
AC_MSG_CHECKING(if we should use assembler functions)
471
# For now we only support assembler on i386 and sparc systems
472
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;))
473
AM_CONDITIONAL(ASSEMBLER_sparc32, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "sparc")
474
AM_CONDITIONAL(ASSEMBLER_sparc64, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "sparcv9")
475
AM_CONDITIONAL(ASSEMBLER, test "$ASSEMBLER_x86_TRUE" = "" -o "$ASSEMBLER_sparc32_TRUE" = "")
477
if test "$ASSEMBLER_TRUE" = ""
485
AC_MSG_CHECKING(if SHOW PROFILE should be enabled.)
486
AC_ARG_ENABLE([profiling],
487
[AS_HELP_STRING([--enable-profiling],
488
[Build a version with query profiling code])],
489
[ ENABLED_PROFILING=$enableval ],
490
[ ENABLED_PROFILING=no ])
492
if test "$ENABLED_PROFILING" = "yes"
494
AC_DEFINE([ENABLED_PROFILING], [1],
495
[If SHOW PROFILE should be enabled])
663
501
AC_ARG_WITH([tcp-port],
664
502
[AS_HELP_STRING([--with-tcp-port=port-number],
665
[Which port to use for Drizzle services @<:@default=4427@:>@])],
666
[ DRIZZLE_TCP_PORT=$withval ],
667
[ DRIZZLE_TCP_PORT=$DRIZZLE_TCP_PORT_DEFAULT
503
[Which port to use for MySQL services @<:@default=3306@:>@])],
504
[ MYSQL_TCP_PORT=$withval ],
505
[ MYSQL_TCP_PORT=$MYSQL_TCP_PORT_DEFAULT
668
506
# if we actually defaulted (as opposed to the pathological case of
669
# --with-tcp-port=<DRIZZLE_TCP_PORT_DEFAULT> which might in theory
507
# --with-tcp-port=<MYSQL_TCP_PORT_DEFAULT> which might in theory
670
508
# happen if whole batch of servers was built from a script), set
671
509
# the default to zero to indicate that; we don't lose information
672
510
# that way, because 0 obviously indicates that we can get the
673
# default value from DRIZZLE_TCP_PORT. this seems really evil, but
674
# testing for DRIZZLE_TCP_PORT==DRIZZLE_TCP_PORT_DEFAULT would make a
675
# a port of DRIZZLE_TCP_PORT_DEFAULT magic even if the builder did not
511
# default value from MYSQL_TCP_PORT. this seems really evil, but
512
# testing for MYSQL_TCP_PORT==MYSQL_TCP_PORT_DEFAULT would make a
513
# a port of MYSQL_TCP_PORT_DEFAULT magic even if the builder did not
676
514
# intend it to mean "use the default, in fact, look up a good default
677
# from /etc/services if you can", but really, really meant 4427 when
678
# they passed in 4427. When they pass in a specific value, let them
515
# from /etc/services if you can", but really, really meant 3306 when
516
# they passed in 3306. When they pass in a specific value, let them
679
517
# have it; don't second guess user and think we know better, this will
680
518
# just make people cross. this makes the the logic work like this
681
519
# (which is complicated enough):
683
521
# - if a port was set during build, use that as a default.
685
523
# - otherwise, try to look up a port in /etc/services; if that fails,
686
# use DRIZZLE_TCP_PORT_DEFAULT (at the time of this writing 4427)
524
# use MYSQL_TCP_PORT_DEFAULT (at the time of this writing 3306)
688
# - allow the DRIZZLE_TCP_PORT environment variable to override that.
526
# - allow the MYSQL_TCP_PORT environment variable to override that.
690
528
# - allow command-line parameters to override all of the above.
692
# the top-most DRIZZLE_TCP_PORT_DEFAULT is read from win/configure.js,
530
# the top-most MYSQL_TCP_PORT_DEFAULT is read from win/configure.js,
693
531
# so don't mess with that.
694
DRIZZLE_TCP_PORT_DEFAULT=0 ]
532
MYSQL_TCP_PORT_DEFAULT=0 ]
696
AC_SUBST(DRIZZLE_TCP_PORT)
534
AC_SUBST(MYSQL_TCP_PORT)
697
535
# We might want to document the assigned port in the manual.
698
AC_SUBST(DRIZZLE_TCP_PORT_DEFAULT)
699
AC_DEFINE_UNQUOTED([DRIZZLE_PORT],[$DRIZZLE_TCP_PORT],
700
[Drizzle port to use])
701
AC_DEFINE_UNQUOTED([DRIZZLE_PORT_DEFAULT],[$DRIZZLE_TCP_PORT_DEFAULT],
702
[If we defaulted to DRIZZLE_PORT, then this will be zero])
536
AC_SUBST(MYSQL_TCP_PORT_DEFAULT)
704
538
# Use this to set the place used for unix socket used to local communication.
705
AC_ARG_WITH([drizzled-user],
706
[AS_HELP_STRING([--with-drizzled-user=username],
707
[What user the drizzled daemon shall be run as.
708
@<:@default=drizzle@:>@])],
709
[ DRIZZLED_USER=$withval ],
710
[ DRIZZLED_USER=drizzle ]
539
AC_ARG_WITH([mysqld-user],
540
[AS_HELP_STRING([--with-mysqld-user=username],
541
[What user the mysqld daemon shall be run as.
542
@<:@default=mysql@:>@])],
543
[ MYSQLD_USER=$withval ],
544
[ MYSQLD_USER=mysql ]
712
AC_SUBST(DRIZZLED_USER)
546
AC_SUBST(MYSQLD_USER)
714
548
# If we should allow LOAD DATA LOCAL
715
549
AC_MSG_CHECKING(If we should should enable LOAD DATA LOCAL by default)
739
575
AC_HEADER_SYS_WAIT
740
576
AC_HEADER_STDBOOL
741
AC_CHECK_HEADERS(fcntl.h float.h fpu_control.h ieeefp.h)
742
AC_CHECK_HEADERS(limits.h pwd.h select.h linux/config.h)
743
AC_CHECK_HEADERS(sys/fpu.h utime.h sys/utime.h )
744
AC_CHECK_HEADERS(synch.h sys/mman.h sys/socket.h)
745
AC_CHECK_HEADERS([curses.h term.h],[],[],
746
[[#ifdef HAVE_CURSES_H
750
AC_CHECK_HEADERS(termio.h termios.h sched.h alloca.h)
751
AC_CHECK_HEADERS(sys/prctl.h ieeefp.h)
752
AC_CHECK_HEADERS(execinfo.h)
577
AC_CHECK_HEADERS(fcntl.h float.h floatingpoint.h fpu_control.h ieeefp.h \
578
limits.h memory.h pwd.h select.h \
579
stdlib.h stddef.h stdint.h sys/fpu.h \
580
strings.h string.h synch.h sys/mman.h sys/socket.h netinet/in.h arpa/inet.h \
581
sys/timeb.h sys/types.h sys/un.h sys/vadvise.h sys/wait.h term.h \
582
unistd.h utime.h sys/utime.h termio.h termios.h sched.h crypt.h alloca.h \
583
sys/ioctl.h malloc.h sys/malloc.h sys/ipc.h sys/shm.h linux/config.h \
584
sys/prctl.h sys/resource.h sys/param.h port.h ieeefp.h \
587
AC_CHECK_HEADERS([xfs/xfs.h])
588
#--------------------------------------------------------------------
590
#--------------------------------------------------------------------
592
AC_CHECK_LIB(event, event_loop, [], [AC_MSG_ERROR(could not find libevent)])
594
#--------------------------------------------------------------------
595
# Check for libpthread
596
#--------------------------------------------------------------------
598
AC_CHECK_LIB(pthread, pthread_create, [], [AC_MSG_ERROR(could not find libpthread)])
754
600
#--------------------------------------------------------------------
755
601
# Check for system libraries. Adds the library to $LIBS
757
603
#--------------------------------------------------------------------
759
605
AC_CHECK_LIB(m, floor, [], AC_CHECK_LIB(m, __infinity))
761
AC_CHECK_FUNC(setsockopt, [], [AC_CHECK_LIB(socket, setsockopt)])
762
AC_CHECK_FUNC(yp_get_default_domain, [],
763
[AC_CHECK_LIB(nsl, yp_get_default_domain)])
764
AC_CHECK_FUNC(p2open, [], [AC_CHECK_LIB(gen, p2open)])
608
AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
609
AC_CHECK_FUNC(yp_get_default_domain, ,
610
AC_CHECK_LIB(nsl, yp_get_default_domain))
611
AC_CHECK_FUNC(p2open, , AC_CHECK_LIB(gen, p2open))
765
612
# This may get things to compile even if bind-8 is installed
766
AC_CHECK_FUNC(bind, [], [AC_CHECK_LIB(bind, bind)])
613
AC_CHECK_FUNC(bind, , AC_CHECK_LIB(bind, bind))
767
614
# Check if crypt() exists in libc or libcrypt, sets LIBS if needed
768
615
AC_SEARCH_LIBS(crypt, crypt, AC_DEFINE(HAVE_CRYPT, 1, [crypt]))
771
618
AC_CHECK_LIB(rt, aio_read)
773
620
# For the sched_yield() function on Solaris
774
AC_CHECK_FUNC(sched_yield, [],
775
[AC_CHECK_LIB(posix4, [sched_yield],
776
[AC_DEFINE(HAVE_SCHED_YIELD) LIBS="$LIBS -lposix4"])])
621
AC_CHECK_FUNC(sched_yield, , AC_CHECK_LIB(posix4, sched_yield,
622
[AC_DEFINE(HAVE_SCHED_YIELD) LIBS="$LIBS -lposix4"]))
778
624
if test "$ac_cv_header_termio_h" = "no" -a "$ac_cv_header_termios_h" = "no"
780
AC_CHECK_FUNC(gtty, [], [AC_CHECK_LIB(compat, gtty)])
626
AC_CHECK_FUNC(gtty, , AC_CHECK_LIB(compat, gtty))
629
AC_CHECK_TYPES([int8, uint8, int16, uint16, int32, uint32, int64, uint64,
630
uchar, uint, ulong],[],[], [
631
#include <sys/types.h>
783
633
AC_CHECK_TYPES([fp_except], [], [], [
784
634
#include <sys/types.h>
785
635
#include <ieeefp.h>
788
639
my_save_LIBS="$LIBS"
790
641
AC_CHECK_LIB(dl,dlopen)
791
AC_CHECK_FUNCS(dlopen)
792
if test "$ac_cv_func_dlopen" != "yes"
794
AC_MSG_ERROR([Drizzle requires dlopen])
648
AC_CHECK_FUNCS(dlopen dlerror)
800
651
AC_CHECK_FUNCS(strtok_r)
654
# System characteristics
657
AC_SYS_RESTARTABLE_SYSCALLS
661
# Build optimized or debug version ?
662
# First check for gcc and g++
663
if test "$ac_cv_c_compiler_gnu" = "yes"
666
DEBUG_OPTIMIZE_CC="-O"
667
OPTIMIZE_CFLAGS="$MAX_C_OPTIMIZE"
673
if test "$ac_cv_prog_cxx_g" = "yes"
676
DEBUG_OPTIMIZE_CXX="-O"
677
OPTIMIZE_CXXFLAGS="$MAX_CXX_OPTIMIZE"
680
DEBUG_OPTIMIZE_CXX=""
681
OPTIMIZE_CXXFLAGS="-O"
684
# If the user specified CFLAGS, we won't add any optimizations
685
if test -n "$SAVE_CFLAGS"
691
if test -n "$SAVE_CXXFLAGS"
694
DEBUG_OPTIMIZE_CXX=""
698
[AS_HELP_STRING([--with-debug],
699
[Add debug code (yes|no|full) @<:@default=no@:>@
700
Full adds memory checked, very slow.])],
701
[with_debug=$withval],
703
if test "$with_debug" = "yes"
706
AC_DEFINE([DBUG_ON], [1], [Use libdbug])
707
CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC $CFLAGS"
708
CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX $CXXFLAGS"
709
elif test "$with_debug" = "full"
711
# Full debug. Very slow in some cases
712
AC_DEFINE([DBUG_ON], [1], [Use libdbug])
713
CFLAGS="$DEBUG_CFLAGS $CFLAGS"
714
CXXFLAGS="$DEBUG_CXXFLAGS $CXXFLAGS"
716
# Optimized version. No debug
717
AC_DEFINE([DBUG_OFF], [1], [Dont use libdbug])
718
CFLAGS="$OPTIMIZE_CFLAGS $CFLAGS"
719
CXXFLAGS="$OPTIMIZE_CXXFLAGS $CXXFLAGS"
722
# If we should allow error injection tests
723
AC_ARG_WITH([error-inject],
724
[AS_HELP_STRING([--with-error-inject],
725
[Enable error injection in MySQL Server @<:@default=off@:>@])],
726
[ with_error_inject=$withval ],
727
[ with_error_inject=no ])
729
if test $with_debug != "no"
731
if test "$with_error_inject" = "yes"
733
AC_DEFINE([ERROR_INJECT_SUPPORT], [1],
734
[Enable error injection in MySQL Server])
804
738
AC_ARG_WITH([fast-mutexes],
805
739
[AS_HELP_STRING([--with-fast-mutexes],
827
764
COMPILATION_COMMENT="Source distribution"
829
AC_DEFINE_UNQUOTED([COMPILATION_COMMENT],["$COMPILATION_COMMENT"],
830
[Comment about compilation environment])
766
AC_SUBST(COMPILATION_COMMENT)
768
AC_MSG_CHECKING("need of special linking flags")
769
if test "$TARGET_LINUX" = "true" -a "$ac_cv_c_compiler_gnu" = "yes" -a "$all_is_static" != "yes"
771
LDFLAGS="$LDFLAGS -rdynamic"
772
AC_MSG_RESULT("-rdynamic")
774
case "$SYSTEM_TYPE$with_mysqld_ldflags " in
775
*freebsd*"-all-static "*|*dragonfly*"-all-static "*)
776
AC_MSG_RESULT("none")
778
*freebsd*|*dragonfly*)
779
MYSQLD_EXTRA_LDFLAGS="$MYSQLD_EXTRA_LDFLAGS -export-dynamic"
780
AC_MSG_RESULT("-export-dynamic")
783
AC_MSG_RESULT("none")
832
788
dnl Checks for typedefs, structures, and compiler characteristics.
794
MYSQL_NEEDS_MYSYS_NEW
795
# AC_CHECK_SIZEOF return 0 when it does not find the size of a
796
# type. We want a error instead.
797
AC_CHECK_SIZEOF(char, 1)
798
if test "$ac_cv_sizeof_char" -eq 0
800
AC_MSG_ERROR([No size for char type.
801
A likely cause for this could be that there isn't any
802
static libraries installed. You can verify this by checking if you have libm.a
803
in /lib, /usr/lib or some other standard place. If this is the problem,
804
install the static libraries and try again. If this isn't the problem,
805
examine config.log for possible errors. If you want to report this, use
806
'scripts/mysqlbug' and include at least the last 20 rows from config.log!])
808
AC_CHECK_SIZEOF(char*, 4)
809
AC_CHECK_SIZEOF(short, 2)
810
AC_CHECK_SIZEOF(int, 4)
811
if test "$ac_cv_sizeof_int" -eq 0
813
AC_MSG_ERROR("No size for int type.")
815
AC_CHECK_SIZEOF(long, 4)
816
if test "$ac_cv_sizeof_long" -eq 0
818
AC_MSG_ERROR("No size for long type.")
820
AC_CHECK_SIZEOF(long long, 8)
821
if test "$ac_cv_sizeof_long_long" -eq 0
823
AC_MSG_ERROR("MySQL needs a long long type.")
839
825
# off_t is not a builtin type
840
826
AC_CHECK_SIZEOF(off_t, 4)
841
827
if test "$ac_cv_sizeof_off_t" -eq 0
843
AC_MSG_ERROR("Drizzle needs a off_t type.")
829
AC_MSG_ERROR("MySQL needs a off_t type.")
847
833
dnl check if time_t is unsigned
839
# do we need #pragma interface/#pragma implementation ?
840
# yes if it's gcc 2.x, and not icc pretending to be gcc, and not cygwin
841
AC_MSG_CHECKING(the need for @%:@pragma interface/implementation)
842
# instead of trying to match SYSTEM_TYPE and CC_VERSION (that doesn't
843
# follow any standard), we'll use well-defined preprocessor macros:
844
AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
845
#if !defined(__CYGWIN__) && !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ < 3)
846
#error USE_PRAGMA_IMPLEMENTATION
848
]])],[AC_MSG_RESULT(no) ],[AC_MSG_RESULT(yes) ; CXXFLAGS="$CXXFLAGS -DUSE_PRAGMA_IMPLEMENTATION"])
853
850
# This always gives a warning. Ignore it unless you are cross compiling
855
852
#---START: Used in for client configure
856
853
# Check base type of last arg to accept
859
856
# Figure out what type of struct rlimit to use with setrlimit
860
DRIZZLE_TYPE_STRUCT_RLIMIT
857
MYSQL_TYPE_STRUCT_RLIMIT
861
858
# Find where the stack goes
862
DRIZZLE_STACK_DIRECTION
859
MYSQL_STACK_DIRECTION
863
860
# We want to skip alloca on irix unconditionally. It may work on some version..
865
862
# Do struct timespec have members tv_sec or ts_sec
867
864
# Do we have the tzname variable
866
# Do the c++ compiler have a bool type
869
868
AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>])
870
AC_CHECK_TYPES([uint, ulong])
872
DRIZZLE_PTHREAD_YIELD
869
AC_CHECK_TYPES([size_t], [], [], [#include <stdio.h>])
870
AC_CHECK_TYPES([u_int32_t])
874
######################################################################
875
# For readline/libedit (We simply move the mimimum amount of stuff from
876
# the readline/libedit configure.in here)
875
878
dnl Checks for header files.
876
AC_CHECK_HEADERS(malloc.h)
879
AC_CHECK_HEADERS(malloc.h sys/cdefs.h)
878
881
dnl Checks for library functions.
880
883
AC_PROG_GCC_TRADITIONAL
885
AC_CHECK_FUNCS(re_comp regcomp strdup)
887
dnl Sun compilers have their own vis.h that is about something
888
dnl totally different. So, not to change the libedit source, we
889
dnl do some additional checks before we define HAVE_VIS_H.
890
AC_CHECK_HEADER(vis.h,
891
[AC_CHECK_FUNC(strvis,
892
[AC_DEFINE([HAVE_VIS_H], [1],[Found vis.h and the strvis() function])])])
894
AC_CHECK_FUNCS(strlcat strlcpy)
883
895
AC_CHECK_FUNCS(issetugid)
896
AC_CHECK_FUNCS(fgetln)
897
AC_CHECK_FUNCS(getline flockfile)
885
899
# from old readline settting:
888
902
AC_SUBST(MAKE_SHELL)
890
904
# Already-done: stdlib.h string.h unistd.h termios.h
891
AC_CHECK_HEADERS(stdarg.h dirent.h locale.h ndir.h sys/dir.h \
892
sys/ndir.h sys/select.h \
893
sys/mman.h termcap.h termio.h asm/termbits.h grp.h \
905
AC_CHECK_HEADERS(varargs.h stdarg.h dirent.h locale.h ndir.h sys/dir.h \
906
sys/file.h sys/ndir.h sys/ptem.h sys/pte.h sys/select.h sys/stream.h \
907
sys/mman.h curses.h termcap.h termio.h termbits.h asm/termbits.h grp.h \
896
910
# Already-done: strcasecmp
897
AC_CHECK_FUNCS(lstat select)
911
AC_CHECK_FUNCS(lstat putenv select setenv setlocale strcoll tcgetattr)
901
DRIZZLE_CHECK_GETPW_FUNCS
902
DRIZZLE_HAVE_TIOCGWINSZ
903
DRIZZLE_HAVE_TIOCSTAT
904
DRIZZLE_TYPE_SIGHANDLER
915
MYSQL_CHECK_GETPW_FUNCS
916
MYSQL_HAVE_TIOCGWINSZ
919
MYSQL_STRUCT_DIRENT_D_INO
920
MYSQL_STRUCT_DIRENT_D_NAMLEN
921
MYSQL_TYPE_SIGHANDLER
922
MYSQL_CHECK_MULTIBYTE
905
923
if test "$with_named_curses" = "no"
907
DRIZZLE_CHECK_LIB_TERMCAP
925
MYSQL_CHECK_LIB_TERMCAP
909
TERMCAP_LIBS="$with_named_curses"
927
TERMCAP_LIB="$with_named_curses"
911
AC_SUBST(TERMCAP_LIBS)
929
AC_SUBST(TERMCAP_LIB)
931
# Check if the termcap function 'tgoto' is already declared in
932
# system header files or if it need to be declared locally
933
AC_CHECK_DECLS(tgoto,,,[
937
# include <ncurses.h>
945
AC_CHECK_FUNC(strunvis, ,[LIBEDIT_LOBJECTS="$LIBEDIT_LOBJECTS unvis.o"])
946
AC_CHECK_FUNC(strvis, ,[LIBEDIT_LOBJECTS="$LIBEDIT_LOBJECTS vis.o"])
947
AC_CHECK_FUNC(strlcpy, ,[LIBEDIT_LOBJECTS="$LIBEDIT_LOBJECTS strlcpy.o"])
948
AC_CHECK_FUNC(strlcat, ,[LIBEDIT_LOBJECTS="$LIBEDIT_LOBJECTS strlcat.o"])
949
AC_CHECK_FUNC(fgetln, ,[LIBEDIT_LOBJECTS="$LIBEDIT_LOBJECTS fgetln.o"])
950
AC_SUBST(LIBEDIT_LOBJECTS)
951
enable_readline="yes"
913
953
# End of readline/libedit stuff
914
954
#########################################################################
931
971
AC_FUNC_UTIME_NULL
934
AC_CHECK_FUNCS(fcntl)
935
if test "x$ac_cv_func_fcntl" != "xyes"
937
AC_MSG_ERROR("Drizzle requires fcntl.")
940
AC_CONFIG_LIBOBJ_DIR([mystrings])
944
fdatasync fpresetsticky fpsetmask fsync \
945
getpassphrase getpwnam \
946
getpwuid getrlimit getrusage index initgroups isnan \
974
AC_CHECK_FUNCS(alarm bcmp bfill bmove bsearch bzero \
975
chsize cuserid fchmod fcntl \
976
fconvert fdatasync finite fpresetsticky fpsetmask fsync ftruncate \
977
getcwd getpass getpassphrase getpwnam \
978
getpwuid getrlimit getrusage getwd index initgroups isnan \
947
979
localtime_r gethrtime gmtime_r \
949
mkstemp mlockall poll pread pthread_attr_create mmap mmap64 \
980
locking longjmp lrand48 madvise mallinfo memcpy memmove \
981
mkstemp mlockall perror poll pread pthread_attr_create mmap mmap64 getpagesize \
950
982
pthread_attr_getstacksize pthread_attr_setprio pthread_attr_setschedparam \
951
983
pthread_attr_setstacksize pthread_condattr_create pthread_getsequence_np \
952
984
pthread_key_delete pthread_rwlock_rdlock pthread_setprio \
953
985
pthread_setprio_np pthread_setschedparam pthread_sigmask readlink \
954
realpath rename rwlock_init setupterm \
959
backtrace backtrace_symbols backtrace_symbols_fd)
962
# Test whether madvise() is declared in C++ code -- it is not on some
963
# systems, such as Solaris
964
AC_CHECK_DECLS([madvise], [], [], [AC_INCLUDES_DEFAULT[
966
#include <sys/types.h>
967
#include <sys/mman.h>
973
AM_CONDITIONAL(BUILD_THR_RWLOCK,[test "$ac_cv_func_rwlock_init" -a "$ac_cv_funn_pthread_rwlock_rdlock"])
986
realpath rename rint rwlock_init setupterm \
987
shmget shmat shmdt shmctl sigaction sigemptyset sigaddset \
988
sighold sigset sigthreadmask port_create sleep \
989
snprintf socket stpcpy strcasecmp strerror strsignal strnlen strpbrk strstr \
990
strtol strtoll strtoul strtoull tell tempnam vidattr \
991
posix_fallocate backtrace backtrace_symbols backtrace_symbols_fd)
993
# Check that isinf() is available in math.h and can be used in both C and C++
995
AC_MSG_CHECKING(for isinf in math.h)
996
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]], [[
1002
AC_MSG_CHECKING(whether isinf() can be used in C++ code)
1004
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]], [[
1010
AC_DEFINE(HAVE_ISINF, [1], [isinf() macro or function])
976
1019
CFLAGS="$ORG_CFLAGS"
1028
1059
#---START: Used in for client configure
1029
1060
# Check definition of readdir_r
1030
AC_CACHE_CHECK([args to readdir_r], [mysql_cv_readdir_r],
1031
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1035
#ifndef _POSIX_PTHREAD_SEMANTICS
1061
AC_CACHE_CHECK("args to readdir_r", mysql_cv_readdir_r,
1062
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define _REENTRANT
1036
1063
#define _POSIX_PTHREAD_SEMANTICS
1038
1064
#include <pthread.h>
1039
1065
#include <dirent.h>]], [[ int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result);
1040
readdir_r((DIR *) NULL, (struct dirent *) NULL, (struct dirent **) NULL); ]])],
1041
[mysql_cv_readdir_r=POSIX],
1042
[mysql_cv_readdir_r=other])])
1066
readdir_r((DIR *) NULL, (struct dirent *) NULL, (struct dirent **) NULL); ]])],[mysql_cv_readdir_r=POSIX],[mysql_cv_readdir_r=other]))
1043
1067
if test "$mysql_cv_readdir_r" = "POSIX"
1045
1069
AC_DEFINE([HAVE_READDIR_R], [1], [POSIX readdir_r])
1048
1072
# Check definition of posix sigwait()
1049
AC_CACHE_CHECK([style of sigwait], [mysql_cv_sigwait],
1050
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1054
#ifndef _POSIX_PTHREAD_SEMANTICS
1073
AC_CACHE_CHECK("style of sigwait", mysql_cv_sigwait,
1074
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define _REENTRANT
1055
1075
#define _POSIX_PTHREAD_SEMANTICS
1057
1076
#include <pthread.h>
1077
#include <signal.h>]], [[#ifndef _AIX
1063
1080
sigwait(&set,&sig);
1066
[mysql_cv_sigwait=POSIX],
1067
[mysql_cv_sigwait=other])])
1081
#endif]])],[mysql_cv_sigwait=POSIX],[mysql_cv_sigwait=other]))
1068
1082
if test "$mysql_cv_sigwait" = "POSIX"
1070
1084
AC_DEFINE([HAVE_SIGWAIT], [1], [POSIX sigwait])
1101
1105
# Check if pthread_attr_setscope() exists
1102
AC_CACHE_CHECK([for pthread_attr_setscope], [mysql_cv_pthread_attr_setscope],
1103
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1107
#ifndef _POSIX_PTHREAD_SEMANTICS
1106
AC_CACHE_CHECK("for pthread_attr_setscope", mysql_cv_pthread_attr_setscope,
1107
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define _REENTRANT
1108
1108
#define _POSIX_PTHREAD_SEMANTICS
1110
#include <pthread.h>
1112
pthread_attr_t thr_attr;
1113
pthread_attr_setscope(&thr_attr,0);
1115
[mysql_cv_pthread_attr_setscope=yes],
1116
[mysql_cv_pthread_attr_setscope=no])])
1109
#include <pthread.h>]], [[pthread_attr_t thr_attr;
1110
pthread_attr_setscope(&thr_attr,0);]])],[mysql_cv_pthread_attr_setscope=yes],[mysql_cv_pthread_attr_setscope=no]))
1117
1111
if test "$mysql_cv_pthread_attr_setscope" = "yes"
1119
1113
AC_DEFINE([HAVE_PTHREAD_ATTR_SETSCOPE], [1], [pthread_attr_setscope])
1116
# Check for bad includes
1117
AC_MSG_CHECKING("can netinet files be included")
1118
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
1119
#include <sys/socket.h>
1120
#include <netinet/in_systm.h>
1121
#include <netinet/in.h>
1122
#include <netinet/ip.h>
1123
#include <netinet/tcp.h>]], [[ printf("1\n"); ]])],[netinet_inc=yes],[netinet_inc=no])
1124
if test "$netinet_inc" = "no"
1126
AC_DEFINE([HAVE_BROKEN_NETINET_INCLUDES], [1], [Can netinet be included])
1128
AC_MSG_RESULT("$netinet_inc")
1122
1130
AC_LANG_PUSH([C++])
1123
1131
AC_CHECK_HEADERS(cxxabi.h)
1124
1132
AC_CACHE_CHECK([checking for abi::__cxa_demangle], mysql_cv_cxa_demangle,
1146
1155
# functions tested above
1147
1156
#--------------------------------------------------------------------
1149
DRIZZLE_CONFIGURE_PLUGINS([none])
1158
MYSQL_CONFIGURE_PLUGINS([none])
1160
AC_SUBST(CLIENT_LIBS)
1161
AC_SUBST(STATIC_NSS_FLAGS)
1163
# IMPORTANT - do not modify LIBS past this line - this hack is the only way
1164
# I know to add the static NSS magic if we have static NSS libraries with
1167
LDFLAGS="$LDFLAGS $OTHER_LIBC_LIB"
1168
LIBS="$LIBS $STATIC_NSS_FLAGS"
1151
1170
AC_SUBST(mysql_plugin_dirs)
1152
1171
AC_SUBST(mysql_plugin_libs)
1153
1172
AC_SUBST(mysql_plugin_defs)
1156
AC_ARG_ENABLE([profiling],
1157
[AS_HELP_STRING([--enable-profiling],
1158
[Toggle profiling @<:@default=off@:>@])],
1159
[ac_profiling="$enableval"],
1160
[ac_profiling="no"])
1162
AC_ARG_ENABLE([coverage],
1163
[AS_HELP_STRING([--enable-coverage],
1164
[Toggle coverage @<:@default=off@:>@])],
1165
[ac_coverage="$enableval"],
1168
1174
AC_ARG_ENABLE([pedantic-warnings],
1169
1175
[AS_HELP_STRING([--disable-pedantic-warnings],
1170
1176
[Toggle pedanticness @<:@default=on@:>@])],
1172
1178
[ac_warn_pedantic="yes"])
1174
1180
AC_ARG_ENABLE([fail],
1175
[AS_HELP_STRING([--disable-fail],
1176
[Turn warnings into failures @<:@default=on@:>@])],
1181
[AS_HELP_STRING([--enable-fail],
1182
[Turn warnings into failures @<:@default=off@:>@])],
1177
1183
[ac_warn_fail="$enableval"],
1178
[ac_warn_fail="yes"])
1180
AC_ARG_ENABLE([unreachable],
1181
[AS_HELP_STRING([--enable-unreachable],
1182
[Enable warnings about unreachable code @<:@default=off@:>@])],
1183
[ac_warn_unreachable="$enableval"],
1184
[ac_warn_unreachable="no"])
1186
AC_ARG_ENABLE([longlong-warnings],
1187
[AS_HELP_STRING([--enable-longlong-warnings],
1188
[Enable warnings about longlong in C++ @<:@default=off@:>@])],
1189
[ac_warn_longlong="$enableval"],
1190
[ac_warn_longlong="no"])
1192
AC_ARG_ENABLE([strict-aliasing],
1193
[AS_HELP_STRING([--enable-strict-aliasing],
1194
[Enable warnings about stict-aliasing @<:@default=off@:>@])],
1195
[ac_warn_strict_aliasing="$enableval"],
1196
[ac_warn_strict_aliasing="no"])
1198
AC_ARG_ENABLE([cast-warnings],
1199
[AS_HELP_STRING([--enable-cast-warnings],
1200
[Enable warnings about use of old C-style casts @<:@default=off@:>@])],
1201
[ac_warn_cast="$enableval"],
1202
[ac_warn_cast="no"])
1204
AC_ARG_ENABLE([effective-style],
1205
[AS_HELP_STRING([--enable-effective-style],
1206
[Enable warnings violating Effective C++ Style Guidelines @<:@default=off@:>@])],
1207
[ac_warn_effc="$enableval"],
1208
[ac_warn_effc="no"])
1210
AC_ARG_ENABLE([go-crazy],
1211
[AS_HELP_STRING([--enable-go-crazy],
1212
[Enables extra little warnings that might be too much @<:@default=off@:>@])],
1213
[ac_warn_go_crazy="$enableval"],
1214
[ac_warn_go_crazy="no"])
1216
AC_ARG_ENABLE([datarace],
1217
[AS_HELP_STRING([--enable-datarace],
1218
[Enables Sun Studio data race detection @<:@default=off@:>@])],
1219
[ac_datarace="$enableval"],
1184
[ac_warn_fail="no"])
1223
1187
if test "$GCC" = "yes"
1190
GCC_WARNINGS="-W -Wall"
1191
GXX_WARNINGS="${GCC_WARNINGS}"
1194
if test "$ac_warn_pedantic" = "yes"
1196
GCC_WARNINGS="${GCC_WARNINGS} -std=gnu99 -pedantic -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wunreachable-code"
1197
GXX_WARNINGS="${GXX_WARNINGS} -std=gnu++98 -pedantic -Wundef -Wredundant-decls -Wunreachable-code"
1226
1200
if test "$ac_warn_fail" = "yes"
1230
BASE_WARNINGS="-Wall -Wextra ${W_FAIL}"
1232
if test "$ac_warn_longlong" = "yes"
1234
W_LONGLONG="-Wlong-long"
1236
W_LONGLONG="-Wno-long-long"
1239
if test "$ac_warn_strict_aliasing" = "yes"
1241
W_STRICT_ALIASING="-Wstrict-aliasing"
1243
W_STRICT_ALIASING="-Wno-strict-aliasing"
1246
if test "$ac_profiling" = "yes"
1248
GPROF_PROFILING="-pg"
1253
if test "$ac_coverage" = "yes"
1255
GPROF_COVERAGE="-fprofile-arcs -ftest-coverage"
1260
if test "$ac_warn_pedantic" = "yes"
1262
save_CXXFLAGS="${CXXFLAGS}"
1263
CXXFLAGS="${CXXFLAGS} ${W_FAIL} -Wredundant-decls"
1264
AC_CACHE_CHECK([whether it is safe to use -Wredundant-decls],
1265
[ac_cv_safe_to_use_Wredundant_decls_],
1269
template <typename E> struct C { void foo(); };
1270
template <typename E> void C<E>::foo() { }
1271
template <> void C<int>::foo();
1272
AC_INCLUDES_DEFAULT])],
1273
[ac_cv_safe_to_use_Wredundant_decls_=yes],
1274
[ac_cv_safe_to_use_Wredundant_decls_=no])
1276
if test $ac_cv_safe_to_use_Wredundant_decls_ = yes
1278
GXX_W_REDUNDANT_DECLS="-Wredundant-decls"
1280
GXX_W_REDUNDANT_DECLS="-Wno-redundant-decls"
1283
GCC_PEDANTIC="-pedantic -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls ${W_STRICT_ALIASING}"
1284
GXX_PEDANTIC="-pedantic -Wundef ${GXX_W_REDUNDANT_DECLS} ${W_LONGLONG} ${W_STRICT_ALIASING}"
1286
AC_CACHE_CHECK([whether __attribute__ visibility "hidden" is supported],
1287
[ac_cv_can_use_hidden_],
1292
__attribute__((visibility ("hidden")))
1293
void testme() { };],[
1295
[ac_cv_can_use_hidden_=yes],
1296
[ac_cv_can_use_hidden_=no])
1298
if test "$ac_cv_can_use_hidden_" = "yes"
1300
AC_DEFINE(HAVE_ATTR_HIDDEN, 1,
1301
[Define to 1 if you have support for __attribute__((visibility("hidden")))])
1304
CXXFLAGS="${save_CXXFLAGS}"
1307
if test "$ac_warn_unreachable" = "yes"
1309
W_UNREACHABLE="-Wunreachable-code"
1311
if test "$ac_warn_cast" = "yes"
1313
W_CAST="-Wold-style-cast"
1316
if test "$ac_warn_effc" = "yes"
1321
if test "$ac_warn_gocrazy" = "yes"
1323
W_CRAZY="-Wshadow -Wconversion -Winvalid-pch"
1326
CC_WARNINGS="${C99_SUPPORT_HACK} ${BASE_WARNINGS} ${GCC_PEDANTIC} ${W_UNREACHABLE} ${GPROF_PROFILING} ${GPROF_COVERAGE} ${W_CRAZY}"
1327
CXX_WARNINGS="${BASE_WARNINGS} ${GXX_PEDANTIC} ${W_UNREACHABLE} ${GPROF_PROFILING} ${GPROF_COVERAGE} ${W_CAST} ${W_EFFC} ${W_CRAZY}"
1329
NO_EXCEPTIONS="-fno-exceptions"
1330
W_EXCEPTIONS="-fexceptions"
1331
NO_UNUSED_MACROS="-Wno-unused-macros"
1332
NO_REDUNDANT_DECLS="-Wno-redundant-decls"
1333
# Disable exceptions as they seams to create problems with gcc and threads.
1334
# drizzled doesn't use run-time-type-checking, so we disable it.
1335
AM_CXXFLAGS="${AM_CXXFLAGS} -fno-rtti"
1336
CPPFLAGS="${CPPFLAGS} -fpch-deps"
1338
if test "$SUNCC" = "yes"
1340
if test "$ac_datarace" = "yes"
1342
CFLAGS="${CFLAGS} -xinstrument=datarace"
1343
CXXFLAGS="${CXXFLAGS} -xinstrument=datarace"
1345
CC_WARNINGS="-v -xc99=all -errtags=yes"
1346
CXX_WARNINGS="+w +w2 -xport64 -errtags=yes -erroff=attrskipunsup -compat=5"
1347
NO_EXCEPTIONS="-features=no%except"
1348
W_EXCEPTIONS="-features=except"
1350
AM_CXXFLAGS="${CXX_WARNINGS} ${NO_EXCEPTIONS} ${AM_CXXFLAGS}"
1351
AM_CFLAGS="${CC_WARNINGS} ${AM_CFLAGS}"
1353
AC_SUBST(NO_EXCEPTIONS)
1354
AC_SUBST(W_EXCEPTIONS)
1355
AC_SUBST(NO_UNUSED_MACROS)
1356
AC_SUBST(NO_REDUNDANT_DECLS)
1358
AC_SUBST([GLOBAL_CPPFLAGS],['-I$(top_srcdir) -I$(top_builddir)'])
1359
AC_SUBST([AM_CPPFLAGS],['${GLOBAL_CPPFLAGS}'])
1360
AC_SUBST([AM_CFLAGS])
1361
AC_SUBST([AM_CXXFLAGS])
1202
GCC_WARNINGS="${GCC_WARNINGS} -Werror"
1203
GXX_WARNINGS="${GXX_WARNINGS} -Werror"
1206
CXXFLAGS="$CXXFLAGS ${GXX_WARNINGS}"
1207
CFLAGS="$CFLAGS ${GCC_WARNINGS} "
1363
1210
# Some usefull subst
1376
1223
AC_SUBST(MAKE_BINARY_DISTRIBUTION_OPTIONS)
1378
AC_SUBST(pkgplugindir,"\$(pkglibdir)/plugin")
1380
dnl GCC Precompiled Header Support
1382
dnl AM_CONDITIONAL([BUILD_GCC_PCH],[test "$GCC" = "yes"])
1383
AM_CONDITIONAL([BUILD_GCC_PCH],[test "no" = "yes"])
1385
AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl
1386
mystrings/Makefile storage/Makefile dnl
1388
libdrizzle/Makefile client/Makefile dnl
1389
drizzled/Makefile dnl
1390
drizzled/serialize/Makefile dnl
1391
drizzled/sql_builtin.cc dnl
1225
AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile mysys/tests/Makefile dnl
1226
strings/Makefile strings/tests/Makefile regex/Makefile storage/Makefile dnl
1228
libmysql/Makefile client/Makefile dnl
1229
sql/Makefile sql/share/Makefile dnl
1230
sql/sql_builtin.cc sql-common/Makefile dnl
1231
dbug/Makefile scripts/Makefile include/Makefile dnl
1392
1232
support-files/Makefile dnl
1393
tests/Makefile tests/install_test_db dnl
1395
drizzled/drizzled_safe support-files/libdrizzle.pc dnl
1396
support-files/drizzle.server support-files/drizzle-log-rotate)
1233
mysql-test/Makefile dnl
1234
include/mysql_version.h plugin/Makefile)
1398
1236
AC_CONFIG_COMMANDS([default], , test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h)
1400
1238
# Ensure that table handlers gets all modifications to CFLAGS/CXXFLAGS
1401
AC_CONFIG_COMMANDS_POST(ac_configure_args="$ac_configure_args CFLAGS='$CFLAGS' CXXFLAGS='$CXXFLAGS' AM_CFLAGS='$AM_CFLAGS' AM_CXXFLAGS='$AM_CXXFLAGS'")
1239
AC_CONFIG_COMMANDS_POST(ac_configure_args="$ac_configure_args CFLAGS='$CFLAGS' CXXFLAGS='$CXXFLAGS'")
1406
echo "Configuration summary for $PACKAGE_NAME version $VERSION"
1408
echo " * Installation prefix: $prefix"
1409
echo " * System type: $SYSTEM_TYPE"
1410
echo " * Host CPU: $host_cpu"
1411
echo " * C Compiler: $CC_VERSION"
1412
echo " * C++ Compiler: $CXX_VERSION"
1413
echo " * Build auth_pam: $ac_cv_header_security_pam_appl_h"
1414
echo " * Assertions enabled: $ac_cv_assert"
1415
echo " * Debug enabled: $with_debug"
1416
echo " * Profiling enabled: $ac_profiling"
1417
echo " * Coverage enabled: $ac_coverage"
1418
echo " * Warnings as failure: $ac_warn_fail"
1419
echo " * C++ cstdint location: $ac_cv_cxx_cstdint"
1420
echo " * C++ hash_map location: $ac_cv_cxx_hash_map"
1421
echo " * C++ hash namespace: $ac_cv_cxx_hash_namespace"
1422
echo " * C++ cmath location: $ac_cv_cxx_cmath"
1423
echo " * C++ cmath namespace: $ac_cv_cxx_cmath_namespace"