~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to configure.ac

Replaced regex lib with pcre. Reworked mysqltest to use it. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
dnl -*- bash -*-
 
1
dnl -*- ksh -*-
2
2
dnl Process this file with autoconf to produce a configure script.
3
3
 
4
 
AC_PREREQ(2.59)dnl              Minimum Autoconf version required.
5
 
 
6
 
m4_include(m4/bzr_version.m4)
7
 
 
8
 
AC_CONFIG_SRCDIR([drizzled/drizzled.cc])
 
4
AC_PREREQ(2.61)dnl              Minimum Autoconf version required.
 
5
 
 
6
AC_INIT
 
7
AC_CONFIG_SRCDIR([sql/mysqld.cc])
9
8
AC_CONFIG_AUX_DIR(config)
10
 
AC_CONFIG_HEADERS([config.h])
11
 
AC_CONFIG_MACRO_DIR([m4])
12
 
 
13
 
# Setting CFLAGS here prevents AC_CANONICAL_TARGET from injecting them
14
 
SAVE_CFLAGS=${CFLAGS}
15
 
SAVE_CXXFLAGS=${CXXFLAGS}
16
 
CFLAGS=
17
 
CXXFLAGS=
18
 
 
 
9
AC_CONFIG_HEADERS([include/config.h:config.h.in])
19
10
AC_CANONICAL_TARGET
20
 
 
21
 
CFLAGS=${SAVE_CFLAGS}
22
 
CXXFLAGS=${SAVE_CXXFLAGS}
23
 
 
24
 
AM_INIT_AUTOMAKE(nostdinc subdir-objects -Wall -Werror)
25
 
 
26
 
if test "x${enable_dependency_tracking}" = "x"
27
 
then
28
 
  enable_dependency_tracking=yes
29
 
fi
30
 
 
31
 
gl_EARLY
32
 
 
33
 
 
34
 
dnl Checks for programs.
35
 
AC_PROG_CXX
36
 
 
37
 
gl_USE_SYSTEM_EXTENSIONS
38
 
if test "$GCC" = "yes"
39
 
then
40
 
  # If you're on a Mac, and you didn't ask for a specific compiler
41
 
  # You're gonna get 4.2.
42
 
  if test "$host_vendor" = "apple" -a "x${ac_cv_env_CC_set}" = "x"
43
 
  then
44
 
    CPP="/usr/bin/gcc-4.2 -E"
45
 
    CC=/usr/bin/gcc-4.2
46
 
    CXX=/usr/bin/g++-4.2
47
 
  fi
48
 
  AC_CACHE_CHECK([if GCC is recent enough], [drizzle_cv_gcc_recent],
49
 
    [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
50
 
#if !defined(__GNUC__) || (__GNUC__ < 4) || ((__GNUC__ >= 4) && (__GNUC_MINOR__ < 1))
51
 
# error GCC is Too Old!
52
 
#endif
53
 
      ]])],
54
 
      [drizzle_cv_gcc_recent=yes],
55
 
      [drizzle_cv_gcc_recent=no])])
56
 
  if test "$drizzle_cv_gcc_recent" = "no" -a "$host_vendor" = "apple"
57
 
  then
58
 
    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])
59
 
  fi
60
 
  if test "$drizzle_cv_gcc_recent" = "no"
61
 
  then
62
 
    AC_MSG_ERROR([Your version of GCC is too old. Drizzle requires at least version 4.1])
63
 
  fi
64
 
fi
65
 
AC_CXX_HEADER_STDCXX_98
66
 
if test "$ac_cv_cxx_stdcxx_98" = "no"
67
 
then
68
 
  AC_MSG_ERROR([No working C++ Compiler has been found. Drizzle requires a C++ compiler that can handle C++98])
69
 
fi
70
 
AC_PROG_CPP
71
 
AM_PROG_CC_C_O
72
 
 
73
 
if test "$am_cv_prog_cc_stdc" = "no"
74
 
then
75
 
  AC_MSG_ERROR([Drizzle requires an ANSI C compiler (and a C++ compiler). Try gcc. See the Installation chapter in the Reference Manual.])
76
 
fi
77
 
 
78
 
 
79
 
 
80
 
gl_INIT
81
 
 
82
 
AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
83
 
 
84
 
AC_PROG_GCC_TRADITIONAL
 
11
AM_INIT_AUTOMAKE(mysql, 7.0.0, no-define)
 
12
 
 
13
PROTOCOL_VERSION=10
 
14
DOT_FRM_VERSION=6
 
15
# See the libtool docs for information on how to do shared lib versions.
 
16
SHARED_LIB_MAJOR_VERSION=16
 
17
SHARED_LIB_VERSION=$SHARED_LIB_MAJOR_VERSION:0:0
 
18
 
85
19
 
86
20
 
87
21
# Set all version vars based on $VERSION. How do we do this more elegant ?
89
23
# We take some made up examples
90
24
#
91
25
#  VERSION                  5.1.40sp1-alpha     5.0.34a
92
 
#  DRIZZLE_NO_DASH_VERSION    5.1.40sp1           5.0.34a
93
 
#  DRIZZLE_NUMERIC_VERSION    5.1.40              5.0.34
94
 
#  DRIZZLE_BASE_VERSION       5.1                 5.0
95
 
#  DRIZZLE_VERSION_ID         50140               50034
 
26
#  MYSQL_NO_DASH_VERSION    5.1.40sp1           5.0.34a
 
27
#  MYSQL_NUMERIC_VERSION    5.1.40              5.0.34
 
28
#  MYSQL_BASE_VERSION       5.1                 5.0
 
29
#  MYSQL_VERSION_ID         50140               50034
96
30
#
97
 
DRIZZLE_NO_DASH_VERSION=`echo $VERSION | sed -e "s|-.*$||"`
98
 
DRIZZLE_NUMERIC_VERSION=`echo $DRIZZLE_NO_DASH_VERSION | sed -e "s|[[a-z]][[a-z0-9]]*$||"`
99
 
DRIZZLE_BASE_VERSION=`echo $DRIZZLE_NUMERIC_VERSION | sed -e "s|\.[[^.]]*$||"`
100
 
DRIZZLE_VERSION_ID=`echo $DRIZZLE_NUMERIC_VERSION | \
 
31
MYSQL_NO_DASH_VERSION=`echo $VERSION | sed -e "s|-.*$||"`
 
32
MYSQL_NUMERIC_VERSION=`echo $MYSQL_NO_DASH_VERSION | sed -e "s|[[a-z]][[a-z0-9]]*$||"`
 
33
MYSQL_BASE_VERSION=`echo $MYSQL_NUMERIC_VERSION | sed -e "s|\.[[^.]]*$||"`
 
34
MYSQL_VERSION_ID=`echo $MYSQL_NUMERIC_VERSION | \
101
35
    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])
106
 
 
107
 
AC_DEFINE([_BACKWARD_BACKWARD_WARNING_H],[1],[Hack to disable deprecation warning in gcc])
108
36
 
109
37
# The port should be constant for a LONG time
110
 
DRIZZLE_TCP_PORT_DEFAULT=4427
111
 
 
112
 
m4_include(m4/dtrace.m4)
113
 
 
114
 
m4_include(m4/character_sets.m4)
 
38
MYSQL_TCP_PORT_DEFAULT=3306
 
39
 
 
40
dnl Include m4 
 
41
sinclude(config/ac-macros/alloca.m4)
 
42
sinclude(config/ac-macros/check_cpu.m4)
 
43
sinclude(config/ac-macros/character_sets.m4)
 
44
sinclude(config/ac-macros/compiler_flag.m4)
 
45
sinclude(config/ac-macros/dtrace.m4)
 
46
sinclude(config/ac-macros/plugins.m4)
 
47
sinclude(config/ac-macros/large_file.m4)
 
48
sinclude(config/ac-macros/misc.m4)
 
49
sinclude(config/ac-macros/readline.m4)
 
50
sinclude(config/ac-macros/ssl.m4)
 
51
 
 
52
# Remember to add a directory sql/share/LANGUAGE
 
53
AVAILABLE_LANGUAGES="\
 
54
czech danish dutch english estonian french german greek hungarian \
 
55
italian japanese korean norwegian norwegian-ny polish portuguese \
 
56
romanian russian serbian slovak spanish swedish ukrainian"
 
57
 
 
58
#####
 
59
#####
 
60
 
 
61
AC_SUBST(MYSQL_NO_DASH_VERSION)
 
62
AC_SUBST(MYSQL_BASE_VERSION)
 
63
AC_SUBST(MYSQL_VERSION_ID)
 
64
AC_SUBST(MYSQL_PREVIOUS_BASE_VERSION)
 
65
AC_SUBST(PROTOCOL_VERSION)
 
66
AC_DEFINE_UNQUOTED([PROTOCOL_VERSION], [$PROTOCOL_VERSION],
 
67
                   [mysql client protocol version])
 
68
AC_SUBST(DOT_FRM_VERSION)
 
69
AC_DEFINE_UNQUOTED([DOT_FRM_VERSION], [$DOT_FRM_VERSION],
 
70
                   [Version of .frm files])
 
71
AC_SUBST(SHARED_LIB_MAJOR_VERSION)
 
72
AC_SUBST(SHARED_LIB_VERSION)
115
73
AC_SUBST(AVAILABLE_LANGUAGES)
116
74
 
117
75
 
118
 
# Set this for plugins to use
119
 
ac_build_drizzle="yes"
120
 
 
121
 
 
122
76
# Canonicalize the configuration name.
123
77
 
124
78
# Check whether --with-system-type or --without-system-type was given.
129
83
    [SYSTEM_TYPE="$host_vendor-$host_os"])
130
84
AC_ARG_WITH([machine-type],
131
85
    [AS_HELP_STRING([--with-machine-type],
132
 
       [Set the machine type, like "sparc"])],
 
86
       [Set the machine type, like "powerpc"])],
133
87
    [MACHINE_TYPE="$withval"],
134
88
    [MACHINE_TYPE="$host_cpu"])
135
89
AC_SUBST(SYSTEM_TYPE)
145
99
  i?86) BASE_MACHINE_TYPE=i386 ;;
146
100
esac
147
101
 
148
 
 
 
102
# Save some variables and the command line options for mysqlbug
 
103
SAVE_CC="$CC"
 
104
SAVE_CXX="$CXX"
 
105
SAVE_ASFLAGS="$ASFLAGS"
 
106
SAVE_CFLAGS="$CFLAGS"
 
107
SAVE_CXXFLAGS="$CXXFLAGS"
 
108
SAVE_LDFLAGS="$LDFLAGS"
 
109
SAVE_CXXLDFLAGS="$CXXLDFLAGS"
 
110
CONF_COMMAND="$0 $ac_configure_args"
 
111
AC_SUBST(CONF_COMMAND)
 
112
AC_SUBST(SAVE_CC)
 
113
AC_SUBST(SAVE_CXX)
 
114
AC_SUBST(SAVE_ASFLAGS)
 
115
AC_SUBST(SAVE_CFLAGS)
 
116
AC_SUBST(SAVE_CXXFLAGS)
 
117
AC_SUBST(SAVE_LDFLAGS)
 
118
AC_SUBST(SAVE_CXXLDFLAGS)
 
119
AC_SUBST(CXXLDFLAGS)
 
120
 
 
121
AM_SANITY_CHECK
 
122
# This is needed is SUBDIRS is set
 
123
AC_PROG_MAKE_SET
 
124
 
 
125
##############################################################################
 
126
# The below section needs to be done before AC_PROG_CC
 
127
##############################################################################
 
128
 
 
129
if test "x${CFLAGS-}" = x ; then
 
130
  cflags_is_set=no
 
131
else
 
132
  cflags_is_set=yes
 
133
fi
 
134
 
 
135
if test "x${CPPFLAGS-}" = x ; then
 
136
  cppflags_is_set=no
 
137
else
 
138
  cppflags_is_set=yes
 
139
fi
 
140
 
 
141
if test "x${LDFLAGS-}" = x ; then
 
142
  ldflags_is_set=no
 
143
else
 
144
  ldflags_is_set=yes
 
145
fi
 
146
 
 
147
################ End of section to be done before AC_PROG_CC #################
 
148
 
 
149
# The following hack should ensure that configure doesn't add optimizing
 
150
# or debugging flags to CFLAGS or CXXFLAGS
 
151
# C_EXTRA_FLAGS are flags that are automaticly added to both
 
152
# CFLAGS and CXXFLAGS
 
153
CFLAGS="$CFLAGS $C_EXTRA_FLAGS "
 
154
CXXFLAGS="$CXXFLAGS $C_EXTRA_FLAGS "
 
155
 
 
156
dnl Checks for programs.
 
157
AC_PROG_AWK
 
158
AC_PROG_CC
 
159
AC_PROG_CXX
 
160
AC_PROG_CPP
 
161
AM_PROG_CC_C_O
 
162
 
 
163
# Print version of CC and CXX compiler (if they support --version)
 
164
case $SYSTEM_TYPE in
 
165
  *netware*)
 
166
CC_VERSION=`$CC -version | grep -i version`
 
167
    ;;
 
168
  *)
 
169
CC_VERSION=`$CC --version | sed 1q`
 
170
    ;;
 
171
esac
 
172
if test $? -eq "0"
 
173
then
 
174
  AC_MSG_CHECKING("C Compiler version")
 
175
  AC_MSG_RESULT("$CC $CC_VERSION")
 
176
else
 
177
CC_VERSION=""
 
178
fi
 
179
AC_SUBST(CC_VERSION)
 
180
MYSQL_CHECK_CXX_VERSION
 
181
 
 
182
if test "$ac_cv_c_compiler_gnu" = "yes"
 
183
then
 
184
  AS="$CC -c"
 
185
  AC_SUBST(AS)
 
186
else
 
187
  AC_PATH_PROG(AS, as, as)
 
188
fi
 
189
 
 
190
# Still need ranlib for readline; local static use only so no libtool.
 
191
AC_PROG_RANLIB
 
192
# We use libtool
 
193
#AC_LIBTOOL_WIN32_DLL
 
194
AC_PROG_LIBTOOL
 
195
 
 
196
# Ensure that we have --preserve-dup-deps defines, otherwise we get link
 
197
# problems of 'mysql' with CXX=g++
 
198
LIBTOOL="$LIBTOOL --preserve-dup-deps"
 
199
AC_SUBST(LIBTOOL)dnl
 
200
 
 
201
AC_SUBST(NM)dnl
 
202
 
 
203
AC_PROG_INSTALL
 
204
test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
 
205
 
 
206
# Not critical since the generated file is distributed
 
207
AC_CHECK_PROGS(YACC, ['bison -y -p MYSQL'])
 
208
 
 
209
AC_PATH_PROG(uname_prog, uname, no)
 
210
 
 
211
# We should go through this and put all the explictly system dependent
 
212
# stuff in one place
 
213
AC_MSG_CHECKING(operating system)
 
214
AC_CACHE_VAL(mysql_cv_sys_os,
 
215
[
 
216
if test "$uname_prog" != "no"; then
 
217
  mysql_cv_sys_os="`uname`"
 
218
else
 
219
  mysql_cv_sys_os="Not Solaris"
 
220
fi
 
221
])
 
222
AC_MSG_RESULT($mysql_cv_sys_os)
 
223
 
 
224
# This should be rewritten to use $target_os
149
225
case "$target_os" in
150
 
  *linux*)
151
 
  TARGET_LINUX="true"
152
 
  AC_SUBST(TARGET_LINUX)
153
 
  AC_DEFINE([TARGET_OS_LINUX], [1], [Whether we build for Linux])
154
 
    ;;
155
 
  *apple-darwin*)
156
 
    TARGET_OSX="true"
157
 
    AC_SUBST(TARGET_OSX)
158
 
    AC_DEFINE([TARGET_OS_OSX], [1], [Whether we build for OSX])
159
 
    ;;
160
226
  *solaris*)
161
227
    TARGET_SOLARIS="true"
 
228
    AC_DEFINE([TARGET_OS_SOLARIS], [1], [Whether we are building for Solaris])
162
229
    AC_SUBST(TARGET_SOLARIS)
163
 
    AC_DEFINE([TARGET_OS_SOLARIS], [1], [Whether we are building for Solaris])
164
 
    ;;
165
 
  *)
166
 
    ;;
 
230
  ;;
167
231
esac
168
232
 
169
 
DRIZZLE_CHECK_C_VERSION
170
 
DRIZZLE_CHECK_CXX_VERSION
171
 
 
172
 
AC_SYS_LARGEFILE
173
 
 
174
 
AC_PROG_AWK
175
 
 
176
 
 
177
 
AC_PATH_PROG(GPERF, gperf)
178
 
AS_IF([test "x$GPERF" = "x"],
179
 
      AC_MSG_ERROR("Drizzle requires gperf to build."))
180
 
 
181
 
AC_PATH_PROG(LCOV, lcov)
182
 
AC_PATH_PROG(GENHTML, genhtml)
183
 
 
184
 
AM_CONDITIONAL(HAVE_LCOV,[test "x$LCOV" != "x"])
185
 
 
186
 
dnl TODO: This needs to go away and be replaced with _ISOC99_SOURCE
187
 
if test "$ac_cv_c_compiler_gnu" = "yes" -o "$target_os" = "linux-gnu"
188
 
then
189
 
  AC_DEFINE([_GNU_SOURCE],[1],[Fix problem with S_ISLNK() on Linux])
190
 
fi
191
 
 
192
 
dnl C99 is illegal in C++... but these turn on extensions to the standard
193
 
dnl On Solars. This whole block is sort of silly atm, since we don't do 
194
 
dnl GCC on Solaris.
195
 
if test "$GCC" = "yes"
196
 
then
197
 
  case "$target_os" in
198
 
    *solaris*)
199
 
    AC_DEFINE([_XOPEN_SOURCE],[600],[Turn on XOpen 6.0 Features])
200
 
    AC_DEFINE([__C99FEATURES__],[1],[Turn on C99 Features for C++])
201
 
    AC_DEFINE([__XPG6],[1],[Turn on C99/XOpen Group 6 Extensions])
202
 
    ;;
203
 
  esac
204
 
fi
205
 
 
206
 
AC_SUBST(NM)dnl
207
 
 
208
 
AC_PROG_INSTALL
209
 
 
210
 
# Look for "(group|user)add". 
211
 
# TODO: If the programs do not exist, inform the DBA that the user
212
 
#       was not created at the end of the install routine.
213
 
AC_CHECK_PROGS(GROUPADD, groupadd addgroup)
214
 
AC_CHECK_PROGS(USERADD, useradd adduser)
215
 
 
216
 
dnl Not critical since the generated file is distributed
217
 
AC_CHECK_PROGS(YACC, ['bison -y'])
218
 
if test -z "$YACC" && test -d ".bzr"
219
 
then
220
 
  AC_MSG_ERROR(["bison is required for Drizzle to build from a bzr branch"])
221
 
fi
222
 
 
223
 
# Build optimized or debug version ?
224
 
# First check for gcc and g++
225
 
if test "$GCC" = "yes"
226
 
then
227
 
  dnl The following is required for portable results of floating point 
228
 
  dnl calculations on PowerPC. The same must also be done for IA-64, but 
229
 
  dnl this options is missing in the IA-64 gcc backend.
 
233
# The following is required for portable results of floating point calculations
 
234
# on PowerPC. The same must also be done for IA-64, but this options is missing
 
235
# in the IA-64 gcc backend.
 
236
 
 
237
if test "$GCC" = "yes"
 
238
then
230
239
  case "$host_cpu" in
231
240
    *ppc* | *powerpc*)
232
 
      CFLAGS="-mno-fused-madd ${CFLAGS}"
233
 
      CXXFLAGS="-mno-fused-madd ${CXXFLAGS}"
 
241
      CFLAGS="$CFLAGS -mno-fused-madd"
 
242
      CXXFLAGS="$CXXFLAGS -mno-fused-madd"
234
243
    ;;
235
244
  esac
236
 
 
237
 
  CFLAGS="-ggdb3 -std=gnu99 ${CFLAGS}"
238
 
  CXXFLAGS="-ggdb3 ${CXXFLAGS}"
239
 
  AC_CXX_CHECK_STANDARD
240
 
  
241
 
 
242
 
  DEBUG_CFLAGS="-O0"
243
 
  DEBUG_CXXFLAGS="-O0"
244
 
 
245
 
  OPTIMIZE_CFLAGS="-O3"
246
 
  OPTIMIZE_CXXFLAGS="-O3"
247
 
fi
248
 
if test "$SUNCC" = "yes"
249
 
then
250
 
  dnl we put CPPFLAGS and LDFLAGS first here, because if the user has specified
251
 
  dnl command line CPPFLAGS or LDFLAGS, their -I or -L should come _first_
252
 
  if test "$target_cpu" = "sparc"
253
 
  then
254
 
    MEMALIGN_FLAGS="-xmemalign=8s"
255
 
  fi
256
 
 
257
 
  isainfo_b=`isainfo -b`
258
 
  if test "$isainfo_b" = "64"
259
 
  then
260
 
    IS_64="-m64"
261
 
  fi
262
 
  if test "x$use_additional" != "xyes"
263
 
  then
264
 
    LDFLAGS="${LDFLAGS} -L/usr/local/lib/${isainfo_b} -L/usr/local/lib -L/opt/csw/lib/${isainfo_b} -L/opt/csw/lib"
265
 
    CPPFLAGS="${CPPFLAGS} -I/usr/local/include -I/opt/csw/include"
266
 
  fi
267
 
  LDFLAGS="${LDFLAGS} -L/usr/lib/${isainfo_b}"
268
 
 
269
 
  CXXFLAGS="-xlang=c99 -g -mt -compat=5 -library=stlport4 -template=no%extdef ${IS_64} ${MEMALIGN_FLAGS} ${CXXFLAGS}"
270
 
  CFLAGS="-g -mt -xc99=all ${IS_64} ${MEMALIGN_FLAGS} ${CFLAGS}"
271
 
  DEBUG_CFLAGS="-xO0"
272
 
  DEBUG_CXXFLAGS="-xO0" 
273
 
 
274
 
  dnl TODO: -xO4 causes a Sun Studio failure in innodb... let's check back
275
 
  dnl       in on this one.
276
 
  OPTIMIZE_FLAGS="-xO3 -xlibmil -xdepend"
277
 
  OPTIMIZE_CFLAGS="${OPTIMIZE_FLAGS} -Xa -xstrconst"
278
 
  OPTIMIZE_CXXFLAGS="${OPTIMIZE_FLAGS}"
279
 
 
280
 
fi
281
 
 
282
 
m4_include(m4/gettext.m4)
283
 
AM_GNU_GETTEXT(external, need-formatstring-macros)
284
 
if test "x$MSGMERGE" = "x" -o "x$MSGMERGE" = "x:"
285
 
then
286
 
  AM_PATH_PROG_WITH_TEST(GMSGMERGE, gmsgmerge,
287
 
    [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
288
 
  MSGMERGE="${GMSGMERGE}"
289
 
fi
290
 
AM_CONDITIONAL([BUILD_GETTEXT],[test "x$MSGMERGE" != "x" -a "x$MSGMERGE" != "x:"])
291
 
 
292
 
 
293
 
# We use libtool
294
 
AC_PROG_LIBTOOL
295
 
 
296
 
dnl TODO: Remove this define once we are using 2.61 across the board.
297
 
# AX_HEADER_ASSERT
298
 
# ----------------
299
 
# Check whether to enable assertions.
300
 
AC_DEFUN([AX_HEADER_ASSERT],
301
 
[
302
 
  AC_MSG_CHECKING([whether to enable assertions])
303
 
  AC_ARG_ENABLE([assert],
304
 
    [AS_HELP_STRING([--disable-assert],
305
 
       [Turn off assertions])],
306
 
    [ac_cv_assert="no"],
307
 
    [ac_cv_assert="yes"])
308
 
  AC_MSG_RESULT([$ac_cv_assert])
309
 
])
310
 
 
311
 
AX_HEADER_ASSERT
312
 
 
313
 
AC_ARG_WITH([debug],
314
 
    [AS_HELP_STRING([--with-debug],
315
 
       [Add debug code/turns off optimizations (yes|no) @<:@default=no@:>@])],
316
 
    [with_debug=$withval],
317
 
    [with_debug=no])
318
 
if test "$with_debug" = "yes"
319
 
then
320
 
  # Debuging. No optimization.
321
 
  CFLAGS="${DEBUG_CFLAGS} ${CFLAGS}"
322
 
  CXXFLAGS="${DEBUG_CXXFLAGS} ${CXXFLAGS}"
 
245
fi
 
246
 
 
247
AC_SUBST(CC)
 
248
AC_SUBST(CFLAGS)
 
249
AC_SUBST(CXX)
 
250
AC_SUBST(CXXFLAGS)
 
251
AC_SUBST(ASFLAGS)
 
252
AC_SUBST(LD)
 
253
AC_SUBST(INSTALL_SCRIPT)
 
254
 
 
255
 
 
256
export CC CXX CFLAGS LD LDFLAGS AR ARFLAGS
 
257
 
 
258
if test "$GCC" = "yes"
 
259
then
 
260
  # mysqld requires -fno-implicit-templates.
 
261
  # Disable exceptions as they seams to create problems with gcc and threads.
 
262
  # mysqld doesn't use run-time-type-checking, so we disable it.
 
263
  # We should use -Wno-invalid-offsetof flag to disable some warnings from gcc
 
264
  # regarding offset() usage in C++ which are done in a safe manner in the
 
265
  # server
 
266
  CXXFLAGS="$CXXFLAGS ${GCC_WARNINGS} -fno-implicit-templates -fno-exceptions -fno-rtti"
 
267
  CFLAGS="$CFLAGS ${GCC_WARNINGS} "
 
268
  AC_DEFINE([HAVE_EXPLICIT_TEMPLATE_INSTANTIATION],
 
269
    [1], [Defined by configure. Use explicit template instantiation.])
 
270
fi
 
271
 
 
272
MYSQL_PROG_AR
 
273
 
 
274
# libmysqlclient versioning when linked with GNU ld.
 
275
if $LD --version 2>/dev/null|grep -q GNU; then
 
276
  LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_builddir)/libmysql/libmysql.ver"
 
277
  AC_CONFIG_FILES(libmysql/libmysql.ver)
 
278
fi
 
279
AC_SUBST(LD_VERSION_SCRIPT)
 
280
 
 
281
 
 
282
# Avoid bug in fcntl on some versions of linux
 
283
AC_MSG_CHECKING([if we should use 'skip-external-locking' as default for $target_os])
 
284
# Any variation of Linux
 
285
if expr "$target_os" : "[[Ll]]inux.*" > /dev/null
 
286
then
 
287
  MYSQLD_DEFAULT_SWITCHES="--skip-external-locking"
 
288
  TARGET_LINUX="true"
 
289
  AC_MSG_RESULT([yes])
 
290
  AC_DEFINE([TARGET_OS_LINUX], [1], [Whether we build for Linux])
323
291
else
324
 
  # Optimized version. No debug
325
 
  CFLAGS="${OPTIMIZE_CFLAGS} ${CFLAGS}"
326
 
  CXXFLAGS="${OPTIMIZE_CXXFLAGS} ${CXXFLAGS}"
327
 
fi
328
 
 
329
 
 
330
 
AC_CXX_STL_HASH
331
 
AC_CXX_CSTDINT
332
 
AC_CXX_CINTTYPES
333
 
AC_CXX_SHARED_PTR
334
 
 
335
 
DRIZZLE_PROG_AR
336
 
 
337
 
AC_LIB_PREFIX
338
 
 
339
 
#--------------------------------------------------------------------
340
 
# Check for Google Proto Buffers
341
 
#--------------------------------------------------------------------
342
 
 
343
 
AC_LANG_PUSH([C++])
344
 
AC_LIB_HAVE_LINKFLAGS(protobuf,,
345
 
[#include <google/protobuf/descriptor.h>
346
 
],
347
 
[google::protobuf::FileDescriptor* file;])
348
 
AS_IF([test x$ac_cv_libprotobuf = xno],
349
 
      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.]))
350
 
 
351
 
AC_CACHE_CHECK([if protobuf is recent enough], [drizzle_cv_protobuf_recent],
352
 
  [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
353
 
#include <google/protobuf/descriptor.h>
354
 
#if GOOGLE_PROTOBUF_VERSION < 2000002
355
 
# error Your version of Protobuf is too old
356
 
#endif
357
 
    ]])],
358
 
    [drizzle_cv_protobuf_recent=yes],
359
 
    [drizzle_cv_protobuf_recent=no])])
360
 
if test "$drizzle_cv_protobuf_recent" = "no"
361
 
then
362
 
  AC_MSG_ERROR([Your version of Google Protocol Buffers is too old. Drizzle requires at least version 2.0.2])
363
 
fi
364
 
 
365
 
AC_PATH_PROG([PROTOC],[protoc],[no],[$LIBPROTOBUF_PREFIX/bin:$PATH])
366
 
if test "x$PROTOC" = "xno"
367
 
then
368
 
  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.])
369
 
fi
370
 
 
371
 
AC_LANG_POP()
372
 
 
373
 
#--------------------------------------------------------------------
374
 
# Check for libuuid
375
 
#--------------------------------------------------------------------
376
 
 
377
 
dnl Do this by hand. Need to check for uuid/uuid.h, but uuid may or may
378
 
dnl not be a lib is weird.
379
 
 
380
 
AC_CHECK_HEADERS(uuid/uuid.h)
381
 
if test "x$ac_cv_header_uuid_uuid_h" = "xno"
382
 
then
383
 
  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.])
384
 
fi
385
 
AC_LIB_HAVE_LINKFLAGS(uuid,,
386
 
[
387
 
#include <uuid/uuid.h>
388
 
],
389
 
[
390
 
  uuid_t uout;
391
 
  uuid_generate(uout);
392
 
])
393
 
 
394
 
 
395
 
 
396
 
#--------------------------------------------------------------------
397
 
# Check for libpthread
398
 
#--------------------------------------------------------------------
399
 
 
400
 
ACX_PTHREAD(,AC_MSG_ERROR(could not find libpthread))
401
 
LIBS="$PTHREAD_LIBS $LIBS"
402
 
CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS}"
403
 
CC="$PTHREAD_CC"
404
 
 
405
 
#--------------------------------------------------------------------
406
 
# Check for tcmalloc/mtmalloc
407
 
#--------------------------------------------------------------------
408
 
 
409
 
AC_ARG_ENABLE([tcmalloc],
410
 
    [AS_HELP_STRING([--disable-tcmalloc],
411
 
       [Enable linking with tcmalloc @<:@default=on@:>@])],
412
 
    [ac_enable_tcmalloc="$enableval"],
413
 
    [ac_enable_tcmalloc="yes"])
414
 
 
415
 
if test "x$ac_enable_tcmalloc" != "xno"
416
 
then
417
 
  AC_CHECK_LIB(tcmalloc,malloc,[],[])
418
 
fi
419
 
 
420
 
if test "x$ac_cv_lib_tcmalloc_malloc" != "xyes"
421
 
then
422
 
  AC_CHECK_LIB(mtmalloc,malloc,[],[])
423
 
fi
424
 
 
425
 
 
426
 
#--------------------------------------------------------------------
427
 
# Check for libdrizzle
428
 
#--------------------------------------------------------------------
429
 
 
430
 
AC_LIB_HAVE_LINKFLAGS(drizzle,,
431
 
[#include <libdrizzle/drizzle.h>],
432
 
[
433
 
  const char *version= drizzle_version()
434
 
])
435
 
AS_IF([test x$ac_cv_libdrizzle = xno],
436
 
      AC_MSG_ERROR([libdrizzle is required for Drizzle]))
437
 
 
438
 
 
439
 
#--------------------------------------------------------------------
440
 
# Check for libz
441
 
#--------------------------------------------------------------------
442
 
 
443
 
AC_LIB_HAVE_LINKFLAGS(z,,
444
 
[#include <zlib.h>],
445
 
[
446
 
  crc32(0, Z_NULL, 0);
447
 
])
448
 
AS_IF([test x$ac_cv_libz = xno],
449
 
      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.]))
450
 
 
451
 
#--------------------------------------------------------------------
452
 
# Check for TBB
453
 
#--------------------------------------------------------------------
454
 
 
455
 
AC_LANG_PUSH(C++)
456
 
AC_LIB_HAVE_LINKFLAGS(tbb,,
457
 
[#include <tbb/atomic.h>
458
 
 #include <stdint.h>
459
 
],
460
 
[
461
 
  tbb::atomic<uint64_t> x;
462
 
  tbb::atomic<uint8_t> y;
463
 
  x=0;
464
 
  y=0;
465
 
  x++;
466
 
  y++;
467
 
])
468
 
AC_LANG_POP()
469
 
 
470
 
#--------------------------------------------------------------------
471
 
# Check for libreadline or compatible (libedit on Mac OS X)
472
 
#--------------------------------------------------------------------
473
 
 
474
 
save_LIBS="${LIBS}"
475
 
LIBS=""
476
 
VL_LIB_READLINE
477
 
AS_IF([test "x$vl_cv_lib_readline" = "xno"],
478
 
      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.]))
479
 
READLINE_LIBS="${LIBS}"
480
 
LIBS="${save_LIBS}"
481
 
AC_SUBST(READLINE_LIBS)
482
 
 
483
 
DRIZZLE_CHECK_NEW_RL_INTERFACE
484
 
 
485
 
#--------------------------------------------------------------------
486
 
# Check for libpcre
487
 
#--------------------------------------------------------------------
488
 
 
489
 
AC_LIB_HAVE_LINKFLAGS(pcre,, [#include <pcre.h>], [pcre *re= NULL])
490
 
AS_IF([test "x$ac_cv_libpcre" = "xno"],[
491
 
  unset ac_cv_libpcre
492
 
  AC_LIB_HAVE_LINKFLAGS(pcre,, [#include <pcre/pcre.h>], [pcre *re= NULL])
493
 
  AS_IF([test "x$ac_cv_libpcre" = "xno"],
494
 
        [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.])]
495
 
        [AC_DEFINE(PCRE_HEADER,[<pcre/pcre.h>],[Location of pcre header])])
496
 
],[
497
 
  AC_DEFINE(PCRE_HEADER,[<pcre.h>],[Location of pcre header])
498
 
])
499
 
 
 
292
  MYSQLD_DEFAULT_SWITCHES=""
 
293
  TARGET_LINUX="false"
 
294
  AC_MSG_RESULT([no])
 
295
fi
 
296
AC_SUBST(MYSQLD_DEFAULT_SWITCHES)
 
297
AC_SUBST(TARGET_LINUX)
500
298
 
501
299
dnl Find paths to some shell programs
502
300
AC_PATH_PROG(LN, ln, ln)
580
378
  FIND_PROC="$PS \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
581
379
else
582
380
  case $SYSTEM_TYPE in
583
 
    *freebsd*|*dragonfly*|*cygwin*)
 
381
    *freebsd*|*dragonfly*)
584
382
      FIND_PROC="$PS p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
585
383
      ;;
586
384
    *darwin*)
588
386
      ;;
589
387
    *)
590
388
      AC_MSG_ERROR([Could not find the right ps switches. Which OS is this ?. See the Installation chapter in the Reference Manual.])
591
 
      ;;
592
389
  esac
593
390
fi
594
391
AC_SUBST(FIND_PROC)
610
407
AC_SUBST(CHECK_PID)
611
408
AC_MSG_RESULT("$CHECK_PID")
612
409
 
 
410
# We need an ANSI C compiler
 
411
AM_PROG_CC_STDC
 
412
 
 
413
# We need an assembler, too
 
414
AM_PROG_AS
 
415
CCASFLAGS="$CCASFLAGS $ASFLAGS"
613
416
 
614
417
# Check if we need noexec stack for assembler
615
418
AC_CHECK_NOEXECSTACK
616
419
 
 
420
if test "$am_cv_prog_cc_stdc" = "no"
 
421
then
 
422
  AC_MSG_ERROR([MySQL requires an ANSI C compiler (and a C++ compiler). Try gcc. See the Installation chapter in the Reference Manual.])
 
423
fi
 
424
 
 
425
 
617
426
AC_ARG_WITH([server-suffix],
618
427
    [AS_HELP_STRING([--with-server-suffix],
619
428
      [Append value to the version string.])],
620
 
    [ DRIZZLE_SERVER_SUFFIX=`echo "$withval" | sed -e  's/^\(...................................\)..*$/\1/'` ],
621
 
    [ DRIZZLE_SERVER_SUFFIX= ]
 
429
    [ MYSQL_SERVER_SUFFIX=`echo "$withval" | sed -e  's/^\(...................................\)..*$/\1/'` ],
 
430
    [ MYSQL_SERVER_SUFFIX= ]
622
431
    )
623
 
AC_DEFINE_UNQUOTED([DRIZZLE_SERVER_SUFFIX],[$DRIZZLE_SERVER_SUFFIX],
624
 
                   [Append value to the version string])
 
432
AC_SUBST(MYSQL_SERVER_SUFFIX)
625
433
 
626
434
# Force use of a curses libs
627
435
AC_ARG_WITH([named-curses-libs],
632
440
    [ with_named_curses=no ]
633
441
    )
634
442
 
 
443
# compile with strings functions in assembler
 
444
AC_ARG_ENABLE([assembler],
 
445
    [AS_HELP_STRING([--enable-assembler],
 
446
            [Use assembler versions of some string functions if available.])],
 
447
    [ ENABLE_ASSEMBLER=$enableval ],
 
448
    [ ENABLE_ASSEMBLER=no ]
 
449
    )
 
450
 
 
451
AC_MSG_CHECKING(if we should use assembler functions)
 
452
# For now we only support assembler on i386 and sparc systems
 
453
AM_CONDITIONAL(ASSEMBLER_x86, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "i386" && $AS strings/strings-x86.s -o checkassembler >/dev/null 2>&1 && test -f checkassembler && (rm -f checkassembler; exit 0;))
 
454
AM_CONDITIONAL(ASSEMBLER_sparc32, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "sparc")
 
455
AM_CONDITIONAL(ASSEMBLER_sparc64, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "sparcv9")
 
456
AM_CONDITIONAL(ASSEMBLER, test "$ASSEMBLER_x86_TRUE" = "" -o "$ASSEMBLER_sparc32_TRUE" = "")
 
457
 
 
458
if test "$ASSEMBLER_TRUE" = ""
 
459
then
 
460
  AC_MSG_RESULT([yes])
 
461
else
 
462
  AC_MSG_RESULT([no])
 
463
fi
 
464
 
 
465
# Add query profiler
 
466
AC_MSG_CHECKING(if SHOW PROFILE should be enabled.)
 
467
AC_ARG_ENABLE([profiling],
 
468
    [AS_HELP_STRING([--enable-profiling], 
 
469
            [Build a version with query profiling code])],
 
470
    [ ENABLED_PROFILING=$enableval ],
 
471
    [ ENABLED_PROFILING=no ])
 
472
 
 
473
if test "$ENABLED_PROFILING" = "yes"
 
474
then
 
475
  AC_DEFINE([ENABLED_PROFILING], [1],
 
476
            [If SHOW PROFILE should be enabled])
 
477
  AC_MSG_RESULT([yes]) 
 
478
else
 
479
  AC_MSG_RESULT([no])
 
480
fi
 
481
 
635
482
AC_ARG_WITH([tcp-port],
636
483
    [AS_HELP_STRING([--with-tcp-port=port-number],
637
 
            [Which port to use for Drizzle services @<:@default=4427@:>@])],
638
 
    [ DRIZZLE_TCP_PORT=$withval ],
639
 
    [ DRIZZLE_TCP_PORT=$DRIZZLE_TCP_PORT_DEFAULT
 
484
            [Which port to use for MySQL services @<:@default=3306@:>@])],
 
485
    [ MYSQL_TCP_PORT=$withval ],
 
486
    [ MYSQL_TCP_PORT=$MYSQL_TCP_PORT_DEFAULT
640
487
      # if we actually defaulted (as opposed to the pathological case of
641
 
      # --with-tcp-port=<DRIZZLE_TCP_PORT_DEFAULT> which might in theory
 
488
      # --with-tcp-port=<MYSQL_TCP_PORT_DEFAULT> which might in theory
642
489
      # happen if whole batch of servers was built from a script), set
643
490
      # the default to zero to indicate that; we don't lose information
644
491
      # that way, because 0 obviously indicates that we can get the
645
 
      # default value from DRIZZLE_TCP_PORT. this seems really evil, but
646
 
      # testing for DRIZZLE_TCP_PORT==DRIZZLE_TCP_PORT_DEFAULT would make a
647
 
      # a port of DRIZZLE_TCP_PORT_DEFAULT magic even if the builder did not
 
492
      # default value from MYSQL_TCP_PORT. this seems really evil, but
 
493
      # testing for MYSQL_TCP_PORT==MYSQL_TCP_PORT_DEFAULT would make a
 
494
      # a port of MYSQL_TCP_PORT_DEFAULT magic even if the builder did not
648
495
      # intend it to mean "use the default, in fact, look up a good default
649
 
      # from /etc/services if you can", but really, really meant 4427 when
650
 
      # they passed in 4427. When they pass in a specific value, let them
 
496
      # from /etc/services if you can", but really, really meant 3306 when
 
497
      # they passed in 3306. When they pass in a specific value, let them
651
498
      # have it; don't second guess user and think we know better, this will
652
499
      # just make people cross.  this makes the the logic work like this
653
500
      # (which is complicated enough):
655
502
      # - if a port was set during build, use that as a default.
656
503
      #
657
504
      # - otherwise, try to look up a port in /etc/services; if that fails,
658
 
      #   use DRIZZLE_TCP_PORT_DEFAULT (at the time of this writing 4427)
 
505
      #   use MYSQL_TCP_PORT_DEFAULT (at the time of this writing 3306)
659
506
      #
660
 
      # - allow the DRIZZLE_TCP_PORT environment variable to override that.
 
507
      # - allow the MYSQL_TCP_PORT environment variable to override that.
661
508
      #
662
509
      # - allow command-line parameters to override all of the above.
663
510
      #
664
 
      # the top-most DRIZZLE_TCP_PORT_DEFAULT is read from win/configure.js,
 
511
      # the top-most MYSQL_TCP_PORT_DEFAULT is read from win/configure.js,
665
512
      # so don't mess with that.
666
 
      DRIZZLE_TCP_PORT_DEFAULT=0 ]
 
513
      MYSQL_TCP_PORT_DEFAULT=0 ]
667
514
    )
668
 
AC_SUBST(DRIZZLE_TCP_PORT)
 
515
AC_SUBST(MYSQL_TCP_PORT)
669
516
# We might want to document the assigned port in the manual.
670
 
AC_SUBST(DRIZZLE_TCP_PORT_DEFAULT)
671
 
AC_DEFINE_UNQUOTED([DRIZZLE_PORT],[$DRIZZLE_TCP_PORT],
672
 
                   [Drizzle port to use])
673
 
AC_DEFINE_UNQUOTED([DRIZZLE_PORT_DEFAULT],[$DRIZZLE_TCP_PORT_DEFAULT],
674
 
                   [If we defaulted to DRIZZLE_PORT, then this will be zero])
 
517
AC_SUBST(MYSQL_TCP_PORT_DEFAULT)
675
518
 
676
519
# Use this to set the place used for unix socket used to local communication.
677
 
AC_ARG_WITH([drizzled-user],
678
 
    [AS_HELP_STRING([--with-drizzled-user=username],
679
 
            [What user the drizzled daemon shall be run as.
680
 
                @<:@default=drizzle@:>@])],
681
 
    [ DRIZZLED_USER=$withval ],
682
 
    [ DRIZZLED_USER=drizzle ]
 
520
AC_ARG_WITH([mysqld-user],
 
521
    [AS_HELP_STRING([--with-mysqld-user=username],
 
522
            [What user the mysqld daemon shall be run as.
 
523
                @<:@default=mysql@:>@])],
 
524
    [ MYSQLD_USER=$withval ],
 
525
    [ MYSQLD_USER=mysql ]
683
526
    )
684
 
AC_SUBST(DRIZZLED_USER)
 
527
AC_SUBST(MYSQLD_USER)
685
528
 
686
529
# If we should allow LOAD DATA LOCAL
687
530
AC_MSG_CHECKING(If we should should enable LOAD DATA LOCAL by default)
699
542
  AC_MSG_RESULT([no])
700
543
fi
701
544
 
 
545
MYSQL_SYS_LARGEFILE
 
546
 
702
547
# Types that must be checked AFTER large file support is checked
703
548
AC_TYPE_SIZE_T
704
549
 
713
558
AC_CHECK_HEADERS(fcntl.h float.h fpu_control.h ieeefp.h)
714
559
AC_CHECK_HEADERS(limits.h pwd.h select.h linux/config.h)
715
560
AC_CHECK_HEADERS(sys/fpu.h utime.h sys/utime.h )
716
 
AC_CHECK_HEADERS(synch.h sys/mman.h sys/socket.h)
717
 
AC_CHECK_HEADERS([curses.h term.h],[],[],
718
 
[[#ifdef HAVE_CURSES_H
719
 
# include <curses.h>
720
 
#endif
721
 
]])
722
 
AC_CHECK_HEADERS(termio.h termios.h sched.h alloca.h)
723
 
AC_CHECK_HEADERS(sys/prctl.h ieeefp.h)
 
561
AC_CHECK_HEADERS(synch.h sys/mman.h sys/socket.h netinet/in.h arpa/inet.h)
 
562
AC_CHECK_HEADERS(sys/timeb.h ys/un.h sys/vadvise.h sys/wait.h term.h)
 
563
AC_CHECK_HEADERS(termio.h termios.h sched.h crypt.h alloca.h)
 
564
AC_CHECK_HEADERS(sys/ioctl.h malloc.h sys/malloc.h sys/ipc.h sys/shm.h)
 
565
AC_CHECK_HEADERS(sys/prctl.h sys/resource.h sys/param.h port.h ieeefp.h)
724
566
AC_CHECK_HEADERS(execinfo.h)
725
567
 
 
568
AC_CHECK_HEADERS([xfs/xfs.h])
 
569
#--------------------------------------------------------------------
 
570
# Check for libevent
 
571
#--------------------------------------------------------------------
 
572
 
 
573
AC_CHECK_LIB(event, event_loop, [], [AC_MSG_ERROR(could not find libevent)])
 
574
 
 
575
#--------------------------------------------------------------------
 
576
# Check for libpthread
 
577
#--------------------------------------------------------------------
 
578
 
 
579
AC_CHECK_LIB(pthread, pthread_create, [], [AC_MSG_ERROR(could not find libpthread)])
 
580
 
 
581
#--------------------------------------------------------------------
 
582
# Check for libpcre
 
583
#--------------------------------------------------------------------
 
584
 
 
585
AC_PATH_PROG(PKG_CONFIG, pkg-config, AC_MSG_ERROR([pkg-config wasn't found.]))
 
586
PKG_CHECK_MODULES(PCRE, [libpcrecpp >= 3], [
 
587
  ac_cv_have_libpcre=yes
 
588
  AC_DEFINE([HAVE_PCRE], [1], [Perl Compatible Regex Lib for mysqltest])
 
589
  ],[
 
590
  ac_cv_have_libpcre=no
 
591
  AC_MSG_WARN([PCRE not found - mysqltest will not be built])
 
592
  ])
 
593
AM_CONDITIONAL(BUILD_MYSQLTEST, test "x$ac_cv_have_libpcre" = "xyes")
 
594
AC_SUBST(PCRE_LIBS)
 
595
AC_SUBST(PCRE_CFLAGS)
 
596
 
726
597
#--------------------------------------------------------------------
727
598
# Check for system libraries. Adds the library to $LIBS
728
599
# and defines HAVE_LIBM etc
729
600
#--------------------------------------------------------------------
730
601
 
731
602
AC_CHECK_LIB(m, floor, [], AC_CHECK_LIB(m, __infinity))
 
603
AC_CHECK_FUNCS(log2)
732
604
 
733
 
AC_CHECK_FUNC(setsockopt, [], [AC_CHECK_LIB(socket, setsockopt)])
734
 
AC_CHECK_FUNC(yp_get_default_domain, [],
735
 
  [AC_CHECK_LIB(nsl, yp_get_default_domain)])
736
 
AC_CHECK_FUNC(p2open, [], [AC_CHECK_LIB(gen, p2open)])
 
605
AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
 
606
AC_CHECK_FUNC(yp_get_default_domain, ,
 
607
  AC_CHECK_LIB(nsl, yp_get_default_domain))
 
608
AC_CHECK_FUNC(p2open, , AC_CHECK_LIB(gen, p2open))
737
609
# This may get things to compile even if bind-8 is installed
738
 
AC_CHECK_FUNC(bind, [], [AC_CHECK_LIB(bind, bind)])
 
610
AC_CHECK_FUNC(bind, , AC_CHECK_LIB(bind, bind))
739
611
# Check if crypt() exists in libc or libcrypt, sets LIBS if needed
740
612
AC_SEARCH_LIBS(crypt, crypt, AC_DEFINE(HAVE_CRYPT, 1, [crypt]))
741
613
 
743
615
AC_CHECK_LIB(rt, aio_read)
744
616
 
745
617
# For the sched_yield() function on Solaris
746
 
AC_CHECK_FUNC(sched_yield, [],
747
 
  [AC_CHECK_LIB(posix4, [sched_yield],
748
 
    [AC_DEFINE(HAVE_SCHED_YIELD) LIBS="$LIBS -lposix4"])])
 
618
AC_CHECK_FUNC(sched_yield, , AC_CHECK_LIB(posix4, sched_yield,
 
619
[AC_DEFINE(HAVE_SCHED_YIELD) LIBS="$LIBS -lposix4"]))
749
620
 
750
621
if test "$ac_cv_header_termio_h" = "no" -a "$ac_cv_header_termios_h" = "no"
751
622
then
752
 
  AC_CHECK_FUNC(gtty, [], [AC_CHECK_LIB(compat, gtty)])
 
623
  AC_CHECK_FUNC(gtty, , AC_CHECK_LIB(compat, gtty))
753
624
fi
754
625
 
 
626
AC_CHECK_TYPES([int8, uint8, int16, uint16, int32, uint32, int64, uint64,
 
627
                uchar, uint, ulong],[],[], [
 
628
#include <sys/types.h>
 
629
])
755
630
AC_CHECK_TYPES([fp_except], [], [], [
756
631
#include <sys/types.h>
757
632
#include <ieeefp.h>
758
633
])
759
634
 
 
635
 
760
636
my_save_LIBS="$LIBS"
761
637
LIBS=""
762
638
AC_CHECK_LIB(dl,dlopen)
763
 
AC_CHECK_FUNCS(dlopen)
764
 
if test "$ac_cv_func_dlopen" != "yes"
765
 
then
766
 
  AC_MSG_ERROR([Drizzle requires dlopen])
767
 
fi
768
 
LIBDL_LIBS="$LIBS"
769
 
LIBS="$my_save_LIBS"
770
 
AC_SUBST(LIBDL_LIBS)
771
 
 
 
639
LIBDL=$LIBS
 
640
LIBS="$my_save_LIBS"
 
641
AC_SUBST(LIBDL)
 
642
 
 
643
my_save_LIBS="$LIBS"
 
644
LIBS="$LIBS $LIBDL"
 
645
AC_CHECK_FUNCS(dlopen dlerror)
 
646
LIBS="$my_save_LIBS"
 
647
 
 
648
AC_CHECK_FUNCS(strtok_r)
 
649
 
 
650
# Build optimized or debug version ?
 
651
# First check for gcc and g++
 
652
if test "$ac_cv_c_compiler_gnu" = "yes"
 
653
then
 
654
  DEBUG_CFLAGS="-g"
 
655
  DEBUG_OPTIMIZE_CC="-O"
 
656
  OPTIMIZE_CFLAGS="$MAX_C_OPTIMIZE"
 
657
else
 
658
  DEBUG_CFLAGS="-g"
 
659
  DEBUG_OPTIMIZE_CC=""
 
660
  OPTIMIZE_CFLAGS="-O"
 
661
fi
 
662
if test "$ac_cv_prog_cxx_g" = "yes"
 
663
then
 
664
  DEBUG_CXXFLAGS="-g"
 
665
  DEBUG_OPTIMIZE_CXX="-O"
 
666
  OPTIMIZE_CXXFLAGS="$MAX_CXX_OPTIMIZE"
 
667
else
 
668
  DEBUG_CXXFLAGS="-g"
 
669
  DEBUG_OPTIMIZE_CXX=""
 
670
  OPTIMIZE_CXXFLAGS="-O"
 
671
fi
 
672
 
 
673
# If the user specified CFLAGS, we won't add any optimizations
 
674
if test -n "$SAVE_CFLAGS"
 
675
then
 
676
  OPTIMIZE_CFLAGS=""
 
677
  DEBUG_OPTIMIZE_CC=""
 
678
fi
 
679
# Ditto for CXXFLAGS
 
680
if test -n "$SAVE_CXXFLAGS"
 
681
then
 
682
  OPTIMIZE_CXXFLAGS=""
 
683
  DEBUG_OPTIMIZE_CXX=""
 
684
fi
 
685
 
 
686
AC_ARG_WITH([debug],
 
687
    [AS_HELP_STRING([--with-debug],
 
688
            [Add debug code (yes|no|full) @<:@default=no@:>@ 
 
689
            Full adds memory checked, very slow.])],
 
690
    [with_debug=$withval],
 
691
    [with_debug=no])
 
692
AM_CONDITIONAL(BUILD_DBUG, test "$with_debug" != "no")
 
693
if test "$with_debug" = "yes"
 
694
then
 
695
  # Medium debug.
 
696
  AC_DEFINE([DBUG_ON], [1], [Use libdbug])
 
697
  CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC $CFLAGS"
 
698
  CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX $CXXFLAGS"
 
699
  
 
700
elif test "$with_debug" = "full"
 
701
then
 
702
  # Full debug. Very slow in some cases
 
703
  AC_DEFINE([DBUG_ON], [1], [Use libdbug])
 
704
  CFLAGS="$DEBUG_CFLAGS $CFLAGS"
 
705
  CXXFLAGS="$DEBUG_CXXFLAGS $CXXFLAGS"
 
706
else
 
707
  # Optimized version. No debug
 
708
  AC_DEFINE([DBUG_OFF], [1], [Dont use libdbug])
 
709
  CFLAGS="$OPTIMIZE_CFLAGS $CFLAGS"
 
710
  CXXFLAGS="$OPTIMIZE_CXXFLAGS $CXXFLAGS"
 
711
fi
 
712
 
 
713
# If we should allow error injection tests
 
714
AC_ARG_WITH([error-inject],
 
715
    [AS_HELP_STRING([--with-error-inject],
 
716
            [Enable error injection in MySQL Server @<:@default=off@:>@])],
 
717
    [ with_error_inject=$withval ],
 
718
    [ with_error_inject=no ])
 
719
 
 
720
if test $with_debug != "no"
 
721
then
 
722
  if test "$with_error_inject" = "yes"
 
723
  then
 
724
    AC_DEFINE([ERROR_INJECT_SUPPORT], [1],
 
725
              [Enable error injection in MySQL Server])
 
726
  fi
 
727
fi
772
728
 
773
729
AC_ARG_WITH([fast-mutexes],
774
730
    [AS_HELP_STRING([--with-fast-mutexes],
778
734
 
779
735
if test "$with_fast_mutexes" != "no"
780
736
then
781
 
        AC_DEFINE([MY_PTHREAD_FASTMUTEX], [1], 
782
 
                        [Define to 1 if you want to use fast mutexes])
 
737
  if test "$with_debug" != "no"
 
738
  then
 
739
    AC_MSG_WARN(['--with-fast-mutexes' ignored when '--with-debug' is given])
 
740
  else
 
741
    AC_DEFINE([MY_PTHREAD_FASTMUTEX], [1], 
 
742
              [Define to 1 if you want to use fast mutexes])
 
743
  fi
783
744
fi
784
745
 
785
 
AM_CONDITIONAL(BUILD_FAST_MUTEX,[test "$with_fast_mutexes" != "no"])
786
 
 
787
 
AC_ARG_WITH([atomic-ops],
788
 
    [AS_HELP_STRING([--with-atomic-ops=rwlocks|smp|up],
789
 
       [Implement atomic operations using pthread rwlocks or atomic CPU
790
 
        instructions for multi-processor or uniprocessor
791
 
        configuration. By default gcc built-in sync functions are used,
792
 
        if available and 'smp' configuration otherwise.])],
793
 
    [with_atomic_ops="$withval"],
794
 
    [with_atomic_ops=smp])
795
 
 
796
 
case "$with_atomic_ops" in
797
 
  "up") AC_DEFINE([MY_ATOMIC_MODE_DUMMY], [1],
798
 
                  [Assume single-CPU mode, no concurrency]) ;;
799
 
  "rwlocks") AC_DEFINE([MY_ATOMIC_MODE_RWLOCKS], [1],
800
 
                  [Use pthread rwlocks for atomic ops]) ;;
801
 
  "smp") 
802
 
    AC_CACHE_CHECK(
803
 
      [whether the compiler provides atomic builtins],
804
 
      [ac_cv_gcc_atomic_builtins],
805
 
      [AC_RUN_IFELSE(
806
 
        [AC_LANG_PROGRAM([],[[
807
 
          int foo= -10; int bar= 10;
808
 
          if (!__sync_fetch_and_add(&foo, bar) || foo)
809
 
            return -1;
810
 
          bar= __sync_lock_test_and_set(&foo, bar);
811
 
          if (bar || foo != 10)
812
 
            return -1;
813
 
          bar= __sync_val_compare_and_swap(&bar, foo, 15);
814
 
          if (bar)
815
 
            return -1;
816
 
          return 0;
817
 
        ]])],
818
 
       [ac_cv_gcc_atomic_builtins=yes],
819
 
       [ac_cv_gcc_atomic_builtins=no])])
820
 
 
821
 
    if test "x$ac_cv_gcc_atomic_builtins" = "xyes"; then
822
 
      AC_DEFINE(HAVE_GCC_ATOMIC_BUILTINS, 1,
823
 
                [Define to 1 if compiler provides atomic builtins.])
824
 
    fi
825
 
   ;;
826
 
   *) AC_MSG_ERROR(["$with_atomic_ops" is not a valid value for --with-atomic-ops]) ;;
827
 
esac
828
 
 
829
 
 
830
746
AC_ARG_WITH([comment],
831
747
    [AS_HELP_STRING([--with-comment],
832
748
            [Comment about compilation environment. @<:@default=off@:>@])],
838
754
else
839
755
  COMPILATION_COMMENT="Source distribution"
840
756
fi
841
 
AC_DEFINE_UNQUOTED([COMPILATION_COMMENT],["$COMPILATION_COMMENT"],
842
 
                   [Comment about compilation environment])
 
757
AC_SUBST(COMPILATION_COMMENT)
 
758
 
 
759
AC_MSG_CHECKING("need of special linking flags")
 
760
if test "$TARGET_LINUX" = "true" -a "$ac_cv_c_compiler_gnu" = "yes" -a "$all_is_static" != "yes"
 
761
then
 
762
  LDFLAGS="$LDFLAGS -rdynamic"
 
763
  AC_MSG_RESULT("-rdynamic")
 
764
else
 
765
  case "$SYSTEM_TYPE$with_mysqld_ldflags " in
 
766
  *freebsd*"-all-static "*|*dragonfly*"-all-static "*)
 
767
    AC_MSG_RESULT("none")
 
768
    ;;
 
769
  *freebsd*|*dragonfly*)
 
770
    MYSQLD_EXTRA_LDFLAGS="$MYSQLD_EXTRA_LDFLAGS -export-dynamic"
 
771
    AC_MSG_RESULT("-export-dynamic")
 
772
    ;;
 
773
  *)
 
774
    AC_MSG_RESULT("none")
 
775
    ;;
 
776
  esac
 
777
fi
843
778
 
844
779
dnl Checks for typedefs, structures, and compiler characteristics.
845
780
AC_C_CONST
846
781
AC_C_INLINE
847
 
AC_C_VOLATILE
848
782
AC_TYPE_OFF_T
849
783
AC_HEADER_TIME
850
784
AC_STRUCT_TM
 
785
MYSQL_NEEDS_MYSYS_NEW
 
786
# AC_CHECK_SIZEOF return 0 when it does not find the size of a
 
787
# type. We want a error instead.
 
788
AC_CHECK_SIZEOF(char, 1)
 
789
if test "$ac_cv_sizeof_char" -eq 0
 
790
then
 
791
  AC_MSG_ERROR([No size for char type.])
 
792
fi
 
793
AC_CHECK_SIZEOF(char*, 4)
 
794
AC_CHECK_SIZEOF(short, 2)
 
795
AC_CHECK_SIZEOF(int, 4)
 
796
if test "$ac_cv_sizeof_int" -eq 0
 
797
then
 
798
  AC_MSG_ERROR("No size for int type.")
 
799
fi
 
800
AC_CHECK_SIZEOF(long, 4)
 
801
if test "$ac_cv_sizeof_long" -eq 0
 
802
then
 
803
  AC_MSG_ERROR("No size for long type.")
 
804
fi
 
805
AC_CHECK_SIZEOF(long long, 8)
 
806
if test "$ac_cv_sizeof_long_long" -eq 0
 
807
then
 
808
  AC_MSG_ERROR("MySQL needs a long long type.")
 
809
fi
851
810
# off_t is not a builtin type
852
811
AC_CHECK_SIZEOF(off_t, 4)
853
812
if test "$ac_cv_sizeof_off_t" -eq 0
854
813
then
855
 
  AC_MSG_ERROR("Drizzle needs a off_t type.")
 
814
  AC_MSG_ERROR("MySQL needs a off_t type.")
856
815
fi
857
 
AC_CHECK_SIZEOF(size_t)
858
 
AC_DEFINE_UNQUOTED([SIZEOF_SIZE_T],[$ac_cv_sizeof_size_t],[Size of size_t as computed by sizeof()])
859
 
AC_CHECK_SIZEOF(long long)
860
 
AC_DEFINE_UNQUOTED(SIZEOF_LONG_LONG,[$ac_cv_sizeof_long_long],[Size of long long as computed by sizeof()])
861
816
 
862
817
dnl
863
818
dnl check if time_t is unsigned
864
819
dnl
865
820
 
866
 
DRIZZLE_CHECK_TIME_T
867
 
 
 
821
MYSQL_CHECK_TIME_T
 
822
 
 
823
 
 
824
# do we need #pragma interface/#pragma implementation ?
 
825
# yes if it's gcc 2.x, and not icc pretending to be gcc, and not cygwin
 
826
AC_MSG_CHECKING(the need for @%:@pragma interface/implementation)
 
827
# instead of trying to match SYSTEM_TYPE and CC_VERSION (that doesn't
 
828
# follow any standard), we'll use well-defined preprocessor macros:
 
829
AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
 
830
#if !defined(__CYGWIN__) && !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ < 3)
 
831
#error USE_PRAGMA_IMPLEMENTATION
 
832
#endif
 
833
]])],[AC_MSG_RESULT(no) ],[AC_MSG_RESULT(yes) ; CXXFLAGS="$CXXFLAGS -DUSE_PRAGMA_IMPLEMENTATION"])
868
834
 
869
835
# This always gives a warning. Ignore it unless you are cross compiling
870
836
AC_C_BIGENDIAN
871
 
 
 
837
#---START: Used in for client configure
 
838
# Check base type of last arg to accept
 
839
MYSQL_TYPE_ACCEPT
 
840
#---END:
 
841
# Figure out what type of struct rlimit to use with setrlimit
 
842
MYSQL_TYPE_STRUCT_RLIMIT
872
843
# Find where the stack goes
873
 
DRIZZLE_STACK_DIRECTION
 
844
MYSQL_STACK_DIRECTION
874
845
# We want to skip alloca on irix unconditionally. It may work on some version..
875
 
DRIZZLE_FUNC_ALLOCA
876
 
 
 
846
MYSQL_FUNC_ALLOCA
 
847
# Do struct timespec have members tv_sec or ts_sec
 
848
MYSQL_TIMESPEC_TS
 
849
# Do we have the tzname variable
 
850
MYSQL_TZNAME
 
851
# Do the c++ compiler have a bool type
 
852
MYSQL_CXX_BOOL
877
853
AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>])
878
 
AC_CHECK_TYPES([uint, ulong])
879
 
 
880
 
DRIZZLE_PTHREAD_YIELD
881
 
 
 
854
AC_CHECK_TYPES([size_t], [], [], [#include <stdio.h>])
 
855
AC_CHECK_TYPES([u_int32_t])
 
856
 
 
857
MYSQL_PTHREAD_YIELD
 
858
 
 
859
######################################################################
 
860
# For readline/libedit (We simply move the mimimum amount of stuff from
 
861
# the readline/libedit configure.in here)
882
862
 
883
863
dnl Checks for header files.
884
 
AC_CHECK_HEADERS(malloc.h)
 
864
AC_CHECK_HEADERS(malloc.h sys/cdefs.h)
885
865
 
886
866
dnl Checks for library functions.
887
867
AC_FUNC_ALLOCA
888
868
AC_PROG_GCC_TRADITIONAL
889
869
AC_TYPE_SIGNAL
890
 
 
 
870
AC_CHECK_FUNCS(re_comp regcomp strdup)
 
871
 
 
872
dnl Sun compilers have their own vis.h that is about something
 
873
dnl totally different. So, not to change the libedit source, we
 
874
dnl do some additional checks before we define HAVE_VIS_H.
 
875
AC_CHECK_HEADER(vis.h,
 
876
  [AC_CHECK_FUNC(strvis,
 
877
    [AC_DEFINE([HAVE_VIS_H], [1],[Found vis.h and the strvis() function])])])
 
878
 
 
879
AC_CHECK_FUNCS(strlcat strlcpy)
891
880
AC_CHECK_FUNCS(issetugid)
 
881
AC_CHECK_FUNCS(getline flockfile)
892
882
 
893
883
# from old readline settting:
894
884
 
896
886
AC_SUBST(MAKE_SHELL)
897
887
 
898
888
# Already-done: stdlib.h string.h unistd.h termios.h
899
 
AC_CHECK_HEADERS(stdarg.h dirent.h locale.h ndir.h sys/dir.h \
900
 
 sys/ndir.h sys/select.h \
901
 
 sys/mman.h termcap.h termio.h asm/termbits.h grp.h \
902
 
 paths.h)
 
889
AC_CHECK_HEADERS(varargs.h stdarg.h dirent.h locale.h ndir.h sys/dir.h \
 
890
 sys/file.h sys/ndir.h sys/ptem.h sys/pte.h sys/select.h sys/stream.h \
 
891
 sys/mman.h curses.h termcap.h termio.h termbits.h asm/termbits.h grp.h \
 
892
paths.h semaphore.h)
903
893
 
904
894
# Already-done: strcasecmp
905
 
AC_CHECK_FUNCS(lstat select)
 
895
AC_CHECK_FUNCS(lstat putenv select setenv setlocale strcoll tcgetattr)
906
896
 
907
897
AC_HEADER_STAT
908
 
DRIZZLE_SIGNAL_CHECK
909
 
DRIZZLE_CHECK_GETPW_FUNCS
910
 
DRIZZLE_HAVE_TIOCGWINSZ
911
 
DRIZZLE_HAVE_TIOCSTAT
912
 
 
 
898
MYSQL_SIGNAL_CHECK
 
899
MYSQL_CHECK_GETPW_FUNCS
 
900
MYSQL_HAVE_TIOCGWINSZ
 
901
MYSQL_HAVE_FIONREAD
 
902
MYSQL_HAVE_TIOCSTAT
 
903
MYSQL_STRUCT_DIRENT_D_INO
 
904
MYSQL_STRUCT_DIRENT_D_NAMLEN
 
905
MYSQL_TYPE_SIGHANDLER
 
906
MYSQL_CHECK_MULTIBYTE
 
907
if test "$with_named_curses" = "no"
 
908
then
 
909
  MYSQL_CHECK_LIB_TERMCAP
 
910
else
 
911
  TERMCAP_LIB="$with_named_curses"
 
912
fi
 
913
AC_SUBST(TERMCAP_LIB)
 
914
 
 
915
# Check if the termcap function 'tgoto' is already declared in
 
916
# system header files or if it need to be declared locally
 
917
AC_CHECK_DECLS(tgoto,,,[
 
918
#ifdef HAVE_CURSES_H
 
919
# include <curses.h>
 
920
#elif HAVE_NCURSES_H
 
921
# include <ncurses.h>
 
922
#endif
 
923
#ifdef HAVE_TERM_H
 
924
# include <term.h>
 
925
#endif
 
926
])
 
927
 
 
928
# End of readline/libedit stuff
913
929
#########################################################################
914
930
 
915
931
dnl Checks for library functions.
916
932
 
 
933
#
 
934
# The following code disables intrinsic function support while we test for
 
935
# library functions.  This is to avoid configure problems with Intel ecc
 
936
# compiler
 
937
 
 
938
ORG_CFLAGS="$CFLAGS"
 
939
if test "$GCC" != "yes"; then
 
940
  AC_SYS_COMPILER_FLAG(-nolib_inline,nolib_inline,CFLAGS,[],[])
 
941
fi
 
942
 
 
943
#AC_FUNC_MMAP
 
944
AC_TYPE_SIGNAL
 
945
MYSQL_TYPE_QSORT
917
946
AC_FUNC_UTIME_NULL
918
947
AC_FUNC_VPRINTF
919
948
 
923
952
  AC_MSG_ERROR("Drizzle requires fcntl.")
924
953
fi
925
954
 
926
 
AC_CONFIG_LIBOBJ_DIR([gnulib])
927
 
 
928
 
AC_CHECK_FUNCS( \
 
955
AC_CHECK_FUNCS(bcmp bfill bmove bsearch bzero \
929
956
  cuserid fchmod \
930
 
  fdatasync fpresetsticky fpsetmask fsync \
931
 
  getpassphrase getpwnam \
932
 
  getpwuid getrlimit getrusage index initgroups isnan \
 
957
  fdatasync finite fpresetsticky fpsetmask fsync ftruncate \
 
958
  getcwd getpass getpassphrase getpwnam \
 
959
  getpwuid getrlimit getrusage getwd index initgroups isnan \
933
960
  localtime_r gethrtime gmtime_r \
934
 
  madvise \
935
 
  mkstemp mlockall poll pread pthread_attr_create mmap mmap64 \
 
961
  locking longjmp lrand48 madvise mallinfo memcpy memmove \
 
962
  mkstemp mlockall perror poll pread pthread_attr_create mmap mmap64 getpagesize \
936
963
  pthread_attr_getstacksize pthread_attr_setprio pthread_attr_setschedparam \
937
964
  pthread_attr_setstacksize pthread_condattr_create pthread_getsequence_np \
938
965
  pthread_key_delete pthread_rwlock_rdlock pthread_setprio \
939
966
  pthread_setprio_np pthread_setschedparam pthread_sigmask readlink \
940
 
  realpath rename rwlock_init setupterm \
941
 
  sigaction \
942
 
  sigthreadmask \
943
 
  snprintf strpbrk \
944
 
  tell tempnam \
945
 
  backtrace backtrace_symbols backtrace_symbols_fd)
946
 
 
947
 
AC_LANG_PUSH(C++)
948
 
# Test whether madvise() is declared in C++ code -- it is not on some
949
 
# systems, such as Solaris
950
 
AC_CHECK_DECLS([madvise], [], [], [AC_INCLUDES_DEFAULT[
951
 
#if HAVE_SYS_MMAN_H
952
 
#include <sys/types.h>
953
 
#include <sys/mman.h>
954
 
#endif
955
 
]])
956
 
AC_LANG_POP()
957
 
 
958
 
 
959
 
AM_CONDITIONAL(BUILD_THR_RWLOCK,[test "$ac_cv_func_rwlock_init" -a "$ac_cv_funn_pthread_rwlock_rdlock"])
960
 
 
 
967
  realpath rename rint rwlock_init setupterm \
 
968
  shmget shmat shmdt shmctl sigaction sigemptyset sigaddset \
 
969
  sighold sigset sigthreadmask port_create sleep \
 
970
  snprintf socket stpcpy strcasecmp strerror strsignal strnlen strpbrk strstr \
 
971
  strtol strtoll strtoul strtoull tell tempnam vidattr \
 
972
  posix_fallocate backtrace backtrace_symbols backtrace_symbols_fd)
 
973
 
 
974
# Check that isinf() is available in math.h and can be used in both C and C++
 
975
# code
 
976
AC_MSG_CHECKING(for isinf in math.h)
 
977
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]], [[
 
978
    float f = 0.0; 
 
979
    int r = isinf(f); 
 
980
    return r;
 
981
  ]])],[
 
982
    AC_MSG_RESULT(yes)
 
983
    AC_MSG_CHECKING(whether isinf() can be used in C++ code)
 
984
    AC_LANG_PUSH([C++])
 
985
    AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]], [[
 
986
      float f = 0.0;
 
987
      int r = isinf(f);
 
988
      return r;
 
989
    ]])],[
 
990
      AC_MSG_RESULT(yes)
 
991
      AC_DEFINE(HAVE_ISINF, [1], [isinf() macro or function])
 
992
    ],[
 
993
      AC_MSG_RESULT(no)
 
994
    ])
 
995
    AC_LANG_POP([])
 
996
  ],[
 
997
  AC_MSG_RESULT(no)])
 
998
 
 
999
 
 
1000
CFLAGS="$ORG_CFLAGS"
961
1001
 
962
1002
# Sanity check: We chould not have any fseeko symbol unless
963
1003
# large_file_support=yes
964
1004
AC_CHECK_FUNC(fseeko,
965
 
[if test "$large_file_support" = no -a "x$TARGET_LINUX" = "xtrue";
 
1005
[if test "$large_file_support" = no -a "$TARGET_LINUX" = "true";
966
1006
then
967
1007
  AC_MSG_ERROR("Found fseeko symbol but large_file_support is not enabled!")
968
1008
fi]
969
1009
)
970
1010
 
971
1011
# Check definition of pthread_getspecific
972
 
AC_CACHE_CHECK([args to pthread_getspecific], [mysql_cv_getspecific_args],
973
 
  [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
974
 
#if !defined(_REENTRANT)
 
1012
AC_CACHE_CHECK("args to pthread_getspecific", mysql_cv_getspecific_args,
 
1013
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if !defined(_REENTRANT)
975
1014
#define _REENTRANT
976
1015
#endif
977
 
#ifndef _POSIX_PTHREAD_SEMANTICS 
978
1016
#define _POSIX_PTHREAD_SEMANTICS 
979
 
#endif
980
 
#include <pthread.h>
981
 
   ]], [[
982
 
void *pthread_getspecific(pthread_key_t key);
983
 
pthread_getspecific((pthread_key_t) NULL);
984
 
   ]])],
985
 
    [mysql_cv_getspecific_args=POSIX],
986
 
    [mysql_cv_getspecific_args=other])])
 
1017
#include <pthread.h> ]], [[ void *pthread_getspecific(pthread_key_t key);
 
1018
pthread_getspecific((pthread_key_t) NULL); ]])],[mysql_cv_getspecific_args=POSIX],[mysql_cv_getspecific_args=other]))
987
1019
  if test "$mysql_cv_getspecific_args" = "other"
988
1020
  then
989
1021
    AC_DEFINE([HAVE_NONPOSIX_PTHREAD_GETSPECIFIC], [1],
991
1023
  fi
992
1024
 
993
1025
  # Check definition of pthread_mutex_init
994
 
  AC_CACHE_CHECK([args to pthread_mutex_init], [mysql_cv_mutex_init_args],
995
 
    [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
996
 
#ifndef _REENTRANT
997
 
#define _REENTRANT
998
 
#endif
999
 
#ifndef _POSIX_PTHREAD_SEMANTICS
 
1026
  AC_CACHE_CHECK("args to pthread_mutex_init", mysql_cv_mutex_init_args,
 
1027
  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#define _REENTRANT
1000
1028
#define _POSIX_PTHREAD_SEMANTICS 
1001
 
#endif
1002
1029
#include <pthread.h> ]], [[ 
1003
1030
  pthread_mutexattr_t attr;
1004
1031
  pthread_mutex_t mp;
1005
 
  pthread_mutex_init(&mp,&attr); ]])],
1006
 
      [mysql_cv_mutex_init_args=POSIX],
1007
 
      [mysql_cv_mutex_init_args=other])])
 
1032
  pthread_mutex_init(&mp,&attr); ]])],[mysql_cv_mutex_init_args=POSIX],[mysql_cv_mutex_init_args=other]))
1008
1033
  if test "$mysql_cv_mutex_init_args" = "other"
1009
1034
  then
1010
1035
    AC_DEFINE([HAVE_NONPOSIX_PTHREAD_MUTEX_INIT], [1],
1014
1039
 
1015
1040
#---START: Used in for client configure
1016
1041
# Check definition of readdir_r
1017
 
AC_CACHE_CHECK([args to readdir_r], [mysql_cv_readdir_r],
1018
 
  [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1019
 
#ifndef _REENTRANT
1020
 
#define _REENTRANT
1021
 
#endif
1022
 
#ifndef _POSIX_PTHREAD_SEMANTICS 
 
1042
AC_CACHE_CHECK("args to readdir_r", mysql_cv_readdir_r,
 
1043
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define _REENTRANT
1023
1044
#define _POSIX_PTHREAD_SEMANTICS 
1024
 
#endif
1025
1045
#include <pthread.h>
1026
1046
#include <dirent.h>]], [[ int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result);
1027
 
readdir_r((DIR *) NULL, (struct dirent *) NULL, (struct dirent **) NULL); ]])],
1028
 
    [mysql_cv_readdir_r=POSIX],
1029
 
    [mysql_cv_readdir_r=other])])
 
1047
readdir_r((DIR *) NULL, (struct dirent *) NULL, (struct dirent **) NULL); ]])],[mysql_cv_readdir_r=POSIX],[mysql_cv_readdir_r=other]))
1030
1048
if test "$mysql_cv_readdir_r" = "POSIX"
1031
1049
then
1032
1050
  AC_DEFINE([HAVE_READDIR_R], [1], [POSIX readdir_r])
1033
1051
fi
1034
1052
 
1035
1053
# Check definition of posix sigwait()
1036
 
AC_CACHE_CHECK([style of sigwait], [mysql_cv_sigwait],
1037
 
  [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1038
 
#ifndef _REENTRANT
1039
 
#define _REENTRANT
1040
 
#endif
1041
 
#ifndef _POSIX_PTHREAD_SEMANTICS
 
1054
AC_CACHE_CHECK("style of sigwait", mysql_cv_sigwait,
 
1055
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define _REENTRANT
1042
1056
#define _POSIX_PTHREAD_SEMANTICS 
1043
 
#endif
1044
1057
#include <pthread.h>
1045
 
#include <signal.h>
1046
 
      ]], [[
1047
 
#ifndef _AIX
 
1058
#include <signal.h>]], [[#ifndef _AIX
1048
1059
sigset_t set;
1049
1060
int sig;
1050
1061
sigwait(&set,&sig);
1051
 
#endif
1052
 
      ]])],
1053
 
    [mysql_cv_sigwait=POSIX],
1054
 
    [mysql_cv_sigwait=other])])
 
1062
#endif]])],[mysql_cv_sigwait=POSIX],[mysql_cv_sigwait=other]))
1055
1063
if test "$mysql_cv_sigwait" = "POSIX"
1056
1064
then
1057
1065
  AC_DEFINE([HAVE_SIGWAIT], [1], [POSIX sigwait])
1061
1069
then
1062
1070
unset mysql_cv_sigwait
1063
1071
# Check definition of posix sigwait()
1064
 
AC_CACHE_CHECK([style of sigwait], [mysql_cv_sigwait],
1065
 
  [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1066
 
#ifndef _REENTRANT
1067
 
#define _REENTRANT
1068
 
#endif
1069
 
#ifndef _POSIX_PTHREAD_SEMANTICS
 
1072
AC_CACHE_CHECK("style of sigwait", mysql_cv_sigwait,
 
1073
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define _REENTRANT
1070
1074
#define _POSIX_PTHREAD_SEMANTICS 
1071
 
#endif
1072
1075
#include <pthread.h>
1073
 
#include <signal.h>
1074
 
      ]], [[
1075
 
sigset_t set;
 
1076
#include <signal.h>]], [[sigset_t set;
1076
1077
int sig;
1077
 
sigwait(&set);
1078
 
      ]])],
1079
 
    [mysql_cv_sigwait=NONPOSIX],
1080
 
    [mysql_cv_sigwait=other])])
 
1078
sigwait(&set);]])],[mysql_cv_sigwait=NONPOSIX],[mysql_cv_sigwait=other]))
1081
1079
if test "$mysql_cv_sigwait" = "NONPOSIX"
1082
1080
then
1083
1081
  AC_DEFINE([HAVE_NONPOSIX_SIGWAIT], [1], [sigwait with one argument])
1086
1084
#---END:
1087
1085
 
1088
1086
# Check if pthread_attr_setscope() exists
1089
 
AC_CACHE_CHECK([for pthread_attr_setscope], [mysql_cv_pthread_attr_setscope],
1090
 
  [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1091
 
#ifndef _REENTRANT
1092
 
#define _REENTRANT
1093
 
#endif
1094
 
#ifndef _POSIX_PTHREAD_SEMANTICS
 
1087
AC_CACHE_CHECK("for pthread_attr_setscope", mysql_cv_pthread_attr_setscope,
 
1088
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define _REENTRANT
1095
1089
#define _POSIX_PTHREAD_SEMANTICS 
1096
 
#endif
1097
 
#include <pthread.h>
1098
 
      ]], [[
1099
 
pthread_attr_t thr_attr;
1100
 
pthread_attr_setscope(&thr_attr,0);
1101
 
      ]])],
1102
 
    [mysql_cv_pthread_attr_setscope=yes],
1103
 
    [mysql_cv_pthread_attr_setscope=no])])
 
1090
#include <pthread.h>]], [[pthread_attr_t thr_attr;
 
1091
pthread_attr_setscope(&thr_attr,0);]])],[mysql_cv_pthread_attr_setscope=yes],[mysql_cv_pthread_attr_setscope=no]))
1104
1092
if test "$mysql_cv_pthread_attr_setscope" = "yes"
1105
1093
then
1106
1094
  AC_DEFINE([HAVE_PTHREAD_ATTR_SETSCOPE], [1], [pthread_attr_setscope])
1107
1095
fi
1108
1096
 
 
1097
# Check for bad includes
 
1098
AC_MSG_CHECKING("can netinet files be included")
 
1099
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
 
1100
#include <sys/socket.h>
 
1101
#include <netinet/in_systm.h>
 
1102
#include <netinet/in.h>
 
1103
#include <netinet/ip.h>
 
1104
#include <netinet/tcp.h>]], [[ printf("1\n"); ]])],[netinet_inc=yes],[netinet_inc=no])
 
1105
if test "$netinet_inc" = "no"
 
1106
then
 
1107
  AC_DEFINE([HAVE_BROKEN_NETINET_INCLUDES], [1], [Can netinet be included])
 
1108
fi
 
1109
AC_MSG_RESULT("$netinet_inc")
 
1110
 
1109
1111
AC_LANG_PUSH([C++])
1110
1112
AC_CHECK_HEADERS(cxxabi.h)
1111
1113
AC_CACHE_CHECK([checking for abi::__cxa_demangle], mysql_cv_cxa_demangle,
1124
1126
# Check for requested features
1125
1127
#--------------------------------------------------------------------
1126
1128
 
1127
 
DRIZZLE_CHECK_MAX_INDEXES
 
1129
MYSQL_CHECK_BIG_TABLES
 
1130
MYSQL_CHECK_MAX_INDEXES
 
1131
MYSQL_CHECK_VIO
1128
1132
 
1129
1133
#--------------------------------------------------------------------
1130
1134
# Declare our plugin modules
1132
1136
# functions tested above
1133
1137
#--------------------------------------------------------------------
1134
1138
 
1135
 
DRIZZLE_CONFIGURE_PLUGINS([none])
 
1139
MYSQL_CONFIGURE_PLUGINS([none])
 
1140
 
 
1141
AC_SUBST(CLIENT_LIBS)
1136
1142
 
1137
1143
AC_SUBST(mysql_plugin_dirs)
1138
1144
AC_SUBST(mysql_plugin_libs)
1139
1145
AC_SUBST(mysql_plugin_defs)
1140
 
AC_SUBST(DRIZZLED_PLUGIN_DEP_LIBS)
1141
 
 
1142
 
 
1143
 
AC_ARG_ENABLE([profiling],
1144
 
    [AS_HELP_STRING([--enable-profiling],
1145
 
       [Toggle profiling @<:@default=off@:>@])],
1146
 
    [ac_profiling="$enableval"],
1147
 
    [ac_profiling="no"])
1148
 
 
1149
 
AC_ARG_ENABLE([coverage],
1150
 
    [AS_HELP_STRING([--enable-coverage],
1151
 
       [Toggle coverage @<:@default=off@:>@])],
1152
 
    [ac_coverage="$enableval"],
1153
 
    [ac_coverage="no"])
1154
1146
 
1155
1147
AC_ARG_ENABLE([pedantic-warnings],
1156
1148
    [AS_HELP_STRING([--disable-pedantic-warnings],
1159
1151
    [ac_warn_pedantic="yes"])
1160
1152
 
1161
1153
AC_ARG_ENABLE([fail],
1162
 
    [AS_HELP_STRING([--disable-fail],
1163
 
       [Turn warnings into failures @<:@default=on@:>@])],
 
1154
    [AS_HELP_STRING([--enable-fail],
 
1155
       [Turn warnings into failures @<:@default=off@:>@])],
1164
1156
    [ac_warn_fail="$enableval"],
1165
 
    [ac_warn_fail="yes"])
 
1157
    [ac_warn_fail="no"])
1166
1158
 
1167
1159
AC_ARG_ENABLE([unreachable],
1168
1160
    [AS_HELP_STRING([--enable-unreachable],
1170
1162
    [ac_warn_unreachable="$enableval"],
1171
1163
    [ac_warn_unreachable="no"])
1172
1164
 
1173
 
AC_ARG_ENABLE([longlong-warnings],
1174
 
    [AS_HELP_STRING([--enable-longlong-warnings],
1175
 
       [Enable warnings about longlong in C++ @<:@default=off@:>@])],
1176
 
    [ac_warn_longlong="$enableval"],
1177
 
    [ac_warn_longlong="no"])
1178
 
 
1179
 
AC_ARG_ENABLE([strict-aliasing],
1180
 
    [AS_HELP_STRING([--enable-strict-aliasing],
1181
 
       [Enable warnings about stict-aliasing @<:@default=off@:>@])],
1182
 
    [ac_warn_strict_aliasing="$enableval"],
1183
 
    [ac_warn_strict_aliasing="no"])
1184
 
 
1185
 
AC_ARG_ENABLE([cast-warnings],
1186
 
    [AS_HELP_STRING([--enable-cast-warnings],
1187
 
       [Enable warnings about use of old C-style casts @<:@default=off@:>@])],
1188
 
    [ac_warn_cast="$enableval"],
1189
 
    [ac_warn_cast="no"])
1190
 
 
1191
 
AC_ARG_ENABLE([effective-style],
1192
 
    [AS_HELP_STRING([--enable-effective-style],
1193
 
       [Enable warnings violating Effective C++ Style Guidelines @<:@default=off@:>@])],
1194
 
    [ac_warn_effc="$enableval"],
1195
 
    [ac_warn_effc="no"])
1196
 
 
1197
 
AC_ARG_ENABLE([shadow],
1198
 
    [AS_HELP_STRING([--disable-shadow],
1199
 
       [Disables warnings about scope shadowing @<:@default=on@:>@])],
1200
 
    [ac_warn_shadow="$enableval"],
1201
 
    [ac_warn_shadow="yes"])
1202
 
 
1203
 
AC_ARG_ENABLE([conversion],
1204
 
    [AS_HELP_STRING([--enable-conversion],
1205
 
       [Enables conversion warnings @<:@default=off@:>@])],
1206
 
    [ac_warn_conversion="$enableval"],
1207
 
    [ac_warn_conversion="no"])
1208
 
 
1209
 
AC_ARG_ENABLE([datarace],
1210
 
    [AS_HELP_STRING([--enable-datarace],
1211
 
       [Enables Sun Studio data race detection @<:@default=off@:>@])],
1212
 
    [ac_datarace="$enableval"],
1213
 
    [ac_datarace="no"])
1214
 
 
1215
 
AC_ARG_ENABLE([exceptions],
1216
 
    [AS_HELP_STRING([--disable-exceptions],
1217
 
        [Disables use of Exceptions in the build @<:@default=on@:>@])],
1218
 
    [ac_exceptions="$enableval"],
1219
 
    [ac_exceptions="yes"])
1220
 
 
1221
 
AC_ARG_ENABLE([cast-align-warnings],
1222
 
    [AS_HELP_STRING([--enable-cast-align-warnings],
1223
 
       [Toggle cast alignment warnings @<:@default=off@:>@])],
1224
 
    [ac_warn_cast_align="$enableval"],
1225
 
    [ac_warn_cast_align="no"])
1226
1165
 
1227
1166
if test "$GCC" = "yes"
1228
1167
then
1229
 
  if test "$ac_warn_cast_align" = "yes"
1230
 
  then
1231
 
    W_CAST_ALIGN="-Wcast-align"
1232
 
  else
1233
 
    W_CAST_ALIGN="-Wno-cast-align"
1234
 
  fi
1235
 
 
1236
 
  if test "$ac_warn_fail" = "yes"
1237
 
  then
1238
 
    W_FAIL="-Werror"
1239
 
  fi
1240
 
  BASE_WARNINGS="-Wall -Wextra ${W_FAIL} ${W_CAST_ALIGN}"
1241
 
 
1242
 
  if test "$ac_warn_longlong" = "yes"
1243
 
  then
1244
 
    W_LONGLONG="-Wlong-long"
1245
 
  else
1246
 
    W_LONGLONG="-Wno-long-long"
1247
 
  fi
1248
 
 
1249
 
  if test "$ac_warn_strict_aliasing" = "yes"
1250
 
  then
1251
 
    W_STRICT_ALIASING="-Wstrict-aliasing"
1252
 
  else
1253
 
    W_STRICT_ALIASING="-Wno-strict-aliasing"
1254
 
  fi
1255
 
 
1256
 
  if test "$ac_warn_shadow" = "yes"
1257
 
  then
1258
 
    W_SHADOW="-Wshadow"
1259
 
    NO_SHADOW="-Wno-shadow"
1260
 
  else
1261
 
    W_SHADOW="-Wno-shadow"
1262
 
    NO_SHADOW=""
1263
 
  fi
1264
 
 
1265
 
  if test "$ac_profiling" = "yes"
1266
 
  then
1267
 
    GPROF_PROFILING="-pg"
1268
 
    save_LIBS="${LIBS}"
1269
 
    LIBS=""
1270
 
    AC_CHECK_LIB(c_p, read)
1271
 
    LIBC_P="${LIBS}"
1272
 
    LIBS="${save_LIBS}"
1273
 
  else
1274
 
    GPROF_PROFILING=" "
1275
 
  fi
1276
 
 
1277
 
  if test "$ac_coverage" = "yes"
1278
 
  then
1279
 
    GPROF_COVERAGE="-fprofile-arcs -ftest-coverage"
1280
 
  else
1281
 
    GPROF_COVERAGE=" "
1282
 
  fi
 
1168
 
 
1169
  GCC_WARNINGS="-W -Wall"
 
1170
  GXX_WARNINGS="${GCC_WARNINGS}"
 
1171
 
1283
1172
 
1284
1173
  if test "$ac_warn_pedantic" = "yes"
1285
1174
  then
1286
 
    AC_CACHE_CHECK([whether it is safe to use -Wredundant-decls],
1287
 
      [ac_cv_safe_to_use_Wredundant_decls_],
1288
 
      [AC_LANG_PUSH(C++)
1289
 
       save_CXXFLAGS="${CXXFLAGS}"
1290
 
       CXXFLAGS="${CXXFLAGS} ${W_FAIL} -Wredundant-decls"
1291
 
       AC_COMPILE_IFELSE(
1292
 
         [AC_LANG_PROGRAM([
1293
 
template <typename E> struct C { void foo(); };
1294
 
template <typename E> void C<E>::foo() { }
1295
 
template <> void C<int>::foo();
1296
 
            AC_INCLUDES_DEFAULT])],
1297
 
          [ac_cv_safe_to_use_Wredundant_decls_=yes],
1298
 
          [ac_cv_safe_to_use_Wredundant_decls_=no])
1299
 
        CXXFLAGS="${save_CXXFLAGS}"
1300
 
        AC_LANG_POP()])
1301
 
    if test $ac_cv_safe_to_use_Wredundant_decls_ = yes
1302
 
    then
1303
 
      GXX_W_REDUNDANT_DECLS="-Wredundant-decls"
1304
 
    else
1305
 
      GXX_W_REDUNDANT_DECLS="-Wno-redundant-decls"
1306
 
    fi
1307
 
    
1308
 
    GCC_PEDANTIC="-pedantic -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls ${W_STRICT_ALIASING}"
1309
 
    GXX_PEDANTIC="-pedantic -Wundef -Woverloaded-virtual  -Wnon-virtual-dtor -Wctor-dtor-privacy ${GXX_W_REDUNDANT_DECLS} ${W_LONGLONG} ${W_STRICT_ALIASING}"
1310
 
 
1311
 
    AC_CACHE_CHECK([whether __attribute__ visibility "hidden" is supported],
1312
 
      [ac_cv_can_use_hidden_],
1313
 
      [AC_LANG_PUSH(C++)
1314
 
       AC_COMPILE_IFELSE(
1315
 
         [AC_LANG_PROGRAM([
1316
 
          AC_INCLUDES_DEFAULT
1317
 
__attribute__((visibility ("hidden")))
1318
 
void testme() {  };],[
1319
 
     testme();])],  
1320
 
         [ac_cv_can_use_hidden_=yes],
1321
 
         [ac_cv_can_use_hidden_=no])
1322
 
       AC_LANG_POP()])
1323
 
    if test "$ac_cv_can_use_hidden_" = "yes"
1324
 
    then
1325
 
      AC_DEFINE(HAVE_ATTR_HIDDEN, 1,
1326
 
                [Define to 1 if you have support for __attribute__((visibility("hidden")))])
1327
 
    fi
 
1175
    GCC_WARNINGS="${GCC_WARNINGS}  -std=gnu99 -pedantic -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls  "
 
1176
    GXX_WARNINGS="${GXX_WARNINGS}  -std=gnu++98 -pedantic -Wundef -Wredundant-decls -Wno-long-long "
1328
1177
  fi
1329
1178
 
1330
1179
  if test "$ac_warn_unreachable" = "yes"
1331
1180
  then
1332
 
    W_UNREACHABLE="-Wunreachable-code"
1333
 
  fi
1334
 
 
1335
 
  if test "$ac_warn_cast" = "yes"
1336
 
  then
1337
 
    W_CAST="-Wold-style-cast"
1338
 
  fi
1339
 
 
1340
 
  if test "$ac_warn_effc" = "yes"
1341
 
  then
1342
 
    W_EFFC="-Weffc++"
1343
 
  fi
1344
 
 
1345
 
  if test "$ac_warn_conversion" = "yes"
1346
 
  then
1347
 
    W_CONVERSION="-Wconversion"
1348
 
  fi
1349
 
 
1350
 
  CC_WARNINGS="${BASE_WARNINGS} ${GCC_PEDANTIC} ${W_UNREACHABLE} ${GPROF_PROFILING} ${GPROF_COVERAGE} ${W_SHADOW} ${W_CONVERSION}"
1351
 
  CXX_WARNINGS="${BASE_WARNINGS} ${GXX_PEDANTIC} ${W_UNREACHABLE} ${GPROF_PROFILING} ${GPROF_COVERAGE} ${W_CAST} ${W_SHADOW} ${W_EFFC} ${W_CONVERSION}"
1352
 
 
1353
 
  if test "$ac_exceptions" = "no"
1354
 
  then
1355
 
    NO_EXCEPTIONS="-fno-exceptions"
1356
 
    W_EXCEPTIONS="-fexceptions"
1357
 
  fi
1358
 
  NO_REDUNDANT_DECLS="-Wno-redundant-decls"
1359
 
  PROTOSKIP_WARNINGS="-Wno-effc++ -Wno-shadow"
1360
 
fi
1361
 
if test "$SUNCC" = "yes"
1362
 
then
1363
 
  if test "$ac_datarace" = "yes"
1364
 
  then
1365
 
    CFLAGS="-xinstrument=datarace ${CFLAGS}"
1366
 
    CXXFLAGS="-xinstrument=datarace ${CXXFLAGS}"
 
1181
    GCC_WARNINGS="${GCC_WARNINGS} -Wunreachable-code"
 
1182
    GXX_WARNINGS="${GXX_WARNINGS} -Wunreachable-code"
1367
1183
  fi
1368
1184
 
1369
1185
  if test "$ac_warn_fail" = "yes"
1370
1186
  then
1371
 
    W_FAIL="-errwarn=%all"
1372
 
  fi
1373
 
 
1374
 
  CC_WARNINGS="-v -errtags=yes -erroff=E_ATTRIBUTE_NOT_VAR ${W_FAIL}"
1375
 
  CXX_WARNINGS="+w +w2 -xport64 -errtags=yes -erroff=attrskipunsup,doubunder,reftotemp,inllargeuse,truncwarn1,signextwarn,inllargeint ${W_FAIL}" 
1376
 
  PROTOSKIP_WARNINGS="-erroff=attrskipunsup,doubunder,reftotemp,wbadinitl,identexpected,inllargeuse,truncwarn1,signextwarn"
1377
 
  NO_UNREACHED="-erroff=E_STATEMENT_NOT_REACHED"
1378
 
  if test "$ac_exceptions" = "no"
1379
 
  then
1380
 
    NO_EXCEPTIONS="-features=no%except"
1381
 
    W_EXCEPTIONS="-features=except"
1382
 
  fi
1383
 
fi
1384
 
AC_SUBST(NO_EXCEPTIONS)
1385
 
AC_SUBST(W_EXCEPTIONS)
1386
 
AC_SUBST(NO_SHADOW)
1387
 
AC_SUBST(W_SHADOW)
1388
 
AC_SUBST(NO_REDUNDANT_DECLS)
1389
 
AC_SUBST(PROTOSKIP_WARNINGS)
1390
 
AC_SUBST(NO_UNREACHED)
1391
 
 
1392
 
if test "$ac_cv_func_timegm" = "no" -o "$gl_cv_func_gnu_getopt" = "no"
1393
 
then
1394
 
  CPPFLAGS="-I\$(top_srcdir)/gnulib -I\$(top_builddir)/gnulib ${CPPFLAGS}"
1395
 
fi
1396
 
CPPFLAGS="-I\$(top_srcdir) -I\$(top_builddir) ${CPPFLAGS}"
1397
 
 
1398
 
AM_CPPFLAGS="${CPPFLAGS}"
1399
 
AM_CFLAGS="${CC_WARNINGS} ${CFLAGS}"
1400
 
AM_CXXFLAGS="${CXX_WARNINGS} ${W_EXCEPTIONS} ${CXXFLAGS}"
1401
 
 
1402
 
AC_SUBST([AM_CPPFLAGS])
1403
 
AC_SUBST([AM_CFLAGS])
1404
 
AC_SUBST([AM_CXXFLAGS])
1405
 
 
1406
 
dnl We've collected the flags in AM_*FLAGS now, so blank these.
1407
 
CFLAGS=""
1408
 
CXXFLAGS=""
1409
 
CPPFLAGS=""
1410
 
 
1411
 
AC_SUBST(pkgplugindir,"\$(pkglibdir)/plugin")
1412
 
 
1413
 
dnl GCC Precompiled Header Support
1414
 
dnl re-enable later
1415
 
dnl AM_CONDITIONAL([BUILD_GCC_PCH],[test "$GCC" = "yes"])
1416
 
AM_CONDITIONAL([BUILD_GCC_PCH],[test "no" = "yes"])
1417
 
 
1418
 
AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl
1419
 
 gnulib/Makefile dnl
1420
 
 mystrings/Makefile storage/Makefile dnl
1421
 
 po/Makefile.in dnl
1422
 
 libdrizzleclient/Makefile client/Makefile dnl
1423
 
 drizzled/Makefile dnl
1424
 
 drizzled/serialize/Makefile dnl
1425
 
 drizzled/sql_builtin.cc dnl
 
1187
    GCC_WARNINGS="${GCC_WARNINGS} -Werror"
 
1188
    GXX_WARNINGS="${GXX_WARNINGS} -Werror"
 
1189
  fi
 
1190
 
 
1191
    CXXFLAGS="$CXXFLAGS ${GXX_WARNINGS}"
 
1192
    CFLAGS="$CFLAGS ${GCC_WARNINGS} "
 
1193
fi
 
1194
 
 
1195
# Some usefull subst
 
1196
AC_SUBST(CC)
 
1197
AC_SUBST(GXX)
 
1198
 
 
1199
# Set configuration options for make_binary_distribution
 
1200
case $SYSTEM_TYPE in
 
1201
  *netware*)
 
1202
    MAKE_BINARY_DISTRIBUTION_OPTIONS="$MAKE_BINARY_DISTRIBUTION_OPTIONS --no-strip"
 
1203
    ;;
 
1204
  *)
 
1205
    : # no change for other platforms yet
 
1206
    ;;
 
1207
esac
 
1208
AC_SUBST(MAKE_BINARY_DISTRIBUTION_OPTIONS)
 
1209
 
 
1210
AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile mysys/tests/Makefile dnl
 
1211
 strings/Makefile strings/tests/Makefile storage/Makefile dnl
 
1212
 vio/Makefile dnl
 
1213
 libmysql/Makefile client/Makefile dnl
 
1214
 sql/Makefile sql/share/Makefile dnl
 
1215
 sql/sql_builtin.cc sql-common/Makefile dnl
 
1216
 dbug/Makefile include/Makefile dnl
1426
1217
 support-files/Makefile dnl
1427
 
 tests/Makefile tests/install_test_db dnl
1428
 
 plugin/Makefile dnl
1429
 
 drizzled/drizzled_safe support-files/libdrizzleclient.pc dnl
1430
 
 support-files/drizzle.server support-files/drizzle-log-rotate)
1431
 
 
1432
 
scheduling_plugins_available="
1433
 
  pool_of_threads 
1434
 
  single_thread
1435
 
"
1436
 
 
1437
 
for sched_plugin in $scheduling_plugins_available
1438
 
do
1439
 
  varname="\${with_plugin_${sched_plugin}}"
1440
 
  result=`eval "echo $varname"`
1441
 
  if test "x$result" = "xyes"
1442
 
  then
1443
 
    scheduling_plugins="$sched_plugin $scheduling_plugins"
1444
 
  fi
1445
 
done
1446
 
 
1447
 
AC_CONFIG_COMMANDS([timestamp-h], , test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h)
1448
 
 
1449
 
AC_CONFIG_COMMANDS_PRE([
1450
 
if test "x$EGREP" != "x" -a -d po
1451
 
then
1452
 
  echo "# This file is auto-generated from configure. Do not edit directly" > po/POTFILES.in.in
1453
 
  # The grep -v 'drizzle-' is to exclude any distcheck leftovers
1454
 
  for f in `find . | grep -v 'drizzle-' | ${EGREP} '\.(cc|c|h|yy)$' | cut -c3- | sort`
1455
 
  do
1456
 
    if grep gettext.h "$f" | grep include >/dev/null 2>&1
1457
 
    then
1458
 
      echo "$f" >> po/POTFILES.in.in
1459
 
    fi
1460
 
  done
1461
 
  if ! diff po/POTFILES.in.in po/POTFILES.in >/dev/null 2>&1
1462
 
  then
1463
 
    mv po/POTFILES.in.in po/POTFILES.in
1464
 
  else
1465
 
    rm po/POTFILES.in.in
1466
 
  fi
1467
 
else
1468
 
  touch po/POTFILES.in
1469
 
fi
1470
 
])
 
1218
 mysql-test/Makefile dnl
 
1219
 include/mysql_version.h plugin/Makefile dnl
 
1220
 sql/mysqld_safe support-files/libmysqlclient.pc dnl
 
1221
 support-files/mysql.server support-files/mysql-log-rotate)
 
1222
 
 
1223
AC_CONFIG_COMMANDS([default], , test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h)
1471
1224
 
1472
1225
# Ensure that table handlers gets all modifications to CFLAGS/CXXFLAGS
1473
 
AC_CONFIG_COMMANDS_POST(ac_configure_args="$ac_configure_args CFLAGS='$CFLAGS' CXXFLAGS='$CXXFLAGS' AM_CFLAGS='$AM_CFLAGS' AM_CXXFLAGS='$AM_CXXFLAGS'")
 
1226
AC_CONFIG_COMMANDS_POST(ac_configure_args="$ac_configure_args CFLAGS='$CFLAGS' CXXFLAGS='$CXXFLAGS'")
1474
1227
 
1475
1228
AC_OUTPUT
1476
 
 
1477
 
echo "---"
1478
 
echo "Configuration summary for $PACKAGE_NAME version $VERSION"
1479
 
echo ""
1480
 
echo "   * Installation prefix:       $prefix"
1481
 
echo "   * System type:               $SYSTEM_TYPE"
1482
 
echo "   * Host CPU:                  $host_cpu"
1483
 
echo "   * C Compiler:                $CC_VERSION"
1484
 
echo "   * C++ Compiler:              $CXX_VERSION"
1485
 
echo "   * Build auth_pam:            $ac_cv_header_security_pam_appl_h"
1486
 
echo "   * Assertions enabled:        $ac_cv_assert"
1487
 
echo "   * Debug enabled:             $with_debug"
1488
 
echo "   * Profiling enabled:         $ac_profiling"
1489
 
echo "   * Coverage enabled:          $ac_coverage"
1490
 
echo "   * Warnings as failure:       $ac_warn_fail"
1491
 
echo "   * Scheduling Plugins:        $scheduling_plugins"
1492
 
echo "   * C++ cstdint location:      $ac_cv_cxx_cstdint"
1493
 
echo "   * C++ hash_map location:     $ac_cv_cxx_hash_map"
1494
 
echo "   * C++ hash namespace:        $ac_cv_cxx_hash_namespace"
1495
 
echo "   * C++ shared_ptr namespace:  $ac_cv_shared_ptr_namespace"
1496
 
echo ""
1497
 
echo "---"
1498
 
 
1499
 
dnl libtoolize scans configure.ac  and needs to see some text
1500
 
m4_define([LIBTOOLIZE_AC_INIT], [])