2
2
dnl Process this file with autoconf to produce a configure script.
4
dnl Copyright (C) 2009 Sun Microsystems, Inc.
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
AC_INIT(drizzle, [7.0.0], [http://bugs.launchpad.net/drizzle])
24
7
AC_CONFIG_SRCDIR([drizzled/drizzled.cc])
25
AC_CONFIG_AUX_DIR([config])
27
PANDORA_CANONICAL_TARGET(less-warnings, require-cxx, force-gcc42, version-from-vc)
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)
8
AC_CONFIG_AUX_DIR(config)
9
AC_CONFIG_HEADERS([config.h])
11
# Save some variables and the command line options for mysqlbug
14
SAVE_ASFLAGS="$ASFLAGS"
16
SAVE_CXXFLAGS="$CXXFLAGS"
17
SAVE_LDFLAGS="$LDFLAGS"
18
SAVE_CXXLDFLAGS="$CXXLDFLAGS"
19
CONF_COMMAND="$0 $ac_configure_args"
20
AC_SUBST(CONF_COMMAND)
23
AC_SUBST(SAVE_ASFLAGS)
25
AC_SUBST(SAVE_CXXFLAGS)
26
AC_SUBST(SAVE_LDFLAGS)
27
AC_SUBST(SAVE_CXXLDFLAGS)
31
AM_INIT_AUTOMAKE(-Wall -Wno-portability -Werror)
35
# See the libtool docs for information on how to do shared lib versions.
36
SHARED_LIB_MAJOR_VERSION=1
37
SHARED_LIB_VERSION=$SHARED_LIB_MAJOR_VERSION:0:0
39
##############################################################################
40
# The below section needs to be done before AC_PROG_CC
41
##############################################################################
43
if test "x${CFLAGS-}" = x ; then
49
if test "x${CPPFLAGS-}" = x ; then
55
if test "x${LDFLAGS-}" = x ; then
61
################ End of section to be done before AC_PROG_CC #################
63
dnl Checks for programs.
65
ifdef([AC_PROG_CC_C99],[
66
dnl TODO: Need to fix this to use c99 instead of gnu99
67
AC_PROG_CC_C99([],[AC_MSG_ERROR([C99 support required for compiling Drizzle])])
69
],[C99_SUPPORT_HACK="-std=gnu99"])
71
ifdef([AC_USE_SYSTEM_EXTENSIONS],[
72
AC_USE_SYSTEM_EXTENSIONS
75
AH_VERBATIM([__EXTENSIONS__],
76
[/* Enable extensions on Solaris. */
77
#ifndef __EXTENSIONS__
78
# undef __EXTENSIONS__
80
#ifndef _POSIX_PTHREAD_SEMANTICS
81
# undef _POSIX_PTHREAD_SEMANTICS
83
#ifndef _TANDEM_SOURCE
84
# undef _TANDEM_SOURCE
87
AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
88
[ac_cv_safe_to_define___extensions__],
91
# define __EXTENSIONS__ 1
92
AC_INCLUDES_DEFAULT])],
93
[ac_cv_safe_to_define___extensions__=yes],
94
[ac_cv_safe_to_define___extensions__=no])])
95
test $ac_cv_safe_to_define___extensions__ = yes &&
96
AC_DEFINE([__EXTENSIONS__])
97
AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
98
AC_DEFINE([_TANDEM_SOURCE])
102
AC_CXX_HEADER_STDCXX_98
103
if test "$ac_cv_cxx_stdcxx_98" = "no"
105
AC_MSG_ERROR([C++ Compiler required to compile Drizzle])
110
AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
112
dnl AC_CANONICAL_HOST thinks it's a good idea to just set CFLAGS to
113
dnl -g -O2 if you're running gcc. We would like to use something else, thanks.
114
if test "x${CFLAGS}" = "x-g -O2"
118
if test "x${CXXFLAGS}" = "x-g -O2"
124
# Set all version vars based on $VERSION. How do we do this more elegant ?
125
# Remember that regexps needs to quote [ and ] since this is run through m4
126
# We take some made up examples
128
# VERSION 5.1.40sp1-alpha 5.0.34a
129
# DRIZZLE_NO_DASH_VERSION 5.1.40sp1 5.0.34a
130
# DRIZZLE_NUMERIC_VERSION 5.1.40 5.0.34
131
# DRIZZLE_BASE_VERSION 5.1 5.0
132
# DRIZZLE_VERSION_ID 50140 50034
134
DRIZZLE_NO_DASH_VERSION=`echo $VERSION | sed -e "s|-.*$||"`
135
DRIZZLE_NUMERIC_VERSION=`echo $DRIZZLE_NO_DASH_VERSION | sed -e "s|[[a-z]][[a-z0-9]]*$||"`
136
DRIZZLE_BASE_VERSION=`echo $DRIZZLE_NUMERIC_VERSION | sed -e "s|\.[[^.]]*$||"`
137
DRIZZLE_VERSION_ID=`echo $DRIZZLE_NUMERIC_VERSION | \
138
awk -F. '{printf "%d%0.2d%0.2d", $1, $2, $3}'`
140
# The port should be constant for a LONG time
141
DRIZZLE_TCP_PORT_DEFAULT=4427
143
sinclude(m4/dtrace.m4)
144
sinclude(m4/character_sets.m4)
145
sinclude(m4/gettext.m4)
147
AM_GNU_GETTEXT([external])
148
AM_GNU_GETTEXT_VERSION(0.17)
150
AM_CONDITIONAL([BUILD_GETTEXT],[test "x$MSGMERGE" != "x" -a "x$MSGMERGE" != "x:"])
152
AC_SUBST(DRIZZLE_NO_DASH_VERSION)
153
AC_DEFINE_UNQUOTED(DRIZZLE_BASE_VERSION,["$DRIZZLE_BASE_VERSION"],
154
[Major and minor version])
155
AC_SUBST(DRIZZLE_VERSION_ID)
156
AC_DEFINE_UNQUOTED([DRIZZLE_VERSION_ID],[$DRIZZLE_VERSION_ID],
157
[Version ID that can be easily used for numeric comparison])
158
AC_SUBST(DRIZZLE_PREVIOUS_BASE_VERSION)
159
AC_SUBST(PROTOCOL_VERSION)
160
AC_DEFINE_UNQUOTED([PROTOCOL_VERSION], [$PROTOCOL_VERSION],
161
[mysql client protocol version])
162
AC_SUBST(DOT_FRM_VERSION)
163
AC_DEFINE_UNQUOTED([FRM_VER], [$DOT_FRM_VERSION],
164
[Version of .frm files])
165
AC_DEFINE_UNQUOTED([DRIZZLE_CONFIG_NAME],["drizzled"],[Name of server config section])
167
AC_SUBST(SHARED_LIB_MAJOR_VERSION)
168
AC_SUBST(SHARED_LIB_VERSION)
169
AC_SUBST(AVAILABLE_LANGUAGES)
171
dnl Ok. This is sort of lame, but we need to be nice to plugins Makefile.am's.
172
AM_CONDITIONAL(BUILDING_DRIZZLE,[test "x" = "x"])
176
AC_DEFINE([IO_SIZE], [4096], [Io buffer size; Must be a power of 2 and
177
a multiple of 512. May be
178
smaller what the disk page size. This influences the speed of the
179
isam btree library. eg to big to slow.])
180
AC_DEFINE([SC_MAXWIDTH],[256], [Max width of screen (for error messages)])
181
AC_DEFINE([FN_LEN],[256 ], [Max file name len ])
182
AC_DEFINE([FN_EXTLEN],[20], [Max length of extension (part of FN_LEN) ])
183
AC_DEFINE([FN_REFLEN],[512], [Max length of full path-name ])
184
AC_DEFINE([FN_EXTCHAR],['.'], [File extension character])
185
AC_DEFINE([FN_HOMELIB],['~'], [~/ is used as abbrev for home dir ])
186
AC_DEFINE([FN_CURLIB],['.'], [./ is used as abbrev for current dir ])
187
AC_DEFINE([FN_PARENTDIR],[".."], [Parent directory; Must be a string ])
189
AC_DEFINE([MASTER],[1],[Compile without unireg])
191
AH_VERBATIM([QUOTE_ARG],[
192
/* Quote argument (before cpp) */
194
# define QUOTE_ARG(x) #x
196
/* Quote argument, (after cpp) */
197
#ifndef STRINGIFY_ARG
198
# define STRINGIFY_ARG(x) QUOTE_ARG(x)
202
AH_VERBATIM([builtin_expect],[
204
* The macros below are borrowed from include/linux/compiler.h in the
205
* Linux kernel. Use them to indicate the likelyhood of the truthfulness
206
* of a condition. This serves two purposes - newer versions of gcc will be
207
* able to optimize for branch predication, which could yield siginficant
208
* performance gains in frequently executed sections of the code, and the
209
* other reason to use them is for documentation
211
#if !defined(__GNUC__)
212
#define __builtin_expect(x, expected_value) (x)
215
#define likely(x) __builtin_expect((x),1)
216
#define unlikely(x) __builtin_expect((x),0)
219
dnl InnoDB depends on some Drizzle's internals which other plugins should not
220
dnl need. This is because of InnoDB's foreign key support, "safe" binlog
221
dnl truncation, and other similar legacy features.
223
dnl We define accessors for these internals unconditionally, but do not
224
dnl expose them in mysql/plugin.h. They are declared in ha_innodb.h for
227
AC_DEFINE([INNODB_COMPATIBILITY_HOOKS],[1],[TODO: Remove the need for this])
228
dnl TODO: Make a test for when this needs to be set.
229
AC_DEFINE([_REENTRANT],[1],[Some thread libraries require this])
231
AH_VERBATIM([posix_pthread],[
232
/* We want posix threads */
233
#ifndef _POSIX_PTHREAD_SEMANTICS
234
#define _POSIX_PTHREAD_SEMANTICS
239
# Canonicalize the configuration name.
241
# Check whether --with-system-type or --without-system-type was given.
242
AC_ARG_WITH([system-type],
243
[AS_HELP_STRING([--with-system-type],
244
[Set the system type, like "sun-solaris10"])],
245
[SYSTEM_TYPE="$withval"],
246
[SYSTEM_TYPE="$host_vendor-$host_os"])
247
AC_ARG_WITH([machine-type],
248
[AS_HELP_STRING([--with-machine-type],
249
[Set the machine type, like "powerpc"])],
250
[MACHINE_TYPE="$withval"],
251
[MACHINE_TYPE="$host_cpu"])
252
AC_SUBST(SYSTEM_TYPE)
253
AC_DEFINE_UNQUOTED([SYSTEM_TYPE], ["$SYSTEM_TYPE"],
254
[Name of system, eg sun-solaris])
255
AC_SUBST(MACHINE_TYPE)
256
AC_DEFINE_UNQUOTED([MACHINE_TYPE], ["$MACHINE_TYPE"],
257
[Machine type name, eg sparc])
259
# Detect intel x86 like processor
260
BASE_MACHINE_TYPE=$MACHINE_TYPE
261
case $MACHINE_TYPE in
262
i?86) BASE_MACHINE_TYPE=i386 ;;
266
# This is needed is SUBDIRS is set
273
AC_SUBST(TARGET_LINUX)
274
AC_DEFINE([TARGET_OS_LINUX], [1], [Whether we build for Linux])
279
AC_DEFINE([TARGET_OS_OSX], [1], [Whether we build for OSX])
282
TARGET_SOLARIS="true"
283
AC_SUBST(TARGET_SOLARIS)
284
AC_DEFINE([TARGET_OS_SOLARIS], [1], [Whether we are building for Solaris])
290
dnl AC_CANONICAL_HOST thinks it's a good idea to just set CFLAGS to
291
dnl -g -O2 if you're running gcc. We would like to use something else, thanks.
292
if test "x${CFLAGS}" = "x-g -O2"
296
if test "x${CXXFLAGS}" = "x-g -O2"
301
DRIZZLE_CHECK_C_VERSION
302
DRIZZLE_CHECK_CXX_VERSION
306
if test "$ac_cv_c_compiler_gnu" = "yes"
311
AC_PATH_PROG(AS, as, as)
314
dnl TODO: This needs to go away and be replaced with _ISOC99_SOURCE
315
if test "$ac_cv_c_compiler_gnu" = "yes" -o "$target_os" = "linux-gnu"
317
AC_DEFINE([_GNU_SOURCE],[1],[Fix problem with S_ISLNK() on Linux])
320
dnl Solaris 9 include file <sys/feature_tests.h> refers to X/Open document
322
dnl System Interfaces and Headers, Issue 5
324
dnl saying we should define _XOPEN_SOURCE=500 to get POSIX.1c prototypes,
325
dnl but apparently other systems (namely FreeBSD) don't agree.
327
dnl On a newer Solaris 10, the above file recognizes also _XOPEN_SOURCE=600.
328
dnl Furthermore, it tests that if a program requires older standard
329
dnl (_XOPEN_SOURCE<600 or _POSIX_C_SOURCE<200112L) it cannot be
330
dnl run on a new compiler (that defines _STDC_C99) and issues an #error.
331
dnl It's also an #error if a program requires new standard (_XOPEN_SOURCE=600
332
dnl or _POSIX_C_SOURCE=200112L) and a compiler does not define _STDC_C99.
334
dnl To add more to this mess, Sun Studio C compiler defines _STDC_C99 while
335
dnl C++ compiler does not!
337
dnl TODO: Can _ISOC99_SOURCE be defined on all platforms and remove the
338
dnl Need for all of this?
339
if test "$GCC" = "yes"
343
CFLAGS="${CFLAGS} -D_XOPEN_SOURCE=600"
344
CXXFLAGS="${CXXFLAGS} -D__C99FEATURES__"
352
# Ensure that we have --preserve-dup-deps defines, otherwise we get link
353
# problems of 'mysql' with CXX=g++
354
LIBTOOL="$LIBTOOL --preserve-dup-deps"
360
test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
362
# Look for "(group|user)add".
363
# TODO: If the programs do not exist, inform the DBA that the user
364
# was not created at the end of the install routine.
365
AC_CHECK_PROGS(GROUPADD, groupadd addgroup)
366
AC_CHECK_PROGS(USERADD, useradd adduser)
368
# Not critical since the generated file is distributed
369
AC_CHECK_PROGS(YACC, ['bison -y -p DRIZZLE'])
370
if test -z "$YACC" && test -d ".bzr"
372
AC_MSG_ERROR(["bison is required for Drizzle to build from a bzr branch"])
375
AC_PATH_PROG(uname_prog, uname, no)
377
# We should go through this and put all the explictly system dependent
379
AC_MSG_CHECKING(operating system)
380
AC_CACHE_VAL(mysql_cv_sys_os,
382
if test "$uname_prog" != "no"; then
383
mysql_cv_sys_os="`uname`"
385
mysql_cv_sys_os="Not Solaris"
388
AC_MSG_RESULT($mysql_cv_sys_os)
391
# The following is required for portable results of floating point calculations
392
# on PowerPC. The same must also be done for IA-64, but this options is missing
393
# in the IA-64 gcc backend.
395
if test "$GCC" = "yes"
399
AM_CFLAGS="$CFLAGS -mno-fused-madd"
400
AM_CXXFLAGS="$CXXFLAGS -mno-fused-madd"
404
# Build optimized or debug version ?
405
# First check for gcc and g++
409
DEBUG_OPTIMIZE_CXX=""
410
OPTIMIZE_CXXFLAGS="-O"
411
if test "$GCC" = "yes"
413
SYMBOLS_FLAGS="-ggdb3"
414
DEBUG_OPTIMIZE_CC="-O0"
415
OPTIMIZE_CFLAGS="-O3"
416
DEBUG_OPTIMIZE_CXX="-O0"
417
OPTIMIZE_CXXFLAGS="-O3"
419
if test "$SUNCC" = "yes"
421
dnl I'm cheating here and sticking C99 support in SYMBOLS_FLAGS
424
OPTIMIZE_CFLAGS="-xO4 -xlibmil -xdepend -Xa -mt -xstrconst -D_FORTEC_"
425
DEBUG_OPTIMIZE_CXX=""
426
#Put back in once isnan is figured out
427
OPTIMIZE_CXXFLAGS="-xO4 -xlibmil -mt -D_FORTEC_ -xlang=c99 -compat=5 -library=stlport4"
430
dnl TODO: Remove this define once we are using 2.61 across the board.
433
# Check whether to enable assertions.
434
AC_DEFUN([AX_HEADER_ASSERT],
436
AC_MSG_CHECKING([whether to enable assertions])
437
AC_ARG_ENABLE([assert],
438
[AS_HELP_STRING([--disable-assert],
439
[Turn off assertions])],
441
[ac_cv_assert="yes"])
442
AC_MSG_RESULT([$ac_cv_assert])
447
CFLAGS="${SYMBOLS_FLAGS} ${CFLAGS}"
448
CXXFLAGS="${SYMBOLS_FLAGS} ${CXXFLAGS}"
451
[AS_HELP_STRING([--with-debug],
452
[Add debug code/turns off optimizations (yes|no) @<:@default=no@:>@])],
453
[with_debug=$withval],
455
if test "$with_debug" = "yes"
458
CFLAGS="$DEBUG_OPTIMIZE_CC -DDEBUG $CFLAGS ${SAVE_CFLAGS}"
459
CXXFLAGS="$DEBUG_OPTIMIZE_CXX -DDEBUG $CXXFLAGS ${SAVE_CXXFLAGS}"
461
# Optimized version. No debug
462
CFLAGS="${OPTIMIZE_CFLAGS} ${CFLAGS} ${SAVE_CFLAGS}"
463
CXXFLAGS="$OPTIMIZE_CXXFLAGS $CXXFLAGS ${SAVE_CXXFLAGS}"
472
AC_SUBST(INSTALL_SCRIPT)
475
export CC CXX CFLAGS LD LDFLAGS AR ARFLAGS
44
484
# 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"
485
if test "$lt_cv_prog_gnu_ld" = "yes" -a $LD --version 2>/dev/null|grep -q GNU; then
486
LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_srcdir)/libdrizzle/libdrizzle.ver"
48
488
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])
63
PANDORA_REQUIRE_LIBPROTOBUF
64
PANDORA_PROTOBUF_REQUIRE_VERSION([2.1.0])
65
PANDORA_REQUIRE_PROTOC
68
PANDORA_REQUIRE_PTHREAD
69
PANDORA_REQUIRE_LIBUUID
71
PANDORA_REQUIRE_LIBPCRE
72
PANDORA_REQUIRE_LIBREADLINE
76
DRIZZLE_STACK_DIRECTION
78
PANDORA_USE_BETTER_MALLOC
81
AC_DEFINE([BUILDING_DRIZZLED],[1],
82
[Define indicating we are building and not consuming drizzle.])
84
PANDORA_HAVE_BOOST_TEST
85
PANDORA_HAVE_LIBSQLITE3
87
AC_CHECK_FUNC(inet_ntoa, [], [AC_CHECK_LIB(nsl, inet_ntoa)])
490
#--------------------------------------------------------------------
491
# Check for Google Proto Buffers
492
#--------------------------------------------------------------------
494
AC_MSG_CHECKING(for Google Protocol Buffers)
495
AC_ARG_WITH(protobuf,
496
[AS_HELP_STRING([--with-protobuf@<:@=DIR@:>@],
497
[search for protobuf in DIR/include and DIR/lib])],
498
[ with_protobuf=$withval ],
499
[ with_protobuf=yes ])
501
save_CPPFLAGS="$CPPFLAGS"
504
if test "$with_protobuf" = "yes"
510
CPPFLAGS="-I$withval/include"
511
LIBS="-L$withval/lib -lprotobuf"
512
PROTO_PATH="${withval}/bin:$PATH"
515
AC_CHECK_TOOL([PROTOC],[protoc],[no],[$PROTO_PATH])
516
if test "x$PROTOC" = "xno"
518
AC_MSG_ERROR([Couldn't find protoc. Try installing Google Protocol Buffer.])
522
AC_CHECK_HEADERS([google/protobuf/message.h])
523
if test "x$ac_cv_header_google_protobuf_message_h" != "xyes"
525
AC_MSG_ERROR([Couldn't find message.h. Try installing Google Protocol Buffer development packages])
527
AC_MSG_RESULT("$wthval")
529
AC_CACHE_CHECK([for Message in libprotobuf], ac_libprotobuf_works, [
531
#include <google/protobuf/descriptor.pb.h>
533
google::protobuf::FileDescriptorProto testFdp;
534
], ac_libprotobuf_works=yes, [
535
AC_ERROR([could not find Google's libprotobuf])
540
PROTOBUF_LIBS="${LIBS}"
541
PROTOBUF_CPPFLAGS="${CPPFLAGS}"
542
AC_SUBST(PROTOBUF_LIBS)
543
AC_SUBST(PROTOBUF_CPPFLAGS)
544
CPPFLAGS="$save_CPPFLAGS"
548
#--------------------------------------------------------------------
550
#--------------------------------------------------------------------
552
AC_CHECK_HEADERS(uuid/uuid.h)
553
if test "x$ac_cv_header_uuid_uuid_h" = "xno"
555
AC_MSG_ERROR([Couldn't find uuid/uuid.h. Try installing libuuid development packages])
557
AC_CHECK_LIB(uuid, uuid_generate)
559
#--------------------------------------------------------------------
561
#--------------------------------------------------------------------
563
AC_ARG_WITH(libevent,
564
[AS_HELP_STRING([--with-libevent@<:@=DIR@:>@],
565
[Use libevent in DIR])],
566
[ with_libevent=$withval ],
567
[ with_libevent=yes ])
569
if test "$with_libevent" = "yes"
571
AC_CHECK_HEADERS(event.h)
572
if test "x$ac_cv_header_event_h" != "xyes"
574
AC_MSG_ERROR([Couldn't find event.h. Try installing libevent development packages])
578
AC_CHECK_LIB(event, event_loop, [], [AC_MSG_ERROR(could not find libevent)])
579
LIBEVENT_LIBS="${LIBS}"
580
LIBS="${my_save_LIBS}"
583
AC_MSG_CHECKING(for libevent in $withval)
584
if test -f $withval/event.h -a -f $withval/libevent.a; then
586
if cd $withval; then withval=`pwd`; cd $owd; fi
587
LIBEVENT_CPPFLAGS="-I$withval"
588
LIBEVENT_LIBS="-L$withval -levent"
589
elif test -f $withval/include/event.h -a -f $withval/lib/libevent.a; then
591
if cd $withval; then withval=`pwd`; cd $owd; fi
592
LIBEVENT_CPPFLAGS="-I$withval/include"
593
LIBEVENT_LIBS="-L$withval/lib -levent"
595
AC_MSG_ERROR([event.h or libevent.a not found in $withval])
599
AC_SUBST(LIBEVENT_CPPFLAGS)
600
AC_SUBST(LIBEVENT_LIBS)
602
AC_CACHE_CHECK([for bufferevent in libevent], ac_libevent_works, [
603
save_CPPFLAGS="$CPPFLAGS"
605
CPPFLAGS="$LIBEVENT_CPPFLAGS"
606
LIBS="$LIBEVENT_LIBS"
608
#include <sys/types.h>
609
#include <sys/time.h>
611
#include <event.h>],[
612
struct bufferevent bev;
613
bufferevent_settimeout(&bev, 1, 1);
614
], ac_libevent_works=yes, [
615
AC_ERROR([you need to install a more recent version of libevent,
616
check http://www.monkey.org/~provos/libevent/])
619
CPPFLAGS="$save_CPPFLAGS"
624
#--------------------------------------------------------------------
625
# Check for libpthread
626
#--------------------------------------------------------------------
628
AC_CHECK_HEADERS(pthread.h)
629
if test "x$ac_cv_header_pthread_h" != "xyes"
631
AC_MSG_ERROR([Couldn't find pthread.h.])
633
AC_CHECK_LIB(pthread, pthread_create, [], [AC_MSG_ERROR(could not find libpthread)])
635
#--------------------------------------------------------------------
637
#--------------------------------------------------------------------
639
AC_ARG_ENABLE([tcmalloc],
640
[AS_HELP_STRING([--enable-tcmalloc],
641
[Enable linking with tcmalloc @<:@default=off@:>@])],
642
[ac_enable_tcmalloc="$enableval"],
643
[ac_enable_tcmalloc="no"])
645
if test "x$ac_enable_tcmalloc" = "xyes"
647
AC_CHECK_LIB(tcmalloc,malloc,[],[])
650
#--------------------------------------------------------------------
652
#--------------------------------------------------------------------
656
AC_CHECK_HEADERS(zlib.h)
657
if test "x$ac_cv_header_zlib_h" != "xyes"
659
AC_MSG_ERROR([Couldn't find zlib.h. Try installing zlib development packages])
661
AC_CHECK_LIB(z, crc32, [], [AC_MSG_ERROR(could not find libz)])
667
#--------------------------------------------------------------------
668
# Check for libreadline or compatible (libedit on Mac OS X)
669
#--------------------------------------------------------------------
671
AC_CHECK_HEADERS(readline/history.h readline/readline.h)
672
if test "x$ac_cv_header_readline_readline_h" != "xyes"
674
AC_MSG_ERROR([Couldn't find readline/readline.h. Try installing readline development packages.])
676
AC_CHECK_TYPES([HIST_ENTRY], [], [], [AC_INCLUDES_DEFAULT[
677
#ifdef HAVE_READLINE_HISTORY_H
678
#include <readline/history.h>
680
#include <readline/readline.h>
682
AC_CHECK_DECLS([completion_matches], [], [], [AC_INCLUDES_DEFAULT[
683
#ifdef HAVE_READLINE_HISTORY_H
684
#include <readline/history.h>
686
#include <readline/readline.h>
689
DRIZZLE_CHECK_NEW_RL_INTERFACE
693
AC_CHECK_LIB(readline, rl_initialize, [],
694
[AC_CHECK_LIB(ncurses, tgetent, [], [AC_MSG_ERROR(Couldn't find ncurses)])
695
AC_SEARCH_LIBS(rl_initialize, readline, [],
696
[AC_MSG_ERROR(Couldn't find libreadline.)])])
697
READLINE_LIBS="$LIBS"
699
AC_SUBST(READLINE_LIBS)
702
#--------------------------------------------------------------------
704
#--------------------------------------------------------------------
707
AC_PATH_PROG(PKG_CONFIG, pkg-config, AC_MSG_ERROR([pkg-config wasn't found.]))
708
PKG_CHECK_MODULES(PCRE, [libpcrecpp >= 3], [found_pcre="yes"],[found_pcre="no"])
710
if test "$found_pcre" = "no"
712
dnl Only check the header here, because autoconf can't handle
713
dnl checking for C++ methods without C linkages
714
AC_CHECK_HEADERS(pcrecpp.h)
715
if test "x$ac_cv_header_pcrecpp_h" != "xyes"
717
AC_MSG_ERROR([Couldn't find pcrecpp.h. Try installing the development package associated with libpcre on your system.])
719
# Found headers, now see if we can link
720
AC_MSG_CHECKING(for libpcrecpp)
721
save_LDFLAGS="$LDFLAGS"
722
LDFLAGS="-lpcrecpp -lpcre"
726
[pcrecpp::RE_Options opt;],
728
[AC_MSG_ERROR([Couldn't link libpcrecpp])])
731
LDFLAGS="$save_LDFLAGS"
737
AC_SUBST(PCRE_CFLAGS)
739
dnl Find paths to some shell programs
740
AC_PATH_PROG(LN, ln, ln)
741
# This must be able to take a -f flag like normal unix ln.
742
AC_PATH_PROG(LN_CP_F, ln, ln)
744
AC_PATH_PROG(MV, mv, mv)
745
AC_PATH_PROG(RM, rm, rm)
746
AC_PATH_PROG(CP, cp, cp)
747
AC_PATH_PROG(SED, sed, sed)
748
AC_PATH_PROG(CMP, cmp, cmp)
749
AC_PATH_PROG(CHMOD, chmod, chmod)
750
AC_PATH_PROG(HOSTNAME, hostname, hostname)
751
# Check for a GNU tar named 'gtar', or 'gnutar' (MacOS X) and
752
# fall back to 'tar' otherwise and hope that it's a GNU tar as well
753
AC_CHECK_PROGS(TAR, gnutar gtar tar)
755
dnl We use a path for perl so the script startup works
756
dnl We make sure to use perl, not perl5, in hopes that the RPMs will
757
dnl not depend on the perl5 binary being installed (probably a bug in RPM)
758
AC_PATH_PROG(PERL, perl, no)
759
if test "$PERL" != "no" && $PERL -e 'require 5' > /dev/null 2>&1
763
AC_PATH_PROG(PERL5, perl5, no)
764
if test "$PERL5" != no
767
ac_cv_path_PERL=$ac_cv_path_PERL5
775
# icheck, used for ABI check
776
AC_PATH_PROG(ICHECK, icheck, no)
777
# "icheck" is also the name of a file system check program on Tru64.
778
# Verify the program found is really the interface checker.
779
if test "x$ICHECK" != "xno"
781
AC_MSG_CHECKING(if $ICHECK works as expected)
782
echo "int foo;" > conftest.h
783
$ICHECK --canonify -o conftest.ic conftest.h 2>/dev/null
784
if test -f "conftest.ic"
791
rm -f conftest.ic conftest.h
796
AC_PATH_PROG(PS, ps, ps)
797
AC_MSG_CHECKING("how to check if pid exists")
800
if $PS p $$ 2> /dev/null | grep `echo $0 | sed s/\-//` > /dev/null
802
FIND_PROC="$PS p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
804
elif $PS -fp $$ 2> /dev/null | grep $0 > /dev/null
806
FIND_PROC="$PS -p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
808
elif $PS -uaxww 2> /dev/null | grep $0 > /dev/null
810
FIND_PROC="$PS -uaxww | grep -v grep | grep \$\$MYSQLD | grep \" \$\$PID \" > /dev/null"
812
elif $PS -ef 2> /dev/null | grep $0 > /dev/null
814
FIND_PROC="$PS -ef | grep -v grep | grep \$\$MYSQLD | grep \" \$\$PID \" > /dev/null"
815
# Do anybody use this?
816
elif $PS $$ 2> /dev/null | grep $0 > /dev/null
818
FIND_PROC="$PS \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
821
*freebsd*|*dragonfly*|*cygwin*)
822
FIND_PROC="$PS p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
825
FIND_PROC="$PS -uaxww | grep -v grep | grep \$\$MYSQLD | grep \" \$\$PID \" > /dev/null"
828
AC_MSG_ERROR([Could not find the right ps switches. Which OS is this ?. See the Installation chapter in the Reference Manual.])
833
AC_MSG_RESULT("$FIND_PROC")
835
# Check if a pid is valid
836
AC_PATH_PROG(KILL, kill, kill)
837
AC_MSG_CHECKING("for kill switches")
838
if $ac_cv_path_KILL -0 $$
840
CHECK_PID="$ac_cv_path_KILL -0 \$\$PID > /dev/null 2> /dev/null"
843
CHECK_PID="$ac_cv_path_KILL -s 0 \$\$PID > /dev/null 2> /dev/null"
845
AC_MSG_WARN([kill -0 to check for pid seems to fail])
846
CHECK_PID="$ac_cv_path_KILL -s SIGCONT \$\$PID > /dev/null 2> /dev/null"
849
AC_MSG_RESULT("$CHECK_PID")
851
# We need an ANSI C compiler
854
# We need an assembler, too
856
CCASFLAGS="$CCASFLAGS $ASFLAGS"
858
# Check if we need noexec stack for assembler
861
if test "$am_cv_prog_cc_stdc" = "no"
863
AC_MSG_ERROR([Drizzle requires an ANSI C compiler (and a C++ compiler). Try gcc. See the Installation chapter in the Reference Manual.])
90
867
AC_ARG_WITH([server-suffix],
91
868
[AS_HELP_STRING([--with-server-suffix],
92
869
[Append value to the version string.])],
93
[ DRIZZLE_SERVER_SUFFIX="$withval" ]
94
[ DRIZZLE_SERVER_SUFFIX= ])
870
[ DRIZZLE_SERVER_SUFFIX=`echo "$withval" | sed -e 's/^\(...................................\)..*$/\1/'` ],
871
[ DRIZZLE_SERVER_SUFFIX= ]
96
873
AC_DEFINE_UNQUOTED([DRIZZLE_SERVER_SUFFIX],[$DRIZZLE_SERVER_SUFFIX],
97
874
[Append value to the version string])
876
# Force use of a curses libs
877
AC_ARG_WITH([named-curses-libs],
878
[AS_HELP_STRING([--with-named-curses-libs=ARG],
879
[Use specified curses libraries instead of those
880
automatically found by configure.])],
881
[ with_named_curses=$withval ],
882
[ with_named_curses=no ]
885
AC_ARG_WITH([tcp-port],
886
[AS_HELP_STRING([--with-tcp-port=port-number],
887
[Which port to use for Drizzle services @<:@default=4427@:>@])],
888
[ DRIZZLE_TCP_PORT=$withval ],
889
[ DRIZZLE_TCP_PORT=$DRIZZLE_TCP_PORT_DEFAULT
890
# if we actually defaulted (as opposed to the pathological case of
891
# --with-tcp-port=<DRIZZLE_TCP_PORT_DEFAULT> which might in theory
892
# happen if whole batch of servers was built from a script), set
893
# the default to zero to indicate that; we don't lose information
894
# that way, because 0 obviously indicates that we can get the
895
# default value from DRIZZLE_TCP_PORT. this seems really evil, but
896
# testing for DRIZZLE_TCP_PORT==DRIZZLE_TCP_PORT_DEFAULT would make a
897
# a port of DRIZZLE_TCP_PORT_DEFAULT magic even if the builder did not
898
# intend it to mean "use the default, in fact, look up a good default
899
# from /etc/services if you can", but really, really meant 4427 when
900
# they passed in 4427. When they pass in a specific value, let them
901
# have it; don't second guess user and think we know better, this will
902
# just make people cross. this makes the the logic work like this
903
# (which is complicated enough):
905
# - if a port was set during build, use that as a default.
907
# - otherwise, try to look up a port in /etc/services; if that fails,
908
# use DRIZZLE_TCP_PORT_DEFAULT (at the time of this writing 4427)
910
# - allow the DRIZZLE_TCP_PORT environment variable to override that.
912
# - allow command-line parameters to override all of the above.
914
# the top-most DRIZZLE_TCP_PORT_DEFAULT is read from win/configure.js,
915
# so don't mess with that.
916
DRIZZLE_TCP_PORT_DEFAULT=0 ]
918
AC_SUBST(DRIZZLE_TCP_PORT)
919
# We might want to document the assigned port in the manual.
920
AC_SUBST(DRIZZLE_TCP_PORT_DEFAULT)
921
AC_DEFINE_UNQUOTED([DRIZZLE_PORT],[$DRIZZLE_TCP_PORT],
922
[Drizzle port to use])
923
AC_DEFINE_UNQUOTED([DRIZZLE_PORT_DEFAULT],[$DRIZZLE_TCP_PORT_DEFAULT],
924
[If we defaulted to DRIZZLE_PORT, then this will be zero])
926
# Use this to set the place used for unix socket used to local communication.
100
927
AC_ARG_WITH([drizzled-user],
101
928
[AS_HELP_STRING([--with-drizzled-user=username],
102
929
[What user the drizzled daemon shall be run as.
103
930
@<:@default=drizzle@:>@])],
104
[ DRIZZLED_USER="$withval" ],
105
[ DRIZZLED_USER=drizzle ])
931
[ DRIZZLED_USER=$withval ],
932
[ DRIZZLED_USER=drizzle ]
106
934
AC_SUBST(DRIZZLED_USER)
936
# If we should allow LOAD DATA LOCAL
937
AC_MSG_CHECKING(If we should should enable LOAD DATA LOCAL by default)
938
AC_ARG_ENABLE(local-infile,
939
[ --enable-local-infile Enable LOAD DATA LOCAL INFILE (default: disabled)],
940
[ ENABLED_LOCAL_INFILE=$enableval ],
941
[ ENABLED_LOCAL_INFILE=no ]
943
if test "$ENABLED_LOCAL_INFILE" = "yes"
946
AC_DEFINE([ENABLED_LOCAL_INFILE], [1],
947
[If LOAD DATA LOCAL INFILE should be enabled by default])
955
# Types that must be checked AFTER large file support is checked
958
#--------------------------------------------------------------------
959
# Check for system header files
960
#--------------------------------------------------------------------
966
AC_CHECK_HEADERS(fcntl.h float.h fpu_control.h ieeefp.h)
967
AC_CHECK_HEADERS(limits.h pwd.h select.h linux/config.h)
968
AC_CHECK_HEADERS(sys/fpu.h utime.h sys/utime.h )
969
AC_CHECK_HEADERS(synch.h sys/mman.h sys/socket.h)
970
AC_CHECK_HEADERS([curses.h term.h],[],[],
971
[[#ifdef HAVE_CURSES_H
975
AC_CHECK_HEADERS(termio.h termios.h sched.h alloca.h)
976
AC_CHECK_HEADERS(sys/prctl.h ieeefp.h)
977
AC_CHECK_HEADERS(execinfo.h)
979
#--------------------------------------------------------------------
980
# Check for system libraries. Adds the library to $LIBS
981
# and defines HAVE_LIBM etc
982
#--------------------------------------------------------------------
984
AC_CHECK_LIB(m, floor, [], AC_CHECK_LIB(m, __infinity))
986
AC_CHECK_FUNC(setsockopt, [], [AC_CHECK_LIB(socket, setsockopt)])
987
AC_CHECK_FUNC(yp_get_default_domain, [],
988
[AC_CHECK_LIB(nsl, yp_get_default_domain)])
989
AC_CHECK_FUNC(p2open, [], [AC_CHECK_LIB(gen, p2open)])
990
# This may get things to compile even if bind-8 is installed
991
AC_CHECK_FUNC(bind, [], [AC_CHECK_LIB(bind, bind)])
992
# Check if crypt() exists in libc or libcrypt, sets LIBS if needed
993
AC_SEARCH_LIBS(crypt, crypt, AC_DEFINE(HAVE_CRYPT, 1, [crypt]))
995
# Check rt for aio_read
996
AC_CHECK_LIB(rt, aio_read)
998
# For the sched_yield() function on Solaris
999
AC_CHECK_FUNC(sched_yield, [],
1000
[AC_CHECK_LIB(posix4, [sched_yield],
1001
[AC_DEFINE(HAVE_SCHED_YIELD) LIBS="$LIBS -lposix4"])])
1003
if test "$ac_cv_header_termio_h" = "no" -a "$ac_cv_header_termios_h" = "no"
1005
AC_CHECK_FUNC(gtty, [], [AC_CHECK_LIB(compat, gtty)])
1008
AC_CHECK_TYPES([fp_except], [], [], [
1009
#include <sys/types.h>
1013
my_save_LIBS="$LIBS"
1015
AC_CHECK_LIB(dl,dlopen)
1016
AC_CHECK_FUNCS(dlopen)
1017
if test "$ac_cv_func_dlopen" != "yes"
1019
AC_MSG_ERROR([Drizzle requires dlopen])
1022
LIBS="$my_save_LIBS"
1023
AC_SUBST(LIBDL_LIBS)
1025
AC_CHECK_FUNCS(strtok_r)
1029
AC_ARG_WITH([fast-mutexes],
1030
[AS_HELP_STRING([--with-fast-mutexes],
1031
[Compile with fast mutexes @<:@default=off@:>@])],
1032
[with_fast_mutexes=$withval],
1033
[with_fast_mutexes=no])
1035
if test "$with_fast_mutexes" != "no"
1037
AC_DEFINE([MY_PTHREAD_FASTMUTEX], [1],
1038
[Define to 1 if you want to use fast mutexes])
1041
AM_CONDITIONAL(BUILD_FAST_MUTEX,[test "$with_fast_mutexes" != "no"])
109
1043
AC_ARG_WITH([comment],
110
1044
[AS_HELP_STRING([--with-comment],
111
1045
[Comment about compilation environment. @<:@default=off@:>@])],
112
1046
[with_comment=$withval],
113
1047
[with_comment=no])
114
AS_IF([test "$with_comment" != "no"],[
1048
if test "$with_comment" != "no"
115
1050
COMPILATION_COMMENT=$with_comment
117
COMPILATION_COMMENT="Source distribution (${PANDORA_RELEASE_COMMENT})"
1052
COMPILATION_COMMENT="Source distribution"
119
1054
AC_DEFINE_UNQUOTED([COMPILATION_COMMENT],["$COMPILATION_COMMENT"],
120
1055
[Comment about compilation environment])
1057
dnl Checks for typedefs, structures, and compiler characteristics.
1063
# off_t is not a builtin type
1064
AC_CHECK_SIZEOF(off_t, 4)
1065
if test "$ac_cv_sizeof_off_t" -eq 0
1067
AC_MSG_ERROR("Drizzle needs a off_t type.")
1071
dnl check if time_t is unsigned
1074
DRIZZLE_CHECK_TIME_T
1077
# This always gives a warning. Ignore it unless you are cross compiling
1079
#---START: Used in for client configure
1080
# Check base type of last arg to accept
1083
# Figure out what type of struct rlimit to use with setrlimit
1084
DRIZZLE_TYPE_STRUCT_RLIMIT
1085
# Find where the stack goes
1086
DRIZZLE_STACK_DIRECTION
1087
# We want to skip alloca on irix unconditionally. It may work on some version..
1089
# Do struct timespec have members tv_sec or ts_sec
1091
# Do we have the tzname variable
1093
AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>])
1094
AC_CHECK_TYPES([uint, ulong])
1096
DRIZZLE_PTHREAD_YIELD
1099
dnl Checks for header files.
1100
AC_CHECK_HEADERS(malloc.h)
1102
dnl Checks for library functions.
1104
AC_PROG_GCC_TRADITIONAL
1107
AC_CHECK_FUNCS(issetugid)
1109
# from old readline settting:
1112
AC_SUBST(MAKE_SHELL)
1114
# Already-done: stdlib.h string.h unistd.h termios.h
1115
AC_CHECK_HEADERS(stdarg.h dirent.h locale.h ndir.h sys/dir.h \
1116
sys/ndir.h sys/select.h \
1117
sys/mman.h termcap.h termio.h asm/termbits.h grp.h \
1120
# Already-done: strcasecmp
1121
AC_CHECK_FUNCS(lstat select)
1124
DRIZZLE_SIGNAL_CHECK
1125
DRIZZLE_CHECK_GETPW_FUNCS
1126
DRIZZLE_HAVE_TIOCGWINSZ
1127
DRIZZLE_HAVE_TIOCSTAT
1128
DRIZZLE_TYPE_SIGHANDLER
1129
if test "$with_named_curses" = "no"
1131
DRIZZLE_CHECK_LIB_TERMCAP
1133
TERMCAP_LIBS="$with_named_curses"
1135
AC_SUBST(TERMCAP_LIBS)
1137
# End of readline/libedit stuff
123
1138
#########################################################################
126
dnl Has to be done late, as the plugin may need to check for existence of
127
dnl functions tested above
128
PANDORA_PLUGINS([drizzled/module/load_list.h])
1140
dnl Checks for library functions.
1143
# The following code disables intrinsic function support while we test for
1144
# library functions. This is to avoid configure problems with Intel ecc
1147
ORG_CFLAGS="$CFLAGS"
1148
if test "$GCC" != "yes"; then
1149
AC_SYS_COMPILER_FLAG(-nolib_inline,nolib_inline,CFLAGS,[],[])
1158
AC_CHECK_FUNCS(fcntl)
1159
if test "x$ac_cv_func_fcntl" != "xyes"
1161
AC_MSG_ERROR("Drizzle requires fcntl.")
1164
AC_CONFIG_LIBOBJ_DIR([mystrings])
1168
fdatasync fpresetsticky fpsetmask fsync \
1169
getpassphrase getpwnam \
1170
getpwuid getrlimit getrusage index initgroups isnan \
1171
localtime_r gethrtime gmtime_r \
1173
mkstemp mlockall poll pread pthread_attr_create mmap mmap64 \
1174
pthread_attr_getstacksize pthread_attr_setprio pthread_attr_setschedparam \
1175
pthread_attr_setstacksize pthread_condattr_create pthread_getsequence_np \
1176
pthread_key_delete pthread_rwlock_rdlock pthread_setprio \
1177
pthread_setprio_np pthread_setschedparam pthread_sigmask readlink \
1178
realpath rename rwlock_init setupterm \
1183
backtrace backtrace_symbols backtrace_symbols_fd)
1186
# Test whether madvise() is declared in C++ code -- it is not on some
1187
# systems, such as Solaris
1188
AC_CHECK_DECLS([madvise], [], [], [AC_INCLUDES_DEFAULT[
1190
#include <sys/types.h>
1191
#include <sys/mman.h>
1197
AM_CONDITIONAL(BUILD_THR_RWLOCK,[test "$ac_cv_func_rwlock_init" -a "$ac_cv_funn_pthread_rwlock_rdlock"])
1200
CFLAGS="$ORG_CFLAGS"
1202
# Sanity check: We chould not have any fseeko symbol unless
1203
# large_file_support=yes
1204
AC_CHECK_FUNC(fseeko,
1205
[if test "$large_file_support" = no -a "x$TARGET_LINUX" = "xtrue";
1207
AC_MSG_ERROR("Found fseeko symbol but large_file_support is not enabled!")
1211
# Check definition of pthread_getspecific
1212
AC_CACHE_CHECK([args to pthread_getspecific], [mysql_cv_getspecific_args],
1213
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if !defined(_REENTRANT)
1216
#define _POSIX_PTHREAD_SEMANTICS
1217
#include <pthread.h> ]], [[ void *pthread_getspecific(pthread_key_t key);
1218
pthread_getspecific((pthread_key_t) NULL); ]])],
1219
[mysql_cv_getspecific_args=POSIX],
1220
[mysql_cv_getspecific_args=other])])
1221
if test "$mysql_cv_getspecific_args" = "other"
1223
AC_DEFINE([HAVE_NONPOSIX_PTHREAD_GETSPECIFIC], [1],
1224
[For some non posix threads])
1227
# Check definition of pthread_mutex_init
1228
AC_CACHE_CHECK([args to pthread_mutex_init], [mysql_cv_mutex_init_args],
1229
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#define _REENTRANT
1230
#define _POSIX_PTHREAD_SEMANTICS
1231
#include <pthread.h> ]], [[
1232
pthread_mutexattr_t attr;
1234
pthread_mutex_init(&mp,&attr); ]])],
1235
[mysql_cv_mutex_init_args=POSIX],
1236
[mysql_cv_mutex_init_args=other])])
1237
if test "$mysql_cv_mutex_init_args" = "other"
1239
AC_DEFINE([HAVE_NONPOSIX_PTHREAD_MUTEX_INIT], [1],
1240
[For some non posix threads])
1244
#---START: Used in for client configure
1245
# Check definition of readdir_r
1246
AC_CACHE_CHECK([args to readdir_r], [mysql_cv_readdir_r],
1247
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define _REENTRANT
1248
#define _POSIX_PTHREAD_SEMANTICS
1249
#include <pthread.h>
1250
#include <dirent.h>]], [[ int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result);
1251
readdir_r((DIR *) NULL, (struct dirent *) NULL, (struct dirent **) NULL); ]])],
1252
[mysql_cv_readdir_r=POSIX],
1253
[mysql_cv_readdir_r=other])])
1254
if test "$mysql_cv_readdir_r" = "POSIX"
1256
AC_DEFINE([HAVE_READDIR_R], [1], [POSIX readdir_r])
1259
# Check definition of posix sigwait()
1260
AC_CACHE_CHECK([style of sigwait], [mysql_cv_sigwait],
1261
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1263
#define _POSIX_PTHREAD_SEMANTICS
1264
#include <pthread.h>
1273
[mysql_cv_sigwait=POSIX],
1274
[mysql_cv_sigwait=other])])
1275
if test "$mysql_cv_sigwait" = "POSIX"
1277
AC_DEFINE([HAVE_SIGWAIT], [1], [POSIX sigwait])
1280
if test "$mysql_cv_sigwait" != "POSIX"
1282
unset mysql_cv_sigwait
1283
# Check definition of posix sigwait()
1284
AC_CACHE_CHECK([style of sigwait], [mysql_cv_sigwait],
1285
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1287
#define _POSIX_PTHREAD_SEMANTICS
1288
#include <pthread.h>
1295
[mysql_cv_sigwait=NONPOSIX],
1296
[mysql_cv_sigwait=other])])
1297
if test "$mysql_cv_sigwait" = "NONPOSIX"
1299
AC_DEFINE([HAVE_NONPOSIX_SIGWAIT], [1], [sigwait with one argument])
1304
# Check if pthread_attr_setscope() exists
1305
AC_CACHE_CHECK([for pthread_attr_setscope], [mysql_cv_pthread_attr_setscope],
1306
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1308
#define _POSIX_PTHREAD_SEMANTICS
1309
#include <pthread.h>
1311
pthread_attr_t thr_attr;
1312
pthread_attr_setscope(&thr_attr,0);
1314
[mysql_cv_pthread_attr_setscope=yes],
1315
[mysql_cv_pthread_attr_setscope=no])])
1316
if test "$mysql_cv_pthread_attr_setscope" = "yes"
1318
AC_DEFINE([HAVE_PTHREAD_ATTR_SETSCOPE], [1], [pthread_attr_setscope])
1322
AC_CHECK_HEADERS(cxxabi.h)
1323
AC_CACHE_CHECK([checking for abi::__cxa_demangle], mysql_cv_cxa_demangle,
1324
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <cxxabi.h>]], [[
1325
char *foo= 0; int bar= 0;
1326
foo= abi::__cxa_demangle(foo, foo, 0, &bar);
1327
]])],[mysql_cv_cxa_demangle=yes],[mysql_cv_cxa_demangle=no])])
1330
if test "x$mysql_cv_cxa_demangle" = xyes; then
1331
AC_DEFINE(HAVE_ABI_CXA_DEMANGLE, 1,
1332
[Define to 1 if you have the `abi::__cxa_demangle' function.])
1335
#--------------------------------------------------------------------
1336
# Check for requested features
1337
#--------------------------------------------------------------------
1339
DRIZZLE_CHECK_MAX_INDEXES
1342
#--------------------------------------------------------------------
1343
# Declare our plugin modules
1344
# Has to be done late, as the plugin may need to check for existence of
1345
# functions tested above
1346
#--------------------------------------------------------------------
1348
DRIZZLE_CONFIGURE_PLUGINS([none])
1350
AC_SUBST(mysql_plugin_dirs)
1351
AC_SUBST(mysql_plugin_libs)
1352
AC_SUBST(mysql_plugin_defs)
1355
AC_ARG_ENABLE([profiling],
1356
[AS_HELP_STRING([--enable-profiling],
1357
[Toggle profiling @<:@default=off@:>@])],
1358
[ac_profiling="$enableval"],
1359
[ac_profiling="no"])
1361
AC_ARG_ENABLE([coverage],
1362
[AS_HELP_STRING([--enable-coverage],
1363
[Toggle coverage @<:@default=off@:>@])],
1364
[ac_coverage="$enableval"],
1367
AC_ARG_ENABLE([pedantic-warnings],
1368
[AS_HELP_STRING([--disable-pedantic-warnings],
1369
[Toggle pedanticness @<:@default=on@:>@])],
1370
[ac_warn_pedantic="$enableval"],
1371
[ac_warn_pedantic="yes"])
1373
AC_ARG_ENABLE([fail],
1374
[AS_HELP_STRING([--disable-fail],
1375
[Turn warnings into failures @<:@default=on@:>@])],
1376
[ac_warn_fail="$enableval"],
1377
[ac_warn_fail="yes"])
1379
AC_ARG_ENABLE([unreachable],
1380
[AS_HELP_STRING([--enable-unreachable],
1381
[Enable warnings about unreachable code @<:@default=off@:>@])],
1382
[ac_warn_unreachable="$enableval"],
1383
[ac_warn_unreachable="no"])
1385
AC_ARG_ENABLE([longlong-warnings],
1386
[AS_HELP_STRING([--enable-longlong-warnings],
1387
[Enable warnings about longlong in C++ @<:@default=off@:>@])],
1388
[ac_warn_longlong="$enableval"],
1389
[ac_warn_longlong="no"])
1391
AC_ARG_ENABLE([strict-aliasing],
1392
[AS_HELP_STRING([--enable-strict-aliasing],
1393
[Enable warnings about stict-aliasing @<:@default=off@:>@])],
1394
[ac_warn_strict_aliasing="$enableval"],
1395
[ac_warn_strict_aliasing="no"])
1397
AC_ARG_ENABLE([cast-warnings],
1398
[AS_HELP_STRING([--enable-cast-warnings],
1399
[Enable warnings about use of old C-style casts @<:@default=off@:>@])],
1400
[ac_warn_cast="$enableval"],
1401
[ac_warn_cast="no"])
1403
AC_ARG_ENABLE([effective-style],
1404
[AS_HELP_STRING([--enable-effective-style],
1405
[Enable warnings violating Effective C++ Style Guidelines @<:@default=off@:>@])],
1406
[ac_warn_effc="$enableval"],
1407
[ac_warn_effc="no"])
1409
AC_ARG_ENABLE([go-crazy],
1410
[AS_HELP_STRING([--enable-go-crazy],
1411
[Enables extra little warnings that might be too much @<:@default=off@:>@])],
1412
[ac_warn_go_crazy="$enableval"],
1413
[ac_warn_go_crazy="no"])
1416
if test "$GCC" = "yes"
1420
if test "$ac_warn_fail" = "yes"
1424
BASE_WARNINGS="-W -Wall -Wextra -Wunused-macros ${W_FAIL}"
1426
if test "$ac_warn_longlong" = "yes"
1428
W_LONGLONG="-Wlong-long"
1430
W_LONGLONG="-Wno-long-long"
1433
if test "$ac_warn_strict_aliasing" = "yes"
1435
W_STRICT_ALIASING="-Wstrict-aliasing"
1437
W_STRICT_ALIASING="-Wno-strict-aliasing"
1440
if test "$ac_profiling" = "yes"
1442
GPROF_PROFILING="-pg"
1447
if test "$ac_coverage" = "yes"
1449
GPROF_COVERAGE="-fprofile-arcs -ftest-coverage"
1454
if test "$ac_warn_pedantic" = "yes"
1456
save_CXXFLAGS="${CXXFLAGS}"
1457
CXXFLAGS="${CXXFLAGS} ${W_FAIL} -Wredundant-decls"
1458
AC_CACHE_CHECK([whether it is safe to use -Wredundant-decls],
1459
[ac_cv_safe_to_use_Wredundant_decls_],
1463
template <typename E> struct C { void foo(); };
1464
template <typename E> void C<E>::foo() { }
1465
template <> void C<int>::foo();
1466
AC_INCLUDES_DEFAULT])],
1467
[ac_cv_safe_to_use_Wredundant_decls_=yes],
1468
[ac_cv_safe_to_use_Wredundant_decls_=no])
1470
if test $ac_cv_safe_to_use_Wredundant_decls_ = yes
1472
GXX_W_REDUNDANT_DECLS="-Wredundant-decls"
1474
GXX_W_REDUNDANT_DECLS="-Wno-redundant-decls"
1477
GCC_PEDANTIC="-pedantic -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls ${W_STRICT_ALIASING}"
1478
GXX_PEDANTIC="-pedantic -Wundef ${GXX_W_REDUNDANT_DECLS} ${W_LONGLONG} ${W_STRICT_ALIASING}"
1480
AC_CACHE_CHECK([whether __attribute__ visibility "hidden" is supported],
1481
[ac_cv_can_use_hidden_],
1486
__attribute__((visibility ("hidden")))
1487
void testme() { };],[
1489
[ac_cv_can_use_hidden_=yes],
1490
[ac_cv_can_use_hidden_=no])
1492
if test "$ac_cv_can_use_hidden_" = "yes"
1494
AC_DEFINE(HAVE_ATTR_HIDDEN, 1,
1495
[Define to 1 if you have support for __attribute__((visibility("hidden")))])
1498
CXXFLAGS="${save_CXXFLAGS}"
1501
if test "$ac_warn_unreachable" = "yes"
1503
W_UNREACHABLE="-Wunreachable-code"
1505
if test "$ac_warn_cast" = "yes"
1507
W_CAST="-Wold-style-cast"
1510
if test "$ac_warn_effc" = "yes"
1515
if test "$ac_warn_gocrazy" = "yes"
1517
W_CRAZY="-Wshadow -Wconversion -Winvalid-pch"
1520
CC_WARNINGS="${C99_SUPPORT_HACK} ${BASE_WARNINGS} ${GCC_PEDANTIC} ${W_UNREACHABLE} ${GPROF_PROFILING} ${GPROF_COVERAGE} ${W_CRAZY}"
1521
CXX_WARNINGS="${BASE_WARNINGS} ${GXX_PEDANTIC} ${W_UNREACHABLE} ${GPROF_PROFILING} ${GPROF_COVERAGE} ${W_CAST} ${W_EFFC} ${W_CRAZY}"
1523
NO_EXCEPTIONS="-fno-exceptions"
1524
W_EXCEPTIONS="-fexceptions"
1525
NO_UNUSED_MACROS="-Wno-unused-macros"
1526
NO_REDUNDANT_DECLS="-Wno-redundant-decls"
1527
# Disable exceptions as they seams to create problems with gcc and threads.
1528
# drizzled doesn't use run-time-type-checking, so we disable it.
1529
AM_CXXFLAGS="${AM_CXXFLAGS} -fno-rtti"
1530
CPPFLAGS="${CPPFLAGS} -fpch-deps"
1532
if test "$SUNCC" = "yes"
1534
CC_WARNINGS="-v -xc99=all -errtags=yes"
1535
CXX_WARNINGS="+w +w2 -xport64 -errtags=yes -erroff=attrskipunsup -compat=5"
1536
NO_EXCEPTIONS="-features=no%except"
1537
W_EXCEPTIONS="-features=except"
1539
AM_CXXFLAGS="${CXX_WARNINGS} ${NO_EXCEPTIONS} ${AM_CXXFLAGS}"
1540
AM_CFLAGS="${CC_WARNINGS} ${AM_CFLAGS}"
1542
AC_SUBST(NO_EXCEPTIONS)
1543
AC_SUBST(W_EXCEPTIONS)
1544
AC_SUBST(NO_UNUSED_MACROS)
1545
AC_SUBST(NO_REDUNDANT_DECLS)
1547
AC_SUBST([GLOBAL_CPPFLAGS],['-I$(top_srcdir) -I$(top_builddir)'])
1548
AC_SUBST([AM_CPPFLAGS],['${GLOBAL_CPPFLAGS}'])
1549
AC_SUBST([AM_CFLAGS])
1550
AC_SUBST([AM_CXXFLAGS])
1552
# Some usefull subst
1556
# Set configuration options for make_binary_distribution
1557
case $SYSTEM_TYPE in
1559
MAKE_BINARY_DISTRIBUTION_OPTIONS="$MAKE_BINARY_DISTRIBUTION_OPTIONS --no-strip"
1562
: # no change for other platforms yet
1565
AC_SUBST(MAKE_BINARY_DISTRIBUTION_OPTIONS)
130
1567
dnl GCC Precompiled Header Support
131
1568
dnl re-enable later
132
dnl AM_CONDITIONAL([BUILD_GCC_PCH],[test "$GCC" = "yes"])
133
AM_CONDITIONAL([BUILD_GCC_PCH],[test "no" = "yes"])
135
AS_IF([test "$lt_cv_prog_gnu_ld" = "yes"],[
136
LDFLAGS="${LDFLAGS} ${LD_VERSION_SCRIPT}"
140
AS_IF([test "x${ac_gcc_profile_mode}" = "xyes" -a "x${pandora_cv_boost_profile}" = "xyes"],[
141
AC_DEFINE([_GLIBCXX_PROFILE],[1],[Enable GCC Profile Mode])
145
AC_CONFIG_FILES(Makefile dnl
147
drizzled/plugin/version.h dnl
148
support-files/drizzle7.pc dnl
149
support-files/libdrizzle.pc dnl
150
support-files/smf/install.sh dnl
151
support-files/smf/drizzle.xml dnl
152
support-files/smf/drizzle)
154
scheduling_plugins_available="
159
for sched_plugin in $scheduling_plugins_available
161
varname="\${with_plugin_${sched_plugin}}"
162
result=`eval "echo $varname"`
163
if test "x$result" = "xyes"
165
scheduling_plugins="$sched_plugin $scheduling_plugins"
1569
dnl AM_CONDITIONAL([GCC_PCH],[test "$GCC" = "yes"])
1570
AM_CONDITIONAL([GCC_PCH],[test "no" = "yes"])
1572
AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl
1573
mystrings/Makefile storage/Makefile dnl
1575
libdrizzle/Makefile client/Makefile dnl
1576
drizzled/Makefile dnl
1577
drizzled/field/Makefile dnl
1578
drizzled/serialize/Makefile dnl
1579
drizzled/functions/Makefile dnl
1580
drizzled/functions/str/Makefile dnl
1581
drizzled/functions/time/Makefile dnl
1582
drizzled/util/Makefile dnl
1583
drizzled/sql_builtin.cc dnl
1584
support-files/Makefile dnl
1585
tests/Makefile tests/install_test_db dnl
1587
drizzled/drizzled_safe support-files/libdrizzle.pc dnl
1588
support-files/drizzle.server support-files/drizzle-log-rotate)
1590
AC_CONFIG_COMMANDS([default], , test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h)
1592
# Ensure that table handlers gets all modifications to CFLAGS/CXXFLAGS
1593
AC_CONFIG_COMMANDS_POST(ac_configure_args="$ac_configure_args CFLAGS='$CFLAGS' CXXFLAGS='$CXXFLAGS' AM_CFLAGS='$AM_CFLAGS' AM_CXXFLAGS='$AM_CXXFLAGS'")
172
echo "Configuration summary for $PACKAGE_NAME version $VERSION $PANDORA_RELEASE_COMMENT"
1598
echo "Configuration summary for $PACKAGE_NAME version $VERSION"
174
1600
echo " * Installation prefix: $prefix"
175
echo " * System type: $host_vendor-$host_os"
176
echo " * pandora-build version: PANDORA_CANONICAL_VERSION"
1601
echo " * System type: $SYSTEM_TYPE"
177
1602
echo " * Host CPU: $host_cpu"
178
1603
echo " * C Compiler: $CC_VERSION"
179
echo " * C++ Compiler: $CXX_VERSION"
1604
echo " * C++ Compiler: $CXX"
1605
echo " * Build auth_pam: $ac_cv_header_security_pam_appl_h"
180
1606
echo " * Assertions enabled: $ac_cv_assert"
181
1607
echo " * Debug enabled: $with_debug"
182
1608
echo " * Profiling enabled: $ac_profiling"
183
1609
echo " * Coverage enabled: $ac_coverage"
184
echo " * Warnings as failure: $ac_cv_warnings_as_errors"
1610
echo " * Warnings as failure: $ac_warn_fail"
1611
echo " * C++ cstdint location: $ac_cv_cxx_cstdint"
1612
echo " * C++ hash_map location: $ac_cv_cxx_hash_map"
1613
echo " * C++ hash namespace: $ac_cv_cxx_hash_namespace"
1614
echo " * C++ cmath location: $ac_cv_cxx_cmath"
1615
echo " * C++ cmath namespace: $ac_cv_cxx_cmath_namespace"
192
echo "* NOTE: You are on FreeBSD. BSD make will not work."
194
echo "* use 'gmake' To build Drizzle"
196
echo "* And ensure that /usr/local/lib/gcc44 is in your LD_LIBRARY_PATH"
203
dnl libtoolize scans configure.ac and needs to see some text
204
m4_define([LIBTOOLIZE_AC_INIT], [])