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)
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
AC_CACHE_CHECK([if GCC is recent enough], [drizzle_cv_gcc_recent],
47
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
48
#if !defined(__GNUC__) || (__GNUC__ < 4)
49
# error GCC is Too Old!
52
[drizzle_cv_gcc_recent=yes],
53
[drizzle_cv_gcc_recent=no])])
54
if test "$drizzle_cv_gcc_recent" = "no"
56
AC_MSG_ERROR([Your version of GCC is too old. Drizzle requires at least version 4.0.2])
59
AC_CXX_HEADER_STDCXX_98
60
if test "$ac_cv_cxx_stdcxx_98" = "no"
62
AC_MSG_ERROR([C++ Compiler required to compile Drizzle])
70
AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
72
AC_PROG_GCC_TRADITIONAL
75
# Set all version vars based on $VERSION. How do we do this more elegant ?
76
# Remember that regexps needs to quote [ and ] since this is run through m4
77
# We take some made up examples
79
# VERSION 5.1.40sp1-alpha 5.0.34a
80
# DRIZZLE_NO_DASH_VERSION 5.1.40sp1 5.0.34a
81
# DRIZZLE_NUMERIC_VERSION 5.1.40 5.0.34
82
# DRIZZLE_BASE_VERSION 5.1 5.0
83
# DRIZZLE_VERSION_ID 50140 50034
85
DRIZZLE_NO_DASH_VERSION=`echo $VERSION | sed -e "s|-.*$||"`
86
DRIZZLE_NUMERIC_VERSION=`echo $DRIZZLE_NO_DASH_VERSION | sed -e "s|[[a-z]][[a-z0-9]]*$||"`
87
DRIZZLE_BASE_VERSION=`echo $DRIZZLE_NUMERIC_VERSION | sed -e "s|\.[[^.]]*$||"`
88
DRIZZLE_VERSION_ID=`echo $DRIZZLE_NUMERIC_VERSION | \
89
awk -F. '{printf "%d%0.2d%0.2d", $1, $2, $3}'`
90
AC_DEFINE_UNQUOTED(DRIZZLE_BASE_VERSION,["$DRIZZLE_BASE_VERSION"],
91
[Major and minor version])
92
AC_DEFINE_UNQUOTED([DRIZZLE_VERSION_ID],[$DRIZZLE_VERSION_ID],
93
[Version ID that can be easily used for numeric comparison])
95
AC_DEFINE([_BACKWARD_BACKWARD_WARNING_H],[1],[Hack to disable deprecation warning in gcc])
97
# The port should be constant for a LONG time
98
DRIZZLE_TCP_PORT_DEFAULT=4427
100
m4_include(m4/dtrace.m4)
102
m4_include(m4/character_sets.m4)
103
AC_SUBST(AVAILABLE_LANGUAGES)
105
m4_include(m4/gettext.m4)
106
AM_GNU_GETTEXT(external, need-formatstring-macros)
107
if test "x$MSGMERGE" = "x" -o "x$MSGMERGE" = "x:"
109
AM_PATH_PROG_WITH_TEST(GMSGMERGE, gmsgmerge,
110
[$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
111
MSGMERGE="${GMSGMERGE}"
113
AM_CONDITIONAL([BUILD_GETTEXT],[test "x$MSGMERGE" != "x" -a "x$MSGMERGE" != "x:"])
116
# Set this for plugins to use
117
ac_build_drizzle="yes"
120
# Canonicalize the configuration name.
122
# Check whether --with-system-type or --without-system-type was given.
123
AC_ARG_WITH([system-type],
124
[AS_HELP_STRING([--with-system-type],
125
[Set the system type, like "sun-solaris10"])],
126
[SYSTEM_TYPE="$withval"],
127
[SYSTEM_TYPE="$host_vendor-$host_os"])
128
AC_ARG_WITH([machine-type],
129
[AS_HELP_STRING([--with-machine-type],
130
[Set the machine type, like "sparc"])],
131
[MACHINE_TYPE="$withval"],
132
[MACHINE_TYPE="$host_cpu"])
133
AC_SUBST(SYSTEM_TYPE)
134
AC_DEFINE_UNQUOTED([SYSTEM_TYPE], ["$SYSTEM_TYPE"],
135
[Name of system, eg sun-solaris])
136
AC_SUBST(MACHINE_TYPE)
137
AC_DEFINE_UNQUOTED([MACHINE_TYPE], ["$MACHINE_TYPE"],
138
[Machine type name, eg sparc])
140
# Detect intel x86 like processor
141
BASE_MACHINE_TYPE=$MACHINE_TYPE
142
case $MACHINE_TYPE in
143
i?86) BASE_MACHINE_TYPE=i386 ;;
150
AC_SUBST(TARGET_LINUX)
151
AC_DEFINE([TARGET_OS_LINUX], [1], [Whether we build for Linux])
156
AC_DEFINE([TARGET_OS_OSX], [1], [Whether we build for OSX])
159
TARGET_SOLARIS="true"
160
AC_SUBST(TARGET_SOLARIS)
161
AC_DEFINE([TARGET_OS_SOLARIS], [1], [Whether we are building for Solaris])
167
DRIZZLE_CHECK_C_VERSION
168
DRIZZLE_CHECK_CXX_VERSION
175
AC_PATH_PROG(GPERF, gperf)
176
AS_IF([test "x$GPERF" = "x"],
177
AC_MSG_ERROR("Drizzle requires gperf to build. Please install it."))
179
AC_PATH_PROG(LCOV, lcov)
180
AC_PATH_PROG(GENHTML, genhtml)
182
AM_CONDITIONAL(HAVE_LCOV,[test "x$LCOV" != "x"])
184
dnl TODO: This needs to go away and be replaced with _ISOC99_SOURCE
185
if test "$ac_cv_c_compiler_gnu" = "yes" -o "$target_os" = "linux-gnu"
187
AC_DEFINE([_GNU_SOURCE],[1],[Fix problem with S_ISLNK() on Linux])
190
dnl Solaris 9 include file <sys/feature_tests.h> refers to X/Open document
192
dnl System Interfaces and Headers, Issue 5
194
dnl saying we should define _XOPEN_SOURCE=500 to get POSIX.1c prototypes,
195
dnl but apparently other systems (namely FreeBSD) don't agree.
197
dnl On a newer Solaris 10, the above file recognizes also _XOPEN_SOURCE=600.
198
dnl Furthermore, it tests that if a program requires older standard
199
dnl (_XOPEN_SOURCE<600 or _POSIX_C_SOURCE<200112L) it cannot be
200
dnl run on a new compiler (that defines _STDC_C99) and issues an #error.
201
dnl It's also an #error if a program requires new standard (_XOPEN_SOURCE=600
202
dnl or _POSIX_C_SOURCE=200112L) and a compiler does not define _STDC_C99.
204
dnl To add more to this mess, Sun Studio C compiler defines _STDC_C99 while
205
dnl C++ compiler does not!
207
dnl TODO: Can _ISOC99_SOURCE be defined on all platforms and remove the
208
dnl Need for all of this?
209
if test "$GCC" = "yes"
213
AC_DEFINE([_XOPEN_SOURCE],[600],[Turn on XOpen 6.0 Features])
214
AC_DEFINE([__C99FEATURES__],[1],[Turn on C99 Features for C++])
223
# Look for "(group|user)add".
224
# TODO: If the programs do not exist, inform the DBA that the user
225
# was not created at the end of the install routine.
226
AC_CHECK_PROGS(GROUPADD, groupadd addgroup)
227
AC_CHECK_PROGS(USERADD, useradd adduser)
229
dnl Not critical since the generated file is distributed
230
AC_CHECK_PROGS(YACC, ['bison -y'])
231
if test -z "$YACC" && test -d ".bzr"
233
AC_MSG_ERROR(["bison is required for Drizzle to build from a bzr branch"])
237
# The following is required for portable results of floating point calculations
238
# on PowerPC. The same must also be done for IA-64, but this options is missing
239
# in the IA-64 gcc backend.
241
if test "$GCC" = "yes"
245
CFLAGS="$CFLAGS -mno-fused-madd"
246
CXXFLAGS="$CXXFLAGS -mno-fused-madd"
250
# Build optimized or debug version ?
251
# First check for gcc and g++
252
if test "$GCC" = "yes"
254
CFLAGS="${CFLAGS} -ggdb3 -std=gnu99"
255
CXXFLAGS="${CXXFLAGS} -ggdb3 -std=gnu++98"
260
OPTIMIZE_CFLAGS="-O3"
261
OPTIMIZE_CXXFLAGS="-O3"
263
if test "$SUNCC" = "yes"
265
isainfo_k=`isainfo -k`
266
if test "$target_cpu" = "sparc"
268
MEMALIGN_FLAGS="-xmemalign=8s"
270
LDFLAGS="${LDFLAGS} -L/usr/lib/${isainfo_k} -L/usr/local/lib/${isainfo_k}"
272
if test "$isainfo_k" = "amd64"
275
LDFLAGS="${LDFLAGS} -L/usr/lib/${isainfo_k} -L/usr/local/lib/${isainfo_k}"
278
CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
280
CXXFLAGS="${CXXFLAGS} -xlang=c99 -g -mt -compat=5 -library=stlport4 -template=no%extdef ${IS_64} ${MEMALIGN_FLAGS}"
281
CFLAGS="${CFLAGS} -g -mt -xc99=all ${IS_64} ${MEMALIGN_FLAGS}"
283
DEBUG_CXXFLAGS="-xO0"
285
dnl TODO: -xO4 causes a Sun Studio failure in innodb... let's check back
287
OPTIMIZE_FLAGS="-xO3 -xlibmil -xdepend"
288
OPTIMIZE_CFLAGS="${OPTIMIZE_FLAGS} -Xa -xstrconst"
289
OPTIMIZE_CXXFLAGS="${OPTIMIZE_FLAGS}"
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} -DDEBUG ${CFLAGS}"
322
CXXFLAGS="${DEBUG_CXXFLAGS} -DDEBUG ${CXXFLAGS}"
324
# Optimized version. No debug
325
CFLAGS="${OPTIMIZE_CFLAGS} ${CFLAGS}"
326
CXXFLAGS="${OPTIMIZE_CXXFLAGS} ${CXXFLAGS}"
44
337
# 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"
338
if test "x$EGREP" != "x"
340
if test "$lt_cv_prog_gnu_ld" = "yes" -a $LD --version 2>/dev/null|${EGREP} -q GNU
342
LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_srcdir)/libdrizzleclient/libdrizzleclient.ver"
48
345
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'
56
AC_PATH_PROG(GPERF, gperf)
57
AS_IF([test "x$GPERF" = "x"],
58
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
349
#--------------------------------------------------------------------
350
# Check for Google Proto Buffers
351
#--------------------------------------------------------------------
354
AC_LIB_HAVE_LINKFLAGS(protobuf,,
355
[#include <google/protobuf/descriptor.h>
357
[google::protobuf::FileDescriptor* file;])
358
AS_IF([test x$ac_cv_libprotobuf = xno],
359
AC_MSG_ERROR([protobuf is required for Drizzle]))
361
AC_CACHE_CHECK([if protobuf is recent enough], [drizzle_cv_protobuf_recent],
362
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
363
#include <google/protobuf/descriptor.h>
364
#if GOOGLE_PROTOBUF_VERSION < 2000002
365
# error Your version of Protobuf is too old
368
[drizzle_cv_protobuf_recent=yes],
369
[drizzle_cv_protobuf_recent=no])])
370
if test "$drizzle_cv_protobuf_recent" = "no"
372
AC_MSG_ERROR([Your version of Google Protocol Buffers is too old. Drizzle requires at least version 2.0.2])
375
AC_PATH_PROG([PROTOC],[protoc],[no],[$LIBPROTOBUF_PREFIX/bin:$PATH])
376
if test "x$PROTOC" = "xno"
378
AC_MSG_ERROR([Couldn't find protoc. Try installing Google Protocol Buffer.])
383
#--------------------------------------------------------------------
385
#--------------------------------------------------------------------
387
dnl Do this by hand. Need to check for uuid/uuid.h, but uuid may or may
388
dnl not be a lib is weird.
390
AC_CHECK_HEADERS(uuid/uuid.h)
391
if test "x$ac_cv_header_uuid_uuid_h" = "xno"
393
AC_MSG_ERROR([Couldn't find uuid/uuid.h. Try installing libuuid development packages])
395
AC_LIB_HAVE_LINKFLAGS(uuid,,
397
#include <uuid/uuid.h>
406
#--------------------------------------------------------------------
407
# Check for libpthread
408
#--------------------------------------------------------------------
410
ACX_PTHREAD(,AC_MSG_ERROR(could not find libpthread))
411
LIBS="$PTHREAD_LIBS $LIBS"
412
CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS}"
415
#--------------------------------------------------------------------
416
# Check for tcmalloc/mtmalloc
417
#--------------------------------------------------------------------
419
AC_ARG_ENABLE([tcmalloc],
420
[AS_HELP_STRING([--enable-tcmalloc],
421
[Enable linking with tcmalloc @<:@default=off@:>@])],
422
[ac_enable_tcmalloc="$enableval"],
423
[ac_enable_tcmalloc="no"])
425
if test "x$ac_enable_tcmalloc" != "xno"
427
AC_CHECK_LIB(tcmalloc,malloc,[],[])
430
if test "x$ac_cv_lib_tcmalloc_malloc" != "xyes"
432
AC_CHECK_LIB(mtmalloc,malloc,[],[])
436
#--------------------------------------------------------------------
437
# Check for libdrizzle
438
#--------------------------------------------------------------------
440
AC_LIB_HAVE_LINKFLAGS(drizzle,,
441
[#include <libdrizzle/drizzle.h>],
443
const char *version= drizzle_version()
445
dnl AS_IF([test x$ac_cv_libdrizzle = xno],
446
dnl AC_MSG_ERROR([libdrizzle is required for Drizzle])
449
#--------------------------------------------------------------------
451
#--------------------------------------------------------------------
453
AC_LIB_HAVE_LINKFLAGS(z,,
458
AS_IF([test x$ac_cv_libz = xno],
459
AC_MSG_ERROR([libz is required for Drizzle]))
461
#--------------------------------------------------------------------
463
#--------------------------------------------------------------------
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)])
466
AC_LIB_HAVE_LINKFLAGS(tbb,,
467
[#include <tbb/atomic.h>
471
tbb::atomic<uint64_t> x;
472
tbb::atomic<uint8_t> y;
480
#--------------------------------------------------------------------
481
# Check for libreadline or compatible (libedit on Mac OS X)
482
#--------------------------------------------------------------------
487
AS_IF([test "x$vl_cv_lib_readline" = "xno"],
488
AC_MSG_ERROR([libreadline is required for Drizzle]))
489
READLINE_LIBS="${LIBS}"
491
AC_SUBST(READLINE_LIBS)
493
DRIZZLE_CHECK_NEW_RL_INTERFACE
495
#--------------------------------------------------------------------
497
#--------------------------------------------------------------------
499
AC_LIB_HAVE_LINKFLAGS(pcre,, [#include <pcre.h>], [pcre *re= NULL])
500
AS_IF([test "x$ac_cv_libpcre" = "xno"],[
502
AC_LIB_HAVE_LINKFLAGS(pcre,, [#include <pcre/pcre.h>], [pcre *re= NULL])
503
AS_IF([test "x$ac_cv_libpcre" = "xno"],
504
[AC_MSG_ERROR([libpcre is required for Drizzle])]
505
[AC_DEFINE(PCRE_HEADER,[<pcre/pcre.h>],[Location of pcre header])])
507
AC_DEFINE(PCRE_HEADER,[<pcre.h>],[Location of pcre header])
511
dnl Find paths to some shell programs
512
AC_PATH_PROG(LN, ln, ln)
513
# This must be able to take a -f flag like normal unix ln.
514
AC_PATH_PROG(LN_CP_F, ln, ln)
516
AC_PATH_PROG(MV, mv, mv)
517
AC_PATH_PROG(RM, rm, rm)
518
AC_PATH_PROG(CP, cp, cp)
519
AC_PATH_PROG(SED, sed, sed)
520
AC_PATH_PROG(CMP, cmp, cmp)
521
AC_PATH_PROG(CHMOD, chmod, chmod)
522
AC_PATH_PROG(HOSTNAME, hostname, hostname)
523
# Check for a GNU tar named 'gtar', or 'gnutar' (MacOS X) and
524
# fall back to 'tar' otherwise and hope that it's a GNU tar as well
525
AC_CHECK_PROGS(TAR, gnutar gtar tar)
527
dnl We use a path for perl so the script startup works
528
dnl We make sure to use perl, not perl5, in hopes that the RPMs will
529
dnl not depend on the perl5 binary being installed (probably a bug in RPM)
530
AC_PATH_PROG(PERL, perl, no)
531
if test "$PERL" != "no" && $PERL -e 'require 5' > /dev/null 2>&1
535
AC_PATH_PROG(PERL5, perl5, no)
536
if test "$PERL5" != no
539
ac_cv_path_PERL=$ac_cv_path_PERL5
547
# icheck, used for ABI check
548
AC_PATH_PROG(ICHECK, icheck, no)
549
# "icheck" is also the name of a file system check program on Tru64.
550
# Verify the program found is really the interface checker.
551
if test "x$ICHECK" != "xno"
553
AC_MSG_CHECKING(if $ICHECK works as expected)
554
echo "int foo;" > conftest.h
555
$ICHECK --canonify -o conftest.ic conftest.h 2>/dev/null
556
if test -f "conftest.ic"
563
rm -f conftest.ic conftest.h
568
AC_PATH_PROG(PS, ps, ps)
569
AC_MSG_CHECKING("how to check if pid exists")
572
if $PS p $$ 2> /dev/null | grep `echo $0 | sed s/\-//` > /dev/null
574
FIND_PROC="$PS p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
576
elif $PS -fp $$ 2> /dev/null | grep $0 > /dev/null
578
FIND_PROC="$PS -p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
580
elif $PS -uaxww 2> /dev/null | grep $0 > /dev/null
582
FIND_PROC="$PS -uaxww | grep -v grep | grep \$\$MYSQLD | grep \" \$\$PID \" > /dev/null"
584
elif $PS -ef 2> /dev/null | grep $0 > /dev/null
586
FIND_PROC="$PS -ef | grep -v grep | grep \$\$MYSQLD | grep \" \$\$PID \" > /dev/null"
587
# Do anybody use this?
588
elif $PS $$ 2> /dev/null | grep $0 > /dev/null
590
FIND_PROC="$PS \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
593
*freebsd*|*dragonfly*|*cygwin*)
594
FIND_PROC="$PS p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
597
FIND_PROC="$PS -uaxww | grep -v grep | grep \$\$MYSQLD | grep \" \$\$PID \" > /dev/null"
600
AC_MSG_ERROR([Could not find the right ps switches. Which OS is this ?. See the Installation chapter in the Reference Manual.])
605
AC_MSG_RESULT("$FIND_PROC")
607
# Check if a pid is valid
608
AC_PATH_PROG(KILL, kill, kill)
609
AC_MSG_CHECKING("for kill switches")
610
if $ac_cv_path_KILL -0 $$
612
CHECK_PID="$ac_cv_path_KILL -0 \$\$PID > /dev/null 2> /dev/null"
615
CHECK_PID="$ac_cv_path_KILL -s 0 \$\$PID > /dev/null 2> /dev/null"
617
AC_MSG_WARN([kill -0 to check for pid seems to fail])
618
CHECK_PID="$ac_cv_path_KILL -s SIGCONT \$\$PID > /dev/null 2> /dev/null"
621
AC_MSG_RESULT("$CHECK_PID")
624
# Check if we need noexec stack for assembler
627
if test "$am_cv_prog_cc_stdc" = "no"
629
AC_MSG_ERROR([Drizzle requires an ANSI C compiler (and a C++ compiler). Try gcc. See the Installation chapter in the Reference Manual.])
92
633
AC_ARG_WITH([server-suffix],
93
634
[AS_HELP_STRING([--with-server-suffix],
94
635
[Append value to the version string.])],
95
[ DRIZZLE_SERVER_SUFFIX="$withval" ]
96
[ DRIZZLE_SERVER_SUFFIX= ])
636
[ DRIZZLE_SERVER_SUFFIX=`echo "$withval" | sed -e 's/^\(...................................\)..*$/\1/'` ],
637
[ DRIZZLE_SERVER_SUFFIX= ]
98
639
AC_DEFINE_UNQUOTED([DRIZZLE_SERVER_SUFFIX],[$DRIZZLE_SERVER_SUFFIX],
99
640
[Append value to the version string])
642
# Force use of a curses libs
643
AC_ARG_WITH([named-curses-libs],
644
[AS_HELP_STRING([--with-named-curses-libs=ARG],
645
[Use specified curses libraries instead of those
646
automatically found by configure.])],
647
[ with_named_curses=$withval ],
648
[ with_named_curses=no ]
651
AC_ARG_WITH([tcp-port],
652
[AS_HELP_STRING([--with-tcp-port=port-number],
653
[Which port to use for Drizzle services @<:@default=4427@:>@])],
654
[ DRIZZLE_TCP_PORT=$withval ],
655
[ DRIZZLE_TCP_PORT=$DRIZZLE_TCP_PORT_DEFAULT
656
# if we actually defaulted (as opposed to the pathological case of
657
# --with-tcp-port=<DRIZZLE_TCP_PORT_DEFAULT> which might in theory
658
# happen if whole batch of servers was built from a script), set
659
# the default to zero to indicate that; we don't lose information
660
# that way, because 0 obviously indicates that we can get the
661
# default value from DRIZZLE_TCP_PORT. this seems really evil, but
662
# testing for DRIZZLE_TCP_PORT==DRIZZLE_TCP_PORT_DEFAULT would make a
663
# a port of DRIZZLE_TCP_PORT_DEFAULT magic even if the builder did not
664
# intend it to mean "use the default, in fact, look up a good default
665
# from /etc/services if you can", but really, really meant 4427 when
666
# they passed in 4427. When they pass in a specific value, let them
667
# have it; don't second guess user and think we know better, this will
668
# just make people cross. this makes the the logic work like this
669
# (which is complicated enough):
671
# - if a port was set during build, use that as a default.
673
# - otherwise, try to look up a port in /etc/services; if that fails,
674
# use DRIZZLE_TCP_PORT_DEFAULT (at the time of this writing 4427)
676
# - allow the DRIZZLE_TCP_PORT environment variable to override that.
678
# - allow command-line parameters to override all of the above.
680
# the top-most DRIZZLE_TCP_PORT_DEFAULT is read from win/configure.js,
681
# so don't mess with that.
682
DRIZZLE_TCP_PORT_DEFAULT=0 ]
684
AC_SUBST(DRIZZLE_TCP_PORT)
685
# We might want to document the assigned port in the manual.
686
AC_SUBST(DRIZZLE_TCP_PORT_DEFAULT)
687
AC_DEFINE_UNQUOTED([DRIZZLE_PORT],[$DRIZZLE_TCP_PORT],
688
[Drizzle port to use])
689
AC_DEFINE_UNQUOTED([DRIZZLE_PORT_DEFAULT],[$DRIZZLE_TCP_PORT_DEFAULT],
690
[If we defaulted to DRIZZLE_PORT, then this will be zero])
692
# Use this to set the place used for unix socket used to local communication.
102
693
AC_ARG_WITH([drizzled-user],
103
694
[AS_HELP_STRING([--with-drizzled-user=username],
104
695
[What user the drizzled daemon shall be run as.
105
696
@<:@default=drizzle@:>@])],
106
[ DRIZZLED_USER="$withval" ],
107
[ DRIZZLED_USER=drizzle ])
697
[ DRIZZLED_USER=$withval ],
698
[ DRIZZLED_USER=drizzle ]
108
700
AC_SUBST(DRIZZLED_USER)
702
# If we should allow LOAD DATA LOCAL
703
AC_MSG_CHECKING(If we should should enable LOAD DATA LOCAL by default)
704
AC_ARG_ENABLE(local-infile,
705
[ --enable-local-infile Enable LOAD DATA LOCAL INFILE (default: disabled)],
706
[ ENABLED_LOCAL_INFILE=$enableval ],
707
[ ENABLED_LOCAL_INFILE=no ]
709
if test "$ENABLED_LOCAL_INFILE" = "yes"
712
AC_DEFINE([ENABLED_LOCAL_INFILE], [1],
713
[If LOAD DATA LOCAL INFILE should be enabled by default])
718
# Types that must be checked AFTER large file support is checked
721
#--------------------------------------------------------------------
722
# Check for system header files
723
#--------------------------------------------------------------------
729
AC_CHECK_HEADERS(fcntl.h float.h fpu_control.h ieeefp.h)
730
AC_CHECK_HEADERS(limits.h pwd.h select.h linux/config.h)
731
AC_CHECK_HEADERS(sys/fpu.h utime.h sys/utime.h )
732
AC_CHECK_HEADERS(synch.h sys/mman.h sys/socket.h)
733
AC_CHECK_HEADERS([curses.h term.h],[],[],
734
[[#ifdef HAVE_CURSES_H
738
AC_CHECK_HEADERS(termio.h termios.h sched.h alloca.h)
739
AC_CHECK_HEADERS(sys/prctl.h ieeefp.h)
740
AC_CHECK_HEADERS(execinfo.h)
742
#--------------------------------------------------------------------
743
# Check for system libraries. Adds the library to $LIBS
744
# and defines HAVE_LIBM etc
745
#--------------------------------------------------------------------
747
AC_CHECK_LIB(m, floor, [], AC_CHECK_LIB(m, __infinity))
749
AC_CHECK_FUNC(setsockopt, [], [AC_CHECK_LIB(socket, setsockopt)])
750
AC_CHECK_FUNC(yp_get_default_domain, [],
751
[AC_CHECK_LIB(nsl, yp_get_default_domain)])
752
AC_CHECK_FUNC(p2open, [], [AC_CHECK_LIB(gen, p2open)])
753
# This may get things to compile even if bind-8 is installed
754
AC_CHECK_FUNC(bind, [], [AC_CHECK_LIB(bind, bind)])
755
# Check if crypt() exists in libc or libcrypt, sets LIBS if needed
756
AC_SEARCH_LIBS(crypt, crypt, AC_DEFINE(HAVE_CRYPT, 1, [crypt]))
758
# Check rt for aio_read
759
AC_CHECK_LIB(rt, aio_read)
761
# For the sched_yield() function on Solaris
762
AC_CHECK_FUNC(sched_yield, [],
763
[AC_CHECK_LIB(posix4, [sched_yield],
764
[AC_DEFINE(HAVE_SCHED_YIELD) LIBS="$LIBS -lposix4"])])
766
if test "$ac_cv_header_termio_h" = "no" -a "$ac_cv_header_termios_h" = "no"
768
AC_CHECK_FUNC(gtty, [], [AC_CHECK_LIB(compat, gtty)])
771
AC_CHECK_TYPES([fp_except], [], [], [
772
#include <sys/types.h>
778
AC_CHECK_LIB(dl,dlopen)
779
AC_CHECK_FUNCS(dlopen)
780
if test "$ac_cv_func_dlopen" != "yes"
782
AC_MSG_ERROR([Drizzle requires dlopen])
789
AC_ARG_WITH([fast-mutexes],
790
[AS_HELP_STRING([--with-fast-mutexes],
791
[Compile with fast mutexes @<:@default=off@:>@])],
792
[with_fast_mutexes=$withval],
793
[with_fast_mutexes=no])
795
if test "$with_fast_mutexes" != "no"
797
AC_DEFINE([MY_PTHREAD_FASTMUTEX], [1],
798
[Define to 1 if you want to use fast mutexes])
801
AM_CONDITIONAL(BUILD_FAST_MUTEX,[test "$with_fast_mutexes" != "no"])
803
AC_ARG_WITH([atomic-ops],
804
[AS_HELP_STRING([--with-atomic-ops=rwlocks|smp|up],
805
[Implement atomic operations using pthread rwlocks or atomic CPU
806
instructions for multi-processor or uniprocessor
807
configuration. By default gcc built-in sync functions are used,
808
if available and 'smp' configuration otherwise.])],
809
[with_atomic_ops="$withval"],
810
[with_atomic_ops=smp])
812
case "$with_atomic_ops" in
813
"up") AC_DEFINE([MY_ATOMIC_MODE_DUMMY], [1],
814
[Assume single-CPU mode, no concurrency]) ;;
815
"rwlocks") AC_DEFINE([MY_ATOMIC_MODE_RWLOCKS], [1],
816
[Use pthread rwlocks for atomic ops]) ;;
819
[whether the compiler provides atomic builtins],
820
[ac_cv_gcc_atomic_builtins],
824
int foo= -10; int bar= 10;
825
if (!__sync_fetch_and_add(&foo, bar) || foo)
827
bar= __sync_lock_test_and_set(&foo, bar);
828
if (bar || foo != 10)
830
bar= __sync_val_compare_and_swap(&bar, foo, 15);
835
[ac_cv_gcc_atomic_builtins=yes],
836
[ac_cv_gcc_atomic_builtins=no])])
838
if test "x$ac_cv_gcc_atomic_builtins" = "xyes"; then
839
AC_DEFINE(HAVE_GCC_ATOMIC_BUILTINS, 1,
840
[Define to 1 if compiler provides atomic builtins.])
843
*) AC_MSG_ERROR(["$with_atomic_ops" is not a valid value for --with-atomic-ops]) ;;
111
847
AC_ARG_WITH([comment],
112
848
[AS_HELP_STRING([--with-comment],
113
849
[Comment about compilation environment. @<:@default=off@:>@])],
114
850
[with_comment=$withval],
115
851
[with_comment=no])
116
AS_IF([test "$with_comment" != "no"],[
852
if test "$with_comment" != "no"
117
854
COMPILATION_COMMENT=$with_comment
119
COMPILATION_COMMENT="Source distribution (${PANDORA_RELEASE_COMMENT})"
856
COMPILATION_COMMENT="Source distribution"
121
858
AC_DEFINE_UNQUOTED([COMPILATION_COMMENT],["$COMPILATION_COMMENT"],
122
859
[Comment about compilation environment])
861
dnl Checks for typedefs, structures, and compiler characteristics.
868
# off_t is not a builtin type
869
AC_CHECK_SIZEOF(off_t, 4)
870
if test "$ac_cv_sizeof_off_t" -eq 0
872
AC_MSG_ERROR("Drizzle needs a off_t type.")
876
dnl check if time_t is unsigned
882
# This always gives a warning. Ignore it unless you are cross compiling
884
#---START: Used in for client configure
885
# Check base type of last arg to accept
888
# Figure out what type of struct rlimit to use with setrlimit
889
DRIZZLE_TYPE_STRUCT_RLIMIT
890
# Find where the stack goes
891
DRIZZLE_STACK_DIRECTION
892
# We want to skip alloca on irix unconditionally. It may work on some version..
894
# Do struct timespec have members tv_sec or ts_sec
896
# Do we have the tzname variable
898
AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>])
899
AC_CHECK_TYPES([uint, ulong])
901
DRIZZLE_PTHREAD_YIELD
904
dnl Checks for header files.
905
AC_CHECK_HEADERS(malloc.h)
907
dnl Checks for library functions.
909
AC_PROG_GCC_TRADITIONAL
912
AC_CHECK_FUNCS(issetugid)
914
# from old readline settting:
919
# Already-done: stdlib.h string.h unistd.h termios.h
920
AC_CHECK_HEADERS(stdarg.h dirent.h locale.h ndir.h sys/dir.h \
921
sys/ndir.h sys/select.h \
922
sys/mman.h termcap.h termio.h asm/termbits.h grp.h \
925
# Already-done: strcasecmp
926
AC_CHECK_FUNCS(lstat select)
930
DRIZZLE_CHECK_GETPW_FUNCS
931
DRIZZLE_HAVE_TIOCGWINSZ
932
DRIZZLE_HAVE_TIOCSTAT
125
934
#########################################################################
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])
936
dnl Checks for library functions.
941
AC_CHECK_FUNCS(fcntl)
942
if test "x$ac_cv_func_fcntl" != "xyes"
944
AC_MSG_ERROR("Drizzle requires fcntl.")
947
AC_CONFIG_LIBOBJ_DIR([gnulib])
951
fdatasync fpresetsticky fpsetmask fsync \
952
getpassphrase getpwnam \
953
getpwuid getrlimit getrusage index initgroups isnan \
954
localtime_r gethrtime gmtime_r \
956
mkstemp mlockall poll pread pthread_attr_create mmap mmap64 \
957
pthread_attr_getstacksize pthread_attr_setprio pthread_attr_setschedparam \
958
pthread_attr_setstacksize pthread_condattr_create pthread_getsequence_np \
959
pthread_key_delete pthread_rwlock_rdlock pthread_setprio \
960
pthread_setprio_np pthread_setschedparam pthread_sigmask readlink \
961
realpath rename rwlock_init setupterm \
966
backtrace backtrace_symbols backtrace_symbols_fd)
969
# Test whether madvise() is declared in C++ code -- it is not on some
970
# systems, such as Solaris
971
AC_CHECK_DECLS([madvise], [], [], [AC_INCLUDES_DEFAULT[
973
#include <sys/types.h>
974
#include <sys/mman.h>
980
AM_CONDITIONAL(BUILD_THR_RWLOCK,[test "$ac_cv_func_rwlock_init" -a "$ac_cv_funn_pthread_rwlock_rdlock"])
983
# Sanity check: We chould not have any fseeko symbol unless
984
# large_file_support=yes
985
AC_CHECK_FUNC(fseeko,
986
[if test "$large_file_support" = no -a "x$TARGET_LINUX" = "xtrue";
988
AC_MSG_ERROR("Found fseeko symbol but large_file_support is not enabled!")
992
# Check definition of pthread_getspecific
993
AC_CACHE_CHECK([args to pthread_getspecific], [mysql_cv_getspecific_args],
994
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
995
#if !defined(_REENTRANT)
998
#ifndef _POSIX_PTHREAD_SEMANTICS
999
#define _POSIX_PTHREAD_SEMANTICS
1001
#include <pthread.h> ]], [[ void *pthread_getspecific(pthread_key_t key);
1002
pthread_getspecific((pthread_key_t) NULL); ]])],
1003
[mysql_cv_getspecific_args=POSIX],
1004
[mysql_cv_getspecific_args=other])])
1005
if test "$mysql_cv_getspecific_args" = "other"
1007
AC_DEFINE([HAVE_NONPOSIX_PTHREAD_GETSPECIFIC], [1],
1008
[For some non posix threads])
1011
# Check definition of pthread_mutex_init
1012
AC_CACHE_CHECK([args to pthread_mutex_init], [mysql_cv_mutex_init_args],
1013
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1017
#ifndef _POSIX_PTHREAD_SEMANTICS
1018
#define _POSIX_PTHREAD_SEMANTICS
1020
#include <pthread.h> ]], [[
1021
pthread_mutexattr_t attr;
1023
pthread_mutex_init(&mp,&attr); ]])],
1024
[mysql_cv_mutex_init_args=POSIX],
1025
[mysql_cv_mutex_init_args=other])])
1026
if test "$mysql_cv_mutex_init_args" = "other"
1028
AC_DEFINE([HAVE_NONPOSIX_PTHREAD_MUTEX_INIT], [1],
1029
[For some non posix threads])
1033
#---START: Used in for client configure
1034
# Check definition of readdir_r
1035
AC_CACHE_CHECK([args to readdir_r], [mysql_cv_readdir_r],
1036
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1040
#ifndef _POSIX_PTHREAD_SEMANTICS
1041
#define _POSIX_PTHREAD_SEMANTICS
1043
#include <pthread.h>
1044
#include <dirent.h>]], [[ int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result);
1045
readdir_r((DIR *) NULL, (struct dirent *) NULL, (struct dirent **) NULL); ]])],
1046
[mysql_cv_readdir_r=POSIX],
1047
[mysql_cv_readdir_r=other])])
1048
if test "$mysql_cv_readdir_r" = "POSIX"
1050
AC_DEFINE([HAVE_READDIR_R], [1], [POSIX readdir_r])
1053
# Check definition of posix sigwait()
1054
AC_CACHE_CHECK([style of sigwait], [mysql_cv_sigwait],
1055
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1059
#ifndef _POSIX_PTHREAD_SEMANTICS
1060
#define _POSIX_PTHREAD_SEMANTICS
1062
#include <pthread.h>
1071
[mysql_cv_sigwait=POSIX],
1072
[mysql_cv_sigwait=other])])
1073
if test "$mysql_cv_sigwait" = "POSIX"
1075
AC_DEFINE([HAVE_SIGWAIT], [1], [POSIX sigwait])
1078
if test "$mysql_cv_sigwait" != "POSIX"
1080
unset mysql_cv_sigwait
1081
# Check definition of posix sigwait()
1082
AC_CACHE_CHECK([style of sigwait], [mysql_cv_sigwait],
1083
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1087
#ifndef _POSIX_PTHREAD_SEMANTICS
1088
#define _POSIX_PTHREAD_SEMANTICS
1090
#include <pthread.h>
1097
[mysql_cv_sigwait=NONPOSIX],
1098
[mysql_cv_sigwait=other])])
1099
if test "$mysql_cv_sigwait" = "NONPOSIX"
1101
AC_DEFINE([HAVE_NONPOSIX_SIGWAIT], [1], [sigwait with one argument])
1106
# Check if pthread_attr_setscope() exists
1107
AC_CACHE_CHECK([for pthread_attr_setscope], [mysql_cv_pthread_attr_setscope],
1108
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1112
#ifndef _POSIX_PTHREAD_SEMANTICS
1113
#define _POSIX_PTHREAD_SEMANTICS
1115
#include <pthread.h>
1117
pthread_attr_t thr_attr;
1118
pthread_attr_setscope(&thr_attr,0);
1120
[mysql_cv_pthread_attr_setscope=yes],
1121
[mysql_cv_pthread_attr_setscope=no])])
1122
if test "$mysql_cv_pthread_attr_setscope" = "yes"
1124
AC_DEFINE([HAVE_PTHREAD_ATTR_SETSCOPE], [1], [pthread_attr_setscope])
1128
AC_CHECK_HEADERS(cxxabi.h)
1129
AC_CACHE_CHECK([checking for abi::__cxa_demangle], mysql_cv_cxa_demangle,
1130
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <cxxabi.h>]], [[
1131
char *foo= 0; int bar= 0;
1132
foo= abi::__cxa_demangle(foo, foo, 0, &bar);
1133
]])],[mysql_cv_cxa_demangle=yes],[mysql_cv_cxa_demangle=no])])
1136
if test "x$mysql_cv_cxa_demangle" = xyes; then
1137
AC_DEFINE(HAVE_ABI_CXA_DEMANGLE, 1,
1138
[Define to 1 if you have the `abi::__cxa_demangle' function.])
1141
#--------------------------------------------------------------------
1142
# Check for requested features
1143
#--------------------------------------------------------------------
1145
DRIZZLE_CHECK_MAX_INDEXES
1147
#--------------------------------------------------------------------
1148
# Declare our plugin modules
1149
# Has to be done late, as the plugin may need to check for existence of
1150
# functions tested above
1151
#--------------------------------------------------------------------
1153
DRIZZLE_CONFIGURE_PLUGINS([none])
1155
AC_SUBST(mysql_plugin_dirs)
1156
AC_SUBST(mysql_plugin_libs)
1157
AC_SUBST(mysql_plugin_defs)
1158
AC_SUBST(DRIZZLED_PLUGIN_DEP_LIBS)
1161
AC_ARG_ENABLE([profiling],
1162
[AS_HELP_STRING([--enable-profiling],
1163
[Toggle profiling @<:@default=off@:>@])],
1164
[ac_profiling="$enableval"],
1165
[ac_profiling="no"])
1167
AC_ARG_ENABLE([coverage],
1168
[AS_HELP_STRING([--enable-coverage],
1169
[Toggle coverage @<:@default=off@:>@])],
1170
[ac_coverage="$enableval"],
1173
AC_ARG_ENABLE([pedantic-warnings],
1174
[AS_HELP_STRING([--disable-pedantic-warnings],
1175
[Toggle pedanticness @<:@default=on@:>@])],
1176
[ac_warn_pedantic="$enableval"],
1177
[ac_warn_pedantic="yes"])
1179
AC_ARG_ENABLE([fail],
1180
[AS_HELP_STRING([--disable-fail],
1181
[Turn warnings into failures @<:@default=on@:>@])],
1182
[ac_warn_fail="$enableval"],
1183
[ac_warn_fail="yes"])
1185
AC_ARG_ENABLE([unreachable],
1186
[AS_HELP_STRING([--enable-unreachable],
1187
[Enable warnings about unreachable code @<:@default=off@:>@])],
1188
[ac_warn_unreachable="$enableval"],
1189
[ac_warn_unreachable="no"])
1191
AC_ARG_ENABLE([longlong-warnings],
1192
[AS_HELP_STRING([--enable-longlong-warnings],
1193
[Enable warnings about longlong in C++ @<:@default=off@:>@])],
1194
[ac_warn_longlong="$enableval"],
1195
[ac_warn_longlong="no"])
1197
AC_ARG_ENABLE([strict-aliasing],
1198
[AS_HELP_STRING([--enable-strict-aliasing],
1199
[Enable warnings about stict-aliasing @<:@default=off@:>@])],
1200
[ac_warn_strict_aliasing="$enableval"],
1201
[ac_warn_strict_aliasing="no"])
1203
AC_ARG_ENABLE([cast-warnings],
1204
[AS_HELP_STRING([--enable-cast-warnings],
1205
[Enable warnings about use of old C-style casts @<:@default=off@:>@])],
1206
[ac_warn_cast="$enableval"],
1207
[ac_warn_cast="no"])
1209
AC_ARG_ENABLE([effective-style],
1210
[AS_HELP_STRING([--enable-effective-style],
1211
[Enable warnings violating Effective C++ Style Guidelines @<:@default=off@:>@])],
1212
[ac_warn_effc="$enableval"],
1213
[ac_warn_effc="no"])
1215
AC_ARG_ENABLE([shadow],
1216
[AS_HELP_STRING([--disable-shadow],
1217
[Disables warnings about scope shadowing @<:@default=on@:>@])],
1218
[ac_warn_shadow="$enableval"],
1219
[ac_warn_shadow="yes"])
1221
AC_ARG_ENABLE([conversion],
1222
[AS_HELP_STRING([--enable-conversion],
1223
[Enables conversion warnings @<:@default=off@:>@])],
1224
[ac_warn_conversion="$enableval"],
1225
[ac_warn_conversion="no"])
1227
AC_ARG_ENABLE([datarace],
1228
[AS_HELP_STRING([--enable-datarace],
1229
[Enables Sun Studio data race detection @<:@default=off@:>@])],
1230
[ac_datarace="$enableval"],
1233
AC_ARG_ENABLE([exceptions],
1234
[AS_HELP_STRING([--disable-exceptions],
1235
[Disables use of Exceptions in the build @<:@default=on@:>@])],
1236
[ac_exceptions="$enableval"],
1237
[ac_exceptions="yes"])
1239
if test "$GCC" = "yes"
1242
if test "$ac_warn_fail" = "yes"
1246
BASE_WARNINGS="-Wall -Wextra ${W_FAIL}"
1248
if test "$ac_warn_longlong" = "yes"
1250
W_LONGLONG="-Wlong-long"
1252
W_LONGLONG="-Wno-long-long"
1255
if test "$ac_warn_strict_aliasing" = "yes"
1257
W_STRICT_ALIASING="-Wstrict-aliasing"
1259
W_STRICT_ALIASING="-Wno-strict-aliasing"
1262
if test "$ac_warn_shadow" = "yes"
1265
NO_SHADOW="-Wno-shadow"
1267
W_SHADOW="-Wno-shadow"
1271
if test "$ac_profiling" = "yes"
1273
GPROF_PROFILING="-pg"
1276
AC_CHECK_LIB(c_p, read)
1283
if test "$ac_coverage" = "yes"
1285
GPROF_COVERAGE="-fprofile-arcs -ftest-coverage"
1290
if test "$ac_warn_pedantic" = "yes"
1292
save_CXXFLAGS="${CXXFLAGS}"
1293
CXXFLAGS="${CXXFLAGS} ${W_FAIL} -Wredundant-decls"
1294
AC_CACHE_CHECK([whether it is safe to use -Wredundant-decls],
1295
[ac_cv_safe_to_use_Wredundant_decls_],
1299
template <typename E> struct C { void foo(); };
1300
template <typename E> void C<E>::foo() { }
1301
template <> void C<int>::foo();
1302
AC_INCLUDES_DEFAULT])],
1303
[ac_cv_safe_to_use_Wredundant_decls_=yes],
1304
[ac_cv_safe_to_use_Wredundant_decls_=no])
1306
if test $ac_cv_safe_to_use_Wredundant_decls_ = yes
1308
GXX_W_REDUNDANT_DECLS="-Wredundant-decls"
1310
GXX_W_REDUNDANT_DECLS="-Wno-redundant-decls"
1313
GCC_PEDANTIC="-pedantic -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls ${W_STRICT_ALIASING}"
1314
GXX_PEDANTIC="-pedantic -Wundef -Woverloaded-virtual -Wnon-virtual-dtor -Wctor-dtor-privacy ${GXX_W_REDUNDANT_DECLS} ${W_LONGLONG} ${W_STRICT_ALIASING}"
1316
AC_CACHE_CHECK([whether __attribute__ visibility "hidden" is supported],
1317
[ac_cv_can_use_hidden_],
1322
__attribute__((visibility ("hidden")))
1323
void testme() { };],[
1325
[ac_cv_can_use_hidden_=yes],
1326
[ac_cv_can_use_hidden_=no])
1328
if test "$ac_cv_can_use_hidden_" = "yes"
1330
AC_DEFINE(HAVE_ATTR_HIDDEN, 1,
1331
[Define to 1 if you have support for __attribute__((visibility("hidden")))])
1334
CXXFLAGS="${save_CXXFLAGS}"
1337
if test "$ac_warn_unreachable" = "yes"
1339
W_UNREACHABLE="-Wunreachable-code"
1342
if test "$ac_warn_cast" = "yes"
1344
W_CAST="-Wold-style-cast"
1347
if test "$ac_warn_effc" = "yes"
1352
if test "$ac_warn_conversion" = "yes"
1354
W_CONVERSION="-Wconversion"
1357
CC_WARNINGS="${C99_SUPPORT_HACK} ${BASE_WARNINGS} ${GCC_PEDANTIC} ${W_UNREACHABLE} ${GPROF_PROFILING} ${GPROF_COVERAGE} ${W_SHADOW} ${W_CONVERSION}"
1358
CXX_WARNINGS="${BASE_WARNINGS} ${GXX_PEDANTIC} ${W_UNREACHABLE} ${GPROF_PROFILING} ${GPROF_COVERAGE} ${W_CAST} ${W_SHADOW} ${W_EFFC} ${W_CONVERSION}"
1360
if test "$ac_exceptions" = "no"
1362
NO_EXCEPTIONS="-fno-exceptions"
1363
W_EXCEPTIONS="-fexceptions"
1365
NO_REDUNDANT_DECLS="-Wno-redundant-decls"
1366
# Disable exceptions as they seams to create problems with gcc and threads.
1367
# drizzled doesn't use run-time-type-checking, so we disable it.
1368
CXXFLAGS="${CXXFLAGS} -fno-rtti"
1369
CPPFLAGS="${CPPFLAGS} -fpch-deps"
1370
PROTOSKIP_WARNINGS="${NO_SHADOW}"
1372
if test "$SUNCC" = "yes"
1374
if test "$ac_datarace" = "yes"
1376
CFLAGS="${CFLAGS} -xinstrument=datarace"
1377
CXXFLAGS="${CXXFLAGS} -xinstrument=datarace"
1380
if test "$ac_warn_fail" = "yes"
1382
W_FAIL="-errwarn=%all"
1385
CC_WARNINGS="-v -errtags=yes -erroff=E_ATTRIBUTE_NOT_VAR ${W_FAIL}"
1386
CXX_WARNINGS="+w +w2 -xport64 -errtags=yes -erroff=attrskipunsup,doubunder,reftotemp,inllargeuse,truncwarn1,signextwarn ${W_FAIL}"
1387
PROTOSKIP_WARNINGS="-erroff=attrskipunsup,doubunder,reftotemp,wbadinitl,identexpected,inllargeuse,truncwarn1,signextwarn"
1388
NO_UNREACHED="-erroff=E_STATEMENT_NOT_REACHED"
1389
if test "$ac_exceptions" = "no"
1391
NO_EXCEPTIONS="-features=no%except"
1392
W_EXCEPTIONS="-features=except"
1395
AC_SUBST(NO_EXCEPTIONS)
1396
AC_SUBST(W_EXCEPTIONS)
1399
AC_SUBST(NO_REDUNDANT_DECLS)
1400
AC_SUBST(PROTOSKIP_WARNINGS)
1401
AC_SUBST(NO_UNREACHED)
1403
if test "$ac_cv_func_timegm" = "no" -o "$gl_cv_func_gnu_getopt" = "no"
1405
CPPFLAGS="-I\$(top_srcdir)/gnulib -I\$(top_builddir)/gnulib ${CPPFLAGS}"
1407
CPPFLAGS="-I\$(top_srcdir) -I\$(top_builddir) ${CPPFLAGS}"
1409
AM_CPPFLAGS="${CPPFLAGS}"
1410
AM_CFLAGS="${CC_WARNINGS} ${CFLAGS}"
1411
AM_CXXFLAGS="${CXX_WARNINGS} ${NO_EXCEPTIONS} ${CXXFLAGS}"
1413
AC_SUBST([AM_CPPFLAGS])
1414
AC_SUBST([AM_CFLAGS])
1415
AC_SUBST([AM_CXXFLAGS])
1417
dnl We've collected the flags in AM_*FLAGS now, so blank these.
1422
AC_SUBST(pkgplugindir,"\$(pkglibdir)/plugin")
132
1424
dnl GCC Precompiled Header Support
133
1425
dnl re-enable later
134
1426
dnl AM_CONDITIONAL([BUILD_GCC_PCH],[test "$GCC" = "yes"])
135
1427
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)
1429
AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl
1431
mystrings/Makefile storage/Makefile dnl
1433
libdrizzleclient/Makefile client/Makefile dnl
1434
drizzled/Makefile dnl
1435
drizzled/serialize/Makefile dnl
1436
drizzled/sql_builtin.cc dnl
1437
support-files/Makefile dnl
1438
tests/Makefile tests/install_test_db dnl
1440
drizzled/drizzled_safe support-files/libdrizzleclient.pc dnl
1441
support-files/drizzle.server support-files/drizzle-log-rotate)
153
1443
scheduling_plugins_available="