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
4
20
AC_PREREQ(2.59)dnl Minimum Autoconf version required.
6
AC_INIT(drizzle, [7.0.0], [http://bugs.launchpad.net/drizzle])
22
m4_include(m4/bzr_version.m4)
7
24
AC_CONFIG_SRCDIR([drizzled/drizzled.cc])
8
25
AC_CONFIG_AUX_DIR(config)
9
26
AC_CONFIG_HEADERS([config.h])
27
AC_CONFIG_MACRO_DIR([m4])
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)
29
# Setting CFLAGS here prevents AC_CANONICAL_TARGET from injecting them
31
SAVE_CXXFLAGS=${CXXFLAGS}
30
35
AC_CANONICAL_TARGET
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
38
CXXFLAGS=${SAVE_CXXFLAGS}
40
AM_INIT_AUTOMAKE(nostdinc subdir-objects -Wall -Werror)
61
42
if test "x${enable_dependency_tracking}" = "x"
63
44
enable_dependency_tracking=yes
66
################ End of section to be done before AC_PROG_CC #################
68
50
dnl Checks for programs.
70
ifdef([AC_PROG_CC_C99],[
71
dnl TODO: Need to fix this to use c99 instead of gnu99
72
AC_PROG_CC_C99([],[AC_MSG_ERROR([C99 support required for compiling Drizzle])])
74
],[C99_SUPPORT_HACK="-std=gnu99"])
76
ifdef([AC_USE_SYSTEM_EXTENSIONS],[
77
AC_USE_SYSTEM_EXTENSIONS
80
AH_VERBATIM([__EXTENSIONS__],
81
[/* Enable extensions on Solaris. */
82
#ifndef __EXTENSIONS__
83
# undef __EXTENSIONS__
85
#ifndef _POSIX_PTHREAD_SEMANTICS
86
# undef _POSIX_PTHREAD_SEMANTICS
88
#ifndef _TANDEM_SOURCE
89
# undef _TANDEM_SOURCE
92
AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
93
[ac_cv_safe_to_define___extensions__],
96
# define __EXTENSIONS__ 1
97
AC_INCLUDES_DEFAULT])],
98
[ac_cv_safe_to_define___extensions__=yes],
99
[ac_cv_safe_to_define___extensions__=no])])
100
test $ac_cv_safe_to_define___extensions__ = yes &&
101
AC_DEFINE([__EXTENSIONS__])
102
AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
103
AC_DEFINE([_TANDEM_SOURCE])
53
gl_USE_SYSTEM_EXTENSIONS
54
if test "$GCC" = "yes"
56
# If you're on a Mac, and you didn't ask for a specific compiler
57
# You're gonna get 4.2.
58
if test "$host_vendor" = "apple" -a "x${ac_cv_env_CC_set}" = "x"
60
CPP="/usr/bin/gcc-4.2 -E"
64
AC_CACHE_CHECK([if GCC is recent enough], [drizzle_cv_gcc_recent],
65
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
66
#if !defined(__GNUC__) || (__GNUC__ < 4) || ((__GNUC__ >= 4) && (__GNUC_MINOR__ < 1))
67
# error GCC is Too Old!
70
[drizzle_cv_gcc_recent=yes],
71
[drizzle_cv_gcc_recent=no])])
72
if test "$drizzle_cv_gcc_recent" = "no" -a "$host_vendor" = "apple"
74
AC_MSG_ERROR([Your version of GCC is too old. Drizzle requires at least version 4.2 on OSX. You may need to install a version of XCode >= 3.1.2])
76
if test "$drizzle_cv_gcc_recent" = "no"
78
AC_MSG_ERROR([Your version of GCC is too old. Drizzle requires at least version 4.1])
107
81
AC_CXX_HEADER_STDCXX_98
108
82
if test "$ac_cv_cxx_stdcxx_98" = "no"
110
AC_MSG_ERROR([C++ Compiler required to compile Drizzle])
84
AC_MSG_ERROR([No working C++ Compiler has been found. Drizzle requires a C++ compiler that can handle C++98])
89
if test "$am_cv_prog_cc_stdc" = "no"
91
AC_MSG_ERROR([Drizzle requires an ANSI C compiler (and a C++ compiler). Try gcc. See the Installation chapter in the Reference Manual.])
115
98
AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
117
dnl AC_CANONICAL_HOST thinks it's a good idea to just set CFLAGS to
118
dnl -g -O2 if you're running gcc. We would like to use something else, thanks.
119
if test "x${CFLAGS}" = "x-g -O2"
123
if test "x${CXXFLAGS}" = "x-g -O2"
100
AC_PROG_GCC_TRADITIONAL
129
103
# Set all version vars based on $VERSION. How do we do this more elegant ?
141
115
DRIZZLE_BASE_VERSION=`echo $DRIZZLE_NUMERIC_VERSION | sed -e "s|\.[[^.]]*$||"`
142
116
DRIZZLE_VERSION_ID=`echo $DRIZZLE_NUMERIC_VERSION | \
143
117
awk -F. '{printf "%d%0.2d%0.2d", $1, $2, $3}'`
145
# The port should be constant for a LONG time
146
DRIZZLE_TCP_PORT_DEFAULT=4427
148
sinclude(m4/dtrace.m4)
149
sinclude(m4/character_sets.m4)
150
sinclude(m4/gettext.m4)
152
AM_GNU_GETTEXT([external])
153
AM_GNU_GETTEXT_VERSION(0.17)
155
AM_CONDITIONAL([BUILD_GETTEXT],[test "x$MSGMERGE" != "x" -a "x$MSGMERGE" != "x:"])
157
AC_SUBST(DRIZZLE_NO_DASH_VERSION)
158
118
AC_DEFINE_UNQUOTED(DRIZZLE_BASE_VERSION,["$DRIZZLE_BASE_VERSION"],
159
[Major and minor version])
160
AC_SUBST(DRIZZLE_VERSION_ID)
119
[Major and minor version])
161
120
AC_DEFINE_UNQUOTED([DRIZZLE_VERSION_ID],[$DRIZZLE_VERSION_ID],
162
121
[Version ID that can be easily used for numeric comparison])
163
AC_SUBST(DRIZZLE_PREVIOUS_BASE_VERSION)
164
AC_SUBST(PROTOCOL_VERSION)
165
AC_DEFINE_UNQUOTED([PROTOCOL_VERSION], [$PROTOCOL_VERSION],
166
[mysql client protocol version])
167
AC_SUBST(DOT_FRM_VERSION)
168
AC_DEFINE_UNQUOTED([FRM_VER], [$DOT_FRM_VERSION],
169
[Version of .frm files])
170
AC_DEFINE_UNQUOTED([DRIZZLE_CONFIG_NAME],["drizzled"],[Name of server config section])
172
AC_SUBST(SHARED_LIB_MAJOR_VERSION)
173
AC_SUBST(SHARED_LIB_VERSION)
123
AC_DEFINE([_BACKWARD_BACKWARD_WARNING_H],[1],[Hack to disable deprecation warning in gcc])
125
# The port should be constant for a LONG time
126
DRIZZLE_TCP_PORT_DEFAULT=4427
128
m4_include(m4/dtrace.m4)
130
m4_include(m4/character_sets.m4)
174
131
AC_SUBST(AVAILABLE_LANGUAGES)
176
dnl Ok. This is sort of lame, but we need to be nice to plugins Makefile.am's.
177
AM_CONDITIONAL(BUILDING_DRIZZLE,[test "x" = "x"])
181
AC_DEFINE([IO_SIZE], [4096], [Io buffer size; Must be a power of 2 and
182
a multiple of 512. May be
183
smaller what the disk page size. This influences the speed of the
184
isam btree library. eg to big to slow.])
185
AC_DEFINE([SC_MAXWIDTH],[256], [Max width of screen (for error messages)])
186
AC_DEFINE([FN_LEN],[256 ], [Max file name len ])
187
AC_DEFINE([FN_EXTLEN],[20], [Max length of extension (part of FN_LEN) ])
188
AC_DEFINE([FN_REFLEN],[512], [Max length of full path-name ])
189
AC_DEFINE([FN_EXTCHAR],['.'], [File extension character])
190
AC_DEFINE([FN_HOMELIB],['~'], [~/ is used as abbrev for home dir ])
191
AC_DEFINE([FN_CURLIB],['.'], [./ is used as abbrev for current dir ])
192
AC_DEFINE([FN_PARENTDIR],[".."], [Parent directory; Must be a string ])
194
AC_DEFINE([MASTER],[1],[Compile without unireg])
196
AH_VERBATIM([QUOTE_ARG],[
197
/* Quote argument (before cpp) */
199
# define QUOTE_ARG(x) #x
201
/* Quote argument, (after cpp) */
202
#ifndef STRINGIFY_ARG
203
# define STRINGIFY_ARG(x) QUOTE_ARG(x)
207
AH_VERBATIM([builtin_expect],[
209
* The macros below are borrowed from include/linux/compiler.h in the
210
* Linux kernel. Use them to indicate the likelyhood of the truthfulness
211
* of a condition. This serves two purposes - newer versions of gcc will be
212
* able to optimize for branch predication, which could yield siginficant
213
* performance gains in frequently executed sections of the code, and the
214
* other reason to use them is for documentation
216
#if !defined(__GNUC__)
217
#define __builtin_expect(x, expected_value) (x)
220
#define likely(x) __builtin_expect((x),1)
221
#define unlikely(x) __builtin_expect((x),0)
224
dnl InnoDB depends on some Drizzle's internals which other plugins should not
225
dnl need. This is because of InnoDB's foreign key support, "safe" binlog
226
dnl truncation, and other similar legacy features.
228
dnl We define accessors for these internals unconditionally, but do not
229
dnl expose them in mysql/plugin.h. They are declared in ha_innodb.h for
232
AC_DEFINE([INNODB_COMPATIBILITY_HOOKS],[1],[TODO: Remove the need for this])
233
dnl TODO: Make a test for when this needs to be set.
234
AC_DEFINE([_REENTRANT],[1],[Some thread libraries require this])
236
AH_VERBATIM([posix_pthread],[
237
/* We want posix threads */
238
#ifndef _POSIX_PTHREAD_SEMANTICS
239
#define _POSIX_PTHREAD_SEMANTICS
134
# Set this for plugins to use
135
ac_build_drizzle="yes"
244
138
# Canonicalize the configuration name.
313
if test "$ac_cv_c_compiler_gnu" = "yes"
318
AC_PATH_PROG(AS, as, as)
321
dnl TODO: This needs to go away and be replaced with _ISOC99_SOURCE
322
if test "$ac_cv_c_compiler_gnu" = "yes" -o "$target_os" = "linux-gnu"
324
AC_DEFINE([_GNU_SOURCE],[1],[Fix problem with S_ISLNK() on Linux])
327
dnl Solaris 9 include file <sys/feature_tests.h> refers to X/Open document
329
dnl System Interfaces and Headers, Issue 5
331
dnl saying we should define _XOPEN_SOURCE=500 to get POSIX.1c prototypes,
332
dnl but apparently other systems (namely FreeBSD) don't agree.
334
dnl On a newer Solaris 10, the above file recognizes also _XOPEN_SOURCE=600.
335
dnl Furthermore, it tests that if a program requires older standard
336
dnl (_XOPEN_SOURCE<600 or _POSIX_C_SOURCE<200112L) it cannot be
337
dnl run on a new compiler (that defines _STDC_C99) and issues an #error.
338
dnl It's also an #error if a program requires new standard (_XOPEN_SOURCE=600
339
dnl or _POSIX_C_SOURCE=200112L) and a compiler does not define _STDC_C99.
341
dnl To add more to this mess, Sun Studio C compiler defines _STDC_C99 while
342
dnl C++ compiler does not!
344
dnl TODO: Can _ISOC99_SOURCE be defined on all platforms and remove the
345
dnl Need for all of this?
346
if test "$GCC" = "yes"
350
CFLAGS="${CFLAGS} -D_XOPEN_SOURCE=600"
351
CXXFLAGS="${CXXFLAGS} -D__C99FEATURES__"
359
# Ensure that we have --preserve-dup-deps defines, otherwise we get link
360
# problems of 'mysql' with CXX=g++
361
LIBTOOL="$LIBTOOL --preserve-dup-deps"
193
AC_PATH_PROG(GPERF, gperf)
194
AS_IF([test "x$GPERF" = "x"],
195
AC_MSG_ERROR("Drizzle requires gperf to build."))
197
AC_PATH_PROG(LCOV, lcov)
198
AC_PATH_PROG(GENHTML, genhtml)
200
AM_CONDITIONAL(HAVE_LCOV,[test "x$LCOV" != "x"])
367
test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
369
# Look for "(group|user)add".
370
# TODO: If the programs do not exist, inform the DBA that the user
371
# was not created at the end of the install routine.
372
AC_CHECK_PROGS(GROUPADD, groupadd addgroup)
373
AC_CHECK_PROGS(USERADD, useradd adduser)
375
dnl Needed for ltmain
378
206
dnl Not critical since the generated file is distributed
380
if test -z "$YACC" && test -d ".bzr"
207
AC_CHECK_PROGS(YACC, ['bison -y'])
208
if test -z "$YACC" && test -d "$srcdir/.bzr"
382
210
AC_MSG_ERROR(["bison is required for Drizzle to build from a bzr branch"])
385
AC_PATH_PROG(uname_prog, uname, no)
387
# We should go through this and put all the explictly system dependent
389
AC_MSG_CHECKING(operating system)
390
AC_CACHE_VAL(mysql_cv_sys_os,
392
if test "$uname_prog" != "no"; then
393
mysql_cv_sys_os="`uname`"
395
mysql_cv_sys_os="Not Solaris"
398
AC_MSG_RESULT($mysql_cv_sys_os)
401
# The following is required for portable results of floating point calculations
402
# on PowerPC. The same must also be done for IA-64, but this options is missing
403
# in the IA-64 gcc backend.
213
AC_CHECK_PROGS(ISAINFO, [isainfo], [no])
214
AS_IF([test "x$ISAINFO" != "xno"],
215
[isainfo_b=`isainfo -b`],
218
# Build optimized or debug version ?
219
# First check for gcc and g++
405
220
if test "$GCC" = "yes"
222
if test "$isainfo_b" = "64"
226
AC_DEFINE([_GNU_SOURCE],[1],[Fix problem with S_ISLNK() on Linux])
228
dnl The following is required for portable results of floating point
229
dnl calculations on PowerPC. The same must also be done for IA-64, but
230
dnl this options is missing in the IA-64 gcc backend.
407
231
case "$host_cpu" in
408
232
*ppc* | *powerpc*)
409
AM_CFLAGS="$CFLAGS -mno-fused-madd"
410
AM_CXXFLAGS="$CXXFLAGS -mno-fused-madd"
233
CFLAGS="-mno-fused-madd ${CFLAGS}"
234
CXXFLAGS="-mno-fused-madd ${CXXFLAGS}"
414
# Build optimized or debug version ?
415
# First check for gcc and g++
419
DEBUG_OPTIMIZE_CXX=""
420
OPTIMIZE_CXXFLAGS="-O"
421
if test "$GCC" = "yes"
423
SYMBOLS_FLAGS="-ggdb3"
424
DEBUG_OPTIMIZE_CC="-O0"
238
CFLAGS="-ggdb3 ${IS_64} -std=gnu99 ${CFLAGS}"
239
CXXFLAGS="-ggdb3 ${IS_64} ${CXXFLAGS}"
240
AC_CXX_CHECK_STANDARD
425
246
OPTIMIZE_CFLAGS="-O3"
426
DEBUG_OPTIMIZE_CXX="-O0"
427
247
OPTIMIZE_CXXFLAGS="-O3"
429
249
if test "$SUNCC" = "yes"
431
dnl I'm cheating here and sticking C99 support in SYMBOLS_FLAGS
434
OPTIMIZE_CFLAGS="-xO4 -xlibmil -xdepend -Xa -mt -xstrconst -D_FORTEC_"
435
DEBUG_OPTIMIZE_CXX=""
436
#Put back in once isnan is figured out
437
OPTIMIZE_CXXFLAGS="-xO4 -xlibmil -mt -D_FORTEC_ -xlang=c99 -compat=5 -library=stlport4"
251
if test "$isainfo_b" = "64"
255
dnl we put CPPFLAGS and LDFLAGS first here, because if the user has specified
256
dnl command line CPPFLAGS or LDFLAGS, their -I or -L should come _first_
257
if test "$target_cpu" = "sparc"
259
MEMALIGN_FLAGS="-xmemalign=8s"
262
if test "x$use_additional" != "xyes"
264
AS_IF([test "$isainfo_b" != "none"],[
265
LDFLAGS="${LDFLAGS} -L/usr/local/lib/${isainfo_b} -L/usr/local/lib -L/opt/csw/lib/${isainfo_b} -L/opt/csw/lib"
267
LDFLAGS="${LDFLAGS} -L/usr/local/lib -L/opt/csw/lib"
269
CPPFLAGS="${CPPFLAGS} -I/usr/local/include -I/opt/csw/include"
271
AS_IF([test "$isainfo_b" != "none"],
272
[LDFLAGS="${LDFLAGS} -L/usr/lib/${isainfo_b}"])
274
CXXFLAGS="-xlang=c99 -g -mt -compat=5 -library=stlport4 -template=no%extdef ${IS_64} ${MEMALIGN_FLAGS} ${CXXFLAGS}"
275
CFLAGS="-g -mt -xc99=all ${IS_64} ${MEMALIGN_FLAGS} ${CFLAGS}"
277
DEBUG_CXXFLAGS="-xO0"
279
dnl TODO: -xO4 causes a Sun Studio failure in innodb... let's check back
281
OPTIMIZE_FLAGS="-xO3 -xlibmil -xdepend"
282
OPTIMIZE_CFLAGS="${OPTIMIZE_FLAGS} -Xa -xstrconst"
283
OPTIMIZE_CXXFLAGS="${OPTIMIZE_FLAGS}"
287
m4_include(m4/gettext.m4)
288
AM_GNU_GETTEXT(external, need-formatstring-macros)
289
if test "x$MSGMERGE" = "x" -o "x$MSGMERGE" = "x:"
291
AM_PATH_PROG_WITH_TEST(GMSGMERGE, gmsgmerge,
292
[$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
293
MSGMERGE="${GMSGMERGE}"
295
AM_CONDITIONAL([BUILD_GETTEXT],[test "x$MSGMERGE" != "x" -a "x$MSGMERGE" != "x:"])
440
301
dnl TODO: Remove this define once we are using 2.61 across the board.
441
302
# AX_HEADER_ASSERT
465
323
if test "$with_debug" = "yes"
468
CFLAGS="$DEBUG_OPTIMIZE_CC -DDEBUG $CFLAGS ${SAVE_CFLAGS}"
469
CXXFLAGS="$DEBUG_OPTIMIZE_CXX -DDEBUG $CXXFLAGS ${SAVE_CXXFLAGS}"
325
# Debuging. No optimization.
326
CFLAGS="${DEBUG_CFLAGS} ${CFLAGS}"
327
CXXFLAGS="${DEBUG_CXXFLAGS} ${CXXFLAGS}"
471
329
# Optimized version. No debug
472
CFLAGS="${OPTIMIZE_CFLAGS} ${CFLAGS} ${SAVE_CFLAGS}"
473
CXXFLAGS="$OPTIMIZE_CXXFLAGS $CXXFLAGS ${SAVE_CXXFLAGS}"
330
CFLAGS="${OPTIMIZE_CFLAGS} ${CFLAGS}"
331
CXXFLAGS="${OPTIMIZE_CXXFLAGS} ${CXXFLAGS}"
482
AC_SUBST(INSTALL_SCRIPT)
485
export CC CXX CFLAGS LD LDFLAGS AR ARFLAGS
494
# libdrizzle versioning when linked with GNU ld.
495
if test "$lt_cv_prog_gnu_ld" = "yes" -a $LD --version 2>/dev/null|grep -q GNU; then
496
LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_srcdir)/libdrizzle/libdrizzle.ver"
498
AC_SUBST(LD_VERSION_SCRIPT)
500
344
#--------------------------------------------------------------------
501
345
# Check for Google Proto Buffers
502
346
#--------------------------------------------------------------------
504
AC_MSG_CHECKING(for Google Protocol Buffers)
505
AC_ARG_WITH(protobuf,
506
[AS_HELP_STRING([--with-protobuf@<:@=DIR@:>@],
507
[search for protobuf in DIR/include and DIR/lib])],
508
[ with_protobuf=$withval ],
509
[ with_protobuf=yes ])
511
save_CPPFLAGS="$CPPFLAGS"
514
if test "$with_protobuf" = "yes"
349
AC_LIB_HAVE_LINKFLAGS(protobuf,pthread,
350
[#include <google/protobuf/descriptor.h>
352
[google::protobuf::FileDescriptor* file;],system)
353
AS_IF([test x$ac_cv_libprotobuf = xno],
354
AC_MSG_ERROR([protobuf is required for Drizzle. On Debian this can be found in libprotobuf-dev. On RedHat this can be found in protobuf-devel.]))
356
AC_CACHE_CHECK([if protobuf is recent enough], [drizzle_cv_protobuf_recent],
357
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
358
#include <google/protobuf/descriptor.h>
359
#if GOOGLE_PROTOBUF_VERSION < 2000002
360
# error Your version of Protobuf is too old
363
[drizzle_cv_protobuf_recent=yes],
364
[drizzle_cv_protobuf_recent=no])])
365
if test "$drizzle_cv_protobuf_recent" = "no"
520
CPPFLAGS="-I$withval/include"
521
LIBS="-L$withval/lib -lprotobuf"
522
PROTO_PATH="${withval}/bin:$PATH"
367
AC_MSG_ERROR([Your version of Google Protocol Buffers is too old. Drizzle requires at least version 2.0.2])
525
AC_PATH_PROG([PROTOC],[protoc],[no],[$PROTO_PATH])
370
AC_PATH_PROG([PROTOC],[protoc],[no],[$LIBPROTOBUF_PREFIX/bin:$PATH])
526
371
if test "x$PROTOC" = "xno"
528
AC_MSG_ERROR([Couldn't find protoc. Try installing Google Protocol Buffer.])
532
AC_CHECK_HEADERS([google/protobuf/message.h])
533
if test "x$ac_cv_header_google_protobuf_message_h" != "xyes"
535
AC_MSG_ERROR([Couldn't find message.h. Try installing Google Protocol Buffer development packages])
537
AC_MSG_RESULT("$wthval")
539
AC_CACHE_CHECK([for Message in libprotobuf], ac_cv_libprotobuf_works, [
541
#include <google/protobuf/descriptor.pb.h>
543
google::protobuf::FileDescriptorProto testFdp;
544
], ac_cv_libprotobuf_works=yes, [
545
AC_MSG_ERROR([could not find Google's libprotobuf])
550
PROTOBUF_LIBS="${LIBS}"
551
PROTOBUF_CPPFLAGS="${CPPFLAGS}"
552
AC_SUBST(PROTOBUF_LIBS)
553
AC_SUBST(PROTOBUF_CPPFLAGS)
554
CPPFLAGS="$save_CPPFLAGS"
373
AC_MSG_ERROR([Couldn't find the protoc compiler. On Debian this can be found in protobuf-compiler. On RedHat this can be found in protobuf-compiler.])
558
378
#--------------------------------------------------------------------
559
379
# Check for libuuid
560
380
#--------------------------------------------------------------------
562
dnl Do this by hand instead of with SEARCH_FOR_LIB, because uuid is weird.
382
dnl Do this by hand. Need to check for uuid/uuid.h, but uuid may or may
383
dnl not be a lib is weird.
563
385
AC_CHECK_HEADERS(uuid/uuid.h)
564
386
if test "x$ac_cv_header_uuid_uuid_h" = "xno"
566
AC_MSG_ERROR([Couldn't find uuid/uuid.h. Try installing libuuid development packages])
388
AC_MSG_ERROR([Couldn't find uuid/uuid.h. On Debian this can be found in uuid-dev. On Redhat this can be found in e2fsprogs-devel.])
568
AC_CHECK_LIB(uuid, uuid_generate)
570
#--------------------------------------------------------------------
572
#--------------------------------------------------------------------
574
SEARCH_FOR_LIB(event, event_loop, event.h,
575
AC_MSG_ERROR([libevent is required for Drizzle]))
578
AC_CACHE_CHECK([for bufferevent in libevent], ac_cv_libevent_works, [
579
save_CPPFLAGS="$CPPFLAGS"
581
CPPFLAGS="$EVENT_CPPFLAGS"
584
#include <sys/types.h>
585
#include <sys/time.h>
587
#include <event.h>],[
588
struct bufferevent bev;
589
bufferevent_settimeout(&bev, 1, 1);
590
], ac_cv_libevent_works=yes, [
591
AC_MSG_ERROR([you need to install a more recent version of libevent,
592
check http://www.monkey.org/~provos/libevent/])
595
CPPFLAGS="$save_CPPFLAGS"
390
AC_LIB_HAVE_LINKFLAGS(uuid,,
392
#include <uuid/uuid.h>
600
401
#--------------------------------------------------------------------
601
402
# Check for libpthread
602
403
#--------------------------------------------------------------------
604
AC_CHECK_HEADERS(pthread.h)
605
if test "x$ac_cv_header_pthread_h" != "xyes"
607
AC_MSG_ERROR([Couldn't find pthread.h.])
609
AC_CHECK_LIB(pthread, pthread_create, [], [AC_MSG_ERROR(could not find libpthread)])
405
ACX_PTHREAD(,AC_MSG_ERROR(could not find libpthread))
406
LIBS="$PTHREAD_LIBS $LIBS"
407
CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS}"
611
410
#--------------------------------------------------------------------
612
411
# Check for tcmalloc/mtmalloc
613
412
#--------------------------------------------------------------------
615
414
AC_ARG_ENABLE([tcmalloc],
616
[AS_HELP_STRING([--enable-tcmalloc],
617
[Enable linking with tcmalloc @<:@default=off@:>@])],
415
[AS_HELP_STRING([--disable-tcmalloc],
416
[Enable linking with tcmalloc @<:@default=on@:>@])],
618
417
[ac_enable_tcmalloc="$enableval"],
619
[ac_enable_tcmalloc="no"])
418
[ac_enable_tcmalloc="yes"])
621
420
if test "x$ac_enable_tcmalloc" != "xno"
628
427
AC_CHECK_LIB(mtmalloc,malloc,[],[])
431
#--------------------------------------------------------------------
432
# Check for libdrizzle
433
#--------------------------------------------------------------------
435
AC_LIB_HAVE_LINKFLAGS(drizzle,,
436
[#include <libdrizzle/drizzle.h>],
438
const char *version= drizzle_version()
440
AS_IF([test x$ac_cv_libdrizzle = xno],
441
AC_MSG_ERROR([libdrizzle is required for Drizzle]))
631
444
#--------------------------------------------------------------------
633
446
#--------------------------------------------------------------------
635
SEARCH_FOR_LIB(z, crc32, zlib.h,
636
AC_MSG_ERROR([libz is required for Drizzle]))
638
#--------------------------------------------------------------------
639
# Check for libncurses
640
#--------------------------------------------------------------------
643
SEARCH_FOR_LIB(ncurses, tgetent, ncurses/ncurses.h, AC_MSG_ERROR(Couldn't find ncurses))
448
AC_LIB_HAVE_LINKFLAGS(z,,
453
AS_IF([test x$ac_cv_libz = xno],
454
AC_MSG_ERROR([libz is required for Drizzle. On Debian this can be found in zlib1g-dev. On RedHat this can be found in zlib-devel.]))
456
#--------------------------------------------------------------------
458
#--------------------------------------------------------------------
461
AC_LIB_HAVE_LINKFLAGS(tbb,,
462
[#include <tbb/atomic.h>
466
tbb::atomic<uint64_t> x;
467
tbb::atomic<uint8_t> y;
645
475
#--------------------------------------------------------------------
646
476
# Check for libreadline or compatible (libedit on Mac OS X)
647
477
#--------------------------------------------------------------------
650
SEARCH_FOR_LIB(readline, rl_initialize, readline/readline.h,
651
AC_MSG_ERROR([libreadline is required for Drizzle]),
654
save_CPPFLAGS="$CPPFLAGS"
655
CPPFLAGS="$CPPFLAGS $READLINE_CPPFLAGS"
656
AC_CHECK_HEADERS(readline/history.h)
657
AC_CHECK_TYPES([HIST_ENTRY], [], [], [AC_INCLUDES_DEFAULT[
658
#ifdef HAVE_READLINE_HISTORY_H
659
#include <readline/history.h>
661
#include <readline/readline.h>
663
AC_CHECK_DECLS([completion_matches], [], [], [AC_INCLUDES_DEFAULT[
664
#ifdef HAVE_READLINE_HISTORY_H
665
#include <readline/history.h>
667
#include <readline/readline.h>
482
AS_IF([test "x$vl_cv_lib_readline" = "xno"],
483
AC_MSG_ERROR([libreadline is required for Drizzle. On Debian this can be found in libreadline5-dev. On RedHat this can be found in readline-devel.]))
484
READLINE_LIBS="${LIBS}"
486
AC_SUBST(READLINE_LIBS)
670
488
DRIZZLE_CHECK_NEW_RL_INTERFACE
671
CPPFLAGS="$save_CPPFLAGS"
674
490
#--------------------------------------------------------------------
675
491
# Check for libpcre
676
492
#--------------------------------------------------------------------
678
AC_PATH_PROG(PKG_CONFIG, pkg-config, AC_MSG_ERROR([pkg-config wasn't found.]))
679
PKG_CHECK_MODULES(PCRE, [libpcre >= 3], [found_pcre="yes"],[found_pcre="no"])
494
AC_LIB_HAVE_LINKFLAGS(pcre,,
500
AS_IF([test "x$ac_cv_libpcre" = "xno"],
507
AC_LIB_HAVE_LINKFLAGS(pcre,,
508
[#include <pcre/pcre.h>],
513
AS_IF([test "x$ac_cv_libpcre" = "xno"],
515
AC_MSG_ERROR([libpcre is required for Drizzle. On Debian this can be found in libpcre3-dev. On RedHat this can be found in pcre-devel.])
517
AC_DEFINE(PCRE_HEADER,[<pcre/pcre.h>],[Location of pcre header])
520
AC_DEFINE(PCRE_HEADER,[<pcre.h>],[Location of pcre header])
681
if test "$found_pcre" = "no"
683
SEARCH_FOR_LIB(pcre, pcre_compile, pcre.h,
684
AC_MSG_ERROR([libpcre is required for Drizzle]))
686
AM_CONDITIONAL([HAVE_PCRE],[test "$ac_cv_have_pcre" = "yes"])
688
AC_SUBST(PCRE_CFLAGS)
690
524
dnl Find paths to some shell programs
691
525
AC_PATH_PROG(LN, ln, ln)
970
792
LIBS="$my_save_LIBS"
971
793
AC_SUBST(LIBDL_LIBS)
973
AC_CHECK_FUNCS(strtok_r)
977
AC_ARG_WITH([fast-mutexes],
978
[AS_HELP_STRING([--with-fast-mutexes],
979
[Compile with fast mutexes @<:@default=off@:>@])],
980
[with_fast_mutexes=$withval],
981
[with_fast_mutexes=no])
983
if test "$with_fast_mutexes" != "no"
985
AC_DEFINE([MY_PTHREAD_FASTMUTEX], [1],
986
[Define to 1 if you want to use fast mutexes])
989
AM_CONDITIONAL(BUILD_FAST_MUTEX,[test "$with_fast_mutexes" != "no"])
796
AC_ARG_WITH([atomic-ops],
797
[AS_HELP_STRING([--with-atomic-ops=rwlocks|smp|up],
798
[Implement atomic operations using pthread rwlocks or atomic CPU
799
instructions for multi-processor or uniprocessor
800
configuration. By default gcc built-in sync functions are used,
801
if available and 'smp' configuration otherwise.])],
802
[with_atomic_ops="$withval"],
803
[with_atomic_ops=smp])
805
case "$with_atomic_ops" in
806
"up") AC_DEFINE([MY_ATOMIC_MODE_DUMMY], [1],
807
[Assume single-CPU mode, no concurrency]) ;;
808
"rwlocks") AC_DEFINE([MY_ATOMIC_MODE_RWLOCKS], [1],
809
[Use pthread rwlocks for atomic ops]) ;;
812
[whether the compiler provides atomic builtins],
813
[ac_cv_gcc_atomic_builtins],
815
[AC_LANG_PROGRAM([],[[
816
int foo= -10; int bar= 10;
817
if (!__sync_fetch_and_add(&foo, bar) || foo)
819
bar= __sync_lock_test_and_set(&foo, bar);
820
if (bar || foo != 10)
822
bar= __sync_val_compare_and_swap(&bar, foo, 15);
827
[ac_cv_gcc_atomic_builtins=yes],
828
[ac_cv_gcc_atomic_builtins=no])])
830
if test "x$ac_cv_gcc_atomic_builtins" = "xyes"; then
831
AC_DEFINE(HAVE_GCC_ATOMIC_BUILTINS, 1,
832
[Define to 1 if compiler provides atomic builtins.])
835
*) AC_MSG_ERROR(["$with_atomic_ops" is not a valid value for --with-atomic-ops]) ;;
991
839
AC_ARG_WITH([comment],
992
840
[AS_HELP_STRING([--with-comment],
1355
1213
[ac_warn_effc="$enableval"],
1356
1214
[ac_warn_effc="no"])
1358
AC_ARG_ENABLE([go-crazy],
1359
[AS_HELP_STRING([--enable-go-crazy],
1360
[Enables extra little warnings that might be too much @<:@default=off@:>@])],
1361
[ac_warn_go_crazy="$enableval"],
1362
[ac_warn_go_crazy="no"])
1216
AC_ARG_ENABLE([shadow],
1217
[AS_HELP_STRING([--disable-shadow],
1218
[Disables warnings about scope shadowing @<:@default=on@:>@])],
1219
[ac_warn_shadow="$enableval"],
1220
[ac_warn_shadow="yes"])
1222
AC_ARG_ENABLE([conversion],
1223
[AS_HELP_STRING([--enable-conversion],
1224
[Enables conversion warnings @<:@default=off@:>@])],
1225
[ac_warn_conversion="$enableval"],
1226
[ac_warn_conversion="no"])
1228
AC_ARG_ENABLE([datarace],
1229
[AS_HELP_STRING([--enable-datarace],
1230
[Enables Sun Studio data race detection @<:@default=off@:>@])],
1231
[ac_datarace="$enableval"],
1234
AC_ARG_ENABLE([exceptions],
1235
[AS_HELP_STRING([--disable-exceptions],
1236
[Disables use of Exceptions in the build @<:@default=on@:>@])],
1237
[ac_exceptions="$enableval"],
1238
[ac_exceptions="yes"])
1240
AC_ARG_ENABLE([cast-align-warnings],
1241
[AS_HELP_STRING([--enable-cast-align-warnings],
1242
[Toggle cast alignment warnings @<:@default=off@:>@])],
1243
[ac_warn_cast_align="$enableval"],
1244
[ac_warn_cast_align="no"])
1365
1246
if test "$GCC" = "yes"
1248
if test "$ac_warn_cast_align" = "yes"
1250
W_CAST_ALIGN="-Wcast-align"
1252
W_CAST_ALIGN="-Wno-cast-align"
1369
1255
if test "$ac_warn_fail" = "yes"
1371
1257
W_FAIL="-Werror"
1373
BASE_WARNINGS="-W -Wall -Wextra ${W_FAIL}"
1259
BASE_WARNINGS="-Wall -Wextra ${W_FAIL} ${W_CAST_ALIGN}"
1375
1261
if test "$ac_warn_longlong" = "yes"
1461
1343
W_EFFC="-Weffc++"
1464
if test "$ac_warn_gocrazy" = "yes"
1466
W_CRAZY="-Wshadow -Wconversion -Winvalid-pch"
1469
CC_WARNINGS="${C99_SUPPORT_HACK} ${BASE_WARNINGS} ${GCC_PEDANTIC} ${W_UNREACHABLE} ${GPROF_PROFILING} ${GPROF_COVERAGE} ${W_CRAZY}"
1470
CXX_WARNINGS="${BASE_WARNINGS} ${GXX_PEDANTIC} ${W_UNREACHABLE} ${GPROF_PROFILING} ${GPROF_COVERAGE} ${W_CAST} ${W_EFFC} ${W_CRAZY}"
1472
NO_EXCEPTIONS="-fno-exceptions"
1473
W_EXCEPTIONS="-fexceptions"
1474
NO_UNUSED_MACROS="-Wno-unused-macros"
1346
if test "$ac_warn_conversion" = "yes"
1348
W_CONVERSION="-Wconversion"
1351
CC_WARNINGS="${BASE_WARNINGS} ${GCC_PEDANTIC} ${W_UNREACHABLE} ${GPROF_PROFILING} ${GPROF_COVERAGE} ${W_SHADOW} ${W_CONVERSION}"
1352
CXX_WARNINGS="${BASE_WARNINGS} ${GXX_PEDANTIC} ${W_UNREACHABLE} ${GPROF_PROFILING} ${GPROF_COVERAGE} ${W_CAST} ${W_SHADOW} ${W_EFFC} ${W_CONVERSION}"
1354
if test "$ac_exceptions" = "no"
1356
NO_EXCEPTIONS="-fno-exceptions"
1357
W_EXCEPTIONS="-fexceptions"
1475
1359
NO_REDUNDANT_DECLS="-Wno-redundant-decls"
1476
# Disable exceptions as they seams to create problems with gcc and threads.
1477
# drizzled doesn't use run-time-type-checking, so we disable it.
1478
AM_CXXFLAGS="${AM_CXXFLAGS} -fno-rtti"
1479
CPPFLAGS="${CPPFLAGS} -fpch-deps"
1360
PROTOSKIP_WARNINGS="-Wno-effc++ -Wno-shadow"
1481
1362
if test "$SUNCC" = "yes"
1483
CC_WARNINGS="-v -xc99=all -errtags=yes"
1484
CXX_WARNINGS="+w +w2 -xport64 -errtags=yes -erroff=attrskipunsup -compat=5"
1485
NO_EXCEPTIONS="-features=no%except"
1486
W_EXCEPTIONS="-features=except"
1364
if test "$ac_datarace" = "yes"
1366
CFLAGS="-xinstrument=datarace ${CFLAGS}"
1367
CXXFLAGS="-xinstrument=datarace ${CXXFLAGS}"
1370
if test "$ac_warn_fail" = "yes"
1372
W_FAIL="-errwarn=%all"
1375
CC_WARNINGS="-v -errtags=yes -erroff=E_ATTRIBUTE_NOT_VAR ${W_FAIL}"
1376
CXX_WARNINGS="+w +w2 -xport64 -errtags=yes -erroff=attrskipunsup,doubunder,reftotemp,inllargeuse,truncwarn1,signextwarn,inllargeint ${W_FAIL}"
1377
PROTOSKIP_WARNINGS="-erroff=attrskipunsup,doubunder,reftotemp,wbadinitl,identexpected,inllargeuse,truncwarn1,signextwarn"
1378
NO_UNREACHED="-erroff=E_STATEMENT_NOT_REACHED"
1379
if test "$ac_exceptions" = "no"
1381
NO_EXCEPTIONS="-features=no%except"
1382
W_EXCEPTIONS="-features=except"
1488
AM_CXXFLAGS="${CXX_WARNINGS} ${NO_EXCEPTIONS} ${AM_CXXFLAGS}"
1489
AM_CFLAGS="${CC_WARNINGS} ${AM_CFLAGS}"
1491
1385
AC_SUBST(NO_EXCEPTIONS)
1492
1386
AC_SUBST(W_EXCEPTIONS)
1493
AC_SUBST(NO_UNUSED_MACROS)
1494
1389
AC_SUBST(NO_REDUNDANT_DECLS)
1496
AC_SUBST([GLOBAL_CPPFLAGS],['-I$(top_srcdir) -I$(top_builddir)'])
1497
AC_SUBST([AM_CPPFLAGS],['${GLOBAL_CPPFLAGS}'])
1390
AC_SUBST(PROTOSKIP_WARNINGS)
1391
AC_SUBST(NO_UNREACHED)
1393
if test "x${gl_LIBOBJS}" != "x"
1395
if test "$GCC" = "yes"
1397
CPPFLAGS="-isystem \$(top_srcdir)/gnulib -isystem \$(top_builddir)/gnulib ${CPPFLAGS}"
1399
CPPFLAGS="-I\$(top_srcdir)/gnulib -I\$(top_builddir)/gnulib ${CPPFLAGS}"
1403
CPPFLAGS="-I\$(top_srcdir) -I\$(top_builddir) ${CPPFLAGS}"
1404
CFLAGS="${CC_WARNINGS} ${CFLAGS}"
1405
CXXFLAGS="${CXX_WARNINGS} ${W_EXCEPTIONS} ${CXXFLAGS}"
1407
dnl Must be done once we turn on warnings and such
1409
[whether __attribute__ visibility "hidden" is supported],
1410
[ac_cv_can_use_hidden_],[
1415
__attribute__((visibility ("hidden")))
1419
[ac_cv_can_use_hidden_=yes],
1420
[ac_cv_can_use_hidden_=no])
1422
if test "$ac_cv_can_use_hidden_" = "yes"
1424
AC_DEFINE(HAVE_ATTR_HIDDEN, 1,
1425
[Define to 1 if you have support for __attribute__((visibility("hidden")))])
1428
AM_CPPFLAGS="${CPPFLAGS}"
1429
AM_CFLAGS="${CFLAGS}"
1430
AM_CXXFLAGS="${CXXFLAGS}"
1432
AC_SUBST([AM_CPPFLAGS])
1498
1433
AC_SUBST([AM_CFLAGS])
1499
1434
AC_SUBST([AM_CXXFLAGS])
1501
# Some usefull subst
1436
dnl We've collected the flags in AM_*FLAGS now, so blank these.
1505
# Set configuration options for make_binary_distribution
1506
case $SYSTEM_TYPE in
1508
MAKE_BINARY_DISTRIBUTION_OPTIONS="$MAKE_BINARY_DISTRIBUTION_OPTIONS --no-strip"
1511
: # no change for other platforms yet
1514
AC_SUBST(MAKE_BINARY_DISTRIBUTION_OPTIONS)
1441
AC_SUBST(pkgplugindir,"\$(pkglibdir)/plugin")
1516
1443
dnl GCC Precompiled Header Support
1517
1444
dnl re-enable later
1518
dnl AM_CONDITIONAL([GCC_PCH],[test "$GCC" = "yes"])
1519
AM_CONDITIONAL([GCC_PCH],[test "no" = "yes"])
1445
dnl AM_CONDITIONAL([BUILD_GCC_PCH],[test "$GCC" = "yes"])
1446
AM_CONDITIONAL([BUILD_GCC_PCH],[test "no" = "yes"])
1521
AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl
1522
mystrings/Makefile storage/Makefile dnl
1448
AC_CONFIG_FILES(Makefile dnl
1523
1450
po/Makefile.in dnl
1524
libdrizzle/Makefile client/Makefile dnl
1451
drizzled/message/Makefile dnl
1525
1452
drizzled/Makefile dnl
1526
drizzled/field/Makefile dnl
1527
drizzled/item/Makefile dnl
1528
drizzled/serialize/Makefile dnl
1529
drizzled/functions/Makefile dnl
1530
drizzled/functions/str/Makefile dnl
1531
drizzled/functions/time/Makefile dnl
1532
drizzled/util/Makefile dnl
1533
drizzled/sql_builtin.cc dnl
1534
1453
support-files/Makefile dnl
1535
1454
tests/Makefile tests/install_test_db dnl
1537
drizzled/drizzled_safe support-files/libdrizzle.pc dnl
1455
drizzled/drizzled_safe dnl
1538
1456
support-files/drizzle.server support-files/drizzle-log-rotate)
1540
AC_CONFIG_COMMANDS([default], , test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h)
1458
scheduling_plugins_available="
1463
for sched_plugin in $scheduling_plugins_available
1465
varname="\${with_plugin_${sched_plugin}}"
1466
result=`eval "echo $varname"`
1467
if test "x$result" = "xyes"
1469
scheduling_plugins="$sched_plugin $scheduling_plugins"
1473
AC_CONFIG_COMMANDS([timestamp-h], , test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h)
1475
AC_CONFIG_COMMANDS_PRE([
1476
if test "x$EGREP" != "x" -a -d po
1478
echo "# This file is auto-generated from configure. Do not edit directly" > po/POTFILES.in.in
1479
# The grep -v 'drizzle-' is to exclude any distcheck leftovers
1480
for f in `find . | grep -v 'drizzle-' | ${EGREP} '\.(cc|c|h|yy)$' | cut -c3- | sort`
1482
if grep gettext.h "$f" | grep include >/dev/null 2>&1
1484
echo "$f" >> po/POTFILES.in.in
1487
if ! diff po/POTFILES.in.in po/POTFILES.in >/dev/null 2>&1
1489
mv po/POTFILES.in.in po/POTFILES.in
1491
rm po/POTFILES.in.in
1494
touch po/POTFILES.in
1542
1498
# Ensure that table handlers gets all modifications to CFLAGS/CXXFLAGS
1543
1499
AC_CONFIG_COMMANDS_POST(ac_configure_args="$ac_configure_args CFLAGS='$CFLAGS' CXXFLAGS='$CXXFLAGS' AM_CFLAGS='$AM_CFLAGS' AM_CXXFLAGS='$AM_CXXFLAGS'")