2
2
dnl Process this file with autoconf to produce a configure script.
4
dnl Copyright (C) 2009 Sun Microsystems
6
dnl This program is free software; you can redistribute it and/or modify
7
dnl it under the terms of the GNU General Public License as published by
8
dnl the Free Software Foundation; version 2 of the License.
10
dnl This program is distributed in the hope that it will be useful,
11
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
12
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
dnl GNU General Public License for more details.
15
dnl You should have received a copy of the GNU General Public License
16
dnl along with this program; if not, write to the Free Software
17
dnl Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20
4
AC_PREREQ(2.59)dnl Minimum Autoconf version required.
21
dnl Version from the AC_INIT call below is overridden later
22
dnl So don't update it here
23
AC_INIT([drizzle7],[7],[http://bugs.launchpad.net/drizzle])
6
m4_include(m4/bzr_version.m4)
24
8
AC_CONFIG_SRCDIR([drizzled/drizzled.cc])
25
AC_CONFIG_AUX_DIR([config])
27
PANDORA_CANONICAL_TARGET(less-warnings, warnings-always-on, require-cxx, force-gcc42, version-from-vc, skip-visibility)
29
LIBDRIZZLE_LIBRARY_VERSION=1:0:0
33
# current:revision:age
35
# | | +- increment if interfaces have been added
36
# | | set to zero if interfaces have been
37
# | | removed or changed
38
# | +- increment if source code has changed
39
# | set to zero if current is incremented
40
# +- increment if interfaces have been added, removed or
42
AC_SUBST(LIBDRIZZLE_LIBRARY_VERSION)
44
# libdrizzle versioning when linked with GNU ld.
45
AS_IF([test "$lt_cv_prog_gnu_ld" = "yes"],[
46
LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_srcdir)/config/drizzle.ver"
48
AC_SUBST(LD_VERSION_SCRIPT)
50
dnl Set the default datadir location to /usr/local/var/drizzle. If a
51
dnl localstatedir is explicitly given, just use that.
52
AS_IF([test "x${localstatedir}" = 'x${prefix}/var'],[
53
localstatedir='${prefix}/var/drizzle'
9
AC_CONFIG_AUX_DIR(config)
10
AC_CONFIG_HEADERS([config.h])
11
AC_CONFIG_MACRO_DIR([m4])
13
# Setting CFLAGS here prevents AC_CANONICAL_TARGET from injecting them
15
SAVE_CXXFLAGS=${CXXFLAGS}
22
CXXFLAGS=${SAVE_CXXFLAGS}
24
AM_INIT_AUTOMAKE(nostdinc subdir-objects -Wall -Werror)
26
if test "x${enable_dependency_tracking}" = "x"
28
enable_dependency_tracking=yes
33
# See the libtool docs for information on how to do shared lib versions.
34
SHARED_LIB_MAJOR_VERSION=1
35
SHARED_LIB_VERSION=$SHARED_LIB_MAJOR_VERSION:0:0
36
AC_SUBST(SHARED_LIB_MAJOR_VERSION)
37
AC_SUBST(SHARED_LIB_VERSION)
40
dnl Checks for programs.
43
gl_USE_SYSTEM_EXTENSIONS
44
if test "$GCC" = "yes"
46
# If you're on a Mac, and you didn't ask for a specific compiler
47
# You're gonna get 4.2.
48
if test "$host_vendor" = "apple" -a "x${ac_cv_env_CC_set}" = "x"
50
CPP="/usr/bin/gcc-4.2 -E"
54
AC_CACHE_CHECK([if GCC is recent enough], [drizzle_cv_gcc_recent],
55
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
56
#if !defined(__GNUC__) || (__GNUC__ < 4) || ((__GNUC__ >= 4) && (__GNUC_MINOR__ < 1))
57
# error GCC is Too Old!
60
[drizzle_cv_gcc_recent=yes],
61
[drizzle_cv_gcc_recent=no])])
62
if test "$drizzle_cv_gcc_recent" = "no"
64
AC_MSG_ERROR([Your version of GCC is too old. Drizzle requires at least version 4.1. If you are on OSX, you may need to specify ./configure CC=gcc-4.2 CXX=g++4.2])
67
AC_CXX_HEADER_STDCXX_98
68
if test "$ac_cv_cxx_stdcxx_98" = "no"
70
AC_MSG_ERROR([No working C++ Compiler has been found. Drizzle requires a C++ compiler that can handle C++98])
75
if test "$am_cv_prog_cc_stdc" = "no"
77
AC_MSG_ERROR([Drizzle requires an ANSI C compiler (and a C++ compiler). Try gcc. See the Installation chapter in the Reference Manual.])
84
AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
86
AC_PROG_GCC_TRADITIONAL
89
# Set all version vars based on $VERSION. How do we do this more elegant ?
90
# Remember that regexps needs to quote [ and ] since this is run through m4
91
# We take some made up examples
93
# VERSION 5.1.40sp1-alpha 5.0.34a
94
# DRIZZLE_NO_DASH_VERSION 5.1.40sp1 5.0.34a
95
# DRIZZLE_NUMERIC_VERSION 5.1.40 5.0.34
96
# DRIZZLE_BASE_VERSION 5.1 5.0
97
# DRIZZLE_VERSION_ID 50140 50034
99
DRIZZLE_NO_DASH_VERSION=`echo $VERSION | sed -e "s|-.*$||"`
100
DRIZZLE_NUMERIC_VERSION=`echo $DRIZZLE_NO_DASH_VERSION | sed -e "s|[[a-z]][[a-z0-9]]*$||"`
101
DRIZZLE_BASE_VERSION=`echo $DRIZZLE_NUMERIC_VERSION | sed -e "s|\.[[^.]]*$||"`
102
DRIZZLE_VERSION_ID=`echo $DRIZZLE_NUMERIC_VERSION | \
103
awk -F. '{printf "%d%0.2d%0.2d", $1, $2, $3}'`
104
AC_DEFINE_UNQUOTED(DRIZZLE_BASE_VERSION,["$DRIZZLE_BASE_VERSION"],
105
[Major and minor version])
106
AC_DEFINE_UNQUOTED([DRIZZLE_VERSION_ID],[$DRIZZLE_VERSION_ID],
107
[Version ID that can be easily used for numeric comparison])
109
AC_DEFINE([_BACKWARD_BACKWARD_WARNING_H],[1],[Hack to disable deprecation warning in gcc])
111
# The port should be constant for a LONG time
112
DRIZZLE_TCP_PORT_DEFAULT=4427
114
m4_include(m4/dtrace.m4)
116
m4_include(m4/character_sets.m4)
117
AC_SUBST(AVAILABLE_LANGUAGES)
120
# Set this for plugins to use
121
ac_build_drizzle="yes"
124
# Canonicalize the configuration name.
126
# Check whether --with-system-type or --without-system-type was given.
127
AC_ARG_WITH([system-type],
128
[AS_HELP_STRING([--with-system-type],
129
[Set the system type, like "sun-solaris10"])],
130
[SYSTEM_TYPE="$withval"],
131
[SYSTEM_TYPE="$host_vendor-$host_os"])
132
AC_ARG_WITH([machine-type],
133
[AS_HELP_STRING([--with-machine-type],
134
[Set the machine type, like "sparc"])],
135
[MACHINE_TYPE="$withval"],
136
[MACHINE_TYPE="$host_cpu"])
137
AC_SUBST(SYSTEM_TYPE)
138
AC_DEFINE_UNQUOTED([SYSTEM_TYPE], ["$SYSTEM_TYPE"],
139
[Name of system, eg sun-solaris])
140
AC_SUBST(MACHINE_TYPE)
141
AC_DEFINE_UNQUOTED([MACHINE_TYPE], ["$MACHINE_TYPE"],
142
[Machine type name, eg sparc])
144
# Detect intel x86 like processor
145
BASE_MACHINE_TYPE=$MACHINE_TYPE
146
case $MACHINE_TYPE in
147
i?86) BASE_MACHINE_TYPE=i386 ;;
154
AC_SUBST(TARGET_LINUX)
155
AC_DEFINE([TARGET_OS_LINUX], [1], [Whether we build for Linux])
160
AC_DEFINE([TARGET_OS_OSX], [1], [Whether we build for OSX])
163
TARGET_SOLARIS="true"
164
AC_SUBST(TARGET_SOLARIS)
165
AC_DEFINE([TARGET_OS_SOLARIS], [1], [Whether we are building for Solaris])
171
DRIZZLE_CHECK_C_VERSION
172
DRIZZLE_CHECK_CXX_VERSION
56
179
AC_PATH_PROG(GPERF, gperf)
57
180
AS_IF([test "x$GPERF" = "x"],
58
181
AC_MSG_ERROR("Drizzle requires gperf to build."))
60
# libexecinfo provides backtrace_symbols on FreeBSD
61
AC_SEARCH_LIBS(backtrace_symbols, [execinfo])
65
PANDORA_REQUIRE_LIBPROTOBUF
66
PANDORA_PROTOBUF_REQUIRE_VERSION([2.1.0])
67
PANDORA_REQUIRE_PROTOC
183
AC_PATH_PROG(LCOV, lcov)
184
AC_PATH_PROG(GENHTML, genhtml)
186
AM_CONDITIONAL(HAVE_LCOV,[test "x$LCOV" != "x"])
188
dnl TODO: This needs to go away and be replaced with _ISOC99_SOURCE
189
if test "$ac_cv_c_compiler_gnu" = "yes" -o "$target_os" = "linux-gnu"
191
AC_DEFINE([_GNU_SOURCE],[1],[Fix problem with S_ISLNK() on Linux])
194
dnl C99 is illegal in C++... but these turn on extensions to the standard
195
dnl On Solars. This whole block is sort of silly atm, since we don't do
197
if test "$GCC" = "yes"
201
AC_DEFINE([_XOPEN_SOURCE],[600],[Turn on XOpen 6.0 Features])
202
AC_DEFINE([__C99FEATURES__],[1],[Turn on C99 Features for C++])
203
AC_DEFINE([__XPG6],[1],[Turn on C99/XOpen Group 6 Extensions])
212
# Look for "(group|user)add".
213
# TODO: If the programs do not exist, inform the DBA that the user
214
# was not created at the end of the install routine.
215
AC_CHECK_PROGS(GROUPADD, groupadd addgroup)
216
AC_CHECK_PROGS(USERADD, useradd adduser)
218
dnl Not critical since the generated file is distributed
219
AC_CHECK_PROGS(YACC, ['bison -y'])
220
if test -z "$YACC" && test -d ".bzr"
222
AC_MSG_ERROR(["bison is required for Drizzle to build from a bzr branch"])
225
# Build optimized or debug version ?
226
# First check for gcc and g++
227
if test "$GCC" = "yes"
229
dnl The following is required for portable results of floating point
230
dnl calculations on PowerPC. The same must also be done for IA-64, but
231
dnl this options is missing in the IA-64 gcc backend.
234
CFLAGS="-mno-fused-madd ${CFLAGS}"
235
CXXFLAGS="-mno-fused-madd ${CXXFLAGS}"
239
CFLAGS="-ggdb3 -std=gnu99 ${CFLAGS}"
240
CXXFLAGS="-ggdb3 ${CXXFLAGS}"
241
AC_CXX_CHECK_STANDARD
247
OPTIMIZE_CFLAGS="-O3"
248
OPTIMIZE_CXXFLAGS="-O3"
250
if test "$SUNCC" = "yes"
252
dnl we put CPPFLAGS and LDFLAGS first here, because if the user has specified
253
dnl command line CPPFLAGS or LDFLAGS, their -I or -L should come _first_
254
if test "$target_cpu" = "sparc"
256
MEMALIGN_FLAGS="-xmemalign=8s"
259
isainfo_b=`isainfo -b`
260
if test "$isainfo_b" = "64"
264
LDFLAGS="${LDFLAGS} -L/usr/local/lib/${isainfo_b} -L/usr/local/lib -L/opt/csw/lib/${isainfo_b} -L/opt/csw/lib -L/usr/lib/${isainfo_b}"
265
CPPFLAGS="${CPPFLAGS} -I/usr/local/include -I/opt/csw/include"
267
CXXFLAGS="-xlang=c99 -g -mt -compat=5 -library=stlport4 -template=no%extdef ${IS_64} ${MEMALIGN_FLAGS} ${CXXFLAGS}"
268
CFLAGS="-g -mt -xc99=all ${IS_64} ${MEMALIGN_FLAGS} ${CFLAGS}"
270
DEBUG_CXXFLAGS="-xO0"
272
dnl TODO: -xO4 causes a Sun Studio failure in innodb... let's check back
274
OPTIMIZE_FLAGS="-xO3 -xlibmil -xdepend"
275
OPTIMIZE_CFLAGS="${OPTIMIZE_FLAGS} -Xa -xstrconst"
276
OPTIMIZE_CXXFLAGS="${OPTIMIZE_FLAGS}"
280
m4_include(m4/gettext.m4)
281
AM_GNU_GETTEXT(external, need-formatstring-macros)
282
if test "x$MSGMERGE" = "x" -o "x$MSGMERGE" = "x:"
284
AM_PATH_PROG_WITH_TEST(GMSGMERGE, gmsgmerge,
285
[$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
286
MSGMERGE="${GMSGMERGE}"
288
AM_CONDITIONAL([BUILD_GETTEXT],[test "x$MSGMERGE" != "x" -a "x$MSGMERGE" != "x:"])
294
dnl TODO: Remove this define once we are using 2.61 across the board.
297
# Check whether to enable assertions.
298
AC_DEFUN([AX_HEADER_ASSERT],
300
AC_MSG_CHECKING([whether to enable assertions])
301
AC_ARG_ENABLE([assert],
302
[AS_HELP_STRING([--disable-assert],
303
[Turn off assertions])],
305
[ac_cv_assert="yes"])
306
AC_MSG_RESULT([$ac_cv_assert])
312
[AS_HELP_STRING([--with-debug],
313
[Add debug code/turns off optimizations (yes|no) @<:@default=no@:>@])],
314
[with_debug=$withval],
316
if test "$with_debug" = "yes"
318
# Debuging. No optimization.
319
CFLAGS="${DEBUG_CFLAGS} ${CFLAGS}"
320
CXXFLAGS="${DEBUG_CXXFLAGS} ${CXXFLAGS}"
322
# Optimized version. No debug
323
CFLAGS="${OPTIMIZE_CFLAGS} ${CFLAGS}"
324
CXXFLAGS="${OPTIMIZE_CXXFLAGS} ${CXXFLAGS}"
335
# libdrizzle versioning when linked with GNU ld.
336
if test "x$EGREP" != "x"
338
if test "$lt_cv_prog_gnu_ld" = "yes" -a $LD --version 2>/dev/null|${EGREP} -q GNU
340
LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_srcdir)/libdrizzleclient/libdrizzleclient.ver"
343
AC_SUBST(LD_VERSION_SCRIPT)
347
#--------------------------------------------------------------------
348
# Check for Google Proto Buffers
349
#--------------------------------------------------------------------
352
AC_LIB_HAVE_LINKFLAGS(protobuf,,
353
[#include <google/protobuf/descriptor.h>
355
[google::protobuf::FileDescriptor* file;])
356
AS_IF([test x$ac_cv_libprotobuf = xno],
357
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.]))
359
AC_CACHE_CHECK([if protobuf is recent enough], [drizzle_cv_protobuf_recent],
360
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
361
#include <google/protobuf/descriptor.h>
362
#if GOOGLE_PROTOBUF_VERSION < 2000002
363
# error Your version of Protobuf is too old
366
[drizzle_cv_protobuf_recent=yes],
367
[drizzle_cv_protobuf_recent=no])])
368
if test "$drizzle_cv_protobuf_recent" = "no"
370
AC_MSG_ERROR([Your version of Google Protocol Buffers is too old. Drizzle requires at least version 2.0.2])
373
AC_PATH_PROG([PROTOC],[protoc],[no],[$LIBPROTOBUF_PREFIX/bin:$PATH])
374
if test "x$PROTOC" = "xno"
376
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.])
381
#--------------------------------------------------------------------
383
#--------------------------------------------------------------------
385
dnl Do this by hand. Need to check for uuid/uuid.h, but uuid may or may
386
dnl not be a lib is weird.
388
AC_CHECK_HEADERS(uuid/uuid.h)
389
if test "x$ac_cv_header_uuid_uuid_h" = "xno"
391
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.])
393
AC_LIB_HAVE_LINKFLAGS(uuid,,
395
#include <uuid/uuid.h>
404
#--------------------------------------------------------------------
405
# Check for libpthread
406
#--------------------------------------------------------------------
408
ACX_PTHREAD(,AC_MSG_ERROR(could not find libpthread))
409
LIBS="$PTHREAD_LIBS $LIBS"
410
CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS}"
413
#--------------------------------------------------------------------
414
# Check for tcmalloc/mtmalloc
415
#--------------------------------------------------------------------
417
AC_ARG_ENABLE([tcmalloc],
418
[AS_HELP_STRING([--disable-tcmalloc],
419
[Enable linking with tcmalloc @<:@default=on@:>@])],
420
[ac_enable_tcmalloc="$enableval"],
421
[ac_enable_tcmalloc="yes"])
423
if test "x$ac_enable_tcmalloc" != "xno"
425
AC_CHECK_LIB(tcmalloc,malloc,[],[])
428
if test "x$ac_cv_lib_tcmalloc_malloc" != "xyes"
430
AC_CHECK_LIB(mtmalloc,malloc,[],[])
434
#--------------------------------------------------------------------
435
# Check for libdrizzle
436
#--------------------------------------------------------------------
438
AC_LIB_HAVE_LINKFLAGS(drizzle,,
439
[#include <libdrizzle/drizzle.h>],
441
const char *version= drizzle_version()
443
dnl AS_IF([test x$ac_cv_libdrizzle = xno],
444
dnl AC_MSG_ERROR([libdrizzle is required for Drizzle])
447
#--------------------------------------------------------------------
449
#--------------------------------------------------------------------
451
AC_LIB_HAVE_LINKFLAGS(z,,
456
AS_IF([test x$ac_cv_libz = xno],
457
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.]))
459
#--------------------------------------------------------------------
461
#--------------------------------------------------------------------
70
PANDORA_REQUIRE_PTHREAD
71
PANDORA_REQUIRE_LIBUUID
73
PANDORA_REQUIRE_LIBPCRE
74
PANDORA_REQUIRE_LIBREADLINE
78
DRIZZLE_STACK_DIRECTION
80
PANDORA_USE_BETTER_MALLOC
83
AC_DEFINE([BUILDING_DRIZZLED],[1],
84
[Define indicating we are building and not consuming drizzle.])
87
PANDORA_HAVE_LIBSQLITE3
89
AC_CHECK_FUNC(inet_ntoa, [], [AC_CHECK_LIB(nsl, inet_ntoa)])
464
AC_LIB_HAVE_LINKFLAGS(tbb,,
465
[#include <tbb/atomic.h>
469
tbb::atomic<uint64_t> x;
470
tbb::atomic<uint8_t> y;
478
#--------------------------------------------------------------------
479
# Check for libreadline or compatible (libedit on Mac OS X)
480
#--------------------------------------------------------------------
485
AS_IF([test "x$vl_cv_lib_readline" = "xno"],
486
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.]))
487
READLINE_LIBS="${LIBS}"
489
AC_SUBST(READLINE_LIBS)
491
DRIZZLE_CHECK_NEW_RL_INTERFACE
493
#--------------------------------------------------------------------
495
#--------------------------------------------------------------------
497
AC_LIB_HAVE_LINKFLAGS(pcre,, [#include <pcre.h>], [pcre *re= NULL])
498
AS_IF([test "x$ac_cv_libpcre" = "xno"],[
500
AC_LIB_HAVE_LINKFLAGS(pcre,, [#include <pcre/pcre.h>], [pcre *re= NULL])
501
AS_IF([test "x$ac_cv_libpcre" = "xno"],
502
[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.])]
503
[AC_DEFINE(PCRE_HEADER,[<pcre/pcre.h>],[Location of pcre header])])
505
AC_DEFINE(PCRE_HEADER,[<pcre.h>],[Location of pcre header])
509
dnl Find paths to some shell programs
510
AC_PATH_PROG(LN, ln, ln)
511
# This must be able to take a -f flag like normal unix ln.
512
AC_PATH_PROG(LN_CP_F, ln, ln)
514
AC_PATH_PROG(MV, mv, mv)
515
AC_PATH_PROG(RM, rm, rm)
516
AC_PATH_PROG(CP, cp, cp)
517
AC_PATH_PROG(SED, sed, sed)
518
AC_PATH_PROG(CMP, cmp, cmp)
519
AC_PATH_PROG(CHMOD, chmod, chmod)
520
AC_PATH_PROG(HOSTNAME, hostname, hostname)
521
# Check for a GNU tar named 'gtar', or 'gnutar' (MacOS X) and
522
# fall back to 'tar' otherwise and hope that it's a GNU tar as well
523
AC_CHECK_PROGS(TAR, gnutar gtar tar)
525
dnl We use a path for perl so the script startup works
526
dnl We make sure to use perl, not perl5, in hopes that the RPMs will
527
dnl not depend on the perl5 binary being installed (probably a bug in RPM)
528
AC_PATH_PROG(PERL, perl, no)
529
if test "$PERL" != "no" && $PERL -e 'require 5' > /dev/null 2>&1
533
AC_PATH_PROG(PERL5, perl5, no)
534
if test "$PERL5" != no
537
ac_cv_path_PERL=$ac_cv_path_PERL5
545
# icheck, used for ABI check
546
AC_PATH_PROG(ICHECK, icheck, no)
547
# "icheck" is also the name of a file system check program on Tru64.
548
# Verify the program found is really the interface checker.
549
if test "x$ICHECK" != "xno"
551
AC_MSG_CHECKING(if $ICHECK works as expected)
552
echo "int foo;" > conftest.h
553
$ICHECK --canonify -o conftest.ic conftest.h 2>/dev/null
554
if test -f "conftest.ic"
561
rm -f conftest.ic conftest.h
566
AC_PATH_PROG(PS, ps, ps)
567
AC_MSG_CHECKING("how to check if pid exists")
570
if $PS p $$ 2> /dev/null | grep `echo $0 | sed s/\-//` > /dev/null
572
FIND_PROC="$PS p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
574
elif $PS -fp $$ 2> /dev/null | grep $0 > /dev/null
576
FIND_PROC="$PS -p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
578
elif $PS -uaxww 2> /dev/null | grep $0 > /dev/null
580
FIND_PROC="$PS -uaxww | grep -v grep | grep \$\$MYSQLD | grep \" \$\$PID \" > /dev/null"
582
elif $PS -ef 2> /dev/null | grep $0 > /dev/null
584
FIND_PROC="$PS -ef | grep -v grep | grep \$\$MYSQLD | grep \" \$\$PID \" > /dev/null"
585
# Do anybody use this?
586
elif $PS $$ 2> /dev/null | grep $0 > /dev/null
588
FIND_PROC="$PS \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
591
*freebsd*|*dragonfly*|*cygwin*)
592
FIND_PROC="$PS p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
595
FIND_PROC="$PS -uaxww | grep -v grep | grep \$\$MYSQLD | grep \" \$\$PID \" > /dev/null"
598
AC_MSG_ERROR([Could not find the right ps switches. Which OS is this ?. See the Installation chapter in the Reference Manual.])
603
AC_MSG_RESULT("$FIND_PROC")
605
# Check if a pid is valid
606
AC_PATH_PROG(KILL, kill, kill)
607
AC_MSG_CHECKING("for kill switches")
608
if $ac_cv_path_KILL -0 $$
610
CHECK_PID="$ac_cv_path_KILL -0 \$\$PID > /dev/null 2> /dev/null"
613
CHECK_PID="$ac_cv_path_KILL -s 0 \$\$PID > /dev/null 2> /dev/null"
615
AC_MSG_WARN([kill -0 to check for pid seems to fail])
616
CHECK_PID="$ac_cv_path_KILL -s SIGCONT \$\$PID > /dev/null 2> /dev/null"
619
AC_MSG_RESULT("$CHECK_PID")
622
# Check if we need noexec stack for assembler
92
625
AC_ARG_WITH([server-suffix],
93
626
[AS_HELP_STRING([--with-server-suffix],
94
627
[Append value to the version string.])],
95
[ DRIZZLE_SERVER_SUFFIX="$withval" ]
96
[ DRIZZLE_SERVER_SUFFIX= ])
628
[ DRIZZLE_SERVER_SUFFIX=`echo "$withval" | sed -e 's/^\(...................................\)..*$/\1/'` ],
629
[ DRIZZLE_SERVER_SUFFIX= ]
98
631
AC_DEFINE_UNQUOTED([DRIZZLE_SERVER_SUFFIX],[$DRIZZLE_SERVER_SUFFIX],
99
632
[Append value to the version string])
634
# Force use of a curses libs
635
AC_ARG_WITH([named-curses-libs],
636
[AS_HELP_STRING([--with-named-curses-libs=ARG],
637
[Use specified curses libraries instead of those
638
automatically found by configure.])],
639
[ with_named_curses=$withval ],
640
[ with_named_curses=no ]
643
AC_ARG_WITH([tcp-port],
644
[AS_HELP_STRING([--with-tcp-port=port-number],
645
[Which port to use for Drizzle services @<:@default=4427@:>@])],
646
[ DRIZZLE_TCP_PORT=$withval ],
647
[ DRIZZLE_TCP_PORT=$DRIZZLE_TCP_PORT_DEFAULT
648
# if we actually defaulted (as opposed to the pathological case of
649
# --with-tcp-port=<DRIZZLE_TCP_PORT_DEFAULT> which might in theory
650
# happen if whole batch of servers was built from a script), set
651
# the default to zero to indicate that; we don't lose information
652
# that way, because 0 obviously indicates that we can get the
653
# default value from DRIZZLE_TCP_PORT. this seems really evil, but
654
# testing for DRIZZLE_TCP_PORT==DRIZZLE_TCP_PORT_DEFAULT would make a
655
# a port of DRIZZLE_TCP_PORT_DEFAULT magic even if the builder did not
656
# intend it to mean "use the default, in fact, look up a good default
657
# from /etc/services if you can", but really, really meant 4427 when
658
# they passed in 4427. When they pass in a specific value, let them
659
# have it; don't second guess user and think we know better, this will
660
# just make people cross. this makes the the logic work like this
661
# (which is complicated enough):
663
# - if a port was set during build, use that as a default.
665
# - otherwise, try to look up a port in /etc/services; if that fails,
666
# use DRIZZLE_TCP_PORT_DEFAULT (at the time of this writing 4427)
668
# - allow the DRIZZLE_TCP_PORT environment variable to override that.
670
# - allow command-line parameters to override all of the above.
672
# the top-most DRIZZLE_TCP_PORT_DEFAULT is read from win/configure.js,
673
# so don't mess with that.
674
DRIZZLE_TCP_PORT_DEFAULT=0 ]
676
AC_SUBST(DRIZZLE_TCP_PORT)
677
# We might want to document the assigned port in the manual.
678
AC_SUBST(DRIZZLE_TCP_PORT_DEFAULT)
679
AC_DEFINE_UNQUOTED([DRIZZLE_PORT],[$DRIZZLE_TCP_PORT],
680
[Drizzle port to use])
681
AC_DEFINE_UNQUOTED([DRIZZLE_PORT_DEFAULT],[$DRIZZLE_TCP_PORT_DEFAULT],
682
[If we defaulted to DRIZZLE_PORT, then this will be zero])
684
# Use this to set the place used for unix socket used to local communication.
102
685
AC_ARG_WITH([drizzled-user],
103
686
[AS_HELP_STRING([--with-drizzled-user=username],
104
687
[What user the drizzled daemon shall be run as.
105
688
@<:@default=drizzle@:>@])],
106
[ DRIZZLED_USER="$withval" ],
107
[ DRIZZLED_USER=drizzle ])
689
[ DRIZZLED_USER=$withval ],
690
[ DRIZZLED_USER=drizzle ]
108
692
AC_SUBST(DRIZZLED_USER)
694
# If we should allow LOAD DATA LOCAL
695
AC_MSG_CHECKING(If we should should enable LOAD DATA LOCAL by default)
696
AC_ARG_ENABLE(local-infile,
697
[ --enable-local-infile Enable LOAD DATA LOCAL INFILE (default: disabled)],
698
[ ENABLED_LOCAL_INFILE=$enableval ],
699
[ ENABLED_LOCAL_INFILE=no ]
701
if test "$ENABLED_LOCAL_INFILE" = "yes"
704
AC_DEFINE([ENABLED_LOCAL_INFILE], [1],
705
[If LOAD DATA LOCAL INFILE should be enabled by default])
710
# Types that must be checked AFTER large file support is checked
713
#--------------------------------------------------------------------
714
# Check for system header files
715
#--------------------------------------------------------------------
721
AC_CHECK_HEADERS(fcntl.h float.h fpu_control.h ieeefp.h)
722
AC_CHECK_HEADERS(limits.h pwd.h select.h linux/config.h)
723
AC_CHECK_HEADERS(sys/fpu.h utime.h sys/utime.h )
724
AC_CHECK_HEADERS(synch.h sys/mman.h sys/socket.h)
725
AC_CHECK_HEADERS([curses.h term.h],[],[],
726
[[#ifdef HAVE_CURSES_H
730
AC_CHECK_HEADERS(termio.h termios.h sched.h alloca.h)
731
AC_CHECK_HEADERS(sys/prctl.h ieeefp.h)
732
AC_CHECK_HEADERS(execinfo.h)
734
#--------------------------------------------------------------------
735
# Check for system libraries. Adds the library to $LIBS
736
# and defines HAVE_LIBM etc
737
#--------------------------------------------------------------------
739
AC_CHECK_LIB(m, floor, [], AC_CHECK_LIB(m, __infinity))
741
AC_CHECK_FUNC(setsockopt, [], [AC_CHECK_LIB(socket, setsockopt)])
742
AC_CHECK_FUNC(yp_get_default_domain, [],
743
[AC_CHECK_LIB(nsl, yp_get_default_domain)])
744
AC_CHECK_FUNC(p2open, [], [AC_CHECK_LIB(gen, p2open)])
745
# This may get things to compile even if bind-8 is installed
746
AC_CHECK_FUNC(bind, [], [AC_CHECK_LIB(bind, bind)])
747
# Check if crypt() exists in libc or libcrypt, sets LIBS if needed
748
AC_SEARCH_LIBS(crypt, crypt, AC_DEFINE(HAVE_CRYPT, 1, [crypt]))
750
# Check rt for aio_read
751
AC_CHECK_LIB(rt, aio_read)
753
# For the sched_yield() function on Solaris
754
AC_CHECK_FUNC(sched_yield, [],
755
[AC_CHECK_LIB(posix4, [sched_yield],
756
[AC_DEFINE(HAVE_SCHED_YIELD) LIBS="$LIBS -lposix4"])])
758
if test "$ac_cv_header_termio_h" = "no" -a "$ac_cv_header_termios_h" = "no"
760
AC_CHECK_FUNC(gtty, [], [AC_CHECK_LIB(compat, gtty)])
763
AC_CHECK_TYPES([fp_except], [], [], [
764
#include <sys/types.h>
770
AC_CHECK_LIB(dl,dlopen)
771
AC_CHECK_FUNCS(dlopen)
772
if test "$ac_cv_func_dlopen" != "yes"
774
AC_MSG_ERROR([Drizzle requires dlopen])
781
AC_ARG_WITH([fast-mutexes],
782
[AS_HELP_STRING([--with-fast-mutexes],
783
[Compile with fast mutexes @<:@default=off@:>@])],
784
[with_fast_mutexes=$withval],
785
[with_fast_mutexes=no])
787
if test "$with_fast_mutexes" != "no"
789
AC_DEFINE([MY_PTHREAD_FASTMUTEX], [1],
790
[Define to 1 if you want to use fast mutexes])
793
AM_CONDITIONAL(BUILD_FAST_MUTEX,[test "$with_fast_mutexes" != "no"])
795
AC_ARG_WITH([atomic-ops],
796
[AS_HELP_STRING([--with-atomic-ops=rwlocks|smp|up],
797
[Implement atomic operations using pthread rwlocks or atomic CPU
798
instructions for multi-processor or uniprocessor
799
configuration. By default gcc built-in sync functions are used,
800
if available and 'smp' configuration otherwise.])],
801
[with_atomic_ops="$withval"],
802
[with_atomic_ops=smp])
804
case "$with_atomic_ops" in
805
"up") AC_DEFINE([MY_ATOMIC_MODE_DUMMY], [1],
806
[Assume single-CPU mode, no concurrency]) ;;
807
"rwlocks") AC_DEFINE([MY_ATOMIC_MODE_RWLOCKS], [1],
808
[Use pthread rwlocks for atomic ops]) ;;
811
[whether the compiler provides atomic builtins],
812
[ac_cv_gcc_atomic_builtins],
814
[AC_LANG_PROGRAM([],[[
815
int foo= -10; int bar= 10;
816
if (!__sync_fetch_and_add(&foo, bar) || foo)
818
bar= __sync_lock_test_and_set(&foo, bar);
819
if (bar || foo != 10)
821
bar= __sync_val_compare_and_swap(&bar, foo, 15);
826
[ac_cv_gcc_atomic_builtins=yes],
827
[ac_cv_gcc_atomic_builtins=no])])
829
if test "x$ac_cv_gcc_atomic_builtins" = "xyes"; then
830
AC_DEFINE(HAVE_GCC_ATOMIC_BUILTINS, 1,
831
[Define to 1 if compiler provides atomic builtins.])
834
*) AC_MSG_ERROR(["$with_atomic_ops" is not a valid value for --with-atomic-ops]) ;;
111
838
AC_ARG_WITH([comment],
112
839
[AS_HELP_STRING([--with-comment],
113
840
[Comment about compilation environment. @<:@default=off@:>@])],
114
841
[with_comment=$withval],
115
842
[with_comment=no])
116
AS_IF([test "$with_comment" != "no"],[
843
if test "$with_comment" != "no"
117
845
COMPILATION_COMMENT=$with_comment
119
COMPILATION_COMMENT="Source distribution (${PANDORA_RELEASE_COMMENT})"
847
COMPILATION_COMMENT="Source distribution"
121
849
AC_DEFINE_UNQUOTED([COMPILATION_COMMENT],["$COMPILATION_COMMENT"],
122
850
[Comment about compilation environment])
852
dnl Checks for typedefs, structures, and compiler characteristics.
859
# off_t is not a builtin type
860
AC_CHECK_SIZEOF(off_t, 4)
861
if test "$ac_cv_sizeof_off_t" -eq 0
863
AC_MSG_ERROR("Drizzle needs a off_t type.")
867
dnl check if time_t is unsigned
873
# This always gives a warning. Ignore it unless you are cross compiling
876
# Find where the stack goes
877
DRIZZLE_STACK_DIRECTION
878
# We want to skip alloca on irix unconditionally. It may work on some version..
881
AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>])
882
AC_CHECK_TYPES([uint, ulong])
884
DRIZZLE_PTHREAD_YIELD
887
dnl Checks for header files.
888
AC_CHECK_HEADERS(malloc.h)
890
dnl Checks for library functions.
892
AC_PROG_GCC_TRADITIONAL
895
AC_CHECK_FUNCS(issetugid)
897
# from old readline settting:
902
# Already-done: stdlib.h string.h unistd.h termios.h
903
AC_CHECK_HEADERS(stdarg.h dirent.h locale.h ndir.h sys/dir.h \
904
sys/ndir.h sys/select.h \
905
sys/mman.h termcap.h termio.h asm/termbits.h grp.h \
908
# Already-done: strcasecmp
909
AC_CHECK_FUNCS(lstat select)
913
DRIZZLE_CHECK_GETPW_FUNCS
914
DRIZZLE_HAVE_TIOCGWINSZ
915
DRIZZLE_HAVE_TIOCSTAT
125
917
#########################################################################
128
dnl Has to be done late, as the plugin may need to check for existence of
129
dnl functions tested above
130
PANDORA_PLUGINS([drizzled/module/load_list.h])
919
dnl Checks for library functions.
924
AC_CHECK_FUNCS(fcntl)
925
if test "x$ac_cv_func_fcntl" != "xyes"
927
AC_MSG_ERROR("Drizzle requires fcntl.")
930
AC_CONFIG_LIBOBJ_DIR([gnulib])
934
fdatasync fpresetsticky fpsetmask fsync \
935
getpassphrase getpwnam \
936
getpwuid getrlimit getrusage index initgroups isnan \
937
localtime_r gethrtime gmtime_r \
939
mkstemp mlockall poll pread pthread_attr_create mmap mmap64 \
940
pthread_attr_getstacksize pthread_attr_setprio pthread_attr_setschedparam \
941
pthread_attr_setstacksize pthread_condattr_create pthread_getsequence_np \
942
pthread_key_delete pthread_rwlock_rdlock pthread_setprio \
943
pthread_setprio_np pthread_setschedparam pthread_sigmask readlink \
944
realpath rename rwlock_init setupterm \
949
backtrace backtrace_symbols backtrace_symbols_fd)
952
# Test whether madvise() is declared in C++ code -- it is not on some
953
# systems, such as Solaris
954
AC_CHECK_DECLS([madvise], [], [], [AC_INCLUDES_DEFAULT[
956
#include <sys/types.h>
957
#include <sys/mman.h>
963
AM_CONDITIONAL(BUILD_THR_RWLOCK,[test "$ac_cv_func_rwlock_init" -a "$ac_cv_funn_pthread_rwlock_rdlock"])
966
# Sanity check: We chould not have any fseeko symbol unless
967
# large_file_support=yes
968
AC_CHECK_FUNC(fseeko,
969
[if test "$large_file_support" = no -a "x$TARGET_LINUX" = "xtrue";
971
AC_MSG_ERROR("Found fseeko symbol but large_file_support is not enabled!")
975
# Check definition of pthread_getspecific
976
AC_CACHE_CHECK([args to pthread_getspecific], [mysql_cv_getspecific_args],
977
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
978
#if !defined(_REENTRANT)
981
#ifndef _POSIX_PTHREAD_SEMANTICS
982
#define _POSIX_PTHREAD_SEMANTICS
986
void *pthread_getspecific(pthread_key_t key);
987
pthread_getspecific((pthread_key_t) NULL);
989
[mysql_cv_getspecific_args=POSIX],
990
[mysql_cv_getspecific_args=other])])
991
if test "$mysql_cv_getspecific_args" = "other"
993
AC_DEFINE([HAVE_NONPOSIX_PTHREAD_GETSPECIFIC], [1],
994
[For some non posix threads])
997
# Check definition of pthread_mutex_init
998
AC_CACHE_CHECK([args to pthread_mutex_init], [mysql_cv_mutex_init_args],
999
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1003
#ifndef _POSIX_PTHREAD_SEMANTICS
1004
#define _POSIX_PTHREAD_SEMANTICS
1006
#include <pthread.h> ]], [[
1007
pthread_mutexattr_t attr;
1009
pthread_mutex_init(&mp,&attr); ]])],
1010
[mysql_cv_mutex_init_args=POSIX],
1011
[mysql_cv_mutex_init_args=other])])
1012
if test "$mysql_cv_mutex_init_args" = "other"
1014
AC_DEFINE([HAVE_NONPOSIX_PTHREAD_MUTEX_INIT], [1],
1015
[For some non posix threads])
1019
#---START: Used in for client configure
1020
# Check definition of readdir_r
1021
AC_CACHE_CHECK([args to readdir_r], [mysql_cv_readdir_r],
1022
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1026
#ifndef _POSIX_PTHREAD_SEMANTICS
1027
#define _POSIX_PTHREAD_SEMANTICS
1029
#include <pthread.h>
1030
#include <dirent.h>]], [[ int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result);
1031
readdir_r((DIR *) NULL, (struct dirent *) NULL, (struct dirent **) NULL); ]])],
1032
[mysql_cv_readdir_r=POSIX],
1033
[mysql_cv_readdir_r=other])])
1034
if test "$mysql_cv_readdir_r" = "POSIX"
1036
AC_DEFINE([HAVE_READDIR_R], [1], [POSIX readdir_r])
1039
# Check definition of posix sigwait()
1040
AC_CACHE_CHECK([style of sigwait], [mysql_cv_sigwait],
1041
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1045
#ifndef _POSIX_PTHREAD_SEMANTICS
1046
#define _POSIX_PTHREAD_SEMANTICS
1048
#include <pthread.h>
1057
[mysql_cv_sigwait=POSIX],
1058
[mysql_cv_sigwait=other])])
1059
if test "$mysql_cv_sigwait" = "POSIX"
1061
AC_DEFINE([HAVE_SIGWAIT], [1], [POSIX sigwait])
1064
if test "$mysql_cv_sigwait" != "POSIX"
1066
unset mysql_cv_sigwait
1067
# Check definition of posix sigwait()
1068
AC_CACHE_CHECK([style of sigwait], [mysql_cv_sigwait],
1069
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1073
#ifndef _POSIX_PTHREAD_SEMANTICS
1074
#define _POSIX_PTHREAD_SEMANTICS
1076
#include <pthread.h>
1083
[mysql_cv_sigwait=NONPOSIX],
1084
[mysql_cv_sigwait=other])])
1085
if test "$mysql_cv_sigwait" = "NONPOSIX"
1087
AC_DEFINE([HAVE_NONPOSIX_SIGWAIT], [1], [sigwait with one argument])
1092
# Check if pthread_attr_setscope() exists
1093
AC_CACHE_CHECK([for pthread_attr_setscope], [mysql_cv_pthread_attr_setscope],
1094
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1098
#ifndef _POSIX_PTHREAD_SEMANTICS
1099
#define _POSIX_PTHREAD_SEMANTICS
1101
#include <pthread.h>
1103
pthread_attr_t thr_attr;
1104
pthread_attr_setscope(&thr_attr,0);
1106
[mysql_cv_pthread_attr_setscope=yes],
1107
[mysql_cv_pthread_attr_setscope=no])])
1108
if test "$mysql_cv_pthread_attr_setscope" = "yes"
1110
AC_DEFINE([HAVE_PTHREAD_ATTR_SETSCOPE], [1], [pthread_attr_setscope])
1114
AC_CHECK_HEADERS(cxxabi.h)
1115
AC_CACHE_CHECK([checking for abi::__cxa_demangle], mysql_cv_cxa_demangle,
1116
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <cxxabi.h>]], [[
1117
char *foo= 0; int bar= 0;
1118
foo= abi::__cxa_demangle(foo, foo, 0, &bar);
1119
]])],[mysql_cv_cxa_demangle=yes],[mysql_cv_cxa_demangle=no])])
1122
if test "x$mysql_cv_cxa_demangle" = xyes; then
1123
AC_DEFINE(HAVE_ABI_CXA_DEMANGLE, 1,
1124
[Define to 1 if you have the `abi::__cxa_demangle' function.])
1127
#--------------------------------------------------------------------
1128
# Check for requested features
1129
#--------------------------------------------------------------------
1131
DRIZZLE_CHECK_MAX_INDEXES
1133
#--------------------------------------------------------------------
1134
# Declare our plugin modules
1135
# Has to be done late, as the plugin may need to check for existence of
1136
# functions tested above
1137
#--------------------------------------------------------------------
1139
DRIZZLE_CONFIGURE_PLUGINS([none])
1141
AC_SUBST(mysql_plugin_dirs)
1142
AC_SUBST(mysql_plugin_libs)
1143
AC_SUBST(mysql_plugin_defs)
1144
AC_SUBST(DRIZZLED_PLUGIN_DEP_LIBS)
1147
AC_ARG_ENABLE([profiling],
1148
[AS_HELP_STRING([--enable-profiling],
1149
[Toggle profiling @<:@default=off@:>@])],
1150
[ac_profiling="$enableval"],
1151
[ac_profiling="no"])
1153
AC_ARG_ENABLE([coverage],
1154
[AS_HELP_STRING([--enable-coverage],
1155
[Toggle coverage @<:@default=off@:>@])],
1156
[ac_coverage="$enableval"],
1159
AC_ARG_ENABLE([pedantic-warnings],
1160
[AS_HELP_STRING([--disable-pedantic-warnings],
1161
[Toggle pedanticness @<:@default=on@:>@])],
1162
[ac_warn_pedantic="$enableval"],
1163
[ac_warn_pedantic="yes"])
1165
AC_ARG_ENABLE([fail],
1166
[AS_HELP_STRING([--disable-fail],
1167
[Turn warnings into failures @<:@default=on@:>@])],
1168
[ac_warn_fail="$enableval"],
1169
[ac_warn_fail="yes"])
1171
AC_ARG_ENABLE([unreachable],
1172
[AS_HELP_STRING([--enable-unreachable],
1173
[Enable warnings about unreachable code @<:@default=off@:>@])],
1174
[ac_warn_unreachable="$enableval"],
1175
[ac_warn_unreachable="no"])
1177
AC_ARG_ENABLE([longlong-warnings],
1178
[AS_HELP_STRING([--enable-longlong-warnings],
1179
[Enable warnings about longlong in C++ @<:@default=off@:>@])],
1180
[ac_warn_longlong="$enableval"],
1181
[ac_warn_longlong="no"])
1183
AC_ARG_ENABLE([strict-aliasing],
1184
[AS_HELP_STRING([--enable-strict-aliasing],
1185
[Enable warnings about stict-aliasing @<:@default=off@:>@])],
1186
[ac_warn_strict_aliasing="$enableval"],
1187
[ac_warn_strict_aliasing="no"])
1189
AC_ARG_ENABLE([cast-warnings],
1190
[AS_HELP_STRING([--enable-cast-warnings],
1191
[Enable warnings about use of old C-style casts @<:@default=off@:>@])],
1192
[ac_warn_cast="$enableval"],
1193
[ac_warn_cast="no"])
1195
AC_ARG_ENABLE([effective-style],
1196
[AS_HELP_STRING([--enable-effective-style],
1197
[Enable warnings violating Effective C++ Style Guidelines @<:@default=off@:>@])],
1198
[ac_warn_effc="$enableval"],
1199
[ac_warn_effc="no"])
1201
AC_ARG_ENABLE([shadow],
1202
[AS_HELP_STRING([--disable-shadow],
1203
[Disables warnings about scope shadowing @<:@default=on@:>@])],
1204
[ac_warn_shadow="$enableval"],
1205
[ac_warn_shadow="yes"])
1207
AC_ARG_ENABLE([conversion],
1208
[AS_HELP_STRING([--enable-conversion],
1209
[Enables conversion warnings @<:@default=off@:>@])],
1210
[ac_warn_conversion="$enableval"],
1211
[ac_warn_conversion="no"])
1213
AC_ARG_ENABLE([datarace],
1214
[AS_HELP_STRING([--enable-datarace],
1215
[Enables Sun Studio data race detection @<:@default=off@:>@])],
1216
[ac_datarace="$enableval"],
1219
AC_ARG_ENABLE([exceptions],
1220
[AS_HELP_STRING([--disable-exceptions],
1221
[Disables use of Exceptions in the build @<:@default=on@:>@])],
1222
[ac_exceptions="$enableval"],
1223
[ac_exceptions="yes"])
1225
AC_ARG_ENABLE([cast-align-warnings],
1226
[AS_HELP_STRING([--enable-cast-align-warnings],
1227
[Toggle cast alignment warnings @<:@default=off@:>@])],
1228
[ac_warn_cast_align="$enableval"],
1229
[ac_warn_cast_align="no"])
1231
if test "$GCC" = "yes"
1233
if test "$ac_warn_cast_align" = "yes"
1235
W_CAST_ALIGN="-Wcast-align"
1237
W_CAST_ALIGN="-Wno-cast-align"
1240
if test "$ac_warn_fail" = "yes"
1244
BASE_WARNINGS="-Wall -Wextra ${W_FAIL} ${W_CAST_ALIGN}"
1246
if test "$ac_warn_longlong" = "yes"
1248
W_LONGLONG="-Wlong-long"
1250
W_LONGLONG="-Wno-long-long"
1253
if test "$ac_warn_strict_aliasing" = "yes"
1255
W_STRICT_ALIASING="-Wstrict-aliasing"
1257
W_STRICT_ALIASING="-Wno-strict-aliasing"
1260
if test "$ac_warn_shadow" = "yes"
1263
NO_SHADOW="-Wno-shadow"
1265
W_SHADOW="-Wno-shadow"
1269
if test "$ac_profiling" = "yes"
1271
GPROF_PROFILING="-pg"
1274
AC_CHECK_LIB(c_p, read)
1281
if test "$ac_coverage" = "yes"
1283
GPROF_COVERAGE="-fprofile-arcs -ftest-coverage"
1288
if test "$ac_warn_pedantic" = "yes"
1290
AC_CACHE_CHECK([whether it is safe to use -Wredundant-decls],
1291
[ac_cv_safe_to_use_Wredundant_decls_],
1293
save_CXXFLAGS="${CXXFLAGS}"
1294
CXXFLAGS="${CXXFLAGS} ${W_FAIL} -Wredundant-decls"
1297
template <typename E> struct C { void foo(); };
1298
template <typename E> void C<E>::foo() { }
1299
template <> void C<int>::foo();
1300
AC_INCLUDES_DEFAULT])],
1301
[ac_cv_safe_to_use_Wredundant_decls_=yes],
1302
[ac_cv_safe_to_use_Wredundant_decls_=no])
1303
CXXFLAGS="${save_CXXFLAGS}"
1305
if test $ac_cv_safe_to_use_Wredundant_decls_ = yes
1307
GXX_W_REDUNDANT_DECLS="-Wredundant-decls"
1309
GXX_W_REDUNDANT_DECLS="-Wno-redundant-decls"
1312
GCC_PEDANTIC="-pedantic -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls ${W_STRICT_ALIASING}"
1313
GXX_PEDANTIC="-pedantic -Wundef -Woverloaded-virtual -Wnon-virtual-dtor -Wctor-dtor-privacy ${GXX_W_REDUNDANT_DECLS} ${W_LONGLONG} ${W_STRICT_ALIASING}"
1315
AC_CACHE_CHECK([whether __attribute__ visibility "hidden" is supported],
1316
[ac_cv_can_use_hidden_],
1321
__attribute__((visibility ("hidden")))
1322
void testme() { };],[
1324
[ac_cv_can_use_hidden_=yes],
1325
[ac_cv_can_use_hidden_=no])
1327
if test "$ac_cv_can_use_hidden_" = "yes"
1329
AC_DEFINE(HAVE_ATTR_HIDDEN, 1,
1330
[Define to 1 if you have support for __attribute__((visibility("hidden")))])
1334
if test "$ac_warn_unreachable" = "yes"
1336
W_UNREACHABLE="-Wunreachable-code"
1339
if test "$ac_warn_cast" = "yes"
1341
W_CAST="-Wold-style-cast"
1344
if test "$ac_warn_effc" = "yes"
1349
if test "$ac_warn_conversion" = "yes"
1351
W_CONVERSION="-Wconversion"
1354
CC_WARNINGS="${BASE_WARNINGS} ${GCC_PEDANTIC} ${W_UNREACHABLE} ${GPROF_PROFILING} ${GPROF_COVERAGE} ${W_SHADOW} ${W_CONVERSION}"
1355
CXX_WARNINGS="${BASE_WARNINGS} ${GXX_PEDANTIC} ${W_UNREACHABLE} ${GPROF_PROFILING} ${GPROF_COVERAGE} ${W_CAST} ${W_SHADOW} ${W_EFFC} ${W_CONVERSION}"
1357
if test "$ac_exceptions" = "no"
1359
NO_EXCEPTIONS="-fno-exceptions"
1360
W_EXCEPTIONS="-fexceptions"
1362
NO_REDUNDANT_DECLS="-Wno-redundant-decls"
1363
PROTOSKIP_WARNINGS="-Wno-effc++ -Wshadow"
1365
if test "$SUNCC" = "yes"
1367
if test "$ac_datarace" = "yes"
1369
CFLAGS="-xinstrument=datarace ${CFLAGS}"
1370
CXXFLAGS="-xinstrument=datarace ${CXXFLAGS}"
1373
if test "$ac_warn_fail" = "yes"
1375
W_FAIL="-errwarn=%all"
1378
CC_WARNINGS="-v -errtags=yes -erroff=E_ATTRIBUTE_NOT_VAR ${W_FAIL}"
1379
CXX_WARNINGS="+w +w2 -xport64 -errtags=yes -erroff=attrskipunsup,doubunder,reftotemp,inllargeuse,truncwarn1,signextwarn ${W_FAIL}"
1380
PROTOSKIP_WARNINGS="-erroff=attrskipunsup,doubunder,reftotemp,wbadinitl,identexpected,inllargeuse,truncwarn1,signextwarn"
1381
NO_UNREACHED="-erroff=E_STATEMENT_NOT_REACHED"
1382
if test "$ac_exceptions" = "no"
1384
NO_EXCEPTIONS="-features=no%except"
1385
W_EXCEPTIONS="-features=except"
1388
AC_SUBST(NO_EXCEPTIONS)
1389
AC_SUBST(W_EXCEPTIONS)
1392
AC_SUBST(NO_REDUNDANT_DECLS)
1393
AC_SUBST(PROTOSKIP_WARNINGS)
1394
AC_SUBST(NO_UNREACHED)
1396
if test "$ac_cv_func_timegm" = "no" -o "$gl_cv_func_gnu_getopt" = "no"
1398
CPPFLAGS="-I\$(top_srcdir)/gnulib -I\$(top_builddir)/gnulib ${CPPFLAGS}"
1400
CPPFLAGS="-I\$(top_srcdir) -I\$(top_builddir) ${CPPFLAGS}"
1402
AM_CPPFLAGS="${CPPFLAGS}"
1403
AM_CFLAGS="${CC_WARNINGS} ${CFLAGS}"
1404
AM_CXXFLAGS="${CXX_WARNINGS} ${W_EXCEPTIONS} ${CXXFLAGS}"
1406
AC_SUBST([AM_CPPFLAGS])
1407
AC_SUBST([AM_CFLAGS])
1408
AC_SUBST([AM_CXXFLAGS])
1410
dnl We've collected the flags in AM_*FLAGS now, so blank these.
1415
AC_SUBST(pkgplugindir,"\$(pkglibdir)/plugin")
132
1417
dnl GCC Precompiled Header Support
133
1418
dnl re-enable later
134
1419
dnl AM_CONDITIONAL([BUILD_GCC_PCH],[test "$GCC" = "yes"])
135
1420
AM_CONDITIONAL([BUILD_GCC_PCH],[test "no" = "yes"])
137
AS_IF([test "$lt_cv_prog_gnu_ld" = "yes"],[
138
LDFLAGS="${LDFLAGS} ${LD_VERSION_SCRIPT}"
143
AC_CONFIG_FILES(Makefile dnl
145
drizzled/plugin/version.h dnl
146
support-files/libdrizzle.pc dnl
147
support-files/drizzle.server support-files/drizzle-log-rotate
148
support-files/smf/install.sh dnl
149
support-files/drizzle.spec dnl
150
support-files/smf/drizzle.xml dnl
151
support-files/smf/drizzle)
1422
AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl
1424
mystrings/Makefile storage/Makefile dnl
1426
libdrizzleclient/Makefile client/Makefile dnl
1427
drizzled/Makefile dnl
1428
drizzled/serialize/Makefile dnl
1429
drizzled/sql_builtin.cc dnl
1430
support-files/Makefile dnl
1431
tests/Makefile tests/install_test_db dnl
1433
drizzled/drizzled_safe support-files/libdrizzleclient.pc dnl
1434
support-files/drizzle.server support-files/drizzle-log-rotate)
153
1436
scheduling_plugins_available="