64
99
DRIZZLE_BASE_VERSION=`echo $DRIZZLE_NUMERIC_VERSION | sed -e "s|\.[[^.]]*$||"`
65
100
DRIZZLE_VERSION_ID=`echo $DRIZZLE_NUMERIC_VERSION | \
66
101
awk -F. '{printf "%d%0.2d%0.2d", $1, $2, $3}'`
102
AC_DEFINE_UNQUOTED(DRIZZLE_BASE_VERSION,["$DRIZZLE_BASE_VERSION"],
103
[Major and minor version])
104
AC_DEFINE_UNQUOTED([DRIZZLE_VERSION_ID],[$DRIZZLE_VERSION_ID],
105
[Version ID that can be easily used for numeric comparison])
107
AC_DEFINE([_BACKWARD_BACKWARD_WARNING_H],[1],[Hack to disable deprecation warning in gcc])
68
109
# The port should be constant for a LONG time
69
110
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)
112
m4_include(m4/dtrace.m4)
114
m4_include(m4/character_sets.m4)
91
115
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
118
# Set this for plugins to use
119
ac_build_drizzle="yes"
158
122
# Canonicalize the configuration name.
181
145
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])
228
# Print version of CC and CXX compiler (if they support --version)
152
AC_SUBST(TARGET_LINUX)
153
AC_DEFINE([TARGET_OS_LINUX], [1], [Whether we build for Linux])
231
158
AC_DEFINE([TARGET_OS_OSX], [1], [Whether we build for OSX])
161
TARGET_SOLARIS="true"
162
AC_SUBST(TARGET_SOLARIS)
163
AC_DEFINE([TARGET_OS_SOLARIS], [1], [Whether we are building for Solaris])
234
CC_VERSION=`$CC --version | sed 1q`
239
AC_MSG_CHECKING("C Compiler version")
240
AC_MSG_RESULT("$CC $CC_VERSION")
246
dnl AC_CANONICAL_HOST thinks it's a good idea to just set CFLAGS to
247
dnl -g -O2 if you're running gcc. We would like to use something else, thanks.
248
if test "x${CFLAGS}" = "x-g -O2"
252
if test "x${CXXFLAGS}" = "x-g -O2"
169
DRIZZLE_CHECK_C_VERSION
257
170
DRIZZLE_CHECK_CXX_VERSION
261
if test "$ac_cv_c_compiler_gnu" = "yes"
266
AC_PATH_PROG(AS, as, as)
269
dnl TODO: This needs to go away and be replaced with _ISOC99_SOURCE
270
if test "$ac_cv_compiler_gnu" = "yes" -o "$target_os" = "linux-gnu"
272
AC_DEFINE([_GNU_SOURCE],[1],[Fix problem with S_ISLNK() on Linux])
275
dnl Solaris 9 include file <sys/feature_tests.h> refers to X/Open document
277
dnl System Interfaces and Headers, Issue 5
279
dnl saying we should define _XOPEN_SOURCE=500 to get POSIX.1c prototypes,
280
dnl but apparently other systems (namely FreeBSD) don't agree.
282
dnl On a newer Solaris 10, the above file recognizes also _XOPEN_SOURCE=600.
283
dnl Furthermore, it tests that if a program requires older standard
284
dnl (_XOPEN_SOURCE<600 or _POSIX_C_SOURCE<200112L) it cannot be
285
dnl run on a new compiler (that defines _STDC_C99) and issues an #error.
286
dnl It's also an #error if a program requires new standard (_XOPEN_SOURCE=600
287
dnl or _POSIX_C_SOURCE=200112L) and a compiler does not define _STDC_C99.
289
dnl To add more to this mess, Sun Studio C compiler defines _STDC_C99 while
290
dnl C++ compiler does not!
292
dnl TODO: Can _ISOC99_SOURCE be defined on all platforms and remove the
293
dnl Need for all of this?
294
if test "${build_vendor}" = "sun"
296
dnl Do we need both of these?
298
AC_DEFINE([__C99FEATURES__],[1],[C99 Features])
300
AC_DEFINE([_XOPEN_SOURCE],[600],[X/Open Level])
304
#AC_LIBTOOL_WIN32_DLL
307
# Ensure that we have --preserve-dup-deps defines, otherwise we get link
308
# problems of 'mysql' with CXX=g++
309
LIBTOOL="$LIBTOOL --preserve-dup-deps"
177
AC_PATH_PROG(GPERF, gperf)
178
AS_IF([test "x$GPERF" = "x"],
179
AC_MSG_ERROR("Drizzle requires gperf to build."))
181
AC_PATH_PROG(LCOV, lcov)
182
AC_PATH_PROG(GENHTML, genhtml)
184
AM_CONDITIONAL(HAVE_LCOV,[test "x$LCOV" != "x"])
315
test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
317
# Not critical since the generated file is distributed
318
AC_CHECK_PROGS(YACC, ['bison -y -p MYSQL'])
190
# Look for "(group|user)add".
191
# TODO: If the programs do not exist, inform the DBA that the user
192
# was not created at the end of the install routine.
193
AC_CHECK_PROGS(GROUPADD, groupadd addgroup)
194
AC_CHECK_PROGS(USERADD, useradd adduser)
196
dnl Not critical since the generated file is distributed
197
AC_CHECK_PROGS(YACC, ['bison -y'])
319
198
if test -z "$YACC" && test -d ".bzr"
321
200
AC_MSG_ERROR(["bison is required for Drizzle to build from a bzr branch"])
324
AC_PATH_PROG(uname_prog, uname, no)
326
# We should go through this and put all the explictly system dependent
328
AC_MSG_CHECKING(operating system)
329
AC_CACHE_VAL(mysql_cv_sys_os,
331
if test "$uname_prog" != "no"; then
332
mysql_cv_sys_os="`uname`"
334
mysql_cv_sys_os="Not Solaris"
337
AC_MSG_RESULT($mysql_cv_sys_os)
339
# This should be rewritten to use $target_os
342
TARGET_SOLARIS="true"
343
AC_DEFINE([TARGET_OS_SOLARIS], [1], [Whether we are building for Solaris])
344
AC_SUBST(TARGET_SOLARIS)
348
# The following is required for portable results of floating point calculations
349
# on PowerPC. The same must also be done for IA-64, but this options is missing
350
# in the IA-64 gcc backend.
203
isainfo_b=`isainfo -b`
205
# Build optimized or debug version ?
206
# First check for gcc and g++
352
207
if test "$GCC" = "yes"
209
if test "$isainfo_b" = "64"
213
AC_DEFINE([_GNU_SOURCE],[1],[Fix problem with S_ISLNK() on Linux])
215
dnl The following is required for portable results of floating point
216
dnl calculations on PowerPC. The same must also be done for IA-64, but
217
dnl this options is missing in the IA-64 gcc backend.
354
218
case "$host_cpu" in
355
219
*ppc* | *powerpc*)
356
AM_CFLAGS="$CFLAGS -mno-fused-madd"
357
AM_CXXFLAGS="$CXXFLAGS -mno-fused-madd"
220
CFLAGS="-mno-fused-madd ${CFLAGS}"
221
CXXFLAGS="-mno-fused-madd ${CXXFLAGS}"
368
AC_SUBST(INSTALL_SCRIPT)
371
export CC CXX CFLAGS LD LDFLAGS AR ARFLAGS
373
if test "$GCC" = "yes"
375
# Disable exceptions as they seams to create problems with gcc and threads.
376
# drizzled doesn't use run-time-type-checking, so we disable it.
377
AM_CXXFLAGS="${AM_CXXFLAGS} -fno-exceptions"
225
CFLAGS="-ggdb3 ${IS_64} -std=gnu99 ${CFLAGS}"
226
CXXFLAGS="-ggdb3 ${IS_64} ${CXXFLAGS}"
227
AC_CXX_CHECK_STANDARD
233
OPTIMIZE_CFLAGS="-O3"
234
OPTIMIZE_CXXFLAGS="-O3"
236
if test "$SUNCC" = "yes"
238
if test "$isainfo_b" = "64"
242
dnl we put CPPFLAGS and LDFLAGS first here, because if the user has specified
243
dnl command line CPPFLAGS or LDFLAGS, their -I or -L should come _first_
244
if test "$target_cpu" = "sparc"
246
MEMALIGN_FLAGS="-xmemalign=8s"
249
if test "x$use_additional" != "xyes"
251
LDFLAGS="${LDFLAGS} -L/usr/local/lib/${isainfo_b} -L/usr/local/lib -L/opt/csw/lib/${isainfo_b} -L/opt/csw/lib"
252
CPPFLAGS="${CPPFLAGS} -I/usr/local/include -I/opt/csw/include"
254
LDFLAGS="${LDFLAGS} -L/usr/lib/${isainfo_b}"
256
CXXFLAGS="-xlang=c99 -g -mt -compat=5 -library=stlport4 -template=no%extdef ${IS_64} ${MEMALIGN_FLAGS} ${CXXFLAGS}"
257
CFLAGS="-g -mt -xc99=all ${IS_64} ${MEMALIGN_FLAGS} ${CFLAGS}"
259
DEBUG_CXXFLAGS="-xO0"
261
dnl TODO: -xO4 causes a Sun Studio failure in innodb... let's check back
263
OPTIMIZE_FLAGS="-xO3 -xlibmil -xdepend"
264
OPTIMIZE_CFLAGS="${OPTIMIZE_FLAGS} -Xa -xstrconst"
265
OPTIMIZE_CXXFLAGS="${OPTIMIZE_FLAGS}"
269
m4_include(m4/gettext.m4)
270
AM_GNU_GETTEXT(external, need-formatstring-macros)
271
if test "x$MSGMERGE" = "x" -o "x$MSGMERGE" = "x:"
273
AM_PATH_PROG_WITH_TEST(GMSGMERGE, gmsgmerge,
274
[$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
275
MSGMERGE="${GMSGMERGE}"
277
AM_CONDITIONAL([BUILD_GETTEXT],[test "x$MSGMERGE" != "x" -a "x$MSGMERGE" != "x:"])
283
dnl TODO: Remove this define once we are using 2.61 across the board.
286
# Check whether to enable assertions.
287
AC_DEFUN([AX_HEADER_ASSERT],
289
AC_MSG_CHECKING([whether to enable assertions])
290
AC_ARG_ENABLE([assert],
291
[AS_HELP_STRING([--disable-assert],
292
[Turn off assertions])],
294
[ac_cv_assert="yes"])
295
AC_MSG_RESULT([$ac_cv_assert])
301
[AS_HELP_STRING([--with-debug],
302
[Add debug code/turns off optimizations (yes|no) @<:@default=no@:>@])],
303
[with_debug=$withval],
305
if test "$with_debug" = "yes"
307
# Debuging. No optimization.
308
CFLAGS="${DEBUG_CFLAGS} ${CFLAGS}"
309
CXXFLAGS="${DEBUG_CXXFLAGS} ${CXXFLAGS}"
311
# Optimized version. No debug
312
CFLAGS="${OPTIMIZE_CFLAGS} ${CFLAGS}"
313
CXXFLAGS="${OPTIMIZE_CXXFLAGS} ${CXXFLAGS}"
382
# libdrizzle versioning when linked with GNU ld.
383
if $LD --version 2>/dev/null|grep -q GNU; then
384
LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_srcdir)/libdrizzle/libdrizzle.ver"
386
AC_SUBST(LD_VERSION_SCRIPT)
388
326
#--------------------------------------------------------------------
389
327
# Check for Google Proto Buffers
390
328
#--------------------------------------------------------------------
392
330
AC_LANG_PUSH([C++])
393
AC_CHECK_HEADERS([google/protobuf/message.h])
394
if test "x$ac_cv_header_google_protobuf_message_h" != "xyes"
396
AC_MSG_ERROR([Couldn't find message.h. Try installing Google Protocol Buffer development packages])
399
save_CFLAGS="$CFLAGS"
404
AC_CACHE_CHECK([for Message in libprotobuf], ac_libprotobuf_works, [
406
#include <google/protobuf/descriptor.pb.h>
408
google::protobuf::FileDescriptorProto testFdp;
409
], ac_libprotobuf_works=yes, [
410
AC_ERROR([could not find Google's libprotobuf])
415
PROTOBUF_LIBS="${LIBS}"
416
AC_SUBST(PROTOBUF_LIBS)
417
CFLAGS="$save_CFLAGS"
331
AC_LIB_HAVE_LINKFLAGS(protobuf,,
332
[#include <google/protobuf/descriptor.h>
334
[google::protobuf::FileDescriptor* file;],system)
335
AS_IF([test x$ac_cv_libprotobuf = xno],
336
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.]))
338
AC_CACHE_CHECK([if protobuf is recent enough], [drizzle_cv_protobuf_recent],
339
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
340
#include <google/protobuf/descriptor.h>
341
#if GOOGLE_PROTOBUF_VERSION < 2000002
342
# error Your version of Protobuf is too old
345
[drizzle_cv_protobuf_recent=yes],
346
[drizzle_cv_protobuf_recent=no])])
347
if test "$drizzle_cv_protobuf_recent" = "no"
349
AC_MSG_ERROR([Your version of Google Protocol Buffers is too old. Drizzle requires at least version 2.0.2])
352
AC_PATH_PROG([PROTOC],[protoc],[no],[$LIBPROTOBUF_PREFIX/bin:$PATH])
353
if test "x$PROTOC" = "xno"
355
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.])
421
360
#--------------------------------------------------------------------
423
362
#--------------------------------------------------------------------
425
AC_MSG_CHECKING(for libevent)
426
AC_ARG_WITH(libevent,
427
[AS_HELP_STRING([--with-libevent],
428
[Use libevent build directory])],
429
[ with_libevent=$withval ],
430
[ with_libevent=yes ])
364
dnl Do this by hand. Need to check for uuid/uuid.h, but uuid may or may
365
dnl not be a lib is weird.
432
if test "$with_libevent" = "yes"
367
AC_CHECK_HEADERS(uuid/uuid.h)
368
if test "x$ac_cv_header_uuid_uuid_h" = "xno"
434
AC_CHECK_HEADERS(event.h)
435
if test "x$ac_cv_header_event_h" != "xyes"
437
AC_MSG_ERROR([Couldn't find event.h. Try installing libevent development packages])
441
AC_CHECK_LIB(event, event_loop, [], [AC_MSG_ERROR(could not find libevent)])
442
LIBEVENT_LIBS="${LIBS}"
443
LIBS="${my_save_LIBS}"
446
AC_MSG_RESULT($withval)
447
if test -f $withval/event.h -a -f $withval/libevent.a; then
449
if cd $withval; then withval=`pwd`; cd $owd; fi
450
LIBEVENT_CFLAGS="-I$withval"
451
LIBEVENT_LIBS="-L$withval -levent"
452
elif test -f $withval/include/event.h -a -f $withval/lib/libevent.a; then
454
if cd $withval; then withval=`pwd`; cd $owd; fi
455
LIBEVENT_CFLAGS="-I$withval/include"
456
LIBEVENT_LIBS="-L$withval/lib -levent"
458
AC_MSG_ERROR([event.h or libevent.a not found in $withval])
370
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.])
462
AC_SUBST(LIBEVENT_CFLAGS)
463
AC_SUBST(LIBEVENT_LIBS)
465
AC_CACHE_CHECK([for bufferevent in libevent], ac_libevent_works, [
466
save_CFLAGS="$CFLAGS"
468
CFLAGS="$LIBEVENT_CFLAGS"
469
LIBS="$LIBEVENT_LIBS"
471
#include <sys/types.h>
472
#include <sys/time.h>
474
#include <event.h>],[
475
struct bufferevent bev;
476
bufferevent_settimeout(&bev, 1, 1);
477
], ac_libevent_works=yes, [
478
AC_ERROR([you need to install a more recent version of libevent,
479
check http://www.monkey.org/~provos/libevent/])
482
CFLAGS="$save_CFLAGS"
372
AC_LIB_HAVE_LINKFLAGS(uuid,,
374
#include <uuid/uuid.h>
487
383
#--------------------------------------------------------------------
488
384
# Check for libpthread
489
385
#--------------------------------------------------------------------
491
AC_CHECK_HEADERS(pthread.h)
492
if test "x$ac_cv_header_pthread_h" != "xyes"
494
AC_MSG_ERROR([Couldn't find pthread.h.])
496
AC_CHECK_LIB(pthread, pthread_create, [], [AC_MSG_ERROR(could not find libpthread)])
387
ACX_PTHREAD(,AC_MSG_ERROR(could not find libpthread))
388
LIBS="$PTHREAD_LIBS $LIBS"
389
CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS}"
498
392
#--------------------------------------------------------------------
393
# Check for tcmalloc/mtmalloc
500
394
#--------------------------------------------------------------------
502
396
AC_ARG_ENABLE([tcmalloc],
503
[AS_HELP_STRING([--enable-tcmalloc],
504
[Enable linking with tcmalloc @<:@default=off@:>@])],
397
[AS_HELP_STRING([--disable-tcmalloc],
398
[Enable linking with tcmalloc @<:@default=on@:>@])],
505
399
[ac_enable_tcmalloc="$enableval"],
506
[ac_enable_tcmalloc="no"])
400
[ac_enable_tcmalloc="yes"])
508
if test "x$ac_enable_tcmalloc" = "xyes"
402
if test "x$ac_enable_tcmalloc" != "xno"
510
404
AC_CHECK_LIB(tcmalloc,malloc,[],[])
407
if test "x$ac_cv_lib_tcmalloc_malloc" != "xyes"
409
AC_CHECK_LIB(mtmalloc,malloc,[],[])
413
#--------------------------------------------------------------------
414
# Check for libdrizzle
415
#--------------------------------------------------------------------
417
AC_LIB_HAVE_LINKFLAGS(drizzle,,
418
[#include <libdrizzle/drizzle.h>],
420
const char *version= drizzle_version()
422
AS_IF([test x$ac_cv_libdrizzle = xno],
423
AC_MSG_ERROR([libdrizzle is required for Drizzle]))
513
426
#--------------------------------------------------------------------
515
428
#--------------------------------------------------------------------
519
AC_CHECK_HEADERS(zlib.h)
520
if test "x$ac_cv_header_zlib_h" != "xyes"
522
AC_MSG_ERROR([Couldn't find zlib.h. Try installing zlib development packages])
524
AC_CHECK_LIB(z, crc32, [], [AC_MSG_ERROR(could not find libz)])
430
AC_LIB_HAVE_LINKFLAGS(z,,
435
AS_IF([test x$ac_cv_libz = xno],
436
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.]))
438
#--------------------------------------------------------------------
440
#--------------------------------------------------------------------
443
AC_LIB_HAVE_LINKFLAGS(tbb,,
444
[#include <tbb/atomic.h>
448
tbb::atomic<uint64_t> x;
449
tbb::atomic<uint8_t> y;
530
457
#--------------------------------------------------------------------
531
458
# Check for libreadline or compatible (libedit on Mac OS X)
532
459
#--------------------------------------------------------------------
534
AC_CHECK_HEADERS(readline/history.h readline/readline.h)
535
if test "x$ac_cv_header_readline_readline_h" != "xyes"
537
AC_MSG_ERROR([Couldn't find readline/readline.h. Try installing readline development packages.])
539
AC_CHECK_TYPES([HIST_ENTRY], [], [], [AC_INCLUDES_DEFAULT[
540
#ifdef HAVE_READLINE_HISTORY_H
541
#include <readline/history.h>
543
#include <readline/readline.h>
545
AC_CHECK_DECLS([completion_matches], [], [], [AC_INCLUDES_DEFAULT[
546
#ifdef HAVE_READLINE_HISTORY_H
547
#include <readline/history.h>
549
#include <readline/readline.h>
464
AS_IF([test "x$vl_cv_lib_readline" = "xno"],
465
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.]))
466
READLINE_LIBS="${LIBS}"
468
AC_SUBST(READLINE_LIBS)
552
470
DRIZZLE_CHECK_NEW_RL_INTERFACE
556
AC_CHECK_LIB(readline, rl_initialize, [],
557
[AC_CHECK_LIB(ncurses, tgetent, [], [AC_MSG_ERROR(Couldn't find ncurses)])
558
AC_SEARCH_LIBS(rl_initialize, readline, [],
559
[AC_MSG_ERROR(Couldn't find libreadline.)])])
560
READLINE_LIBS="$LIBS"
562
AC_SUBST(READLINE_LIBS)
565
472
#--------------------------------------------------------------------
566
473
# Check for libpcre
567
474
#--------------------------------------------------------------------
570
AC_PATH_PROG(PKG_CONFIG, pkg-config, AC_MSG_ERROR([pkg-config wasn't found.]))
571
PKG_CHECK_MODULES(PCRE, [libpcrecpp >= 3], [found_pcre="yes"],[found_pcre="no"])
573
if test "$found_pcre" = "no"
575
dnl Only check the header here, because autoconf can't handle
576
dnl checking for C++ methods without C linkages
577
AC_CHECK_HEADERS(pcrecpp.h)
578
if test "x$ac_cv_header_pcrecpp_h" != "xyes"
580
AC_MSG_ERROR([Couldn't find pcrecpp.h. Try installing the development package associated with libpcre on your system.])
582
# Found headers, now see if we can link
583
AC_MSG_CHECKING(for libpcrecpp)
584
save_LDFLAGS="$LDFLAGS"
585
LDFLAGS="-lpcrecpp -lpcre"
589
[pcrecpp::RE_Options opt;],
591
[AC_MSG_ERROR([Couldn't link libpcrecpp])])
594
LDFLAGS="$save_LDFLAGS"
600
AC_SUBST(PCRE_CFLAGS)
476
AC_LIB_HAVE_LINKFLAGS(pcre,, [#include <pcre.h>], [pcre *re= NULL])
477
AS_IF([test "x$ac_cv_libpcre" = "xno"],[
479
AC_LIB_HAVE_LINKFLAGS(pcre,, [#include <pcre/pcre.h>], [pcre *re= NULL])
480
AS_IF([test "x$ac_cv_libpcre" = "xno"],
481
[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.])]
482
[AC_DEFINE(PCRE_HEADER,[<pcre/pcre.h>],[Location of pcre header])])
484
AC_DEFINE(PCRE_HEADER,[<pcre.h>],[Location of pcre header])
602
488
dnl Find paths to some shell programs
603
489
AC_PATH_PROG(LN, ln, ln)
1474
1288
W_UNREACHABLE="-Wunreachable-code"
1291
if test "$ac_warn_cast" = "yes"
1293
W_CAST="-Wold-style-cast"
1296
if test "$ac_warn_effc" = "yes"
1301
if test "$ac_warn_conversion" = "yes"
1303
W_CONVERSION="-Wconversion"
1306
CC_WARNINGS="${BASE_WARNINGS} ${GCC_PEDANTIC} ${W_UNREACHABLE} ${GPROF_PROFILING} ${GPROF_COVERAGE} ${W_SHADOW} ${W_CONVERSION}"
1307
CXX_WARNINGS="${BASE_WARNINGS} ${GXX_PEDANTIC} ${W_UNREACHABLE} ${GPROF_PROFILING} ${GPROF_COVERAGE} ${W_CAST} ${W_SHADOW} ${W_EFFC} ${W_CONVERSION}"
1309
if test "$ac_exceptions" = "no"
1311
NO_EXCEPTIONS="-fno-exceptions"
1312
W_EXCEPTIONS="-fexceptions"
1314
NO_REDUNDANT_DECLS="-Wno-redundant-decls"
1315
PROTOSKIP_WARNINGS="-Wno-effc++ -Wno-shadow"
1317
if test "$SUNCC" = "yes"
1319
if test "$ac_datarace" = "yes"
1321
CFLAGS="-xinstrument=datarace ${CFLAGS}"
1322
CXXFLAGS="-xinstrument=datarace ${CXXFLAGS}"
1477
1325
if test "$ac_warn_fail" = "yes"
1482
BASE_WARNINGS="-W -Wall -Wextra"
1483
GCC_WARNINGS="${C99_SUPPORT_HACK} ${BASE_WARNINGS} ${GCC_PEDANTIC} ${W_UNREACHABLE} ${W_FAIL} ${GPROF_PROFILING} ${GPROF_COVERAGE}"
1484
GXX_WARNINGS="${BASE_WARNINGS} ${GXX_PEDANTIC} ${W_UNREACHABLE} ${W_FAIL} ${GPROF_PROFILING} ${GPROF_COVERAGE}"
1486
AM_CXXFLAGS="${GXX_WARNINGS} ${AM_CXXFLAGS}"
1487
AM_CFLAGS="${GCC_WARNINGS} ${AM_CFLAGS}"
1490
AC_SUBST([GLOBAL_CPPFLAGS],['-I$(top_srcdir) -I$(top_builddir)'])
1491
AC_SUBST([AM_CPPFLAGS],['${GLOBAL_CPPFLAGS}'])
1327
W_FAIL="-errwarn=%all"
1330
CC_WARNINGS="-v -errtags=yes -erroff=E_ATTRIBUTE_NOT_VAR ${W_FAIL}"
1331
CXX_WARNINGS="+w +w2 -xport64 -errtags=yes -erroff=attrskipunsup,doubunder,reftotemp,inllargeuse,truncwarn1,signextwarn,inllargeint ${W_FAIL}"
1332
PROTOSKIP_WARNINGS="-erroff=attrskipunsup,doubunder,reftotemp,wbadinitl,identexpected,inllargeuse,truncwarn1,signextwarn"
1333
NO_UNREACHED="-erroff=E_STATEMENT_NOT_REACHED"
1334
if test "$ac_exceptions" = "no"
1336
NO_EXCEPTIONS="-features=no%except"
1337
W_EXCEPTIONS="-features=except"
1340
AC_SUBST(NO_EXCEPTIONS)
1341
AC_SUBST(W_EXCEPTIONS)
1344
AC_SUBST(NO_REDUNDANT_DECLS)
1345
AC_SUBST(PROTOSKIP_WARNINGS)
1346
AC_SUBST(NO_UNREACHED)
1348
if test "x${gl_LIBOBJS}" != "x"
1350
if test "$GCC" = "yes"
1352
CPPFLAGS="-isystem \$(top_srcdir)/gnulib -isystem \$(top_builddir)/gnulib ${CPPFLAGS}"
1354
CPPFLAGS="-I\$(top_srcdir)/gnulib -I\$(top_builddir)/gnulib ${CPPFLAGS}"
1358
CPPFLAGS="-I\$(top_srcdir) -I\$(top_builddir) ${CPPFLAGS}"
1359
CFLAGS="${CC_WARNINGS} ${CFLAGS}"
1360
CXXFLAGS="${CXX_WARNINGS} ${W_EXCEPTIONS} ${CXXFLAGS}"
1362
dnl Must be done once we turn on warnings and such
1364
[whether __attribute__ visibility "hidden" is supported],
1365
[ac_cv_can_use_hidden_],[
1370
__attribute__((visibility ("hidden")))
1374
[ac_cv_can_use_hidden_=yes],
1375
[ac_cv_can_use_hidden_=no])
1377
if test "$ac_cv_can_use_hidden_" = "yes"
1379
AC_DEFINE(HAVE_ATTR_HIDDEN, 1,
1380
[Define to 1 if you have support for __attribute__((visibility("hidden")))])
1383
AM_CPPFLAGS="${CPPFLAGS}"
1384
AM_CFLAGS="${CFLAGS}"
1385
AM_CXXFLAGS="${CXXFLAGS}"
1387
AC_SUBST([AM_CPPFLAGS])
1492
1388
AC_SUBST([AM_CFLAGS])
1493
1389
AC_SUBST([AM_CXXFLAGS])
1495
# Some usefull subst
1499
# Set configuration options for make_binary_distribution
1500
case $SYSTEM_TYPE in
1502
MAKE_BINARY_DISTRIBUTION_OPTIONS="$MAKE_BINARY_DISTRIBUTION_OPTIONS --no-strip"
1505
: # no change for other platforms yet
1508
AC_SUBST(MAKE_BINARY_DISTRIBUTION_OPTIONS)
1510
AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl
1511
mystrings/Makefile storage/Makefile dnl
1512
vio/Makefile po/Makefile.in dnl
1513
libdrizzle/Makefile client/Makefile dnl
1391
dnl We've collected the flags in AM_*FLAGS now, so blank these.
1396
AC_SUBST(pkgplugindir,"\$(pkglibdir)/plugin")
1398
dnl GCC Precompiled Header Support
1400
dnl AM_CONDITIONAL([BUILD_GCC_PCH],[test "$GCC" = "yes"])
1401
AM_CONDITIONAL([BUILD_GCC_PCH],[test "no" = "yes"])
1403
AC_CONFIG_FILES(Makefile dnl
1405
storage/Makefile dnl
1514
1407
drizzled/Makefile dnl
1515
drizzled/field/Makefile dnl
1516
drizzled/serialize/Makefile dnl
1408
drizzled/message/Makefile dnl
1517
1409
drizzled/sql_builtin.cc dnl
1518
1410
support-files/Makefile dnl
1519
1411
tests/Makefile tests/install_test_db dnl
1520
drizzled/version.h plugin/Makefile dnl
1521
drizzled/drizzled_safe support-files/libdrizzle.pc dnl
1413
drizzled/drizzled_safe dnl
1522
1414
support-files/drizzle.server support-files/drizzle-log-rotate)
1524
AC_CONFIG_COMMANDS([default], , test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h)
1416
scheduling_plugins_available="
1421
for sched_plugin in $scheduling_plugins_available
1423
varname="\${with_plugin_${sched_plugin}}"
1424
result=`eval "echo $varname"`
1425
if test "x$result" = "xyes"
1427
scheduling_plugins="$sched_plugin $scheduling_plugins"
1431
AC_CONFIG_COMMANDS([timestamp-h], , test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h)
1433
AC_CONFIG_COMMANDS_PRE([
1434
if test "x$EGREP" != "x" -a -d po
1436
echo "# This file is auto-generated from configure. Do not edit directly" > po/POTFILES.in.in
1437
# The grep -v 'drizzle-' is to exclude any distcheck leftovers
1438
for f in `find . | grep -v 'drizzle-' | ${EGREP} '\.(cc|c|h|yy)$' | cut -c3- | sort`
1440
if grep gettext.h "$f" | grep include >/dev/null 2>&1
1442
echo "$f" >> po/POTFILES.in.in
1445
if ! diff po/POTFILES.in.in po/POTFILES.in >/dev/null 2>&1
1447
mv po/POTFILES.in.in po/POTFILES.in
1449
rm po/POTFILES.in.in
1452
touch po/POTFILES.in
1526
1456
# Ensure that table handlers gets all modifications to CFLAGS/CXXFLAGS
1527
1457
AC_CONFIG_COMMANDS_POST(ac_configure_args="$ac_configure_args CFLAGS='$CFLAGS' CXXFLAGS='$CXXFLAGS' AM_CFLAGS='$AM_CFLAGS' AM_CXXFLAGS='$AM_CXXFLAGS'")
1462
echo "Configuration summary for $PACKAGE_NAME version $VERSION"
1464
echo " * Installation prefix: $prefix"
1465
echo " * System type: $SYSTEM_TYPE"
1466
echo " * Host CPU: $host_cpu"
1467
echo " * C Compiler: $CC_VERSION"
1468
echo " * C++ Compiler: $CXX_VERSION"
1469
echo " * Build auth_pam: $ac_cv_header_security_pam_appl_h"
1470
echo " * Assertions enabled: $ac_cv_assert"
1471
echo " * Debug enabled: $with_debug"
1472
echo " * Profiling enabled: $ac_profiling"
1473
echo " * Coverage enabled: $ac_coverage"
1474
echo " * Warnings as failure: $ac_warn_fail"
1475
echo " * Scheduling Plugins: $scheduling_plugins"
1476
echo " * C++ cstdint location: $ac_cv_cxx_cstdint"
1477
echo " * C++ hash_map location: $ac_cv_cxx_hash_map"
1478
echo " * C++ hash namespace: $ac_cv_cxx_hash_namespace"
1479
echo " * C++ shared_ptr namespace: $ac_cv_shared_ptr_namespace"
1483
dnl libtoolize scans configure.ac and needs to see some text
1484
m4_define([LIBTOOLIZE_AC_INIT], [])