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)
10
30
AC_CANONICAL_TARGET
11
31
AM_INIT_AUTOMAKE(-Wall -Werror)
17
37
SHARED_LIB_VERSION=$SHARED_LIB_MAJOR_VERSION:0:0
40
dnl AC_CANONICAL_HOST thinks it's a good idea to just set CFLAGS to
41
dnl -g -O2 if you're running gcc. We would like to use something else, thanks.
42
if test "x${CFLAGS}" = "x-g -O2"
46
if test "x${CXXFLAGS}" = "x-g -O2"
21
52
# Set all version vars based on $VERSION. How do we do this more elegant ?
22
53
# Remember that regexps needs to quote [ and ] since this is run through m4
119
150
i?86) BASE_MACHINE_TYPE=i386 ;;
122
# Save some variables and the command line options for mysqlbug
125
SAVE_ASFLAGS="$ASFLAGS"
126
SAVE_CFLAGS="$CFLAGS"
127
SAVE_CXXFLAGS="$CXXFLAGS"
128
SAVE_LDFLAGS="$LDFLAGS"
129
SAVE_CXXLDFLAGS="$CXXLDFLAGS"
130
CONF_COMMAND="$0 $ac_configure_args"
131
AC_SUBST(CONF_COMMAND)
134
AC_SUBST(SAVE_ASFLAGS)
135
AC_SUBST(SAVE_CFLAGS)
136
AC_SUBST(SAVE_CXXFLAGS)
137
AC_SUBST(SAVE_LDFLAGS)
138
AC_SUBST(SAVE_CXXLDFLAGS)
142
154
# This is needed is SUBDIRS is set
167
179
################ End of section to be done before AC_PROG_CC #################
169
# The following hack should ensure that configure doesn't add optimizing
170
# or debugging flags to CFLAGS or CXXFLAGS
171
# C_EXTRA_FLAGS are flags that are automaticly added to both
172
# CFLAGS and CXXFLAGS
173
CFLAGS="$CFLAGS $C_EXTRA_FLAGS "
174
CXXFLAGS="$CXXFLAGS $C_EXTRA_FLAGS "
176
181
dnl Checks for programs.
178
183
ifdef([AC_PROG_CC_C99],[
184
dnl TODO: Need to fix this to use c99 instead of gnu99
179
185
AC_PROG_CC_C99([],[AC_MSG_ERROR([C99 support required for compiling Drizzle])])
180
186
C99_SUPPORT_HACK=""
181
187
],[C99_SUPPORT_HACK="-std=gnu99"])
207
213
AC_SUBST(CC_VERSION)
215
dnl AC_CANONICAL_HOST thinks it's a good idea to just set CFLAGS to
216
dnl -g -O2 if you're running gcc. We would like to use something else, thanks.
217
if test "x${CFLAGS}" = "x-g -O2"
221
if test "x${CXXFLAGS}" = "x-g -O2"
208
226
DRIZZLE_CHECK_CXX_VERSION
803
821
AC_CHECK_FUNCS(strtok_r)
805
# Build optimized or debug version ?
806
# First check for gcc and g++
807
if test "$ac_cv_c_compiler_gnu" = "yes"
809
SYMBOLS_CFLAGS="-ggdb3"
810
DEBUG_OPTIMIZE_CC="-O0"
811
OPTIMIZE_CFLAGS="-O3"
817
if test "$ac_cv_prog_cxx_g" = "yes"
819
SYMBOLS_CXXFLAGS="-ggdb3"
820
DEBUG_OPTIMIZE_CXX="-O0"
821
OPTIMIZE_CXXFLAGS="-O3"
823
SYMBOLS_CXXFLAGS="-g"
824
DEBUG_OPTIMIZE_CXX=""
825
OPTIMIZE_CXXFLAGS="-O"
828
# If the user specified CFLAGS, we won't add any optimizations
829
if test -n "$SAVE_CFLAGS"
835
if test -n "$SAVE_CXXFLAGS"
838
DEBUG_OPTIMIZE_CXX=""
841
dnl TODO: Remove this define once we are using 2.61 across the board.
844
# Check whether to enable assertions.
845
ifdef([AC_HEADER_ASSERT], [], [AC_DEFUN([AC_HEADER_ASSERT],
847
AC_MSG_CHECKING([whether to enable assertions])
848
AC_ARG_ENABLE([assert],
849
[ --disable-assert turn off assertions],
851
AC_DEFINE(NDEBUG, 1, [Define to 1 if assertions should be disabled.])],
852
[AC_MSG_RESULT(yes)])
857
CFLAGS="${SYMBOLS_CFLAGS} ${CFLAGS}"
858
CXXFLAGS="${SYMBOLS_CXXFLAGS} ${CXXFLAGS} -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
861
[AS_HELP_STRING([--with-debug],
862
[Add debug code/turns off optimizations (yes|no) @<:@default=no@:>@])],
863
[with_debug=$withval],
865
if test "$with_debug" = "yes"
868
CFLAGS="$DEBUG_OPTIMIZE_CC $CFLAGS"
869
CXXFLAGS="$DEBUG_OPTIMIZE_CXX $CXXFLAGS"
871
# Optimized version. No debug
872
CFLAGS="${OPTIMIZE_CFLAGS} ${CFLAGS}"
873
CXXFLAGS="$OPTIMIZE_CXXFLAGS $CXXFLAGS"
877
825
AC_ARG_WITH([fast-mutexes],
1312
1260
AC_SUBST(mysql_plugin_libs)
1313
1261
AC_SUBST(mysql_plugin_defs)
1263
# Build optimized or debug version ?
1264
# First check for gcc and g++
1265
if test "$ac_cv_c_compiler_gnu" = "yes"
1267
SYMBOLS_CFLAGS="-ggdb3"
1268
DEBUG_OPTIMIZE_CC="-O0"
1269
OPTIMIZE_CFLAGS="-O3"
1272
DEBUG_OPTIMIZE_CC=""
1273
OPTIMIZE_CFLAGS="-O"
1275
if test "$ac_cv_prog_cxx_g" = "yes"
1277
SYMBOLS_CXXFLAGS="-ggdb3"
1278
DEBUG_OPTIMIZE_CXX="-O0"
1279
OPTIMIZE_CXXFLAGS="-O3"
1281
SYMBOLS_CXXFLAGS="-g"
1282
DEBUG_OPTIMIZE_CXX=""
1283
OPTIMIZE_CXXFLAGS="-O"
1286
dnl TODO: Remove this define once we are using 2.61 across the board.
1289
# Check whether to enable assertions.
1290
ifdef([AC_HEADER_ASSERT], [], [AC_DEFUN([AC_HEADER_ASSERT],
1292
AC_MSG_CHECKING([whether to enable assertions])
1293
AC_ARG_ENABLE([assert],
1294
[ --disable-assert turn off assertions],
1295
[AC_MSG_RESULT([no])
1296
AC_DEFINE(NDEBUG, 1, [Define to 1 if assertions should be disabled.])],
1297
[AC_MSG_RESULT(yes)])
1302
CFLAGS="${SYMBOLS_CFLAGS} ${CFLAGS}"
1303
CXXFLAGS="${SYMBOLS_CXXFLAGS} ${CXXFLAGS} -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
1305
AC_ARG_WITH([debug],
1306
[AS_HELP_STRING([--with-debug],
1307
[Add debug code/turns off optimizations (yes|no) @<:@default=no@:>@])],
1308
[with_debug=$withval],
1310
if test "$with_debug" = "yes"
1313
CFLAGS="$DEBUG_OPTIMIZE_CC $CFLAGS ${SAVE_CFLAGS}"
1314
CXXFLAGS="$DEBUG_OPTIMIZE_CXX $CXXFLAGS ${SAVE_CXXFLAGS}"
1316
# Optimized version. No debug
1317
CFLAGS="${OPTIMIZE_CFLAGS} ${CFLAGS} ${SAVE_CFLAGS}"
1318
CXXFLAGS="$OPTIMIZE_CXXFLAGS $CXXFLAGS ${SAVE_CXXFLAGS}"
1315
1321
AC_ARG_ENABLE([profiling],
1316
1322
[AS_HELP_STRING([--enable-profiling],
1317
1323
[Toggle profiling @<:@default=off@:>@])],