7
7
AC_CONFIG_SRCDIR([drizzled/drizzled.cc])
8
8
AC_CONFIG_AUX_DIR(config)
9
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)
30
10
AC_CANONICAL_TARGET
31
AM_INIT_AUTOMAKE(-Wall -Wno-portability -Werror)
11
AM_INIT_AUTOMAKE(-Wall -Werror)
33
13
PROTOCOL_VERSION=10
35
15
# See the libtool docs for information on how to do shared lib versions.
36
SHARED_LIB_MAJOR_VERSION=1
16
SHARED_LIB_MAJOR_VERSION=16
37
17
SHARED_LIB_VERSION=$SHARED_LIB_MAJOR_VERSION:0:0
39
##############################################################################
40
# The below section needs to be done before AC_PROG_CC
41
##############################################################################
43
if test "x${CFLAGS-}" = x ; then
49
if test "x${CPPFLAGS-}" = x ; then
55
if test "x${LDFLAGS-}" = x ; then
61
################ End of section to be done before AC_PROG_CC #################
63
dnl Checks for programs.
65
ifdef([AC_PROG_CC_C99],[
66
dnl TODO: Need to fix this to use c99 instead of gnu99
67
AC_PROG_CC_C99([],[AC_MSG_ERROR([C99 support required for compiling Drizzle])])
69
],[C99_SUPPORT_HACK="-std=gnu99"])
71
ifdef([AC_USE_SYSTEM_EXTENSIONS],[
72
AC_USE_SYSTEM_EXTENSIONS
75
AH_VERBATIM([__EXTENSIONS__],
76
[/* Enable extensions on Solaris. */
77
#ifndef __EXTENSIONS__
78
# undef __EXTENSIONS__
80
#ifndef _POSIX_PTHREAD_SEMANTICS
81
# undef _POSIX_PTHREAD_SEMANTICS
83
#ifndef _TANDEM_SOURCE
84
# undef _TANDEM_SOURCE
87
AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
88
[ac_cv_safe_to_define___extensions__],
91
# define __EXTENSIONS__ 1
92
AC_INCLUDES_DEFAULT])],
93
[ac_cv_safe_to_define___extensions__=yes],
94
[ac_cv_safe_to_define___extensions__=no])])
95
test $ac_cv_safe_to_define___extensions__ = yes &&
96
AC_DEFINE([__EXTENSIONS__])
97
AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
98
AC_DEFINE([_TANDEM_SOURCE])
102
AC_CXX_HEADER_STDCXX_98
103
if test "$ac_cv_cxx_stdcxx_98" = "no"
105
AC_MSG_ERROR([C++ Compiler required to compile Drizzle])
110
AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
112
dnl AC_CANONICAL_HOST thinks it's a good idea to just set CFLAGS to
113
dnl -g -O2 if you're running gcc. We would like to use something else, thanks.
114
if test "x${CFLAGS}" = "x-g -O2"
118
if test "x${CXXFLAGS}" = "x-g -O2"
124
21
# Set all version vars based on $VERSION. How do we do this more elegant ?
140
37
# The port should be constant for a LONG time
141
38
DRIZZLE_TCP_PORT_DEFAULT=4427
41
sinclude(m4/alloca.m4)
42
sinclude(m4/check_cpu.m4)
43
sinclude(m4/character_sets.m4)
44
sinclude(m4/compiler_flag.m4)
143
45
sinclude(m4/dtrace.m4)
144
sinclude(m4/character_sets.m4)
46
sinclude(m4/plugins.m4)
47
sinclude(m4/large_file.m4)
49
sinclude(m4/readline.m4)
52
sinclude(m4/lib-link.m4)
53
sinclude(m4/lib-prefix.m4)
145
54
sinclude(m4/gettext.m4)
55
sinclude(m4/progtest.m4)
59
sinclude(m4/lib-ld.m4)
60
sinclude(m4/ac_cxx_header_stdcxx_98.m4)
147
62
AM_GNU_GETTEXT([external])
148
63
AM_GNU_GETTEXT_VERSION(0.17)
150
AM_CONDITIONAL([BUILD_GETTEXT],[test "x$MSGMERGE" != "x" -a "x$MSGMERGE" != "x:"])
65
AM_CONDITIONAL([BUILD_GETTEXT],[test "x$MSGMERGE" != "x"])
152
67
AC_SUBST(DRIZZLE_NO_DASH_VERSION)
153
AC_DEFINE_UNQUOTED(DRIZZLE_BASE_VERSION,["$DRIZZLE_BASE_VERSION"],
154
[Major and minor version])
68
AC_SUBST(DRIZZLE_BASE_VERSION)
155
69
AC_SUBST(DRIZZLE_VERSION_ID)
156
AC_DEFINE_UNQUOTED([DRIZZLE_VERSION_ID],[$DRIZZLE_VERSION_ID],
157
[Version ID that can be easily used for numeric comparison])
158
70
AC_SUBST(DRIZZLE_PREVIOUS_BASE_VERSION)
159
71
AC_SUBST(PROTOCOL_VERSION)
160
72
AC_DEFINE_UNQUOTED([PROTOCOL_VERSION], [$PROTOCOL_VERSION],
161
73
[mysql client protocol version])
162
74
AC_SUBST(DOT_FRM_VERSION)
163
AC_DEFINE_UNQUOTED([FRM_VER], [$DOT_FRM_VERSION],
75
AC_DEFINE_UNQUOTED([DOT_FRM_VERSION], [$DOT_FRM_VERSION],
164
76
[Version of .frm files])
165
AC_DEFINE_UNQUOTED([DRIZZLE_CONFIG_NAME],["drizzled"],[Name of server config section])
167
77
AC_SUBST(SHARED_LIB_MAJOR_VERSION)
168
78
AC_SUBST(SHARED_LIB_VERSION)
169
79
AC_SUBST(AVAILABLE_LANGUAGES)
171
dnl Ok. This is sort of lame, but we need to be nice to plugins Makefile.am's.
172
AM_CONDITIONAL(BUILDING_DRIZZLE,[test "x" = "x"])
176
AC_DEFINE([IO_SIZE], [4096], [Io buffer size; Must be a power of 2 and
177
a multiple of 512. May be
178
smaller what the disk page size. This influences the speed of the
179
isam btree library. eg to big to slow.])
180
AC_DEFINE([SC_MAXWIDTH],[256], [Max width of screen (for error messages)])
181
AC_DEFINE([FN_LEN],[256 ], [Max file name len ])
182
AC_DEFINE([FN_EXTLEN],[20], [Max length of extension (part of FN_LEN) ])
183
AC_DEFINE([FN_REFLEN],[512], [Max length of full path-name ])
184
AC_DEFINE([FN_EXTCHAR],['.'], [File extension character])
185
AC_DEFINE([FN_HOMELIB],['~'], [~/ is used as abbrev for home dir ])
186
AC_DEFINE([FN_CURLIB],['.'], [./ is used as abbrev for current dir ])
187
AC_DEFINE([FN_PARENTDIR],[".."], [Parent directory; Must be a string ])
189
AC_DEFINE([MASTER],[1],[Compile without unireg])
191
AH_VERBATIM([QUOTE_ARG],[
192
/* Quote argument (before cpp) */
194
# define QUOTE_ARG(x) #x
196
/* Quote argument, (after cpp) */
197
#ifndef STRINGIFY_ARG
198
# define STRINGIFY_ARG(x) QUOTE_ARG(x)
202
AH_VERBATIM([builtin_expect],[
204
* The macros below are borrowed from include/linux/compiler.h in the
205
* Linux kernel. Use them to indicate the likelyhood of the truthfulness
206
* of a condition. This serves two purposes - newer versions of gcc will be
207
* able to optimize for branch predication, which could yield siginficant
208
* performance gains in frequently executed sections of the code, and the
209
* other reason to use them is for documentation
211
#if !defined(__GNUC__)
212
#define __builtin_expect(x, expected_value) (x)
215
#define likely(x) __builtin_expect((x),1)
216
#define unlikely(x) __builtin_expect((x),0)
219
dnl InnoDB depends on some Drizzle's internals which other plugins should not
220
dnl need. This is because of InnoDB's foreign key support, "safe" binlog
221
dnl truncation, and other similar legacy features.
223
dnl We define accessors for these internals unconditionally, but do not
224
dnl expose them in mysql/plugin.h. They are declared in ha_innodb.h for
227
AC_DEFINE([INNODB_COMPATIBILITY_HOOKS],[1],[TODO: Remove the need for this])
228
dnl TODO: Make a test for when this needs to be set.
229
AC_DEFINE([_REENTRANT],[1],[Some thread libraries require this])
231
AH_VERBATIM([posix_pthread],[
232
/* We want posix threads */
233
#ifndef _POSIX_PTHREAD_SEMANTICS
234
#define _POSIX_PTHREAD_SEMANTICS
239
82
# Canonicalize the configuration name.
262
105
i?86) BASE_MACHINE_TYPE=i386 ;;
108
# Save some variables and the command line options for mysqlbug
111
SAVE_ASFLAGS="$ASFLAGS"
112
SAVE_CFLAGS="$CFLAGS"
113
SAVE_CXXFLAGS="$CXXFLAGS"
114
SAVE_LDFLAGS="$LDFLAGS"
115
SAVE_CXXLDFLAGS="$CXXLDFLAGS"
116
CONF_COMMAND="$0 $ac_configure_args"
117
AC_SUBST(CONF_COMMAND)
120
AC_SUBST(SAVE_ASFLAGS)
121
AC_SUBST(SAVE_CFLAGS)
122
AC_SUBST(SAVE_CXXFLAGS)
123
AC_SUBST(SAVE_LDFLAGS)
124
AC_SUBST(SAVE_CXXLDFLAGS)
266
128
# This is needed is SUBDIRS is set
273
AC_SUBST(TARGET_LINUX)
274
AC_DEFINE([TARGET_OS_LINUX], [1], [Whether we build for Linux])
131
##############################################################################
132
# The below section needs to be done before AC_PROG_CC
133
##############################################################################
135
if test "x${CFLAGS-}" = x ; then
141
if test "x${CPPFLAGS-}" = x ; then
147
if test "x${LDFLAGS-}" = x ; then
153
################ End of section to be done before AC_PROG_CC #################
155
# The following hack should ensure that configure doesn't add optimizing
156
# or debugging flags to CFLAGS or CXXFLAGS
157
# C_EXTRA_FLAGS are flags that are automaticly added to both
158
# CFLAGS and CXXFLAGS
159
CFLAGS="$CFLAGS $C_EXTRA_FLAGS "
160
CXXFLAGS="$CXXFLAGS $C_EXTRA_FLAGS "
162
dnl Checks for programs.
164
ifdef([AC_PROG_CC_C99],[
165
AC_PROG_CC_C99([],[AC_MSG_ERROR([C99 support required for compiling Drizzle])])
167
],[C99_SUPPORT_HACK="-std=gnu99"])
169
AC_CXX_HEADER_STDCXX_98
170
if test "$ac_cv_cxx_stdcxx_98" = "no"
172
AC_MSG_ERROR([C++ Compiler required to compile Drizzle])
177
# Print version of CC and CXX compiler (if they support --version)
279
180
AC_DEFINE([TARGET_OS_OSX], [1], [Whether we build for OSX])
282
TARGET_SOLARIS="true"
283
AC_SUBST(TARGET_SOLARIS)
284
AC_DEFINE([TARGET_OS_SOLARIS], [1], [Whether we are building for Solaris])
183
CC_VERSION=`$CC --version | sed 1q`
290
dnl AC_CANONICAL_HOST thinks it's a good idea to just set CFLAGS to
291
dnl -g -O2 if you're running gcc. We would like to use something else, thanks.
292
if test "x${CFLAGS}" = "x-g -O2"
296
if test "x${CXXFLAGS}" = "x-g -O2"
301
DRIZZLE_CHECK_C_VERSION
188
AC_MSG_CHECKING("C Compiler version")
189
AC_MSG_RESULT("$CC $CC_VERSION")
302
194
DRIZZLE_CHECK_CXX_VERSION
311
203
AC_PATH_PROG(AS, as, as)
314
dnl TODO: This needs to go away and be replaced with _ISOC99_SOURCE
315
if test "$ac_cv_c_compiler_gnu" = "yes" -o "$target_os" = "linux-gnu"
317
AC_DEFINE([_GNU_SOURCE],[1],[Fix problem with S_ISLNK() on Linux])
320
dnl Solaris 9 include file <sys/feature_tests.h> refers to X/Open document
322
dnl System Interfaces and Headers, Issue 5
324
dnl saying we should define _XOPEN_SOURCE=500 to get POSIX.1c prototypes,
325
dnl but apparently other systems (namely FreeBSD) don't agree.
327
dnl On a newer Solaris 10, the above file recognizes also _XOPEN_SOURCE=600.
328
dnl Furthermore, it tests that if a program requires older standard
329
dnl (_XOPEN_SOURCE<600 or _POSIX_C_SOURCE<200112L) it cannot be
330
dnl run on a new compiler (that defines _STDC_C99) and issues an #error.
331
dnl It's also an #error if a program requires new standard (_XOPEN_SOURCE=600
332
dnl or _POSIX_C_SOURCE=200112L) and a compiler does not define _STDC_C99.
334
dnl To add more to this mess, Sun Studio C compiler defines _STDC_C99 while
335
dnl C++ compiler does not!
337
dnl TODO: Can _ISOC99_SOURCE be defined on all platforms and remove the
338
dnl Need for all of this?
339
if test "$GCC" = "yes"
343
CFLAGS="${CFLAGS} -D_XOPEN_SOURCE=600"
344
CXXFLAGS="${CXXFLAGS} -D__C99FEATURES__"
350
207
#AC_LIBTOOL_WIN32_DLL
399
# Build optimized or debug version ?
400
# First check for gcc and g++
404
DEBUG_OPTIMIZE_CXX=""
405
OPTIMIZE_CXXFLAGS="-O"
406
if test "$GCC" = "yes"
408
SYMBOLS_FLAGS="-ggdb3"
409
DEBUG_OPTIMIZE_CC="-O0"
410
OPTIMIZE_CFLAGS="-O3"
411
DEBUG_OPTIMIZE_CXX="-O0"
412
OPTIMIZE_CXXFLAGS="-O3"
414
if test "$SUNCC" = "yes"
416
dnl I'm cheating here and sticking C99 support in SYMBOLS_FLAGS
419
OPTIMIZE_CFLAGS="-xO4 -xlibmil -xdepend -Xa -mt -xstrconst -D_FORTEC_"
420
DEBUG_OPTIMIZE_CXX=""
421
#Put back in once isnan is figured out
422
OPTIMIZE_CXXFLAGS="-xO4 -xlibmil -mt -D_FORTEC_ -xlang=c99 -compat=5 -library=stlport4"
425
dnl TODO: Remove this define once we are using 2.61 across the board.
428
# Check whether to enable assertions.
429
AC_DEFUN([AX_HEADER_ASSERT],
431
AC_MSG_CHECKING([whether to enable assertions])
432
AC_ARG_ENABLE([assert],
433
[AS_HELP_STRING([--disable-assert],
434
[Turn off assertions])],
436
[ac_cv_assert="yes"])
437
AC_MSG_RESULT([$ac_cv_assert])
442
CFLAGS="${SYMBOLS_FLAGS} ${CFLAGS}"
443
CXXFLAGS="${SYMBOLS_FLAGS} ${CXXFLAGS}"
446
[AS_HELP_STRING([--with-debug],
447
[Add debug code/turns off optimizations (yes|no) @<:@default=no@:>@])],
448
[with_debug=$withval],
450
if test "$with_debug" = "yes"
453
CFLAGS="$DEBUG_OPTIMIZE_CC -DDEBUG $CFLAGS ${SAVE_CFLAGS}"
454
CXXFLAGS="$DEBUG_OPTIMIZE_CXX -DDEBUG $CXXFLAGS ${SAVE_CXXFLAGS}"
456
# Optimized version. No debug
457
CFLAGS="${OPTIMIZE_CFLAGS} ${CFLAGS} ${SAVE_CFLAGS}"
458
CXXFLAGS="$OPTIMIZE_CXXFLAGS $CXXFLAGS ${SAVE_CXXFLAGS}"
486
292
# Check for Google Proto Buffers
487
293
#--------------------------------------------------------------------
489
AC_MSG_CHECKING(for Google Protocol Buffers)
490
AC_ARG_WITH(protobuf,
491
[AS_HELP_STRING([--with-protobuf@<:@=DIR@:>@],
492
[search for protobuf in DIR/include and DIR/lib])],
493
[ with_protobuf=$withval ],
494
[ with_protobuf=yes ])
496
save_CPPFLAGS="$CPPFLAGS"
499
if test "$with_protobuf" = "yes"
505
CPPFLAGS="-I$withval/include"
506
LIBS="-L$withval/lib -lprotobuf"
507
PROTO_PATH="${withval}/bin:$PATH"
510
AC_CHECK_TOOL([PROTOC],[protoc],[no],[$PROTO_PATH])
511
if test "x$PROTOC" = "xno"
513
AC_MSG_ERROR([Couldn't find protoc. Try installing Google Protocol Buffer.])
516
295
AC_LANG_PUSH([C++])
517
296
AC_CHECK_HEADERS([google/protobuf/message.h])
518
297
if test "x$ac_cv_header_google_protobuf_message_h" != "xyes"
520
299
AC_MSG_ERROR([Couldn't find message.h. Try installing Google Protocol Buffer development packages])
522
AC_MSG_RESULT("$wthval")
302
save_CFLAGS="$CFLAGS"
524
307
AC_CACHE_CHECK([for Message in libprotobuf], ac_libprotobuf_works, [
535
318
PROTOBUF_LIBS="${LIBS}"
536
PROTOBUF_CPPFLAGS="${CPPFLAGS}"
537
319
AC_SUBST(PROTOBUF_LIBS)
538
AC_SUBST(PROTOBUF_CPPFLAGS)
539
CPPFLAGS="$save_CPPFLAGS"
320
CFLAGS="$save_CFLAGS"
540
321
LIBS="$save_LIBS"
543
324
#--------------------------------------------------------------------
545
#--------------------------------------------------------------------
547
AC_CHECK_HEADERS(uuid/uuid.h)
548
if test "x$ac_cv_header_uuid_uuid_h" = "xno"
550
AC_MSG_ERROR([Couldn't find uuid/uuid.h. Try installing libuuid development packages])
552
AC_CHECK_LIB(uuid, uuid_generate)
554
#--------------------------------------------------------------------
555
325
# Check for libevent
556
326
#--------------------------------------------------------------------
558
328
AC_MSG_CHECKING(for libevent)
559
329
AC_ARG_WITH(libevent,
560
[AS_HELP_STRING([--with-libevent@<:@=DIR@:>@],
561
[Use libevent in DIR])],
330
[AS_HELP_STRING([--with-libevent],
331
[Use libevent build directory])],
562
332
[ with_libevent=$withval ],
563
333
[ with_libevent=yes ])
574
344
AC_CHECK_LIB(event, event_loop, [], [AC_MSG_ERROR(could not find libevent)])
575
345
LIBEVENT_LIBS="${LIBS}"
576
346
LIBS="${my_save_LIBS}"
579
349
AC_MSG_RESULT($withval)
580
350
if test -f $withval/event.h -a -f $withval/libevent.a; then
582
352
if cd $withval; then withval=`pwd`; cd $owd; fi
583
LIBEVENT_CPPFLAGS="-I$withval"
353
LIBEVENT_CFLAGS="-I$withval"
584
354
LIBEVENT_LIBS="-L$withval -levent"
585
355
elif test -f $withval/include/event.h -a -f $withval/lib/libevent.a; then
587
357
if cd $withval; then withval=`pwd`; cd $owd; fi
588
LIBEVENT_CPPFLAGS="-I$withval/include"
358
LIBEVENT_CFLAGS="-I$withval/include"
589
359
LIBEVENT_LIBS="-L$withval/lib -levent"
591
361
AC_MSG_ERROR([event.h or libevent.a not found in $withval])
595
AC_SUBST(LIBEVENT_CPPFLAGS)
365
AC_SUBST(LIBEVENT_CFLAGS)
596
366
AC_SUBST(LIBEVENT_LIBS)
598
368
AC_CACHE_CHECK([for bufferevent in libevent], ac_libevent_works, [
599
save_CPPFLAGS="$CPPFLAGS"
369
save_CFLAGS="$CFLAGS"
600
370
save_LIBS="$LIBS"
601
CPPFLAGS="$LIBEVENT_CPPFLAGS"
371
CFLAGS="$LIBEVENT_CFLAGS"
602
372
LIBS="$LIBEVENT_LIBS"
604
374
#include <sys/types.h>
914
683
AC_SUBST(DRIZZLE_TCP_PORT)
915
684
# We might want to document the assigned port in the manual.
916
685
AC_SUBST(DRIZZLE_TCP_PORT_DEFAULT)
917
AC_DEFINE_UNQUOTED([DRIZZLE_PORT],[$DRIZZLE_TCP_PORT],
918
[Drizzle port to use])
919
AC_DEFINE_UNQUOTED([DRIZZLE_PORT_DEFAULT],[$DRIZZLE_TCP_PORT_DEFAULT],
920
[If we defaulted to DRIZZLE_PORT, then this will be zero])
922
687
# Use this to set the place used for unix socket used to local communication.
923
AC_ARG_WITH([drizzled-user],
924
[AS_HELP_STRING([--with-drizzled-user=username],
925
[What user the drizzled daemon shall be run as.
926
@<:@default=drizzle@:>@])],
927
[ DRIZZLED_USER=$withval ],
928
[ DRIZZLED_USER=drizzle ]
688
AC_ARG_WITH([mysqld-user],
689
[AS_HELP_STRING([--with-mysqld-user=username],
690
[What user the mysqld daemon shall be run as.
691
@<:@default=mysql@:>@])],
692
[ MYSQLD_USER=$withval ],
693
[ MYSQLD_USER=mysql ]
930
AC_SUBST(DRIZZLED_USER)
695
AC_SUBST(MYSQLD_USER)
932
697
# If we should allow LOAD DATA LOCAL
933
698
AC_MSG_CHECKING(If we should should enable LOAD DATA LOCAL by default)
962
726
AC_CHECK_HEADERS(fcntl.h float.h fpu_control.h ieeefp.h)
963
727
AC_CHECK_HEADERS(limits.h pwd.h select.h linux/config.h)
964
728
AC_CHECK_HEADERS(sys/fpu.h utime.h sys/utime.h )
965
AC_CHECK_HEADERS(synch.h sys/mman.h sys/socket.h)
966
AC_CHECK_HEADERS([curses.h term.h],[],[],
967
[[#ifdef HAVE_CURSES_H
729
AC_CHECK_HEADERS(synch.h sys/mman.h sys/socket.h netinet/in.h arpa/inet.h)
730
AC_CHECK_HEADERS(sys/timeb.h sys/vadvise.h sys/wait.h term.h)
971
731
AC_CHECK_HEADERS(termio.h termios.h sched.h alloca.h)
972
AC_CHECK_HEADERS(sys/prctl.h ieeefp.h)
732
AC_CHECK_HEADERS(sys/ioctl.h malloc.h sys/malloc.h sys/ipc.h sys/shm.h)
733
AC_CHECK_HEADERS(sys/prctl.h sys/resource.h sys/param.h port.h ieeefp.h)
973
734
AC_CHECK_HEADERS(execinfo.h)
736
AC_CHECK_HEADERS([xfs/xfs.h])
975
738
#--------------------------------------------------------------------
976
739
# Check for system libraries. Adds the library to $LIBS
977
740
# and defines HAVE_LIBM etc
978
741
#--------------------------------------------------------------------
980
743
AC_CHECK_LIB(m, floor, [], AC_CHECK_LIB(m, __infinity))
982
746
AC_CHECK_FUNC(setsockopt, [], [AC_CHECK_LIB(socket, setsockopt)])
983
747
AC_CHECK_FUNC(yp_get_default_domain, [],
1021
789
AC_CHECK_FUNCS(strtok_r)
791
# Build optimized or debug version ?
792
# First check for gcc and g++
793
if test "$ac_cv_c_compiler_gnu" = "yes"
795
SYMBOLS_CFLAGS="-ggdb3"
796
DEBUG_OPTIMIZE_CC="-O0"
797
OPTIMIZE_CFLAGS="-O3"
803
if test "$ac_cv_prog_cxx_g" = "yes"
805
SYMBOLS_CXXFLAGS="-ggdb3"
806
DEBUG_OPTIMIZE_CXX="-O0"
807
OPTIMIZE_CXXFLAGS="-O3"
809
SYMBOLS_CXXFLAGS="-g"
810
DEBUG_OPTIMIZE_CXX=""
811
OPTIMIZE_CXXFLAGS="-O"
814
# If the user specified CFLAGS, we won't add any optimizations
815
if test -n "$SAVE_CFLAGS"
821
if test -n "$SAVE_CXXFLAGS"
824
DEBUG_OPTIMIZE_CXX=""
827
dnl TODO: Remove this define once we are using 2.61 across the board.
830
# Check whether to enable assertions.
831
ifdef([AC_HEADER_ASSERT], [], [AC_DEFUN([AC_HEADER_ASSERT],
833
AC_MSG_CHECKING([whether to enable assertions])
834
AC_ARG_ENABLE([assert],
835
[ --disable-assert turn off assertions],
837
AC_DEFINE(NDEBUG, 1, [Define to 1 if assertions should be disabled.])],
838
[AC_MSG_RESULT(yes)])
843
CFLAGS="${SYMBOLS_CFLAGS} ${CFLAGS}"
844
CXXFLAGS="${SYMBOLS_CXXFLAGS} ${CXXFLAGS}"
847
[AS_HELP_STRING([--with-debug],
848
[Add debug code/turns off optimizations (yes|no) @<:@default=no@:>@])],
849
[with_debug=$withval],
851
if test "$with_debug" = "yes"
854
CFLAGS="$DEBUG_OPTIMIZE_CC $CFLAGS"
855
CXXFLAGS="$DEBUG_OPTIMIZE_CXX $CXXFLAGS"
857
# Optimized version. No debug
858
CFLAGS="$OPTIMIZE_CFLAGS $CFLAGS"
859
CXXFLAGS="$OPTIMIZE_CXXFLAGS $CXXFLAGS"
1025
863
AC_ARG_WITH([fast-mutexes],
904
# AC_CHECK_SIZEOF return 0 when it does not find the size of a
905
# type. We want a error instead.
906
AC_CHECK_SIZEOF(char, 1)
907
if test "$ac_cv_sizeof_char" -eq 0
909
AC_MSG_ERROR([No size for char type.])
911
AC_CHECK_SIZEOF(char*, 4)
912
AC_CHECK_SIZEOF(short, 2)
913
AC_CHECK_SIZEOF(int, 4)
914
if test "$ac_cv_sizeof_int" -eq 0
916
AC_MSG_ERROR("No size for int type.")
918
AC_CHECK_SIZEOF(long, 4)
919
if test "$ac_cv_sizeof_long" -eq 0
921
AC_MSG_ERROR("No size for long type.")
923
AC_CHECK_SIZEOF(long long, 8)
924
if test "$ac_cv_sizeof_long_long" -eq 0
926
AC_MSG_ERROR("Drizzle needs a long long type.")
1059
928
# off_t is not a builtin type
1060
929
AC_CHECK_SIZEOF(off_t, 4)
1061
930
if test "$ac_cv_sizeof_off_t" -eq 0
1086
966
DRIZZLE_TIMESPEC_TS
1087
967
# Do we have the tzname variable
969
# Do the c++ compiler have a bool type
1089
971
AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>])
1090
AC_CHECK_TYPES([uint, ulong])
972
AC_CHECK_TYPES([size_t], [], [], [#include <stdio.h>])
973
AC_CHECK_TYPES([u_int32_t])
1092
975
DRIZZLE_PTHREAD_YIELD
1095
978
dnl Checks for header files.
1096
AC_CHECK_HEADERS(malloc.h)
979
AC_CHECK_HEADERS(malloc.h sys/cdefs.h)
1098
981
dnl Checks for library functions.
1100
983
AC_PROG_GCC_TRADITIONAL
985
AC_CHECK_FUNCS(re_comp regcomp strdup)
987
dnl Sun compilers have their own vis.h that is about something
988
dnl totally different. So, not to change the libedit source, we
989
dnl do some additional checks before we define HAVE_VIS_H.
990
AC_CHECK_HEADER(vis.h,
991
[AC_CHECK_FUNC(strvis,
992
[AC_DEFINE([HAVE_VIS_H], [1],[Found vis.h and the strvis() function])])])
994
AC_CHECK_FUNCS(strlcat strlcpy)
1103
995
AC_CHECK_FUNCS(issetugid)
996
AC_CHECK_FUNCS(getline flockfile)
1105
998
# from old readline settting:
1160
1070
AC_CONFIG_LIBOBJ_DIR([mystrings])
1071
AC_REPLACE_FUNCS([stpcpy stpncpy])
1073
AC_CHECK_FUNCS(bsearch \
1163
1074
cuserid fchmod \
1164
fdatasync fpresetsticky fpsetmask fsync \
1165
getcwd getpassphrase getpwnam \
1075
fdatasync finite fpresetsticky fpsetmask fsync ftruncate \
1076
getcwd getpass getpassphrase getpwnam \
1166
1077
getpwuid getrlimit getrusage getwd index initgroups isnan \
1167
1078
localtime_r gethrtime gmtime_r \
1169
mkstemp mlockall poll pread pthread_attr_create mmap mmap64 \
1079
locking longjmp lrand48 madvise mallinfo \
1081
mkstemp mlockall perror poll pread pthread_attr_create mmap mmap64 \
1170
1082
pthread_attr_getstacksize pthread_attr_setprio pthread_attr_setschedparam \
1171
1083
pthread_attr_setstacksize pthread_condattr_create pthread_getsequence_np \
1172
1084
pthread_key_delete pthread_rwlock_rdlock pthread_setprio \
1173
1085
pthread_setprio_np pthread_setschedparam pthread_sigmask readlink \
1174
realpath rename rwlock_init setupterm \
1179
backtrace backtrace_symbols backtrace_symbols_fd)
1086
realpath rename rint rwlock_init setupterm \
1087
shmget shmat shmdt shmctl sigaction sigemptyset sigaddset \
1088
sighold sigset sigthreadmask port_create sleep \
1089
snprintf socket strcasecmp strerror strsignal strpbrk \
1090
tell tempnam vidattr \
1091
posix_fallocate backtrace backtrace_symbols backtrace_symbols_fd)
1181
1093
AC_LANG_PUSH(C++)
1182
1094
# Test whether madvise() is declared in C++ code -- it is not on some
1183
1095
# systems, such as Solaris
1184
AC_CHECK_DECLS([madvise], [], [], [AC_INCLUDES_DEFAULT[
1096
AC_CHECK_DECLS(madvise, [], [], [#if HAVE_SYS_MMAN_H
1186
1097
#include <sys/types.h>
1187
1098
#include <sys/mman.h>
1193
1103
AM_CONDITIONAL(BUILD_THR_RWLOCK,[test "$ac_cv_func_rwlock_init" -a "$ac_cv_funn_pthread_rwlock_rdlock"])
1105
# Check that isinf() is available in math.h and can be used in both C and C++
1107
AC_MSG_CHECKING(for isinf in math.h)
1108
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]], [[
1114
AC_MSG_CHECKING(whether isinf() can be used in C++ code)
1116
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]], [[
1122
AC_DEFINE(HAVE_ISINF, [1], [isinf() macro or function])
1196
1131
CFLAGS="$ORG_CFLAGS"
1198
1133
# Sanity check: We chould not have any fseeko symbol unless
1199
1134
# large_file_support=yes
1200
1135
AC_CHECK_FUNC(fseeko,
1201
[if test "$large_file_support" = no -a "x$TARGET_LINUX" = "xtrue";
1136
[if test "$large_file_support" = no -a "$TARGET_LINUX" = "true";
1203
1138
AC_MSG_ERROR("Found fseeko symbol but large_file_support is not enabled!")
1390
1339
[ac_warn_strict_aliasing="$enableval"],
1391
1340
[ac_warn_strict_aliasing="no"])
1393
AC_ARG_ENABLE([cast-warnings],
1394
[AS_HELP_STRING([--enable-cast-warnings],
1395
[Enable warnings about use of old C-style casts @<:@default=off@:>@])],
1396
[ac_warn_cast="$enableval"],
1397
[ac_warn_cast="no"])
1399
AC_ARG_ENABLE([effective-style],
1400
[AS_HELP_STRING([--enable-effective-style],
1401
[Enable warnings violating Effective C++ Style Guidelines @<:@default=off@:>@])],
1402
[ac_warn_effc="$enableval"],
1403
[ac_warn_effc="no"])
1405
AC_ARG_ENABLE([go-crazy],
1406
[AS_HELP_STRING([--enable-go-crazy],
1407
[Enables extra little warnings that might be too much @<:@default=off@:>@])],
1408
[ac_warn_go_crazy="$enableval"],
1409
[ac_warn_go_crazy="no"])
1412
1343
if test "$GCC" = "yes"
1416
if test "$ac_warn_fail" = "yes"
1420
BASE_WARNINGS="-W -Wall -Wextra -Wunused-macros ${W_FAIL}"
1422
1346
if test "$ac_warn_longlong" = "yes"
1424
1348
W_LONGLONG="-Wlong-long"
1450
1374
if test "$ac_warn_pedantic" = "yes"
1452
save_CXXFLAGS="${CXXFLAGS}"
1453
CXXFLAGS="${CXXFLAGS} ${W_FAIL} -Wredundant-decls"
1454
AC_CACHE_CHECK([whether it is safe to use -Wredundant-decls],
1455
[ac_cv_safe_to_use_Wredundant_decls_],
1459
template <typename E> struct C { void foo(); };
1460
template <typename E> void C<E>::foo() { }
1461
template <> void C<int>::foo();
1462
AC_INCLUDES_DEFAULT])],
1463
[ac_cv_safe_to_use_Wredundant_decls_=yes],
1464
[ac_cv_safe_to_use_Wredundant_decls_=no])
1466
if test $ac_cv_safe_to_use_Wredundant_decls_ = yes
1468
GXX_W_REDUNDANT_DECLS="-Wredundant-decls"
1470
GXX_W_REDUNDANT_DECLS="-Wno-redundant-decls"
1473
1376
GCC_PEDANTIC="-pedantic -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls ${W_STRICT_ALIASING}"
1474
GXX_PEDANTIC="-pedantic -Wundef ${GXX_W_REDUNDANT_DECLS} ${W_LONGLONG} ${W_STRICT_ALIASING}"
1476
AC_CACHE_CHECK([whether __attribute__ visibility "hidden" is supported],
1477
[ac_cv_can_use_hidden_],
1482
__attribute__((visibility ("hidden")))
1483
void testme() { };],[
1485
[ac_cv_can_use_hidden_=yes],
1486
[ac_cv_can_use_hidden_=no])
1488
if test "$ac_cv_can_use_hidden_" = "yes"
1490
AC_DEFINE(HAVE_ATTR_HIDDEN, 1,
1491
[Define to 1 if you have support for __attribute__((visibility("hidden")))])
1494
CXXFLAGS="${save_CXXFLAGS}"
1377
GXX_PEDANTIC="-pedantic -Wundef -Wredundant-decls ${W_LONGLONG} ${W_STRICT_ALIASING}"
1497
1380
if test "$ac_warn_unreachable" = "yes"
1499
1382
W_UNREACHABLE="-Wunreachable-code"
1501
if test "$ac_warn_cast" = "yes"
1503
W_CAST="-Wold-style-cast"
1506
if test "$ac_warn_effc" = "yes"
1511
if test "$ac_warn_gocrazy" = "yes"
1513
W_CRAZY="-Wshadow -Wconversion -Winvalid-pch"
1516
CC_WARNINGS="${C99_SUPPORT_HACK} ${BASE_WARNINGS} ${GCC_PEDANTIC} ${W_UNREACHABLE} ${GPROF_PROFILING} ${GPROF_COVERAGE} ${W_CRAZY}"
1517
CXX_WARNINGS="${BASE_WARNINGS} ${GXX_PEDANTIC} ${W_UNREACHABLE} ${GPROF_PROFILING} ${GPROF_COVERAGE} ${W_CAST} ${W_EFFC} ${W_CRAZY}"
1519
NO_EXCEPTIONS="-fno-exceptions"
1520
W_EXCEPTIONS="-fexceptions"
1521
NO_UNUSED_MACROS="-Wno-unused-macros"
1522
NO_REDUNDANT_DECLS="-Wno-redundant-decls"
1523
# Disable exceptions as they seams to create problems with gcc and threads.
1524
# drizzled doesn't use run-time-type-checking, so we disable it.
1525
AM_CXXFLAGS="${AM_CXXFLAGS} -fno-rtti"
1527
if test "$SUNCC" = "yes"
1529
CC_WARNINGS="-v -xc99=all -errtags=yes"
1530
CXX_WARNINGS="+w +w2 -xport64 -errtags=yes -erroff=attrskipunsup -compat=5"
1531
NO_EXCEPTIONS="-features=no%except"
1532
W_EXCEPTIONS="-features=except"
1534
AM_CXXFLAGS="${CXX_WARNINGS} ${NO_EXCEPTIONS} ${AM_CXXFLAGS}"
1535
AM_CFLAGS="${CC_WARNINGS} ${AM_CFLAGS}"
1537
AC_SUBST(NO_EXCEPTIONS)
1538
AC_SUBST(W_EXCEPTIONS)
1539
AC_SUBST(NO_UNUSED_MACROS)
1540
AC_SUBST(NO_REDUNDANT_DECLS)
1385
if test "$ac_warn_fail" = "yes"
1390
BASE_WARNINGS="-W -Wall -Wextra"
1391
GCC_WARNINGS="${C99_SUPPORT_HACK} ${BASE_WARNINGS} ${GCC_PEDANTIC} ${W_UNREACHABLE} ${W_FAIL} ${GPROF_PROFILING} ${GPROF_COVERAGE}"
1392
GXX_WARNINGS="${BASE_WARNINGS} ${GXX_PEDANTIC} ${W_UNREACHABLE} ${W_FAIL} ${GPROF_PROFILING} ${GPROF_COVERAGE}"
1394
AM_CXXFLAGS="${GXX_WARNINGS} ${AM_CXXFLAGS}"
1395
AM_CFLAGS="${GCC_WARNINGS} ${AM_CFLAGS}"
1542
1398
AC_SUBST([GLOBAL_CPPFLAGS],['-I$(top_srcdir) -I$(top_builddir)'])
1543
1399
AC_SUBST([AM_CPPFLAGS],['${GLOBAL_CPPFLAGS}'])
1584
1436
AC_CONFIG_COMMANDS_POST(ac_configure_args="$ac_configure_args CFLAGS='$CFLAGS' CXXFLAGS='$CXXFLAGS' AM_CFLAGS='$AM_CFLAGS' AM_CXXFLAGS='$AM_CXXFLAGS'")
1589
echo "Configuration summary for $PACKAGE_NAME version $VERSION"
1591
echo " * Installation prefix: $prefix"
1592
echo " * System type: $SYSTEM_TYPE"
1593
echo " * Host CPU: $host_cpu"
1594
echo " * C Compiler: $CC_VERSION"
1595
echo " * C++ Compiler: $CXX"
1596
echo " * Build auth_pam: $ac_cv_header_security_pam_appl_h"
1597
echo " * Assertions enabled: $ac_cv_assert"
1598
echo " * Debug enabled: $with_debug"
1599
echo " * Profiling enabled: $ac_profiling"
1600
echo " * Coverage enabled: $ac_coverage"
1601
echo " * Warnings as failure: $ac_warn_fail"
1602
echo " * C++ cstdint location: $ac_cv_cxx_cstdint"
1603
echo " * C++ hash_map location: $ac_cv_cxx_hash_map"
1604
echo " * C++ hash namespace: $ac_cv_cxx_hash_namespace"
1605
echo " * C++ cmath location: $ac_cv_cxx_cmath"
1606
echo " * C++ cmath namespace: $ac_cv_cxx_cmath_namespace"