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
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, warnings-always-on, require-cxx, force-gcc42, version-from-vc, skip-visibility)
29
LIBDRIZZLE_LIBRARY_VERSION=0:8: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
40
dnl AC_CANONICAL_HOST thinks it's a good idea to just set CFLAGS to
41
dnl -g -O2 if you're running gcc. We would like to use something else, thanks.
42
if test "x${CFLAGS}" = "x-g -O2"
46
if test "x${CXXFLAGS}" = "x-g -O2"
52
# Set all version vars based on $VERSION. How do we do this more elegant ?
53
# Remember that regexps needs to quote [ and ] since this is run through m4
54
# We take some made up examples
56
# VERSION 5.1.40sp1-alpha 5.0.34a
57
# DRIZZLE_NO_DASH_VERSION 5.1.40sp1 5.0.34a
58
# DRIZZLE_NUMERIC_VERSION 5.1.40 5.0.34
59
# DRIZZLE_BASE_VERSION 5.1 5.0
60
# DRIZZLE_VERSION_ID 50140 50034
62
DRIZZLE_NO_DASH_VERSION=`echo $VERSION | sed -e "s|-.*$||"`
63
DRIZZLE_NUMERIC_VERSION=`echo $DRIZZLE_NO_DASH_VERSION | sed -e "s|[[a-z]][[a-z0-9]]*$||"`
64
DRIZZLE_BASE_VERSION=`echo $DRIZZLE_NUMERIC_VERSION | sed -e "s|\.[[^.]]*$||"`
65
DRIZZLE_VERSION_ID=`echo $DRIZZLE_NUMERIC_VERSION | \
66
awk -F. '{printf "%d%0.2d%0.2d", $1, $2, $3}'`
68
# The port should be constant for a LONG time
69
DRIZZLE_TCP_PORT_DEFAULT=4427
71
sinclude(m4/dtrace.m4)
72
sinclude(m4/character_sets.m4)
74
AM_GNU_GETTEXT([external])
75
AM_GNU_GETTEXT_VERSION(0.17)
77
AM_CONDITIONAL([BUILD_GETTEXT],[test "x$MSGMERGE" != "x" -a "x$MSGMERGE" != "x:"])
79
AC_SUBST(DRIZZLE_NO_DASH_VERSION)
80
AC_SUBST(DRIZZLE_BASE_VERSION)
81
AC_SUBST(DRIZZLE_VERSION_ID)
82
AC_SUBST(DRIZZLE_PREVIOUS_BASE_VERSION)
83
AC_SUBST(PROTOCOL_VERSION)
84
AC_DEFINE_UNQUOTED([PROTOCOL_VERSION], [$PROTOCOL_VERSION],
85
[mysql client protocol version])
86
AC_SUBST(DOT_FRM_VERSION)
87
AC_DEFINE_UNQUOTED([DOT_FRM_VERSION], [$DOT_FRM_VERSION],
88
[Version of .frm files])
89
AC_SUBST(SHARED_LIB_MAJOR_VERSION)
90
AC_SUBST(SHARED_LIB_VERSION)
91
AC_SUBST(AVAILABLE_LANGUAGES)
94
AC_DEFINE([IO_SIZE], [4096], [Io buffer size; Must be a power of 2 and
95
a multiple of 512. May be
96
smaller what the disk page size. This influences the speed of the
97
isam btree library. eg to big to slow.])
98
AC_DEFINE([SC_MAXWIDTH],[256], [Max width of screen (for error messages)])
99
AC_DEFINE([FN_LEN],[256 ], [Max file name len ])
100
AC_DEFINE([FN_HEADLEN],[253], [Max length of filepart of file name ])
101
AC_DEFINE([FN_EXTLEN],[20], [Max length of extension (part of FN_LEN) ])
102
AC_DEFINE([FN_REFLEN],[512], [Max length of full path-name ])
103
AC_DEFINE([FN_EXTCHAR],['.'], [File extension character])
104
AC_DEFINE([FN_HOMELIB],['~'], [~/ is used as abbrev for home dir ])
105
AC_DEFINE([FN_CURLIB],['.'], [./ is used as abbrev for current dir ])
106
AC_DEFINE([FN_PARENTDIR],[".."], [Parent directory; Must be a string ])
108
AC_DEFINE([MASTER],[1],[Compile without unireg])
110
AH_VERBATIM([QUOTE_ARG],[
111
/* Quote argument (before cpp) */
113
# define QUOTE_ARG(x) #x
115
/* Quote argument, (after cpp) */
116
#ifndef STRINGIFY_ARG
117
# define STRINGIFY_ARG(x) QUOTE_ARG(x)
121
AH_VERBATIM([builtin_expect],[
123
* The macros below are borrowed from include/linux/compiler.h in the
124
* Linux kernel. Use them to indicate the likelyhood of the truthfulness
125
* of a condition. This serves two purposes - newer versions of gcc will be
126
* able to optimize for branch predication, which could yield siginficant
127
* performance gains in frequently executed sections of the code, and the
128
* other reason to use them is for documentation
130
#if !defined(__GNUC__)
131
#define __builtin_expect(x, expected_value) (x)
134
#define likely(x) __builtin_expect((x),1)
135
#define unlikely(x) __builtin_expect((x),0)
138
dnl InnoDB depends on some Drizzle's internals which other plugins should not
139
dnl need. This is because of InnoDB's foreign key support, "safe" binlog
140
dnl truncation, and other similar legacy features.
142
dnl We define accessors for these internals unconditionally, but do not
143
dnl expose them in mysql/plugin.h. They are declared in ha_innodb.h for
146
AC_DEFINE([INNODB_COMPATIBILITY_HOOKS],[1],[TODO: Remove the need for this])
147
dnl TODO: Make a test for when this needs to be set.
148
AC_DEFINE([_REENTRANT],[1],[Some thread libraries require this])
150
AH_VERBATIM([posix_pthread],[
151
/* We want posix threads */
152
#ifndef _POSIX_PTHREAD_SEMANTICS
153
#define _POSIX_PTHREAD_SEMANTICS
158
# Canonicalize the configuration name.
160
# Check whether --with-system-type or --without-system-type was given.
161
AC_ARG_WITH([system-type],
162
[AS_HELP_STRING([--with-system-type],
163
[Set the system type, like "sun-solaris10"])],
164
[SYSTEM_TYPE="$withval"],
165
[SYSTEM_TYPE="$host_vendor-$host_os"])
166
AC_ARG_WITH([machine-type],
167
[AS_HELP_STRING([--with-machine-type],
168
[Set the machine type, like "powerpc"])],
169
[MACHINE_TYPE="$withval"],
170
[MACHINE_TYPE="$host_cpu"])
171
AC_SUBST(SYSTEM_TYPE)
172
AC_DEFINE_UNQUOTED([SYSTEM_TYPE], ["$SYSTEM_TYPE"],
173
[Name of system, eg sun-solaris])
174
AC_SUBST(MACHINE_TYPE)
175
AC_DEFINE_UNQUOTED([MACHINE_TYPE], ["$MACHINE_TYPE"],
176
[Machine type name, eg sparc])
178
# Detect intel x86 like processor
179
BASE_MACHINE_TYPE=$MACHINE_TYPE
180
case $MACHINE_TYPE in
181
i?86) BASE_MACHINE_TYPE=i386 ;;
185
# This is needed is SUBDIRS is set
188
##############################################################################
189
# The below section needs to be done before AC_PROG_CC
190
##############################################################################
192
if test "x${CFLAGS-}" = x ; then
198
if test "x${CPPFLAGS-}" = x ; then
204
if test "x${LDFLAGS-}" = x ; then
210
################ End of section to be done before AC_PROG_CC #################
212
dnl Checks for programs.
214
ifdef([AC_PROG_CC_C99],[
215
dnl TODO: Need to fix this to use c99 instead of gnu99
216
AC_PROG_CC_C99([],[AC_MSG_ERROR([C99 support required for compiling Drizzle])])
218
],[C99_SUPPORT_HACK="-std=gnu99"])
220
AC_CXX_HEADER_STDCXX_98
221
if test "$ac_cv_cxx_stdcxx_98" = "no"
223
AC_MSG_ERROR([C++ Compiler required to compile Drizzle])
233
# Print version of CC and CXX compiler (if they support --version)
236
AC_DEFINE([TARGET_OS_OSX], [1], [Whether we build for OSX])
239
CC_VERSION=`$CC --version | sed 1q`
244
AC_MSG_CHECKING("C Compiler version")
245
AC_MSG_RESULT("$CC $CC_VERSION")
251
dnl AC_CANONICAL_HOST thinks it's a good idea to just set CFLAGS to
252
dnl -g -O2 if you're running gcc. We would like to use something else, thanks.
253
if test "x${CFLAGS}" = "x-g -O2"
257
if test "x${CXXFLAGS}" = "x-g -O2"
262
DRIZZLE_CHECK_CXX_VERSION
266
if test "$ac_cv_c_compiler_gnu" = "yes"
271
AC_PATH_PROG(AS, as, as)
274
dnl TODO: This needs to go away and be replaced with _ISOC99_SOURCE
275
if test "$ac_cv_compiler_gnu" = "yes" -o "$target_os" = "linux-gnu"
277
AC_DEFINE([_GNU_SOURCE],[1],[Fix problem with S_ISLNK() on Linux])
280
dnl Solaris 9 include file <sys/feature_tests.h> refers to X/Open document
282
dnl System Interfaces and Headers, Issue 5
284
dnl saying we should define _XOPEN_SOURCE=500 to get POSIX.1c prototypes,
285
dnl but apparently other systems (namely FreeBSD) don't agree.
287
dnl On a newer Solaris 10, the above file recognizes also _XOPEN_SOURCE=600.
288
dnl Furthermore, it tests that if a program requires older standard
289
dnl (_XOPEN_SOURCE<600 or _POSIX_C_SOURCE<200112L) it cannot be
290
dnl run on a new compiler (that defines _STDC_C99) and issues an #error.
291
dnl It's also an #error if a program requires new standard (_XOPEN_SOURCE=600
292
dnl or _POSIX_C_SOURCE=200112L) and a compiler does not define _STDC_C99.
294
dnl To add more to this mess, Sun Studio C compiler defines _STDC_C99 while
295
dnl C++ compiler does not!
297
dnl TODO: Can _ISOC99_SOURCE be defined on all platforms and remove the
298
dnl Need for all of this?
301
dnl Do we need both of these?
302
CXXFLAGS="${CXXFLAGS} -D__C99FEATURES__"
303
CFLAGS="${CFLAGS} -D_XOPEN_SOURCE=600"
304
AC_DEFINE([__EXTENSIONS__],[1],[Turn on needed extensions on Solaris])
310
#AC_LIBTOOL_WIN32_DLL
313
# Ensure that we have --preserve-dup-deps defines, otherwise we get link
314
# problems of 'mysql' with CXX=g++
315
LIBTOOL="$LIBTOOL --preserve-dup-deps"
321
test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
323
# Not critical since the generated file is distributed
324
AC_CHECK_PROGS(YACC, ['bison -y -p MYSQL'])
325
if test -z "$YACC" && test -d ".bzr"
327
AC_MSG_ERROR(["bison is required for Drizzle to build from a bzr branch"])
330
AC_PATH_PROG(uname_prog, uname, no)
332
# We should go through this and put all the explictly system dependent
334
AC_MSG_CHECKING(operating system)
335
AC_CACHE_VAL(mysql_cv_sys_os,
337
if test "$uname_prog" != "no"; then
338
mysql_cv_sys_os="`uname`"
340
mysql_cv_sys_os="Not Solaris"
343
AC_MSG_RESULT($mysql_cv_sys_os)
345
# This should be rewritten to use $target_os
348
TARGET_SOLARIS="true"
349
AC_DEFINE([TARGET_OS_SOLARIS], [1], [Whether we are building for Solaris])
350
AC_SUBST(TARGET_SOLARIS)
354
# The following is required for portable results of floating point calculations
355
# on PowerPC. The same must also be done for IA-64, but this options is missing
356
# in the IA-64 gcc backend.
358
if test "$GCC" = "yes"
362
AM_CFLAGS="$CFLAGS -mno-fused-madd"
363
AM_CXXFLAGS="$CXXFLAGS -mno-fused-madd"
374
AC_SUBST(INSTALL_SCRIPT)
377
export CC CXX CFLAGS LD LDFLAGS AR ARFLAGS
379
if test "$GCC" = "yes"
381
# Disable exceptions as they seams to create problems with gcc and threads.
382
# drizzled doesn't use run-time-type-checking, so we disable it.
383
AM_CXXFLAGS="${AM_CXXFLAGS} -fno-exceptions"
44
388
# libdrizzle versioning when linked with GNU ld.
45
AS_IF([test "$lt_cv_prog_gnu_ld" = "yes"],[
389
if $LD --version 2>/dev/null|grep -q GNU; then
46
390
LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_srcdir)/libdrizzle/libdrizzle.ver"
48
392
AC_SUBST(LD_VERSION_SCRIPT)
51
dnl Set the default datadir location to /usr/local/var/drizzle. If a
52
dnl localstatedir is explicitly given, just use that.
53
AS_IF([test "x${localstatedir}" = 'x${prefix}/var'],[
54
localstatedir='${prefix}/var/drizzle'
57
AC_PATH_PROG(GPERF, gperf)
58
AS_IF([test "x$GPERF" = "x"],
59
AC_MSG_ERROR("Drizzle requires gperf to build."))
61
AC_CHECK_PROGS(YACC, ['bison -y'])
62
AS_IF([test "x$YACC" = "x" -a "$pandora_building_from_bzr" = "yes"],[
63
AC_MSG_ERROR(["bison is required for Drizzle to build from a bzr branch"])
66
# libexecinfo provides backtrace_symbols on FreeBSD
67
AC_SEARCH_LIBS(backtrace_symbols, [execinfo])
71
PANDORA_REQUIRE_LIBPROTOBUF
72
PANDORA_PROTOBUF_REQUIRE_VERSION([2.1.0])
73
PANDORA_REQUIRE_PROTOC
76
PANDORA_REQUIRE_PTHREAD
77
PANDORA_REQUIRE_LIBUUID
79
PANDORA_REQUIRE_LIBPCRE
80
PANDORA_REQUIRE_LIBREADLINE
84
DRIZZLE_STACK_DIRECTION
86
PANDORA_USE_BETTER_MALLOC
89
AC_DEFINE([BUILDING_DRIZZLED],[1],
90
[Define indicating we are building and not consuming drizzle.])
93
PANDORA_HAVE_LIBSQLITE3
95
AC_CHECK_FUNC(inet_ntoa, [], [AC_CHECK_LIB(nsl, inet_ntoa)])
394
#--------------------------------------------------------------------
395
# Check for Google Proto Buffers
396
#--------------------------------------------------------------------
399
AC_CHECK_HEADERS([google/protobuf/message.h])
400
if test "x$ac_cv_header_google_protobuf_message_h" != "xyes"
402
AC_MSG_ERROR([Couldn't find message.h. Try installing Google Protocol Buffer development packages])
405
save_CFLAGS="$CFLAGS"
410
AC_CACHE_CHECK([for Message in libprotobuf], ac_libprotobuf_works, [
412
#include <google/protobuf/descriptor.pb.h>
414
google::protobuf::FileDescriptorProto testFdp;
415
], ac_libprotobuf_works=yes, [
416
AC_ERROR([could not find Google's libprotobuf])
421
PROTOBUF_LIBS="${LIBS}"
422
AC_SUBST(PROTOBUF_LIBS)
423
CFLAGS="$save_CFLAGS"
427
#--------------------------------------------------------------------
429
#--------------------------------------------------------------------
431
AC_MSG_CHECKING(for libevent)
432
AC_ARG_WITH(libevent,
433
[AS_HELP_STRING([--with-libevent],
434
[Use libevent build directory])],
435
[ with_libevent=$withval ],
436
[ with_libevent=yes ])
438
if test "$with_libevent" = "yes"
440
AC_CHECK_HEADERS(event.h)
441
if test "x$ac_cv_header_event_h" != "xyes"
443
AC_MSG_ERROR([Couldn't find event.h. Try installing libevent development packages])
447
AC_CHECK_LIB(event, event_loop, [], [AC_MSG_ERROR(could not find libevent)])
448
LIBEVENT_LIBS="${LIBS}"
449
LIBS="${my_save_LIBS}"
452
AC_MSG_RESULT($withval)
453
if test -f $withval/event.h -a -f $withval/libevent.a; then
455
if cd $withval; then withval=`pwd`; cd $owd; fi
456
LIBEVENT_CFLAGS="-I$withval"
457
LIBEVENT_LIBS="-L$withval -levent"
458
elif test -f $withval/include/event.h -a -f $withval/lib/libevent.a; then
460
if cd $withval; then withval=`pwd`; cd $owd; fi
461
LIBEVENT_CFLAGS="-I$withval/include"
462
LIBEVENT_LIBS="-L$withval/lib -levent"
464
AC_MSG_ERROR([event.h or libevent.a not found in $withval])
468
AC_SUBST(LIBEVENT_CFLAGS)
469
AC_SUBST(LIBEVENT_LIBS)
471
AC_CACHE_CHECK([for bufferevent in libevent], ac_libevent_works, [
472
save_CFLAGS="$CFLAGS"
474
CFLAGS="$LIBEVENT_CFLAGS"
475
LIBS="$LIBEVENT_LIBS"
477
#include <sys/types.h>
478
#include <sys/time.h>
480
#include <event.h>],[
481
struct bufferevent bev;
482
bufferevent_settimeout(&bev, 1, 1);
483
], ac_libevent_works=yes, [
484
AC_ERROR([you need to install a more recent version of libevent,
485
check http://www.monkey.org/~provos/libevent/])
488
CFLAGS="$save_CFLAGS"
493
#--------------------------------------------------------------------
494
# Check for libpthread
495
#--------------------------------------------------------------------
497
AC_CHECK_HEADERS(pthread.h)
498
if test "x$ac_cv_header_pthread_h" != "xyes"
500
AC_MSG_ERROR([Couldn't find pthread.h.])
502
AC_CHECK_LIB(pthread, pthread_create, [], [AC_MSG_ERROR(could not find libpthread)])
504
#--------------------------------------------------------------------
506
#--------------------------------------------------------------------
508
AC_ARG_ENABLE([tcmalloc],
509
[AS_HELP_STRING([--enable-tcmalloc],
510
[Enable linking with tcmalloc @<:@default=off@:>@])],
511
[ac_enable_tcmalloc="$enableval"],
512
[ac_enable_tcmalloc="no"])
514
if test "x$ac_enable_tcmalloc" = "xyes"
516
AC_CHECK_LIB(tcmalloc,malloc,[],[])
519
#--------------------------------------------------------------------
521
#--------------------------------------------------------------------
525
AC_CHECK_HEADERS(zlib.h)
526
if test "x$ac_cv_header_zlib_h" != "xyes"
528
AC_MSG_ERROR([Couldn't find zlib.h. Try installing zlib development packages])
530
AC_CHECK_LIB(z, crc32, [], [AC_MSG_ERROR(could not find libz)])
536
#--------------------------------------------------------------------
537
# Check for libreadline or compatible (libedit on Mac OS X)
538
#--------------------------------------------------------------------
540
AC_CHECK_HEADERS(readline/history.h readline/readline.h)
541
if test "x$ac_cv_header_readline_readline_h" != "xyes"
543
AC_MSG_ERROR([Couldn't find readline/readline.h. Try installing readline development packages.])
545
AC_CHECK_TYPES([HIST_ENTRY], [], [], [AC_INCLUDES_DEFAULT[
546
#ifdef HAVE_READLINE_HISTORY_H
547
#include <readline/history.h>
549
#include <readline/readline.h>
551
AC_CHECK_DECLS([completion_matches], [], [], [AC_INCLUDES_DEFAULT[
552
#ifdef HAVE_READLINE_HISTORY_H
553
#include <readline/history.h>
555
#include <readline/readline.h>
558
DRIZZLE_CHECK_NEW_RL_INTERFACE
562
AC_CHECK_LIB(readline, rl_initialize, [],
563
[AC_CHECK_LIB(ncurses, tgetent, [], [AC_MSG_ERROR(Couldn't find ncurses)])
564
AC_SEARCH_LIBS(rl_initialize, readline, [],
565
[AC_MSG_ERROR(Couldn't find libreadline.)])])
566
READLINE_LIBS="$LIBS"
568
AC_SUBST(READLINE_LIBS)
571
#--------------------------------------------------------------------
573
#--------------------------------------------------------------------
576
AC_PATH_PROG(PKG_CONFIG, pkg-config, AC_MSG_ERROR([pkg-config wasn't found.]))
577
PKG_CHECK_MODULES(PCRE, [libpcrecpp >= 3], [found_pcre="yes"],[found_pcre="no"])
579
if test "$found_pcre" = "no"
581
dnl Only check the header here, because autoconf can't handle
582
dnl checking for C++ methods without C linkages
583
AC_CHECK_HEADERS(pcrecpp.h)
584
if test "x$ac_cv_header_pcrecpp_h" != "xyes"
586
AC_MSG_ERROR([Couldn't find pcrecpp.h. Try installing the development package associated with libpcre on your system.])
588
# Found headers, now see if we can link
589
AC_MSG_CHECKING(for libpcrecpp)
590
save_LDFLAGS="$LDFLAGS"
591
LDFLAGS="-lpcrecpp -lpcre"
595
[pcrecpp::RE_Options opt;],
597
[AC_MSG_ERROR([Couldn't link libpcrecpp])])
600
LDFLAGS="$save_LDFLAGS"
606
AC_SUBST(PCRE_CFLAGS)
608
dnl Find paths to some shell programs
609
AC_PATH_PROG(LN, ln, ln)
610
# This must be able to take a -f flag like normal unix ln.
611
AC_PATH_PROG(LN_CP_F, ln, ln)
613
AC_PATH_PROG(MV, mv, mv)
614
AC_PATH_PROG(RM, rm, rm)
615
AC_PATH_PROG(CP, cp, cp)
616
AC_PATH_PROG(SED, sed, sed)
617
AC_PATH_PROG(CMP, cmp, cmp)
618
AC_PATH_PROG(CHMOD, chmod, chmod)
619
AC_PATH_PROG(HOSTNAME, hostname, hostname)
620
# Check for a GNU tar named 'gtar', or 'gnutar' (MacOS X) and
621
# fall back to 'tar' otherwise and hope that it's a GNU tar as well
622
AC_CHECK_PROGS(TAR, gnutar gtar tar)
624
dnl We use a path for perl so the script startup works
625
dnl We make sure to use perl, not perl5, in hopes that the RPMs will
626
dnl not depend on the perl5 binary being installed (probably a bug in RPM)
627
AC_PATH_PROG(PERL, perl, no)
628
if test "$PERL" != "no" && $PERL -e 'require 5' > /dev/null 2>&1
632
AC_PATH_PROG(PERL5, perl5, no)
633
if test "$PERL5" != no
636
ac_cv_path_PERL=$ac_cv_path_PERL5
644
# icheck, used for ABI check
645
AC_PATH_PROG(ICHECK, icheck, no)
646
# "icheck" is also the name of a file system check program on Tru64.
647
# Verify the program found is really the interface checker.
648
if test "x$ICHECK" != "xno"
650
AC_MSG_CHECKING(if $ICHECK works as expected)
651
echo "int foo;" > conftest.h
652
$ICHECK --canonify -o conftest.ic conftest.h 2>/dev/null
653
if test -f "conftest.ic"
660
rm -f conftest.ic conftest.h
665
AC_PATH_PROG(PS, ps, ps)
666
AC_MSG_CHECKING("how to check if pid exists")
669
if $PS p $$ 2> /dev/null | grep `echo $0 | sed s/\-//` > /dev/null
671
FIND_PROC="$PS p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
673
elif $PS -fp $$ 2> /dev/null | grep $0 > /dev/null
675
FIND_PROC="$PS -p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
677
elif $PS -uaxww 2> /dev/null | grep $0 > /dev/null
679
FIND_PROC="$PS -uaxww | grep -v grep | grep \$\$MYSQLD | grep \" \$\$PID \" > /dev/null"
681
elif $PS -ef 2> /dev/null | grep $0 > /dev/null
683
FIND_PROC="$PS -ef | grep -v grep | grep \$\$MYSQLD | grep \" \$\$PID \" > /dev/null"
684
# Do anybody use this?
685
elif $PS $$ 2> /dev/null | grep $0 > /dev/null
687
FIND_PROC="$PS \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
690
*freebsd*|*dragonfly*|*cygwin*)
691
FIND_PROC="$PS p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
694
FIND_PROC="$PS -uaxww | grep -v grep | grep \$\$MYSQLD | grep \" \$\$PID \" > /dev/null"
697
AC_MSG_ERROR([Could not find the right ps switches. Which OS is this ?. See the Installation chapter in the Reference Manual.])
702
AC_MSG_RESULT("$FIND_PROC")
704
# Check if a pid is valid
705
AC_PATH_PROG(KILL, kill, kill)
706
AC_MSG_CHECKING("for kill switches")
707
if $ac_cv_path_KILL -0 $$
709
CHECK_PID="$ac_cv_path_KILL -0 \$\$PID > /dev/null 2> /dev/null"
712
CHECK_PID="$ac_cv_path_KILL -s 0 \$\$PID > /dev/null 2> /dev/null"
714
AC_MSG_WARN([kill -0 to check for pid seems to fail])
715
CHECK_PID="$ac_cv_path_KILL -s SIGCONT \$\$PID > /dev/null 2> /dev/null"
718
AC_MSG_RESULT("$CHECK_PID")
720
# We need an ANSI C compiler
723
# We need an assembler, too
725
CCASFLAGS="$CCASFLAGS $ASFLAGS"
727
# Check if we need noexec stack for assembler
730
if test "$am_cv_prog_cc_stdc" = "no"
732
AC_MSG_ERROR([Drizzle requires an ANSI C compiler (and a C++ compiler). Try gcc. See the Installation chapter in the Reference Manual.])
98
736
AC_ARG_WITH([server-suffix],
99
737
[AS_HELP_STRING([--with-server-suffix],
100
738
[Append value to the version string.])],
101
[ DRIZZLE_SERVER_SUFFIX="$withval" ]
102
[ DRIZZLE_SERVER_SUFFIX= ])
104
AC_DEFINE_UNQUOTED([DRIZZLE_SERVER_SUFFIX],[$DRIZZLE_SERVER_SUFFIX],
105
[Append value to the version string])
108
AC_ARG_WITH([drizzled-user],
109
[AS_HELP_STRING([--with-drizzled-user=username],
110
[What user the drizzled daemon shall be run as.
111
@<:@default=drizzle@:>@])],
112
[ DRIZZLED_USER="$withval" ],
113
[ DRIZZLED_USER=drizzle ])
114
AC_SUBST(DRIZZLED_USER)
739
[ DRIZZLE_SERVER_SUFFIX=`echo "$withval" | sed -e 's/^\(...................................\)..*$/\1/'` ],
740
[ DRIZZLE_SERVER_SUFFIX= ]
742
AC_SUBST(DRIZZLE_SERVER_SUFFIX)
744
# Force use of a curses libs
745
AC_ARG_WITH([named-curses-libs],
746
[AS_HELP_STRING([--with-named-curses-libs=ARG],
747
[Use specified curses libraries instead of those
748
automatically found by configure.])],
749
[ with_named_curses=$withval ],
750
[ with_named_curses=no ]
753
AC_ARG_WITH([tcp-port],
754
[AS_HELP_STRING([--with-tcp-port=port-number],
755
[Which port to use for Drizzle services @<:@default=4427@:>@])],
756
[ DRIZZLE_TCP_PORT=$withval ],
757
[ DRIZZLE_TCP_PORT=$DRIZZLE_TCP_PORT_DEFAULT
758
# if we actually defaulted (as opposed to the pathological case of
759
# --with-tcp-port=<DRIZZLE_TCP_PORT_DEFAULT> which might in theory
760
# happen if whole batch of servers was built from a script), set
761
# the default to zero to indicate that; we don't lose information
762
# that way, because 0 obviously indicates that we can get the
763
# default value from DRIZZLE_TCP_PORT. this seems really evil, but
764
# testing for DRIZZLE_TCP_PORT==DRIZZLE_TCP_PORT_DEFAULT would make a
765
# a port of DRIZZLE_TCP_PORT_DEFAULT magic even if the builder did not
766
# intend it to mean "use the default, in fact, look up a good default
767
# from /etc/services if you can", but really, really meant 4427 when
768
# they passed in 4427. When they pass in a specific value, let them
769
# have it; don't second guess user and think we know better, this will
770
# just make people cross. this makes the the logic work like this
771
# (which is complicated enough):
773
# - if a port was set during build, use that as a default.
775
# - otherwise, try to look up a port in /etc/services; if that fails,
776
# use DRIZZLE_TCP_PORT_DEFAULT (at the time of this writing 4427)
778
# - allow the DRIZZLE_TCP_PORT environment variable to override that.
780
# - allow command-line parameters to override all of the above.
782
# the top-most DRIZZLE_TCP_PORT_DEFAULT is read from win/configure.js,
783
# so don't mess with that.
784
DRIZZLE_TCP_PORT_DEFAULT=0 ]
786
AC_SUBST(DRIZZLE_TCP_PORT)
787
# We might want to document the assigned port in the manual.
788
AC_SUBST(DRIZZLE_TCP_PORT_DEFAULT)
790
# Use this to set the place used for unix socket used to local communication.
791
AC_ARG_WITH([mysqld-user],
792
[AS_HELP_STRING([--with-mysqld-user=username],
793
[What user the mysqld daemon shall be run as.
794
@<:@default=mysql@:>@])],
795
[ MYSQLD_USER=$withval ],
796
[ MYSQLD_USER=mysql ]
798
AC_SUBST(MYSQLD_USER)
800
# If we should allow LOAD DATA LOCAL
801
AC_MSG_CHECKING(If we should should enable LOAD DATA LOCAL by default)
802
AC_ARG_ENABLE(local-infile,
803
[ --enable-local-infile Enable LOAD DATA LOCAL INFILE (default: disabled)],
804
[ ENABLED_LOCAL_INFILE=$enableval ],
805
[ ENABLED_LOCAL_INFILE=no ]
807
if test "$ENABLED_LOCAL_INFILE" = "yes"
810
AC_DEFINE([ENABLED_LOCAL_INFILE], [1],
811
[If LOAD DATA LOCAL INFILE should be enabled by default])
819
# Types that must be checked AFTER large file support is checked
822
#--------------------------------------------------------------------
823
# Check for system header files
824
#--------------------------------------------------------------------
830
AC_CHECK_HEADERS(fcntl.h float.h fpu_control.h ieeefp.h)
831
AC_CHECK_HEADERS(limits.h pwd.h select.h linux/config.h)
832
AC_CHECK_HEADERS(sys/fpu.h utime.h sys/utime.h )
833
AC_CHECK_HEADERS(synch.h sys/mman.h sys/socket.h netinet/in.h arpa/inet.h)
834
AC_CHECK_HEADERS(sys/timeb.h sys/vadvise.h sys/wait.h term.h)
835
AC_CHECK_HEADERS(termio.h termios.h sched.h alloca.h)
836
AC_CHECK_HEADERS(sys/ioctl.h malloc.h sys/malloc.h sys/ipc.h sys/shm.h)
837
AC_CHECK_HEADERS(sys/prctl.h sys/resource.h sys/param.h port.h ieeefp.h)
838
AC_CHECK_HEADERS(execinfo.h)
840
AC_CHECK_HEADERS([xfs/xfs.h])
842
#--------------------------------------------------------------------
843
# Check for system libraries. Adds the library to $LIBS
844
# and defines HAVE_LIBM etc
845
#--------------------------------------------------------------------
847
AC_CHECK_LIB(m, floor, [], AC_CHECK_LIB(m, __infinity))
849
AC_CHECK_FUNC(setsockopt, [], [AC_CHECK_LIB(socket, setsockopt)])
850
AC_CHECK_FUNC(yp_get_default_domain, [],
851
[AC_CHECK_LIB(nsl, yp_get_default_domain)])
852
AC_CHECK_FUNC(p2open, [], [AC_CHECK_LIB(gen, p2open)])
853
# This may get things to compile even if bind-8 is installed
854
AC_CHECK_FUNC(bind, [], [AC_CHECK_LIB(bind, bind)])
855
# Check if crypt() exists in libc or libcrypt, sets LIBS if needed
856
AC_SEARCH_LIBS(crypt, crypt, AC_DEFINE(HAVE_CRYPT, 1, [crypt]))
858
# Check rt for aio_read
859
AC_CHECK_LIB(rt, aio_read)
861
# For the sched_yield() function on Solaris
862
AC_CHECK_FUNC(sched_yield, [],
863
[AC_CHECK_LIB(posix4, [sched_yield],
864
[AC_DEFINE(HAVE_SCHED_YIELD) LIBS="$LIBS -lposix4"])])
866
if test "$ac_cv_header_termio_h" = "no" -a "$ac_cv_header_termios_h" = "no"
868
AC_CHECK_FUNC(gtty, [], [AC_CHECK_LIB(compat, gtty)])
871
AC_CHECK_TYPES([fp_except], [], [], [
872
#include <sys/types.h>
878
AC_CHECK_LIB(dl,dlopen)
879
AC_CHECK_FUNCS(dlopen dlerror)
880
if test "$ac_cv_func_dlopen" != "yes"
882
AC_MSG_ERROR([Drizzle requires dlopen])
888
AC_CHECK_FUNCS(strtok_r)
892
AC_ARG_WITH([fast-mutexes],
893
[AS_HELP_STRING([--with-fast-mutexes],
894
[Compile with fast mutexes @<:@default=off@:>@])],
895
[with_fast_mutexes=$withval],
896
[with_fast_mutexes=no])
898
if test "$with_fast_mutexes" != "no"
900
AC_DEFINE([MY_PTHREAD_FASTMUTEX], [1],
901
[Define to 1 if you want to use fast mutexes])
904
AM_CONDITIONAL(BUILD_FAST_MUTEX,[test "$with_fast_mutexes" != "no"])
117
906
AC_ARG_WITH([comment],
118
907
[AS_HELP_STRING([--with-comment],
119
908
[Comment about compilation environment. @<:@default=off@:>@])],
120
909
[with_comment=$withval],
121
910
[with_comment=no])
122
AS_IF([test "$with_comment" != "no"],[
911
if test "$with_comment" != "no"
123
913
COMPILATION_COMMENT=$with_comment
125
COMPILATION_COMMENT="Source distribution (${PANDORA_RELEASE_COMMENT})"
915
COMPILATION_COMMENT="Source distribution"
917
AC_SUBST(COMPILATION_COMMENT)
919
if expr "$target_os" : "[[Ll]]inux.*" > /dev/null
922
AC_DEFINE([TARGET_OS_LINUX], [1], [Whether we build for Linux])
927
dnl Checks for typedefs, structures, and compiler characteristics.
933
# off_t is not a builtin type
934
AC_CHECK_SIZEOF(off_t, 4)
935
if test "$ac_cv_sizeof_off_t" -eq 0
937
AC_MSG_ERROR("Drizzle needs a off_t type.")
941
dnl check if time_t is unsigned
947
# This always gives a warning. Ignore it unless you are cross compiling
949
#---START: Used in for client configure
950
# Check base type of last arg to accept
953
# Figure out what type of struct rlimit to use with setrlimit
954
DRIZZLE_TYPE_STRUCT_RLIMIT
955
# Find where the stack goes
956
DRIZZLE_STACK_DIRECTION
957
# We want to skip alloca on irix unconditionally. It may work on some version..
959
# Do struct timespec have members tv_sec or ts_sec
961
# Do we have the tzname variable
963
# Do the c++ compiler have a bool type
965
AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>])
966
AC_CHECK_TYPES([size_t], [], [], [#include <stdio.h>])
968
DRIZZLE_PTHREAD_YIELD
971
dnl Checks for header files.
972
AC_CHECK_HEADERS(malloc.h sys/cdefs.h)
974
dnl Checks for library functions.
976
AC_PROG_GCC_TRADITIONAL
978
AC_CHECK_FUNCS(re_comp regcomp strdup)
980
dnl Sun compilers have their own vis.h that is about something
981
dnl totally different. So, not to change the libedit source, we
982
dnl do some additional checks before we define HAVE_VIS_H.
983
AC_CHECK_HEADER(vis.h,
984
[AC_CHECK_FUNC(strvis,
985
[AC_DEFINE([HAVE_VIS_H], [1],[Found vis.h and the strvis() function])])])
987
AC_CHECK_FUNCS(strlcat strlcpy)
988
AC_CHECK_FUNCS(issetugid)
989
AC_CHECK_FUNCS(getline flockfile)
991
# from old readline settting:
996
# Already-done: stdlib.h string.h unistd.h termios.h
997
AC_CHECK_HEADERS(stdarg.h dirent.h locale.h ndir.h sys/dir.h \
998
sys/file.h sys/ndir.h sys/ptem.h sys/pte.h sys/select.h sys/stream.h \
999
sys/mman.h curses.h termcap.h termio.h termbits.h asm/termbits.h grp.h \
1000
paths.h semaphore.h)
1002
# Already-done: strcasecmp
1003
AC_CHECK_FUNCS(lstat putenv select setenv setlocale strcoll tcgetattr)
1006
DRIZZLE_SIGNAL_CHECK
1007
DRIZZLE_CHECK_GETPW_FUNCS
1008
DRIZZLE_HAVE_TIOCGWINSZ
1009
DRIZZLE_HAVE_FIONREAD
1010
DRIZZLE_HAVE_TIOCSTAT
1011
DRIZZLE_STRUCT_DIRENT_D_INO
1012
DRIZZLE_STRUCT_DIRENT_D_NAMLEN
1013
DRIZZLE_TYPE_SIGHANDLER
1014
DRIZZLE_CHECK_MULTIBYTE
1015
if test "$with_named_curses" = "no"
1017
DRIZZLE_CHECK_LIB_TERMCAP
1019
TERMCAP_LIBS="$with_named_curses"
1021
AC_SUBST(TERMCAP_LIBS)
1023
# Check if the termcap function 'tgoto' is already declared in
1024
# system header files or if it need to be declared locally
1025
AC_CHECK_DECLS(tgoto,,,[
1026
#ifdef HAVE_CURSES_H
1027
# include <curses.h>
1028
#elif HAVE_NCURSES_H
1029
# include <ncurses.h>
127
AC_DEFINE_UNQUOTED([COMPILATION_COMMENT],["$COMPILATION_COMMENT"],
128
[Comment about compilation environment])
1036
# End of readline/libedit stuff
131
1037
#########################################################################
134
dnl Has to be done late, as the plugin may need to check for existence of
135
dnl functions tested above
136
PANDORA_PLUGINS([drizzled/module/load_list.h])
1039
dnl Checks for library functions.
1042
# The following code disables intrinsic function support while we test for
1043
# library functions. This is to avoid configure problems with Intel ecc
1046
ORG_CFLAGS="$CFLAGS"
1047
if test "$GCC" != "yes"; then
1048
AC_SYS_COMPILER_FLAG(-nolib_inline,nolib_inline,CFLAGS,[],[])
1057
AC_CHECK_FUNCS(fcntl)
1058
if test "x$ac_cv_func_fcntl" != "xyes"
1060
AC_MSG_ERROR("Drizzle requires fcntl.")
1063
AC_CONFIG_LIBOBJ_DIR([mystrings])
1065
AC_CHECK_FUNCS(bsearch \
1067
fdatasync finite fpresetsticky fpsetmask fsync ftruncate \
1068
getcwd getpassphrase getpwnam \
1069
getpwuid getrlimit getrusage getwd index initgroups isnan \
1070
localtime_r gethrtime gmtime_r \
1071
locking longjmp lrand48 madvise mallinfo \
1073
mkstemp mlockall perror poll pread pthread_attr_create mmap mmap64 \
1074
pthread_attr_getstacksize pthread_attr_setprio pthread_attr_setschedparam \
1075
pthread_attr_setstacksize pthread_condattr_create pthread_getsequence_np \
1076
pthread_key_delete pthread_rwlock_rdlock pthread_setprio \
1077
pthread_setprio_np pthread_setschedparam pthread_sigmask readlink \
1078
realpath rename rwlock_init setupterm \
1079
shmget shmat shmdt shmctl sigaction sigemptyset sigaddset \
1080
sighold sigset sigthreadmask port_create sleep \
1081
snprintf socket strcasecmp strerror strsignal strpbrk \
1082
tell tempnam vidattr \
1083
posix_fallocate backtrace backtrace_symbols backtrace_symbols_fd)
1086
# Test whether madvise() is declared in C++ code -- it is not on some
1087
# systems, such as Solaris
1088
AC_CHECK_DECLS([madvise], [], [], [AC_INCLUDES_DEFAULT[
1090
#include <sys/types.h>
1091
#include <sys/mman.h>
1097
AM_CONDITIONAL(BUILD_THR_RWLOCK,[test "$ac_cv_func_rwlock_init" -a "$ac_cv_funn_pthread_rwlock_rdlock"])
1099
# Check that isinf() is available in math.h and can be used in both C and C++
1101
AC_MSG_CHECKING(for isinf in math.h)
1102
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]], [[
1108
AC_MSG_CHECKING(whether isinf() can be used in C++ code)
1110
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]], [[
1116
AC_DEFINE(HAVE_ISINF, [1], [isinf() macro or function])
1125
CFLAGS="$ORG_CFLAGS"
1127
# Sanity check: We chould not have any fseeko symbol unless
1128
# large_file_support=yes
1129
AC_CHECK_FUNC(fseeko,
1130
[if test "$large_file_support" = no -a "$TARGET_LINUX" = "true";
1132
AC_MSG_ERROR("Found fseeko symbol but large_file_support is not enabled!")
1136
# Check definition of pthread_getspecific
1137
AC_CACHE_CHECK([args to pthread_getspecific], [mysql_cv_getspecific_args],
1138
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if !defined(_REENTRANT)
1141
#define _POSIX_PTHREAD_SEMANTICS
1142
#include <pthread.h> ]], [[ void *pthread_getspecific(pthread_key_t key);
1143
pthread_getspecific((pthread_key_t) NULL); ]])],
1144
[mysql_cv_getspecific_args=POSIX],
1145
[mysql_cv_getspecific_args=other])])
1146
if test "$mysql_cv_getspecific_args" = "other"
1148
AC_DEFINE([HAVE_NONPOSIX_PTHREAD_GETSPECIFIC], [1],
1149
[For some non posix threads])
1152
# Check definition of pthread_mutex_init
1153
AC_CACHE_CHECK([args to pthread_mutex_init], [mysql_cv_mutex_init_args],
1154
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#define _REENTRANT
1155
#define _POSIX_PTHREAD_SEMANTICS
1156
#include <pthread.h> ]], [[
1157
pthread_mutexattr_t attr;
1159
pthread_mutex_init(&mp,&attr); ]])],
1160
[mysql_cv_mutex_init_args=POSIX],
1161
[mysql_cv_mutex_init_args=other])])
1162
if test "$mysql_cv_mutex_init_args" = "other"
1164
AC_DEFINE([HAVE_NONPOSIX_PTHREAD_MUTEX_INIT], [1],
1165
[For some non posix threads])
1169
#---START: Used in for client configure
1170
# Check definition of readdir_r
1171
AC_CACHE_CHECK([args to readdir_r], [mysql_cv_readdir_r],
1172
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define _REENTRANT
1173
#define _POSIX_PTHREAD_SEMANTICS
1174
#include <pthread.h>
1175
#include <dirent.h>]], [[ int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result);
1176
readdir_r((DIR *) NULL, (struct dirent *) NULL, (struct dirent **) NULL); ]])],
1177
[mysql_cv_readdir_r=POSIX],
1178
[mysql_cv_readdir_r=other])])
1179
if test "$mysql_cv_readdir_r" = "POSIX"
1181
AC_DEFINE([HAVE_READDIR_R], [1], [POSIX readdir_r])
1184
# Check definition of posix sigwait()
1185
AC_CACHE_CHECK([style of sigwait], [mysql_cv_sigwait],
1186
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1188
#define _POSIX_PTHREAD_SEMANTICS
1189
#include <pthread.h>
1198
[mysql_cv_sigwait=POSIX],
1199
[mysql_cv_sigwait=other])])
1200
if test "$mysql_cv_sigwait" = "POSIX"
1202
AC_DEFINE([HAVE_SIGWAIT], [1], [POSIX sigwait])
1205
if test "$mysql_cv_sigwait" != "POSIX"
1207
unset mysql_cv_sigwait
1208
# Check definition of posix sigwait()
1209
AC_CACHE_CHECK([style of sigwait], [mysql_cv_sigwait],
1210
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1212
#define _POSIX_PTHREAD_SEMANTICS
1213
#include <pthread.h>
1220
[mysql_cv_sigwait=NONPOSIX],
1221
[mysql_cv_sigwait=other])])
1222
if test "$mysql_cv_sigwait" = "NONPOSIX"
1224
AC_DEFINE([HAVE_NONPOSIX_SIGWAIT], [1], [sigwait with one argument])
1229
# Check if pthread_attr_setscope() exists
1230
AC_CACHE_CHECK([for pthread_attr_setscope], [mysql_cv_pthread_attr_setscope],
1231
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1233
#define _POSIX_PTHREAD_SEMANTICS
1234
#include <pthread.h>
1236
pthread_attr_t thr_attr;
1237
pthread_attr_setscope(&thr_attr,0);
1239
[mysql_cv_pthread_attr_setscope=yes],
1240
[mysql_cv_pthread_attr_setscope=no])])
1241
if test "$mysql_cv_pthread_attr_setscope" = "yes"
1243
AC_DEFINE([HAVE_PTHREAD_ATTR_SETSCOPE], [1], [pthread_attr_setscope])
1246
# Check for bad includes
1247
AC_MSG_CHECKING("can netinet files be included")
1248
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
1249
#include <sys/socket.h>
1250
#include <netinet/in_systm.h>
1251
#include <netinet/in.h>
1252
#include <netinet/ip.h>
1253
#include <netinet/tcp.h>]], [[ printf("1\n"); ]])],[netinet_inc=yes],[netinet_inc=no])
1254
if test "$netinet_inc" = "no"
1256
AC_DEFINE([HAVE_BROKEN_NETINET_INCLUDES], [1], [Can netinet be included])
1258
AC_MSG_RESULT("$netinet_inc")
1261
AC_CHECK_HEADERS(cxxabi.h)
1262
AC_CACHE_CHECK([checking for abi::__cxa_demangle], mysql_cv_cxa_demangle,
1263
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <cxxabi.h>]], [[
1264
char *foo= 0; int bar= 0;
1265
foo= abi::__cxa_demangle(foo, foo, 0, &bar);
1266
]])],[mysql_cv_cxa_demangle=yes],[mysql_cv_cxa_demangle=no])])
1269
if test "x$mysql_cv_cxa_demangle" = xyes; then
1270
AC_DEFINE(HAVE_ABI_CXA_DEMANGLE, 1,
1271
[Define to 1 if you have the `abi::__cxa_demangle' function.])
1274
#--------------------------------------------------------------------
1275
# Check for requested features
1276
#--------------------------------------------------------------------
1278
DRIZZLE_CHECK_BIG_TABLES
1279
DRIZZLE_CHECK_MAX_INDEXES
1282
#--------------------------------------------------------------------
1283
# Declare our plugin modules
1284
# Has to be done late, as the plugin may need to check for existence of
1285
# functions tested above
1286
#--------------------------------------------------------------------
1288
DRIZZLE_CONFIGURE_PLUGINS([none])
1290
AC_SUBST(mysql_plugin_dirs)
1291
AC_SUBST(mysql_plugin_libs)
1292
AC_SUBST(mysql_plugin_defs)
1294
# Build optimized or debug version ?
1295
# First check for gcc and g++
1296
if test "$ac_cv_c_compiler_gnu" = "yes"
1298
SYMBOLS_CFLAGS="-ggdb3"
1299
DEBUG_OPTIMIZE_CC="-O0"
1300
OPTIMIZE_CFLAGS="-O3"
1303
DEBUG_OPTIMIZE_CC=""
1304
OPTIMIZE_CFLAGS="-O"
1306
if test "$ac_cv_prog_cxx_g" = "yes"
1308
SYMBOLS_CXXFLAGS="-ggdb3"
1309
DEBUG_OPTIMIZE_CXX="-O0"
1310
OPTIMIZE_CXXFLAGS="-O3"
1312
SYMBOLS_CXXFLAGS="-g"
1313
DEBUG_OPTIMIZE_CXX=""
1314
OPTIMIZE_CXXFLAGS="-O"
1317
dnl TODO: Remove this define once we are using 2.61 across the board.
1320
# Check whether to enable assertions.
1321
AC_DEFUN([AX_HEADER_ASSERT],
1323
AC_MSG_CHECKING([whether to enable assertions])
1324
AC_ARG_ENABLE([assert],
1325
[AS_HELP_STRING([--disable-assert],
1326
[Turn off assertions])],
1327
[ac_cv_assert="no"],
1328
[ac_cv_assert="yes"])
1329
AC_MSG_RESULT([$ac_cv_assert])
1334
CFLAGS="${SYMBOLS_CFLAGS} ${CFLAGS}"
1335
CXXFLAGS="${SYMBOLS_CXXFLAGS} ${CXXFLAGS}"
1336
#CXXFLAGS="${SYMBOLS_CXXFLAGS} ${CXXFLAGS} -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
1338
AC_ARG_WITH([debug],
1339
[AS_HELP_STRING([--with-debug],
1340
[Add debug code/turns off optimizations (yes|no) @<:@default=no@:>@])],
1341
[with_debug=$withval],
1343
if test "$with_debug" = "yes"
1346
CFLAGS="$DEBUG_OPTIMIZE_CC $CFLAGS ${SAVE_CFLAGS}"
1347
CXXFLAGS="$DEBUG_OPTIMIZE_CXX $CXXFLAGS ${SAVE_CXXFLAGS}"
1349
# Optimized version. No debug
1350
CFLAGS="${OPTIMIZE_CFLAGS} ${CFLAGS} ${SAVE_CFLAGS}"
1351
CXXFLAGS="$OPTIMIZE_CXXFLAGS $CXXFLAGS ${SAVE_CXXFLAGS}"
1354
AC_ARG_ENABLE([profiling],
1355
[AS_HELP_STRING([--enable-profiling],
1356
[Toggle profiling @<:@default=off@:>@])],
1357
[ac_profiling="$enableval"],
1358
[ac_profiling="no"])
1360
AC_ARG_ENABLE([coverage],
1361
[AS_HELP_STRING([--enable-coverage],
1362
[Toggle coverage @<:@default=off@:>@])],
1363
[ac_coverage="$enableval"],
1366
AC_ARG_ENABLE([pedantic-warnings],
1367
[AS_HELP_STRING([--disable-pedantic-warnings],
1368
[Toggle pedanticness @<:@default=on@:>@])],
1369
[ac_warn_pedantic="$enableval"],
1370
[ac_warn_pedantic="yes"])
1372
AC_ARG_ENABLE([fail],
1373
[AS_HELP_STRING([--disable-fail],
1374
[Turn warnings into failures @<:@default=on@:>@])],
1375
[ac_warn_fail="$enableval"],
1376
[ac_warn_fail="yes"])
1378
AC_ARG_ENABLE([unreachable],
1379
[AS_HELP_STRING([--enable-unreachable],
1380
[Enable warnings about unreachable code @<:@default=off@:>@])],
1381
[ac_warn_unreachable="$enableval"],
1382
[ac_warn_unreachable="no"])
1384
AC_ARG_ENABLE([longlong-warnings],
1385
[AS_HELP_STRING([--enable-longlong-warnings],
1386
[Enable warnings about longlong in C++ @<:@default=off@:>@])],
1387
[ac_warn_longlong="$enableval"],
1388
[ac_warn_longlong="no"])
1390
AC_ARG_ENABLE([strict-aliasing],
1391
[AS_HELP_STRING([--enable-strict-aliasing],
1392
[Enable warnings about stict-aliasing @<:@default=off@:>@])],
1393
[ac_warn_strict_aliasing="$enableval"],
1394
[ac_warn_strict_aliasing="no"])
1397
if test "$GCC" = "yes"
1400
if test "$ac_warn_longlong" = "yes"
1402
W_LONGLONG="-Wlong-long"
1404
W_LONGLONG="-Wno-long-long"
1407
if test "$ac_warn_strict_aliasing" = "yes"
1409
W_STRICT_ALIASING="-Wstrict-aliasing"
1411
W_STRICT_ALIASING="-Wno-strict-aliasing"
1414
if test "$ac_profiling" = "yes"
1416
GPROF_PROFILING="-pg"
1421
if test "$ac_coverage" = "yes"
1423
GPROF_COVERAGE="-fprofile-arcs -ftest-coverage"
1428
if test "$ac_warn_pedantic" = "yes"
1430
GCC_PEDANTIC="-pedantic -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls ${W_STRICT_ALIASING}"
1431
GXX_PEDANTIC="-pedantic -Wundef -Wredundant-decls ${W_LONGLONG} ${W_STRICT_ALIASING}"
1434
if test "$ac_warn_unreachable" = "yes"
1436
W_UNREACHABLE="-Wunreachable-code"
1439
if test "$ac_warn_fail" = "yes"
1444
BASE_WARNINGS="-W -Wall -Wextra"
1445
GCC_WARNINGS="${C99_SUPPORT_HACK} ${BASE_WARNINGS} ${GCC_PEDANTIC} ${W_UNREACHABLE} ${W_FAIL} ${GPROF_PROFILING} ${GPROF_COVERAGE}"
1446
GXX_WARNINGS="${BASE_WARNINGS} ${GXX_PEDANTIC} ${W_UNREACHABLE} ${W_FAIL} ${GPROF_PROFILING} ${GPROF_COVERAGE}"
1448
AM_CXXFLAGS="${GXX_WARNINGS} ${AM_CXXFLAGS}"
1449
AM_CFLAGS="${GCC_WARNINGS} ${AM_CFLAGS}"
1452
AC_SUBST([GLOBAL_CPPFLAGS],['-I$(top_srcdir) -I$(top_builddir)'])
1453
AC_SUBST([AM_CPPFLAGS],['${GLOBAL_CPPFLAGS}'])
1454
AC_SUBST([AM_CFLAGS])
1455
AC_SUBST([AM_CXXFLAGS])
1457
# Some usefull subst
1461
# Set configuration options for make_binary_distribution
1462
case $SYSTEM_TYPE in
1464
MAKE_BINARY_DISTRIBUTION_OPTIONS="$MAKE_BINARY_DISTRIBUTION_OPTIONS --no-strip"
1467
: # no change for other platforms yet
1470
AC_SUBST(MAKE_BINARY_DISTRIBUTION_OPTIONS)
138
1472
dnl GCC Precompiled Header Support
140
dnl AM_CONDITIONAL([BUILD_GCC_PCH],[test "$GCC" = "yes"])
141
AM_CONDITIONAL([BUILD_GCC_PCH],[test "no" = "yes"])
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)
153
scheduling_plugins_available="
158
for sched_plugin in $scheduling_plugins_available
160
varname="\${with_plugin_${sched_plugin}}"
161
result=`eval "echo $varname"`
162
if test "x$result" = "xyes"
164
scheduling_plugins="$sched_plugin $scheduling_plugins"
1473
AM_CONDITIONAL([GCC_PCH],[test "x$GCC" = "xyes"])
1475
AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl
1476
mystrings/Makefile storage/Makefile dnl
1477
vio/Makefile po/Makefile.in dnl
1478
libdrizzle/Makefile client/Makefile dnl
1479
drizzled/Makefile dnl
1480
drizzled/field/Makefile dnl
1481
drizzled/serialize/Makefile dnl
1482
drizzled/functions/Makefile dnl
1483
drizzled/util/Makefile dnl
1484
drizzled/sql_builtin.cc dnl
1485
support-files/Makefile dnl
1486
tests/Makefile tests/install_test_db dnl
1487
drizzled/version.h plugin/Makefile dnl
1488
drizzled/drizzled_safe support-files/libdrizzle.pc dnl
1489
support-files/drizzle.server support-files/drizzle-log-rotate)
1491
AC_CONFIG_COMMANDS([default], , test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h)
1493
# Ensure that table handlers gets all modifications to CFLAGS/CXXFLAGS
1494
AC_CONFIG_COMMANDS_POST(ac_configure_args="$ac_configure_args CFLAGS='$CFLAGS' CXXFLAGS='$CXXFLAGS' AM_CFLAGS='$AM_CFLAGS' AM_CXXFLAGS='$AM_CXXFLAGS'")
171
echo "Configuration summary for $PACKAGE_NAME version $VERSION $PANDORA_RELEASE_COMMENT"
1499
echo "Configuration summary for $PACKAGE_NAME version $VERSION"
173
1501
echo " * Installation prefix: $prefix"
174
echo " * System type: $host_vendor-$host_os"
175
echo " * pandora-build version: PANDORA_CANONICAL_VERSION"
1502
echo " * System type: $SYSTEM_TYPE"
176
1503
echo " * Host CPU: $host_cpu"
177
1504
echo " * C Compiler: $CC_VERSION"
178
echo " * C++ Compiler: $CXX_VERSION"
1505
echo " * C++ Compiler: $CXX"
1506
echo " * Build auth_pam: $ac_cv_header_security_pam_appl_h"
179
1507
echo " * Assertions enabled: $ac_cv_assert"
180
1508
echo " * Debug enabled: $with_debug"
181
1509
echo " * Profiling enabled: $ac_profiling"
182
1510
echo " * Coverage enabled: $ac_coverage"
183
echo " * Warnings as failure: $ac_cv_warnings_as_errors"
1511
echo " * Warnings as failure: $ac_warn_fail"
1512
echo " * C++ cstdint location: $ac_cv_cxx_cstdint"
1513
echo " * C++ hash_map location: $ac_cv_cxx_hash_map"
1514
echo " * C++ hash namespace: $ac_cv_cxx_hash_namespace"
1515
echo " * C++ cmath location: $ac_cv_cxx_cmath"
1516
echo " * C++ cmath namespace: $ac_cv_cxx_cmath_namespace"
191
echo "* NOTE: You are on FreeBSD. BSD make will not work."
193
echo "* use 'gmake' To build Drizzle"
195
echo "* And ensure that /usr/local/lib/gcc44 is in your LD_LIBRARY_PATH"
202
dnl libtoolize scans configure.ac and needs to see some text
203
m4_define([LIBTOOLIZE_AC_INIT], [])