89
23
# We take some made up examples
91
25
# VERSION 5.1.40sp1-alpha 5.0.34a
92
# DRIZZLE_NO_DASH_VERSION 5.1.40sp1 5.0.34a
93
# DRIZZLE_NUMERIC_VERSION 5.1.40 5.0.34
94
# DRIZZLE_BASE_VERSION 5.1 5.0
95
# 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
97
DRIZZLE_NO_DASH_VERSION=`echo $VERSION | sed -e "s|-.*$||"`
98
DRIZZLE_NUMERIC_VERSION=`echo $DRIZZLE_NO_DASH_VERSION | sed -e "s|[[a-z]][[a-z0-9]]*$||"`
99
DRIZZLE_BASE_VERSION=`echo $DRIZZLE_NUMERIC_VERSION | sed -e "s|\.[[^.]]*$||"`
100
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 | \
101
35
awk -F. '{printf "%d%0.2d%0.2d", $1, $2, $3}'`
102
AC_DEFINE_UNQUOTED(DRIZZLE_BASE_VERSION,["$DRIZZLE_BASE_VERSION"],
103
[Major and minor version])
104
AC_DEFINE_UNQUOTED([DRIZZLE_VERSION_ID],[$DRIZZLE_VERSION_ID],
105
[Version ID that can be easily used for numeric comparison])
107
AC_DEFINE([_BACKWARD_BACKWARD_WARNING_H],[1],[Hack to disable deprecation warning in gcc])
109
37
# The port should be constant for a LONG time
110
DRIZZLE_TCP_PORT_DEFAULT=4427
112
m4_include(m4/dtrace.m4)
114
m4_include(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)
115
73
AC_SUBST(AVAILABLE_LANGUAGES)
118
# Set this for plugins to use
119
ac_build_drizzle="yes"
122
76
# Canonicalize the configuration name.
124
78
# Check whether --with-system-type or --without-system-type was given.
145
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)
122
# This is needed is SUBDIRS is set
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
182
if test "$ac_cv_c_compiler_gnu" = "yes"
187
AC_PATH_PROG(AS, as, as)
190
# Still need ranlib for readline; local static use only so no libtool.
193
#AC_LIBTOOL_WIN32_DLL
196
# Ensure that we have --preserve-dup-deps defines, otherwise we get link
197
# problems of 'mysql' with CXX=g++
198
LIBTOOL="$LIBTOOL --preserve-dup-deps"
204
test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
206
# Not critical since the generated file is distributed
207
AC_CHECK_PROGS(YACC, ['bison -y -p MYSQL'])
209
AC_PATH_PROG(uname_prog, uname, no)
211
# We should go through this and put all the explictly system dependent
213
AC_MSG_CHECKING(operating system)
214
AC_CACHE_VAL(mysql_cv_sys_os,
216
if test "$uname_prog" != "no"; then
217
mysql_cv_sys_os="`uname`"
219
mysql_cv_sys_os="Not Solaris"
222
AC_MSG_RESULT($mysql_cv_sys_os)
224
# This should be rewritten to use $target_os
149
225
case "$target_os" in
152
AC_SUBST(TARGET_LINUX)
153
AC_DEFINE([TARGET_OS_LINUX], [1], [Whether we build for Linux])
158
AC_DEFINE([TARGET_OS_OSX], [1], [Whether we build for OSX])
161
227
TARGET_SOLARIS="true"
228
AC_DEFINE([TARGET_OS_SOLARIS], [1], [Whether we are building for Solaris])
162
229
AC_SUBST(TARGET_SOLARIS)
163
AC_DEFINE([TARGET_OS_SOLARIS], [1], [Whether we are building for Solaris])
169
DRIZZLE_CHECK_C_VERSION
170
DRIZZLE_CHECK_CXX_VERSION
177
AC_PATH_PROG(GPERF, gperf)
178
AS_IF([test "x$GPERF" = "x"],
179
AC_MSG_ERROR("Drizzle requires gperf to build."))
181
AC_PATH_PROG(LCOV, lcov)
182
AC_PATH_PROG(GENHTML, genhtml)
184
AM_CONDITIONAL(HAVE_LCOV,[test "x$LCOV" != "x"])
186
dnl TODO: This needs to go away and be replaced with _ISOC99_SOURCE
187
if test "$ac_cv_c_compiler_gnu" = "yes" -o "$target_os" = "linux-gnu"
189
AC_DEFINE([_GNU_SOURCE],[1],[Fix problem with S_ISLNK() on Linux])
192
dnl C99 is illegal in C++... but these turn on extensions to the standard
193
dnl On Solars. This whole block is sort of silly atm, since we don't do
195
if test "$GCC" = "yes"
199
AC_DEFINE([_XOPEN_SOURCE],[600],[Turn on XOpen 6.0 Features])
200
AC_DEFINE([__C99FEATURES__],[1],[Turn on C99 Features for C++])
201
AC_DEFINE([__XPG6],[1],[Turn on C99/XOpen Group 6 Extensions])
210
# Look for "(group|user)add".
211
# TODO: If the programs do not exist, inform the DBA that the user
212
# was not created at the end of the install routine.
213
AC_CHECK_PROGS(GROUPADD, groupadd addgroup)
214
AC_CHECK_PROGS(USERADD, useradd adduser)
216
dnl Not critical since the generated file is distributed
217
AC_CHECK_PROGS(YACC, ['bison -y'])
218
if test -z "$YACC" && test -d ".bzr"
220
AC_MSG_ERROR(["bison is required for Drizzle to build from a bzr branch"])
223
# Build optimized or debug version ?
224
# First check for gcc and g++
225
if test "$GCC" = "yes"
227
dnl The following is required for portable results of floating point
228
dnl calculations on PowerPC. The same must also be done for IA-64, but
229
dnl this options is missing in the IA-64 gcc backend.
233
# The following is required for portable results of floating point calculations
234
# on PowerPC. The same must also be done for IA-64, but this options is missing
235
# in the IA-64 gcc backend.
237
if test "$GCC" = "yes"
230
239
case "$host_cpu" in
231
240
*ppc* | *powerpc*)
232
CFLAGS="-mno-fused-madd ${CFLAGS}"
233
CXXFLAGS="-mno-fused-madd ${CXXFLAGS}"
241
CFLAGS="$CFLAGS -mno-fused-madd"
242
CXXFLAGS="$CXXFLAGS -mno-fused-madd"
237
CFLAGS="-ggdb3 -std=gnu99 ${CFLAGS}"
238
CXXFLAGS="-ggdb3 ${CXXFLAGS}"
239
AC_CXX_CHECK_STANDARD
245
OPTIMIZE_CFLAGS="-O3"
246
OPTIMIZE_CXXFLAGS="-O3"
248
if test "$SUNCC" = "yes"
250
dnl we put CPPFLAGS and LDFLAGS first here, because if the user has specified
251
dnl command line CPPFLAGS or LDFLAGS, their -I or -L should come _first_
252
if test "$target_cpu" = "sparc"
254
MEMALIGN_FLAGS="-xmemalign=8s"
257
isainfo_b=`isainfo -b`
258
if test "$isainfo_b" = "64"
262
if test "x$use_additional" != "xyes"
264
LDFLAGS="${LDFLAGS} -L/usr/local/lib/${isainfo_b} -L/usr/local/lib -L/opt/csw/lib/${isainfo_b} -L/opt/csw/lib"
265
CPPFLAGS="${CPPFLAGS} -I/usr/local/include -I/opt/csw/include"
267
LDFLAGS="${LDFLAGS} -L/usr/lib/${isainfo_b}"
269
CXXFLAGS="-xlang=c99 -g -mt -compat=5 -library=stlport4 -template=no%extdef ${IS_64} ${MEMALIGN_FLAGS} ${CXXFLAGS}"
270
CFLAGS="-g -mt -xc99=all ${IS_64} ${MEMALIGN_FLAGS} ${CFLAGS}"
272
DEBUG_CXXFLAGS="-xO0"
274
dnl TODO: -xO4 causes a Sun Studio failure in innodb... let's check back
276
OPTIMIZE_FLAGS="-xO3 -xlibmil -xdepend"
277
OPTIMIZE_CFLAGS="${OPTIMIZE_FLAGS} -Xa -xstrconst"
278
OPTIMIZE_CXXFLAGS="${OPTIMIZE_FLAGS}"
282
m4_include(m4/gettext.m4)
283
AM_GNU_GETTEXT(external, need-formatstring-macros)
284
if test "x$MSGMERGE" = "x" -o "x$MSGMERGE" = "x:"
286
AM_PATH_PROG_WITH_TEST(GMSGMERGE, gmsgmerge,
287
[$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
288
MSGMERGE="${GMSGMERGE}"
290
AM_CONDITIONAL([BUILD_GETTEXT],[test "x$MSGMERGE" != "x" -a "x$MSGMERGE" != "x:"])
296
dnl TODO: Remove this define once we are using 2.61 across the board.
299
# Check whether to enable assertions.
300
AC_DEFUN([AX_HEADER_ASSERT],
302
AC_MSG_CHECKING([whether to enable assertions])
303
AC_ARG_ENABLE([assert],
304
[AS_HELP_STRING([--disable-assert],
305
[Turn off assertions])],
307
[ac_cv_assert="yes"])
308
AC_MSG_RESULT([$ac_cv_assert])
314
[AS_HELP_STRING([--with-debug],
315
[Add debug code/turns off optimizations (yes|no) @<:@default=no@:>@])],
316
[with_debug=$withval],
318
if test "$with_debug" = "yes"
320
# Debuging. No optimization.
321
CFLAGS="${DEBUG_CFLAGS} ${CFLAGS}"
322
CXXFLAGS="${DEBUG_CXXFLAGS} ${CXXFLAGS}"
253
AC_SUBST(INSTALL_SCRIPT)
256
export CC CXX CFLAGS LD LDFLAGS AR ARFLAGS
258
if test "$GCC" = "yes"
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)
279
AC_SUBST(LD_VERSION_SCRIPT)
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])
324
# Optimized version. No debug
325
CFLAGS="${OPTIMIZE_CFLAGS} ${CFLAGS}"
326
CXXFLAGS="${OPTIMIZE_CXXFLAGS} ${CXXFLAGS}"
339
#--------------------------------------------------------------------
340
# Check for Google Proto Buffers
341
#--------------------------------------------------------------------
344
AC_LIB_HAVE_LINKFLAGS(protobuf,,
345
[#include <google/protobuf/descriptor.h>
347
[google::protobuf::FileDescriptor* file;])
348
AS_IF([test x$ac_cv_libprotobuf = xno],
349
AC_MSG_ERROR([protobuf is required for Drizzle. On Debian this can be found in libprotobuf-dev. On RedHat this can be found in protobuf-devel.]))
351
AC_CACHE_CHECK([if protobuf is recent enough], [drizzle_cv_protobuf_recent],
352
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
353
#include <google/protobuf/descriptor.h>
354
#if GOOGLE_PROTOBUF_VERSION < 2000002
355
# error Your version of Protobuf is too old
358
[drizzle_cv_protobuf_recent=yes],
359
[drizzle_cv_protobuf_recent=no])])
360
if test "$drizzle_cv_protobuf_recent" = "no"
362
AC_MSG_ERROR([Your version of Google Protocol Buffers is too old. Drizzle requires at least version 2.0.2])
365
AC_PATH_PROG([PROTOC],[protoc],[no],[$LIBPROTOBUF_PREFIX/bin:$PATH])
366
if test "x$PROTOC" = "xno"
368
AC_MSG_ERROR([Couldn't find the protoc compiler. On Debian this can be found in protobuf-compiler. On RedHat this can be found in protobuf-compiler.])
373
#--------------------------------------------------------------------
375
#--------------------------------------------------------------------
377
dnl Do this by hand. Need to check for uuid/uuid.h, but uuid may or may
378
dnl not be a lib is weird.
380
AC_CHECK_HEADERS(uuid/uuid.h)
381
if test "x$ac_cv_header_uuid_uuid_h" = "xno"
383
AC_MSG_ERROR([Couldn't find uuid/uuid.h. On Debian this can be found in uuid-dev. On Redhat this can be found in e2fsprogs-devel.])
385
AC_LIB_HAVE_LINKFLAGS(uuid,,
387
#include <uuid/uuid.h>
396
#--------------------------------------------------------------------
397
# Check for libpthread
398
#--------------------------------------------------------------------
400
ACX_PTHREAD(,AC_MSG_ERROR(could not find libpthread))
401
LIBS="$PTHREAD_LIBS $LIBS"
402
CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS}"
405
#--------------------------------------------------------------------
406
# Check for tcmalloc/mtmalloc
407
#--------------------------------------------------------------------
409
AC_ARG_ENABLE([tcmalloc],
410
[AS_HELP_STRING([--disable-tcmalloc],
411
[Enable linking with tcmalloc @<:@default=on@:>@])],
412
[ac_enable_tcmalloc="$enableval"],
413
[ac_enable_tcmalloc="yes"])
415
if test "x$ac_enable_tcmalloc" != "xno"
417
AC_CHECK_LIB(tcmalloc,malloc,[],[])
420
if test "x$ac_cv_lib_tcmalloc_malloc" != "xyes"
422
AC_CHECK_LIB(mtmalloc,malloc,[],[])
426
#--------------------------------------------------------------------
427
# Check for libdrizzle
428
#--------------------------------------------------------------------
430
AC_LIB_HAVE_LINKFLAGS(drizzle,,
431
[#include <libdrizzle/drizzle.h>],
433
const char *version= drizzle_version()
435
AS_IF([test x$ac_cv_libdrizzle = xno],
436
AC_MSG_ERROR([libdrizzle is required for Drizzle]))
439
#--------------------------------------------------------------------
441
#--------------------------------------------------------------------
443
AC_LIB_HAVE_LINKFLAGS(z,,
448
AS_IF([test x$ac_cv_libz = xno],
449
AC_MSG_ERROR([libz is required for Drizzle. On Debian this can be found in zlib1g-dev. On RedHat this can be found in zlib-devel.]))
451
#--------------------------------------------------------------------
453
#--------------------------------------------------------------------
456
AC_LIB_HAVE_LINKFLAGS(tbb,,
457
[#include <tbb/atomic.h>
461
tbb::atomic<uint64_t> x;
462
tbb::atomic<uint8_t> y;
470
#--------------------------------------------------------------------
471
# Check for libreadline or compatible (libedit on Mac OS X)
472
#--------------------------------------------------------------------
477
AS_IF([test "x$vl_cv_lib_readline" = "xno"],
478
AC_MSG_ERROR([libreadline is required for Drizzle. On Debian this can be found in libreadline5-dev. On RedHat this can be found in readline-devel.]))
479
READLINE_LIBS="${LIBS}"
481
AC_SUBST(READLINE_LIBS)
483
DRIZZLE_CHECK_NEW_RL_INTERFACE
485
#--------------------------------------------------------------------
487
#--------------------------------------------------------------------
489
AC_LIB_HAVE_LINKFLAGS(pcre,, [#include <pcre.h>], [pcre *re= NULL])
490
AS_IF([test "x$ac_cv_libpcre" = "xno"],[
492
AC_LIB_HAVE_LINKFLAGS(pcre,, [#include <pcre/pcre.h>], [pcre *re= NULL])
493
AS_IF([test "x$ac_cv_libpcre" = "xno"],
494
[AC_MSG_ERROR([libpcre is required for Drizzle. On Debian this can be found in libpcre3-dev. On RedHat this can be found in pcre-devel.])]
495
[AC_DEFINE(PCRE_HEADER,[<pcre/pcre.h>],[Location of pcre header])])
497
AC_DEFINE(PCRE_HEADER,[<pcre.h>],[Location of pcre header])
292
MYSQLD_DEFAULT_SWITCHES=""
296
AC_SUBST(MYSQLD_DEFAULT_SWITCHES)
297
AC_SUBST(TARGET_LINUX)
501
299
dnl Find paths to some shell programs
502
300
AC_PATH_PROG(LN, ln, ln)
632
440
[ with_named_curses=no ]
443
# compile with strings functions in assembler
444
AC_ARG_ENABLE([assembler],
445
[AS_HELP_STRING([--enable-assembler],
446
[Use assembler versions of some string functions if available.])],
447
[ ENABLE_ASSEMBLER=$enableval ],
448
[ ENABLE_ASSEMBLER=no ]
451
AC_MSG_CHECKING(if we should use assembler functions)
452
# For now we only support assembler on i386 and sparc systems
453
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;))
454
AM_CONDITIONAL(ASSEMBLER_sparc32, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "sparc")
455
AM_CONDITIONAL(ASSEMBLER_sparc64, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "sparcv9")
456
AM_CONDITIONAL(ASSEMBLER, test "$ASSEMBLER_x86_TRUE" = "" -o "$ASSEMBLER_sparc32_TRUE" = "")
458
if test "$ASSEMBLER_TRUE" = ""
466
AC_MSG_CHECKING(if SHOW PROFILE should be enabled.)
467
AC_ARG_ENABLE([profiling],
468
[AS_HELP_STRING([--enable-profiling],
469
[Build a version with query profiling code])],
470
[ ENABLED_PROFILING=$enableval ],
471
[ ENABLED_PROFILING=no ])
473
if test "$ENABLED_PROFILING" = "yes"
475
AC_DEFINE([ENABLED_PROFILING], [1],
476
[If SHOW PROFILE should be enabled])
635
482
AC_ARG_WITH([tcp-port],
636
483
[AS_HELP_STRING([--with-tcp-port=port-number],
637
[Which port to use for Drizzle services @<:@default=4427@:>@])],
638
[ DRIZZLE_TCP_PORT=$withval ],
639
[ DRIZZLE_TCP_PORT=$DRIZZLE_TCP_PORT_DEFAULT
484
[Which port to use for MySQL services @<:@default=3306@:>@])],
485
[ MYSQL_TCP_PORT=$withval ],
486
[ MYSQL_TCP_PORT=$MYSQL_TCP_PORT_DEFAULT
640
487
# if we actually defaulted (as opposed to the pathological case of
641
# --with-tcp-port=<DRIZZLE_TCP_PORT_DEFAULT> which might in theory
488
# --with-tcp-port=<MYSQL_TCP_PORT_DEFAULT> which might in theory
642
489
# happen if whole batch of servers was built from a script), set
643
490
# the default to zero to indicate that; we don't lose information
644
491
# that way, because 0 obviously indicates that we can get the
645
# default value from DRIZZLE_TCP_PORT. this seems really evil, but
646
# testing for DRIZZLE_TCP_PORT==DRIZZLE_TCP_PORT_DEFAULT would make a
647
# a port of DRIZZLE_TCP_PORT_DEFAULT magic even if the builder did not
492
# default value from MYSQL_TCP_PORT. this seems really evil, but
493
# testing for MYSQL_TCP_PORT==MYSQL_TCP_PORT_DEFAULT would make a
494
# a port of MYSQL_TCP_PORT_DEFAULT magic even if the builder did not
648
495
# intend it to mean "use the default, in fact, look up a good default
649
# from /etc/services if you can", but really, really meant 4427 when
650
# they passed in 4427. When they pass in a specific value, let them
496
# from /etc/services if you can", but really, really meant 3306 when
497
# they passed in 3306. When they pass in a specific value, let them
651
498
# have it; don't second guess user and think we know better, this will
652
499
# just make people cross. this makes the the logic work like this
653
500
# (which is complicated enough):
713
558
AC_CHECK_HEADERS(fcntl.h float.h fpu_control.h ieeefp.h)
714
559
AC_CHECK_HEADERS(limits.h pwd.h select.h linux/config.h)
715
560
AC_CHECK_HEADERS(sys/fpu.h utime.h sys/utime.h )
716
AC_CHECK_HEADERS(synch.h sys/mman.h sys/socket.h)
717
AC_CHECK_HEADERS([curses.h term.h],[],[],
718
[[#ifdef HAVE_CURSES_H
722
AC_CHECK_HEADERS(termio.h termios.h sched.h alloca.h)
723
AC_CHECK_HEADERS(sys/prctl.h ieeefp.h)
561
AC_CHECK_HEADERS(synch.h sys/mman.h sys/socket.h netinet/in.h arpa/inet.h)
562
AC_CHECK_HEADERS(sys/timeb.h ys/un.h sys/vadvise.h sys/wait.h term.h)
563
AC_CHECK_HEADERS(termio.h termios.h sched.h crypt.h alloca.h)
564
AC_CHECK_HEADERS(sys/ioctl.h malloc.h sys/malloc.h sys/ipc.h sys/shm.h)
565
AC_CHECK_HEADERS(sys/prctl.h sys/resource.h sys/param.h port.h ieeefp.h)
724
566
AC_CHECK_HEADERS(execinfo.h)
568
AC_CHECK_HEADERS([xfs/xfs.h])
569
#--------------------------------------------------------------------
571
#--------------------------------------------------------------------
573
AC_CHECK_LIB(event, event_loop, [], [AC_MSG_ERROR(could not find libevent)])
575
#--------------------------------------------------------------------
576
# Check for libpthread
577
#--------------------------------------------------------------------
579
AC_CHECK_LIB(pthread, pthread_create, [], [AC_MSG_ERROR(could not find libpthread)])
581
#--------------------------------------------------------------------
583
#--------------------------------------------------------------------
585
AC_PATH_PROG(PKG_CONFIG, pkg-config, AC_MSG_ERROR([pkg-config wasn't found.]))
586
PKG_CHECK_MODULES(PCRE, [libpcrecpp >= 3], [
587
ac_cv_have_libpcre=yes
588
AC_DEFINE([HAVE_PCRE], [1], [Perl Compatible Regex Lib for mysqltest])
590
ac_cv_have_libpcre=no
591
AC_MSG_WARN([PCRE not found - mysqltest will not be built])
593
AM_CONDITIONAL(BUILD_MYSQLTEST, test "x$ac_cv_have_libpcre" = "xyes")
595
AC_SUBST(PCRE_CFLAGS)
726
597
#--------------------------------------------------------------------
727
598
# Check for system libraries. Adds the library to $LIBS
728
599
# and defines HAVE_LIBM etc
729
600
#--------------------------------------------------------------------
731
602
AC_CHECK_LIB(m, floor, [], AC_CHECK_LIB(m, __infinity))
733
AC_CHECK_FUNC(setsockopt, [], [AC_CHECK_LIB(socket, setsockopt)])
734
AC_CHECK_FUNC(yp_get_default_domain, [],
735
[AC_CHECK_LIB(nsl, yp_get_default_domain)])
736
AC_CHECK_FUNC(p2open, [], [AC_CHECK_LIB(gen, p2open)])
605
AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
606
AC_CHECK_FUNC(yp_get_default_domain, ,
607
AC_CHECK_LIB(nsl, yp_get_default_domain))
608
AC_CHECK_FUNC(p2open, , AC_CHECK_LIB(gen, p2open))
737
609
# This may get things to compile even if bind-8 is installed
738
AC_CHECK_FUNC(bind, [], [AC_CHECK_LIB(bind, bind)])
610
AC_CHECK_FUNC(bind, , AC_CHECK_LIB(bind, bind))
739
611
# Check if crypt() exists in libc or libcrypt, sets LIBS if needed
740
612
AC_SEARCH_LIBS(crypt, crypt, AC_DEFINE(HAVE_CRYPT, 1, [crypt]))
743
615
AC_CHECK_LIB(rt, aio_read)
745
617
# For the sched_yield() function on Solaris
746
AC_CHECK_FUNC(sched_yield, [],
747
[AC_CHECK_LIB(posix4, [sched_yield],
748
[AC_DEFINE(HAVE_SCHED_YIELD) LIBS="$LIBS -lposix4"])])
618
AC_CHECK_FUNC(sched_yield, , AC_CHECK_LIB(posix4, sched_yield,
619
[AC_DEFINE(HAVE_SCHED_YIELD) LIBS="$LIBS -lposix4"]))
750
621
if test "$ac_cv_header_termio_h" = "no" -a "$ac_cv_header_termios_h" = "no"
752
AC_CHECK_FUNC(gtty, [], [AC_CHECK_LIB(compat, gtty)])
623
AC_CHECK_FUNC(gtty, , AC_CHECK_LIB(compat, gtty))
626
AC_CHECK_TYPES([int8, uint8, int16, uint16, int32, uint32, int64, uint64,
627
uchar, uint, ulong],[],[], [
628
#include <sys/types.h>
755
630
AC_CHECK_TYPES([fp_except], [], [], [
756
631
#include <sys/types.h>
757
632
#include <ieeefp.h>
760
636
my_save_LIBS="$LIBS"
762
638
AC_CHECK_LIB(dl,dlopen)
763
AC_CHECK_FUNCS(dlopen)
764
if test "$ac_cv_func_dlopen" != "yes"
766
AC_MSG_ERROR([Drizzle requires dlopen])
645
AC_CHECK_FUNCS(dlopen dlerror)
648
AC_CHECK_FUNCS(strtok_r)
650
# Build optimized or debug version ?
651
# First check for gcc and g++
652
if test "$ac_cv_c_compiler_gnu" = "yes"
655
DEBUG_OPTIMIZE_CC="-O"
656
OPTIMIZE_CFLAGS="$MAX_C_OPTIMIZE"
662
if test "$ac_cv_prog_cxx_g" = "yes"
665
DEBUG_OPTIMIZE_CXX="-O"
666
OPTIMIZE_CXXFLAGS="$MAX_CXX_OPTIMIZE"
669
DEBUG_OPTIMIZE_CXX=""
670
OPTIMIZE_CXXFLAGS="-O"
673
# If the user specified CFLAGS, we won't add any optimizations
674
if test -n "$SAVE_CFLAGS"
680
if test -n "$SAVE_CXXFLAGS"
683
DEBUG_OPTIMIZE_CXX=""
687
[AS_HELP_STRING([--with-debug],
688
[Add debug code (yes|no|full) @<:@default=no@:>@
689
Full adds memory checked, very slow.])],
690
[with_debug=$withval],
692
AM_CONDITIONAL(BUILD_DBUG, test "$with_debug" != "no")
693
if test "$with_debug" = "yes"
696
AC_DEFINE([DBUG_ON], [1], [Use libdbug])
697
CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC $CFLAGS"
698
CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX $CXXFLAGS"
700
elif test "$with_debug" = "full"
702
# Full debug. Very slow in some cases
703
AC_DEFINE([DBUG_ON], [1], [Use libdbug])
704
CFLAGS="$DEBUG_CFLAGS $CFLAGS"
705
CXXFLAGS="$DEBUG_CXXFLAGS $CXXFLAGS"
707
# Optimized version. No debug
708
AC_DEFINE([DBUG_OFF], [1], [Dont use libdbug])
709
CFLAGS="$OPTIMIZE_CFLAGS $CFLAGS"
710
CXXFLAGS="$OPTIMIZE_CXXFLAGS $CXXFLAGS"
713
# If we should allow error injection tests
714
AC_ARG_WITH([error-inject],
715
[AS_HELP_STRING([--with-error-inject],
716
[Enable error injection in MySQL Server @<:@default=off@:>@])],
717
[ with_error_inject=$withval ],
718
[ with_error_inject=no ])
720
if test $with_debug != "no"
722
if test "$with_error_inject" = "yes"
724
AC_DEFINE([ERROR_INJECT_SUPPORT], [1],
725
[Enable error injection in MySQL Server])
773
729
AC_ARG_WITH([fast-mutexes],
774
730
[AS_HELP_STRING([--with-fast-mutexes],
839
755
COMPILATION_COMMENT="Source distribution"
841
AC_DEFINE_UNQUOTED([COMPILATION_COMMENT],["$COMPILATION_COMMENT"],
842
[Comment about compilation environment])
757
AC_SUBST(COMPILATION_COMMENT)
759
AC_MSG_CHECKING("need of special linking flags")
760
if test "$TARGET_LINUX" = "true" -a "$ac_cv_c_compiler_gnu" = "yes" -a "$all_is_static" != "yes"
762
LDFLAGS="$LDFLAGS -rdynamic"
763
AC_MSG_RESULT("-rdynamic")
765
case "$SYSTEM_TYPE$with_mysqld_ldflags " in
766
*freebsd*"-all-static "*|*dragonfly*"-all-static "*)
767
AC_MSG_RESULT("none")
769
*freebsd*|*dragonfly*)
770
MYSQLD_EXTRA_LDFLAGS="$MYSQLD_EXTRA_LDFLAGS -export-dynamic"
771
AC_MSG_RESULT("-export-dynamic")
774
AC_MSG_RESULT("none")
844
779
dnl Checks for typedefs, structures, and compiler characteristics.
785
MYSQL_NEEDS_MYSYS_NEW
786
# AC_CHECK_SIZEOF return 0 when it does not find the size of a
787
# type. We want a error instead.
788
AC_CHECK_SIZEOF(char, 1)
789
if test "$ac_cv_sizeof_char" -eq 0
791
AC_MSG_ERROR([No size for char type.])
793
AC_CHECK_SIZEOF(char*, 4)
794
AC_CHECK_SIZEOF(short, 2)
795
AC_CHECK_SIZEOF(int, 4)
796
if test "$ac_cv_sizeof_int" -eq 0
798
AC_MSG_ERROR("No size for int type.")
800
AC_CHECK_SIZEOF(long, 4)
801
if test "$ac_cv_sizeof_long" -eq 0
803
AC_MSG_ERROR("No size for long type.")
805
AC_CHECK_SIZEOF(long long, 8)
806
if test "$ac_cv_sizeof_long_long" -eq 0
808
AC_MSG_ERROR("MySQL needs a long long type.")
851
810
# off_t is not a builtin type
852
811
AC_CHECK_SIZEOF(off_t, 4)
853
812
if test "$ac_cv_sizeof_off_t" -eq 0
855
AC_MSG_ERROR("Drizzle needs a off_t type.")
814
AC_MSG_ERROR("MySQL needs a off_t type.")
857
AC_CHECK_SIZEOF(size_t)
858
AC_DEFINE_UNQUOTED([SIZEOF_SIZE_T],[$ac_cv_sizeof_size_t],[Size of size_t as computed by sizeof()])
859
AC_CHECK_SIZEOF(long long)
860
AC_DEFINE_UNQUOTED(SIZEOF_LONG_LONG,[$ac_cv_sizeof_long_long],[Size of long long as computed by sizeof()])
863
818
dnl check if time_t is unsigned
824
# do we need #pragma interface/#pragma implementation ?
825
# yes if it's gcc 2.x, and not icc pretending to be gcc, and not cygwin
826
AC_MSG_CHECKING(the need for @%:@pragma interface/implementation)
827
# instead of trying to match SYSTEM_TYPE and CC_VERSION (that doesn't
828
# follow any standard), we'll use well-defined preprocessor macros:
829
AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
830
#if !defined(__CYGWIN__) && !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ < 3)
831
#error USE_PRAGMA_IMPLEMENTATION
833
]])],[AC_MSG_RESULT(no) ],[AC_MSG_RESULT(yes) ; CXXFLAGS="$CXXFLAGS -DUSE_PRAGMA_IMPLEMENTATION"])
869
835
# This always gives a warning. Ignore it unless you are cross compiling
837
#---START: Used in for client configure
838
# Check base type of last arg to accept
841
# Figure out what type of struct rlimit to use with setrlimit
842
MYSQL_TYPE_STRUCT_RLIMIT
872
843
# Find where the stack goes
873
DRIZZLE_STACK_DIRECTION
844
MYSQL_STACK_DIRECTION
874
845
# We want to skip alloca on irix unconditionally. It may work on some version..
847
# Do struct timespec have members tv_sec or ts_sec
849
# Do we have the tzname variable
851
# Do the c++ compiler have a bool type
877
853
AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>])
878
AC_CHECK_TYPES([uint, ulong])
880
DRIZZLE_PTHREAD_YIELD
854
AC_CHECK_TYPES([size_t], [], [], [#include <stdio.h>])
855
AC_CHECK_TYPES([u_int32_t])
859
######################################################################
860
# For readline/libedit (We simply move the mimimum amount of stuff from
861
# the readline/libedit configure.in here)
883
863
dnl Checks for header files.
884
AC_CHECK_HEADERS(malloc.h)
864
AC_CHECK_HEADERS(malloc.h sys/cdefs.h)
886
866
dnl Checks for library functions.
888
868
AC_PROG_GCC_TRADITIONAL
870
AC_CHECK_FUNCS(re_comp regcomp strdup)
872
dnl Sun compilers have their own vis.h that is about something
873
dnl totally different. So, not to change the libedit source, we
874
dnl do some additional checks before we define HAVE_VIS_H.
875
AC_CHECK_HEADER(vis.h,
876
[AC_CHECK_FUNC(strvis,
877
[AC_DEFINE([HAVE_VIS_H], [1],[Found vis.h and the strvis() function])])])
879
AC_CHECK_FUNCS(strlcat strlcpy)
891
880
AC_CHECK_FUNCS(issetugid)
881
AC_CHECK_FUNCS(getline flockfile)
893
883
# from old readline settting:
923
952
AC_MSG_ERROR("Drizzle requires fcntl.")
926
AC_CONFIG_LIBOBJ_DIR([gnulib])
955
AC_CHECK_FUNCS(bcmp bfill bmove bsearch bzero \
930
fdatasync fpresetsticky fpsetmask fsync \
931
getpassphrase getpwnam \
932
getpwuid getrlimit getrusage index initgroups isnan \
957
fdatasync finite fpresetsticky fpsetmask fsync ftruncate \
958
getcwd getpass getpassphrase getpwnam \
959
getpwuid getrlimit getrusage getwd index initgroups isnan \
933
960
localtime_r gethrtime gmtime_r \
935
mkstemp mlockall poll pread pthread_attr_create mmap mmap64 \
961
locking longjmp lrand48 madvise mallinfo memcpy memmove \
962
mkstemp mlockall perror poll pread pthread_attr_create mmap mmap64 getpagesize \
936
963
pthread_attr_getstacksize pthread_attr_setprio pthread_attr_setschedparam \
937
964
pthread_attr_setstacksize pthread_condattr_create pthread_getsequence_np \
938
965
pthread_key_delete pthread_rwlock_rdlock pthread_setprio \
939
966
pthread_setprio_np pthread_setschedparam pthread_sigmask readlink \
940
realpath rename rwlock_init setupterm \
945
backtrace backtrace_symbols backtrace_symbols_fd)
948
# Test whether madvise() is declared in C++ code -- it is not on some
949
# systems, such as Solaris
950
AC_CHECK_DECLS([madvise], [], [], [AC_INCLUDES_DEFAULT[
952
#include <sys/types.h>
953
#include <sys/mman.h>
959
AM_CONDITIONAL(BUILD_THR_RWLOCK,[test "$ac_cv_func_rwlock_init" -a "$ac_cv_funn_pthread_rwlock_rdlock"])
967
realpath rename rint rwlock_init setupterm \
968
shmget shmat shmdt shmctl sigaction sigemptyset sigaddset \
969
sighold sigset sigthreadmask port_create sleep \
970
snprintf socket stpcpy strcasecmp strerror strsignal strnlen strpbrk strstr \
971
strtol strtoll strtoul strtoull tell tempnam vidattr \
972
posix_fallocate backtrace backtrace_symbols backtrace_symbols_fd)
974
# Check that isinf() is available in math.h and can be used in both C and C++
976
AC_MSG_CHECKING(for isinf in math.h)
977
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]], [[
983
AC_MSG_CHECKING(whether isinf() can be used in C++ code)
985
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]], [[
991
AC_DEFINE(HAVE_ISINF, [1], [isinf() macro or function])
1000
CFLAGS="$ORG_CFLAGS"
962
1002
# Sanity check: We chould not have any fseeko symbol unless
963
1003
# large_file_support=yes
964
1004
AC_CHECK_FUNC(fseeko,
965
[if test "$large_file_support" = no -a "x$TARGET_LINUX" = "xtrue";
1005
[if test "$large_file_support" = no -a "$TARGET_LINUX" = "true";
967
1007
AC_MSG_ERROR("Found fseeko symbol but large_file_support is not enabled!")
971
1011
# Check definition of pthread_getspecific
972
AC_CACHE_CHECK([args to pthread_getspecific], [mysql_cv_getspecific_args],
973
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
974
#if !defined(_REENTRANT)
1012
AC_CACHE_CHECK("args to pthread_getspecific", mysql_cv_getspecific_args,
1013
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if !defined(_REENTRANT)
975
1014
#define _REENTRANT
977
#ifndef _POSIX_PTHREAD_SEMANTICS
978
1016
#define _POSIX_PTHREAD_SEMANTICS
982
void *pthread_getspecific(pthread_key_t key);
983
pthread_getspecific((pthread_key_t) NULL);
985
[mysql_cv_getspecific_args=POSIX],
986
[mysql_cv_getspecific_args=other])])
1017
#include <pthread.h> ]], [[ void *pthread_getspecific(pthread_key_t key);
1018
pthread_getspecific((pthread_key_t) NULL); ]])],[mysql_cv_getspecific_args=POSIX],[mysql_cv_getspecific_args=other]))
987
1019
if test "$mysql_cv_getspecific_args" = "other"
989
1021
AC_DEFINE([HAVE_NONPOSIX_PTHREAD_GETSPECIFIC], [1],
1170
1162
[ac_warn_unreachable="$enableval"],
1171
1163
[ac_warn_unreachable="no"])
1173
AC_ARG_ENABLE([longlong-warnings],
1174
[AS_HELP_STRING([--enable-longlong-warnings],
1175
[Enable warnings about longlong in C++ @<:@default=off@:>@])],
1176
[ac_warn_longlong="$enableval"],
1177
[ac_warn_longlong="no"])
1179
AC_ARG_ENABLE([strict-aliasing],
1180
[AS_HELP_STRING([--enable-strict-aliasing],
1181
[Enable warnings about stict-aliasing @<:@default=off@:>@])],
1182
[ac_warn_strict_aliasing="$enableval"],
1183
[ac_warn_strict_aliasing="no"])
1185
AC_ARG_ENABLE([cast-warnings],
1186
[AS_HELP_STRING([--enable-cast-warnings],
1187
[Enable warnings about use of old C-style casts @<:@default=off@:>@])],
1188
[ac_warn_cast="$enableval"],
1189
[ac_warn_cast="no"])
1191
AC_ARG_ENABLE([effective-style],
1192
[AS_HELP_STRING([--enable-effective-style],
1193
[Enable warnings violating Effective C++ Style Guidelines @<:@default=off@:>@])],
1194
[ac_warn_effc="$enableval"],
1195
[ac_warn_effc="no"])
1197
AC_ARG_ENABLE([shadow],
1198
[AS_HELP_STRING([--disable-shadow],
1199
[Disables warnings about scope shadowing @<:@default=on@:>@])],
1200
[ac_warn_shadow="$enableval"],
1201
[ac_warn_shadow="yes"])
1203
AC_ARG_ENABLE([conversion],
1204
[AS_HELP_STRING([--enable-conversion],
1205
[Enables conversion warnings @<:@default=off@:>@])],
1206
[ac_warn_conversion="$enableval"],
1207
[ac_warn_conversion="no"])
1209
AC_ARG_ENABLE([datarace],
1210
[AS_HELP_STRING([--enable-datarace],
1211
[Enables Sun Studio data race detection @<:@default=off@:>@])],
1212
[ac_datarace="$enableval"],
1215
AC_ARG_ENABLE([exceptions],
1216
[AS_HELP_STRING([--disable-exceptions],
1217
[Disables use of Exceptions in the build @<:@default=on@:>@])],
1218
[ac_exceptions="$enableval"],
1219
[ac_exceptions="yes"])
1221
AC_ARG_ENABLE([cast-align-warnings],
1222
[AS_HELP_STRING([--enable-cast-align-warnings],
1223
[Toggle cast alignment warnings @<:@default=off@:>@])],
1224
[ac_warn_cast_align="$enableval"],
1225
[ac_warn_cast_align="no"])
1227
1166
if test "$GCC" = "yes"
1229
if test "$ac_warn_cast_align" = "yes"
1231
W_CAST_ALIGN="-Wcast-align"
1233
W_CAST_ALIGN="-Wno-cast-align"
1236
if test "$ac_warn_fail" = "yes"
1240
BASE_WARNINGS="-Wall -Wextra ${W_FAIL} ${W_CAST_ALIGN}"
1242
if test "$ac_warn_longlong" = "yes"
1244
W_LONGLONG="-Wlong-long"
1246
W_LONGLONG="-Wno-long-long"
1249
if test "$ac_warn_strict_aliasing" = "yes"
1251
W_STRICT_ALIASING="-Wstrict-aliasing"
1253
W_STRICT_ALIASING="-Wno-strict-aliasing"
1256
if test "$ac_warn_shadow" = "yes"
1259
NO_SHADOW="-Wno-shadow"
1261
W_SHADOW="-Wno-shadow"
1265
if test "$ac_profiling" = "yes"
1267
GPROF_PROFILING="-pg"
1270
AC_CHECK_LIB(c_p, read)
1277
if test "$ac_coverage" = "yes"
1279
GPROF_COVERAGE="-fprofile-arcs -ftest-coverage"
1169
GCC_WARNINGS="-W -Wall"
1170
GXX_WARNINGS="${GCC_WARNINGS}"
1284
1173
if test "$ac_warn_pedantic" = "yes"
1286
AC_CACHE_CHECK([whether it is safe to use -Wredundant-decls],
1287
[ac_cv_safe_to_use_Wredundant_decls_],
1289
save_CXXFLAGS="${CXXFLAGS}"
1290
CXXFLAGS="${CXXFLAGS} ${W_FAIL} -Wredundant-decls"
1293
template <typename E> struct C { void foo(); };
1294
template <typename E> void C<E>::foo() { }
1295
template <> void C<int>::foo();
1296
AC_INCLUDES_DEFAULT])],
1297
[ac_cv_safe_to_use_Wredundant_decls_=yes],
1298
[ac_cv_safe_to_use_Wredundant_decls_=no])
1299
CXXFLAGS="${save_CXXFLAGS}"
1301
if test $ac_cv_safe_to_use_Wredundant_decls_ = yes
1303
GXX_W_REDUNDANT_DECLS="-Wredundant-decls"
1305
GXX_W_REDUNDANT_DECLS="-Wno-redundant-decls"
1308
GCC_PEDANTIC="-pedantic -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls ${W_STRICT_ALIASING}"
1309
GXX_PEDANTIC="-pedantic -Wundef -Woverloaded-virtual -Wnon-virtual-dtor -Wctor-dtor-privacy ${GXX_W_REDUNDANT_DECLS} ${W_LONGLONG} ${W_STRICT_ALIASING}"
1311
AC_CACHE_CHECK([whether __attribute__ visibility "hidden" is supported],
1312
[ac_cv_can_use_hidden_],
1317
__attribute__((visibility ("hidden")))
1318
void testme() { };],[
1320
[ac_cv_can_use_hidden_=yes],
1321
[ac_cv_can_use_hidden_=no])
1323
if test "$ac_cv_can_use_hidden_" = "yes"
1325
AC_DEFINE(HAVE_ATTR_HIDDEN, 1,
1326
[Define to 1 if you have support for __attribute__((visibility("hidden")))])
1175
GCC_WARNINGS="${GCC_WARNINGS} -std=gnu99 -pedantic -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls "
1176
GXX_WARNINGS="${GXX_WARNINGS} -std=gnu++98 -pedantic -Wundef -Wredundant-decls -Wno-long-long "
1330
1179
if test "$ac_warn_unreachable" = "yes"
1332
W_UNREACHABLE="-Wunreachable-code"
1335
if test "$ac_warn_cast" = "yes"
1337
W_CAST="-Wold-style-cast"
1340
if test "$ac_warn_effc" = "yes"
1345
if test "$ac_warn_conversion" = "yes"
1347
W_CONVERSION="-Wconversion"
1350
CC_WARNINGS="${BASE_WARNINGS} ${GCC_PEDANTIC} ${W_UNREACHABLE} ${GPROF_PROFILING} ${GPROF_COVERAGE} ${W_SHADOW} ${W_CONVERSION}"
1351
CXX_WARNINGS="${BASE_WARNINGS} ${GXX_PEDANTIC} ${W_UNREACHABLE} ${GPROF_PROFILING} ${GPROF_COVERAGE} ${W_CAST} ${W_SHADOW} ${W_EFFC} ${W_CONVERSION}"
1353
if test "$ac_exceptions" = "no"
1355
NO_EXCEPTIONS="-fno-exceptions"
1356
W_EXCEPTIONS="-fexceptions"
1358
NO_REDUNDANT_DECLS="-Wno-redundant-decls"
1359
PROTOSKIP_WARNINGS="-Wno-effc++ -Wno-shadow"
1361
if test "$SUNCC" = "yes"
1363
if test "$ac_datarace" = "yes"
1365
CFLAGS="-xinstrument=datarace ${CFLAGS}"
1366
CXXFLAGS="-xinstrument=datarace ${CXXFLAGS}"
1181
GCC_WARNINGS="${GCC_WARNINGS} -Wunreachable-code"
1182
GXX_WARNINGS="${GXX_WARNINGS} -Wunreachable-code"
1369
1185
if test "$ac_warn_fail" = "yes"
1371
W_FAIL="-errwarn=%all"
1374
CC_WARNINGS="-v -errtags=yes -erroff=E_ATTRIBUTE_NOT_VAR ${W_FAIL}"
1375
CXX_WARNINGS="+w +w2 -xport64 -errtags=yes -erroff=attrskipunsup,doubunder,reftotemp,inllargeuse,truncwarn1,signextwarn,inllargeint ${W_FAIL}"
1376
PROTOSKIP_WARNINGS="-erroff=attrskipunsup,doubunder,reftotemp,wbadinitl,identexpected,inllargeuse,truncwarn1,signextwarn"
1377
NO_UNREACHED="-erroff=E_STATEMENT_NOT_REACHED"
1378
if test "$ac_exceptions" = "no"
1380
NO_EXCEPTIONS="-features=no%except"
1381
W_EXCEPTIONS="-features=except"
1384
AC_SUBST(NO_EXCEPTIONS)
1385
AC_SUBST(W_EXCEPTIONS)
1388
AC_SUBST(NO_REDUNDANT_DECLS)
1389
AC_SUBST(PROTOSKIP_WARNINGS)
1390
AC_SUBST(NO_UNREACHED)
1392
if test "$ac_cv_func_timegm" = "no" -o "$gl_cv_func_gnu_getopt" = "no"
1394
CPPFLAGS="-I\$(top_srcdir)/gnulib -I\$(top_builddir)/gnulib ${CPPFLAGS}"
1396
CPPFLAGS="-I\$(top_srcdir) -I\$(top_builddir) ${CPPFLAGS}"
1398
AM_CPPFLAGS="${CPPFLAGS}"
1399
AM_CFLAGS="${CC_WARNINGS} ${CFLAGS}"
1400
AM_CXXFLAGS="${CXX_WARNINGS} ${W_EXCEPTIONS} ${CXXFLAGS}"
1402
AC_SUBST([AM_CPPFLAGS])
1403
AC_SUBST([AM_CFLAGS])
1404
AC_SUBST([AM_CXXFLAGS])
1406
dnl We've collected the flags in AM_*FLAGS now, so blank these.
1411
AC_SUBST(pkgplugindir,"\$(pkglibdir)/plugin")
1413
dnl GCC Precompiled Header Support
1415
dnl AM_CONDITIONAL([BUILD_GCC_PCH],[test "$GCC" = "yes"])
1416
AM_CONDITIONAL([BUILD_GCC_PCH],[test "no" = "yes"])
1418
AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl
1420
mystrings/Makefile storage/Makefile dnl
1422
libdrizzleclient/Makefile client/Makefile dnl
1423
drizzled/Makefile dnl
1424
drizzled/serialize/Makefile dnl
1425
drizzled/sql_builtin.cc dnl
1187
GCC_WARNINGS="${GCC_WARNINGS} -Werror"
1188
GXX_WARNINGS="${GXX_WARNINGS} -Werror"
1191
CXXFLAGS="$CXXFLAGS ${GXX_WARNINGS}"
1192
CFLAGS="$CFLAGS ${GCC_WARNINGS} "
1195
# Some usefull subst
1199
# Set configuration options for make_binary_distribution
1200
case $SYSTEM_TYPE in
1202
MAKE_BINARY_DISTRIBUTION_OPTIONS="$MAKE_BINARY_DISTRIBUTION_OPTIONS --no-strip"
1205
: # no change for other platforms yet
1208
AC_SUBST(MAKE_BINARY_DISTRIBUTION_OPTIONS)
1210
AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile mysys/tests/Makefile dnl
1211
strings/Makefile strings/tests/Makefile storage/Makefile dnl
1213
libmysql/Makefile client/Makefile dnl
1214
sql/Makefile sql/share/Makefile dnl
1215
sql/sql_builtin.cc sql-common/Makefile dnl
1216
dbug/Makefile include/Makefile dnl
1426
1217
support-files/Makefile dnl
1427
tests/Makefile tests/install_test_db dnl
1429
drizzled/drizzled_safe support-files/libdrizzleclient.pc dnl
1430
support-files/drizzle.server support-files/drizzle-log-rotate)
1432
scheduling_plugins_available="
1437
for sched_plugin in $scheduling_plugins_available
1439
varname="\${with_plugin_${sched_plugin}}"
1440
result=`eval "echo $varname"`
1441
if test "x$result" = "xyes"
1443
scheduling_plugins="$sched_plugin $scheduling_plugins"
1447
AC_CONFIG_COMMANDS([timestamp-h], , test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h)
1449
AC_CONFIG_COMMANDS_PRE([
1450
if test "x$EGREP" != "x" -a -d po
1452
echo "# This file is auto-generated from configure. Do not edit directly" > po/POTFILES.in.in
1453
# The grep -v 'drizzle-' is to exclude any distcheck leftovers
1454
for f in `find . | grep -v 'drizzle-' | ${EGREP} '\.(cc|c|h|yy)$' | cut -c3- | sort`
1456
if grep gettext.h "$f" | grep include >/dev/null 2>&1
1458
echo "$f" >> po/POTFILES.in.in
1461
if ! diff po/POTFILES.in.in po/POTFILES.in >/dev/null 2>&1
1463
mv po/POTFILES.in.in po/POTFILES.in
1465
rm po/POTFILES.in.in
1468
touch po/POTFILES.in
1218
mysql-test/Makefile dnl
1219
include/mysql_version.h plugin/Makefile dnl
1220
sql/mysqld_safe support-files/libmysqlclient.pc dnl
1221
support-files/mysql.server support-files/mysql-log-rotate)
1223
AC_CONFIG_COMMANDS([default], , test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h)
1472
1225
# Ensure that table handlers gets all modifications to CFLAGS/CXXFLAGS
1473
AC_CONFIG_COMMANDS_POST(ac_configure_args="$ac_configure_args CFLAGS='$CFLAGS' CXXFLAGS='$CXXFLAGS' AM_CFLAGS='$AM_CFLAGS' AM_CXXFLAGS='$AM_CXXFLAGS'")
1226
AC_CONFIG_COMMANDS_POST(ac_configure_args="$ac_configure_args CFLAGS='$CFLAGS' CXXFLAGS='$CXXFLAGS'")
1478
echo "Configuration summary for $PACKAGE_NAME version $VERSION"
1480
echo " * Installation prefix: $prefix"
1481
echo " * System type: $SYSTEM_TYPE"
1482
echo " * Host CPU: $host_cpu"
1483
echo " * C Compiler: $CC_VERSION"
1484
echo " * C++ Compiler: $CXX_VERSION"
1485
echo " * Build auth_pam: $ac_cv_header_security_pam_appl_h"
1486
echo " * Assertions enabled: $ac_cv_assert"
1487
echo " * Debug enabled: $with_debug"
1488
echo " * Profiling enabled: $ac_profiling"
1489
echo " * Coverage enabled: $ac_coverage"
1490
echo " * Warnings as failure: $ac_warn_fail"
1491
echo " * Scheduling Plugins: $scheduling_plugins"
1492
echo " * C++ cstdint location: $ac_cv_cxx_cstdint"
1493
echo " * C++ hash_map location: $ac_cv_cxx_hash_map"
1494
echo " * C++ hash namespace: $ac_cv_cxx_hash_namespace"
1495
echo " * C++ shared_ptr namespace: $ac_cv_shared_ptr_namespace"
1499
dnl libtoolize scans configure.ac and needs to see some text
1500
m4_define([LIBTOOLIZE_AC_INIT], [])