~drizzle-trunk/drizzle/development

575.4.7 by Monty Taylor
More header cleanup.
1
dnl -*- bash -*-
1 by brian
clean slate
2
dnl Process this file with autoconf to produce a configure script.
3
77.1.65 by Monty Taylor
We don't really require 2.61, 2.59 is actually fine.
4
AC_PREREQ(2.59)dnl		Minimum Autoconf version required.
1 by brian
clean slate
5
908.1.3 by Monty Taylor
Updated build system to use new version numbering. Just remember to run ./config/autorun.sh before running make distcheck for release and all should be peachy.
6
m4_include(m4/bzr_version.m4)
7
214 by Brian Aker
Rename of fields (fix issue with string and decimal .h clashing).
8
AC_CONFIG_SRCDIR([drizzled/drizzled.cc])
39 by Brian Aker
Move build helper files into config
9
AC_CONFIG_AUX_DIR(config)
236.1.9 by Monty Taylor
Cleaned up configure.ac line.
10
AC_CONFIG_HEADERS([config.h])
908.1.4 by Monty Taylor
Fix to fake-out libtoolize, since AC_INIT is in bzr_version.m4 now.
11
AC_CONFIG_MACRO_DIR([m4])
435.1.1 by Monty Taylor
Fixed -O3 optimization for gcc.
12
722.1.3 by Monty Taylor
Cleaned up a few build things.
13
# Setting CFLAGS here prevents AC_CANONICAL_TARGET from injecting them
14
SAVE_CFLAGS=${CFLAGS}
15
SAVE_CXXFLAGS=${CXXFLAGS}
16
CFLAGS=
17
CXXFLAGS=
435.1.1 by Monty Taylor
Fixed -O3 optimization for gcc.
18
28.1.33 by Monty Taylor
Added -Wall
19
AC_CANONICAL_TARGET
722.1.3 by Monty Taylor
Cleaned up a few build things.
20
21
CFLAGS=${SAVE_CFLAGS}
22
CXXFLAGS=${SAVE_CXXFLAGS}
23
779.4.10 by Monty Taylor
Cleaned up a few build things. Thank me... builds should be quicker now. :)
24
AM_INIT_AUTOMAKE(nostdinc subdir-objects -Wall -Werror)
779.3.21 by Monty Taylor
Fixed solaris fixes for linux. Oh, and I also seem to have fixed some more configure stuff.
25
722.1.3 by Monty Taylor
Cleaned up a few build things.
26
if test "x${enable_dependency_tracking}" = "x"
27
then
28
  enable_dependency_tracking=yes
29
fi
30
815.1.1 by Monty Taylor
Add timegm which is missing on Solaris.
31
gl_EARLY
722.1.3 by Monty Taylor
Cleaned up a few build things.
32
1 by brian
clean slate
33
# See the libtool docs for information on how to do shared lib versions.
383.1.47 by Monty Taylor
Couple of tiny changes.
34
SHARED_LIB_MAJOR_VERSION=1
1 by brian
clean slate
35
SHARED_LIB_VERSION=$SHARED_LIB_MAJOR_VERSION:0:0
722.1.3 by Monty Taylor
Cleaned up a few build things.
36
AC_SUBST(SHARED_LIB_MAJOR_VERSION)
37
AC_SUBST(SHARED_LIB_VERSION)
38
528 by Monty Taylor
Re-arragned a few things in configure.ac.
39
40
dnl Checks for programs.
755.1.6 by Monty Taylor
One more stupid change.
41
AC_PROG_CXX
554 by Monty
Added impl of macro missing from old systems.
42
815.1.1 by Monty Taylor
Add timegm which is missing on Solaris.
43
gl_USE_SYSTEM_EXTENSIONS
910.2.1 by Monty Taylor
Put in early check and instructive error message for too-old gcc.
44
if test "$GCC" = "yes"
45
then
919.3.1 by Monty Taylor
Force gcc-4.2 on Mac.
46
  # If you're on a Mac, and you didn't ask for a specific compiler
47
  # You're gonna get 4.2.
48
  if test "$host_vendor" = "apple" -a "x${ac_cv_env_CC_set}" = "x"
49
  then
50
    CPP="/usr/bin/gcc-4.2 -E"
51
    CC=/usr/bin/gcc-4.2
52
    CXX=/usr/bin/g++-4.2
53
  fi
910.2.2 by Monty Taylor
Split out protobuf version check from the check for protobuf version so that we can give better error message.
54
  AC_CACHE_CHECK([if GCC is recent enough], [drizzle_cv_gcc_recent],
55
    [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
923.2.4 by Monty Taylor
Backed GCC requirement back down to 4.1. Stupid RHEL5.
56
#if !defined(__GNUC__) || (__GNUC__ < 4) || ((__GNUC__ >= 4) && (__GNUC_MINOR__ < 1))
910.2.1 by Monty Taylor
Put in early check and instructive error message for too-old gcc.
57
# error GCC is Too Old!
58
#endif
910.2.2 by Monty Taylor
Split out protobuf version check from the check for protobuf version so that we can give better error message.
59
      ]])],
60
      [drizzle_cv_gcc_recent=yes],
61
      [drizzle_cv_gcc_recent=no])])
62
  if test "$drizzle_cv_gcc_recent" = "no"
63
  then
923.2.4 by Monty Taylor
Backed GCC requirement back down to 4.1. Stupid RHEL5.
64
    AC_MSG_ERROR([Your version of GCC is too old. Drizzle requires at least version 4.1. If you are on OSX, you may need to specify ./configure CC=gcc-4.2 CXX=g++4.2])
910.2.2 by Monty Taylor
Split out protobuf version check from the check for protobuf version so that we can give better error message.
65
  fi
910.2.1 by Monty Taylor
Put in early check and instructive error message for too-old gcc.
66
fi
910.2.3 by Monty Taylor
Removed extra checks.
67
AC_CXX_HEADER_STDCXX_98
68
if test "$ac_cv_cxx_stdcxx_98" = "no"
69
then
917.1.5 by Monty Taylor
Added more verbose failure messages.
70
  AC_MSG_ERROR([No working C++ Compiler has been found. Drizzle requires a C++ compiler that can handle C++98])
910.2.3 by Monty Taylor
Removed extra checks.
71
fi
72
AC_PROG_CPP
73
AM_PROG_CC_C_O
74
917.1.5 by Monty Taylor
Added more verbose failure messages.
75
if test "$am_cv_prog_cc_stdc" = "no"
76
then
77
  AC_MSG_ERROR([Drizzle requires an ANSI C compiler (and a C++ compiler). Try gcc. See the Installation chapter in the Reference Manual.])
78
fi
79
80
910.2.1 by Monty Taylor
Put in early check and instructive error message for too-old gcc.
81
815.1.1 by Monty Taylor
Add timegm which is missing on Solaris.
82
gl_INIT
528 by Monty Taylor
Re-arragned a few things in configure.ac.
83
873.2.41 by Monty Taylor
Fixed the ol build for ol Solaris.
84
AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
85
779.3.21 by Monty Taylor
Fixed solaris fixes for linux. Oh, and I also seem to have fixed some more configure stuff.
86
AC_PROG_GCC_TRADITIONAL
755.1.6 by Monty Taylor
One more stupid change.
87
1 by brian
clean slate
88
89
# Set all version vars based on $VERSION. How do we do this more elegant ?
90
# Remember that regexps needs to quote [ and ] since this is run through m4
91
# We take some made up examples
92
#
93
#  VERSION                  5.1.40sp1-alpha     5.0.34a
319.1.1 by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_
94
#  DRIZZLE_NO_DASH_VERSION    5.1.40sp1           5.0.34a
95
#  DRIZZLE_NUMERIC_VERSION    5.1.40              5.0.34
96
#  DRIZZLE_BASE_VERSION       5.1                 5.0
97
#  DRIZZLE_VERSION_ID         50140               50034
1 by brian
clean slate
98
#
319.1.1 by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_
99
DRIZZLE_NO_DASH_VERSION=`echo $VERSION | sed -e "s|-.*$||"`
100
DRIZZLE_NUMERIC_VERSION=`echo $DRIZZLE_NO_DASH_VERSION | sed -e "s|[[a-z]][[a-z0-9]]*$||"`
101
DRIZZLE_BASE_VERSION=`echo $DRIZZLE_NUMERIC_VERSION | sed -e "s|\.[[^.]]*$||"`
102
DRIZZLE_VERSION_ID=`echo $DRIZZLE_NUMERIC_VERSION | \
1 by brian
clean slate
103
    awk -F. '{printf "%d%0.2d%0.2d", $1, $2, $3}'`
722.1.3 by Monty Taylor
Cleaned up a few build things.
104
AC_DEFINE_UNQUOTED(DRIZZLE_BASE_VERSION,["$DRIZZLE_BASE_VERSION"],
105
                   [Major and minor version])
106
AC_DEFINE_UNQUOTED([DRIZZLE_VERSION_ID],[$DRIZZLE_VERSION_ID],
107
		   [Version ID that can be easily used for numeric comparison])
1 by brian
clean slate
108
859.1.4 by Monty Taylor
Hack to allow use of hash_map in gcc 4.3.
109
AC_DEFINE([_BACKWARD_BACKWARD_WARNING_H],[1],[Hack to disable deprecation warning in gcc])
110
1 by brian
clean slate
111
# The port should be constant for a LONG time
301 by Brian Aker
Clean up port startup
112
DRIZZLE_TCP_PORT_DEFAULT=4427
1 by brian
clean slate
113
722.2.9 by Monty Taylor
I _think_ I've got the plug.in triggering rebuild thing going on right.
114
m4_include(m4/dtrace.m4)
722.1.3 by Monty Taylor
Cleaned up a few build things.
115
722.2.9 by Monty Taylor
I _think_ I've got the plug.in triggering rebuild thing going on right.
116
m4_include(m4/character_sets.m4)
722.1.3 by Monty Taylor
Cleaned up a few build things.
117
AC_SUBST(AVAILABLE_LANGUAGES)
118
840.1.2 by Monty Taylor
Fix for msgmerge possibly being gmsgmerge.
119
722.1.3 by Monty Taylor
Cleaned up a few build things.
120
# Set this for plugins to use
121
ac_build_drizzle="yes"
441 by Monty Taylor
Move unconditional defines to config.h.
122
123
1 by brian
clean slate
124
# Canonicalize the configuration name.
125
126
# Check whether --with-system-type or --without-system-type was given.
28.1.33 by Monty Taylor
Added -Wall
127
AC_ARG_WITH([system-type],
128
    [AS_HELP_STRING([--with-system-type],
129
       [Set the system type, like "sun-solaris10"])],
1 by brian
clean slate
130
    [SYSTEM_TYPE="$withval"],
131
    [SYSTEM_TYPE="$host_vendor-$host_os"])
28.1.33 by Monty Taylor
Added -Wall
132
AC_ARG_WITH([machine-type],
133
    [AS_HELP_STRING([--with-machine-type],
907.3.2 by Monty Taylor
Added tests for 64-bit solaris. Look in /usr/lib/amd64 and /usr/local/lib/amd64 if we are 64-bit.
134
       [Set the machine type, like "sparc"])],
1 by brian
clean slate
135
    [MACHINE_TYPE="$withval"],
136
    [MACHINE_TYPE="$host_cpu"])
137
AC_SUBST(SYSTEM_TYPE)
138
AC_DEFINE_UNQUOTED([SYSTEM_TYPE], ["$SYSTEM_TYPE"],
139
                   [Name of system, eg sun-solaris])
140
AC_SUBST(MACHINE_TYPE)
141
AC_DEFINE_UNQUOTED([MACHINE_TYPE], ["$MACHINE_TYPE"],
142
                   [Machine type name, eg sparc])
143
144
# Detect intel x86 like processor
145
BASE_MACHINE_TYPE=$MACHINE_TYPE
146
case $MACHINE_TYPE in
147
  i?86) BASE_MACHINE_TYPE=i386 ;;
148
esac
149
481.1.9 by Monty Taylor
Added autoconf tests for location of cstdint and cinttypes. Use those in C++ programs now, so that we don't have to define _STDC_LIMIT_MACROS, etc by hand. Stop, in fact, defining those by hand.
150
520.4.41 by mordred
Fixed configure.ac to work cleanly on Solaris - and define some good compile flags.
151
case "$target_os" in
152
  *linux*)
153
  TARGET_LINUX="true"
154
  AC_SUBST(TARGET_LINUX)
155
  AC_DEFINE([TARGET_OS_LINUX], [1], [Whether we build for Linux])
156
    ;;
271 by Brian Aker
OSX fix
157
  *apple-darwin*)
520.4.41 by mordred
Fixed configure.ac to work cleanly on Solaris - and define some good compile flags.
158
    TARGET_OSX="true"
159
    AC_SUBST(TARGET_OSX)
271 by Brian Aker
OSX fix
160
    AC_DEFINE([TARGET_OS_OSX], [1], [Whether we build for OSX])
1 by brian
clean slate
161
    ;;
520.4.41 by mordred
Fixed configure.ac to work cleanly on Solaris - and define some good compile flags.
162
  *solaris*)
163
    TARGET_SOLARIS="true"
164
    AC_SUBST(TARGET_SOLARIS)
165
    AC_DEFINE([TARGET_OS_SOLARIS], [1], [Whether we are building for Solaris])
166
    ;;
1 by brian
clean slate
167
  *)
168
    ;;
169
esac
435.1.1 by Monty Taylor
Fixed -O3 optimization for gcc.
170
520.4.41 by mordred
Fixed configure.ac to work cleanly on Solaris - and define some good compile flags.
171
DRIZZLE_CHECK_C_VERSION
319.1.1 by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_
172
DRIZZLE_CHECK_CXX_VERSION
1 by brian
clean slate
173
590.2.23 by Monty Taylor
Fixed a few things for solaris builds.
174
AC_SYS_LARGEFILE
175
230.3.1 by Monty Taylor
Bug 252805: ./configure not detecting missing g++
176
AC_PROG_AWK
177
1 by brian
clean slate
178
873.2.4 by Monty Taylor
Fixed some configure errors.
179
AC_PATH_PROG(GPERF, gperf)
180
AS_IF([test "x$GPERF" = "x"],
917.1.5 by Monty Taylor
Added more verbose failure messages.
181
      AC_MSG_ERROR("Drizzle requires gperf to build."))
779.4.5 by Monty Taylor
Replaced gen_lex_hash with gperf. Yay for no more building tools to build source!!!
182
840.1.3 by Monty Taylor
Fixed gperf checking to fail properly.
183
AC_PATH_PROG(LCOV, lcov)
184
AC_PATH_PROG(GENHTML, genhtml)
779.1.25 by Monty Taylor
Put in LCOV checks. Put output in subdir.
185
873.2.4 by Monty Taylor
Fixed some configure errors.
186
AM_CONDITIONAL(HAVE_LCOV,[test "x$LCOV" != "x"])
779.1.25 by Monty Taylor
Put in LCOV checks. Put output in subdir.
187
446 by Monty Taylor
Moved GNU_SOURCE define to configure.
188
dnl TODO: This needs to go away and be replaced with _ISOC99_SOURCE
520.4.41 by mordred
Fixed configure.ac to work cleanly on Solaris - and define some good compile flags.
189
if test "$ac_cv_c_compiler_gnu" = "yes" -o "$target_os" = "linux-gnu"
446 by Monty Taylor
Moved GNU_SOURCE define to configure.
190
then
191
  AC_DEFINE([_GNU_SOURCE],[1],[Fix problem with S_ISLNK() on Linux])
192
fi
193
919.2.17 by Monty Taylor
Changed comment... added define.
194
dnl C99 is illegal in C++... but these turn on extensions to the standard
195
dnl On Solars. This whole block is sort of silly atm, since we don't do 
196
dnl GCC on Solaris.
520.9.3 by mordred
zomg. Solaris actually builds all the way!!!
197
if test "$GCC" = "yes"
198
then
199
  case "$target_os" in
200
    *solaris*)
873.2.2 by Monty Taylor
Fixed configure.ac to allow for CFLAGS injection during make.
201
    AC_DEFINE([_XOPEN_SOURCE],[600],[Turn on XOpen 6.0 Features])
202
    AC_DEFINE([__C99FEATURES__],[1],[Turn on C99 Features for C++])
919.2.17 by Monty Taylor
Changed comment... added define.
203
    AC_DEFINE([__XPG6],[1],[Turn on C99/XOpen Group 6 Extensions])
520.9.3 by mordred
zomg. Solaris actually builds all the way!!!
204
    ;;
205
  esac
206
fi
445 by Monty Taylor
Moved sun defines to configure.ac.
207
1 by brian
clean slate
208
AC_SUBST(NM)dnl
209
210
AC_PROG_INSTALL
211
579.1.1 by Toru Maesaka
Added tests for groupaad and useradd
212
# Look for "(group|user)add". 
213
# TODO: If the programs do not exist, inform the DBA that the user
214
#       was not created at the end of the install routine.
215
AC_CHECK_PROGS(GROUPADD, groupadd addgroup)
216
AC_CHECK_PROGS(USERADD, useradd adduser)
217
590.2.2 by Monty Taylor
Configure cleanups. Added generic search_for_lib m4 macro.
218
dnl Not critical since the generated file is distributed
629.1.1 by Monty Taylor
More solaris fixes.
219
AC_CHECK_PROGS(YACC, ['bison -y'])
77.1.70 by Monty Taylor
Added a failure if you don't have bison and you're building from a .bzr branch.
220
if test -z "$YACC" && test -d ".bzr"
221
then
222
  AC_MSG_ERROR(["bison is required for Drizzle to build from a bzr branch"])
223
fi
1 by brian
clean slate
224
919.2.21 by Monty Taylor
Fixes for c++0x and shared_ptr support for Solaris.
225
# Build optimized or debug version ?
226
# First check for gcc and g++
1 by brian
clean slate
227
if test "$GCC" = "yes"
228
then
919.2.21 by Monty Taylor
Fixes for c++0x and shared_ptr support for Solaris.
229
  dnl The following is required for portable results of floating point 
230
  dnl calculations on PowerPC. The same must also be done for IA-64, but 
231
  dnl this options is missing in the IA-64 gcc backend.
1 by brian
clean slate
232
  case "$host_cpu" in
233
    *ppc* | *powerpc*)
919.2.18 by Monty Taylor
Restructured CFLAGS processing to always keep user-supplied options last on the command line, so they take precedence.
234
      CFLAGS="-mno-fused-madd ${CFLAGS}"
235
      CXXFLAGS="-mno-fused-madd ${CXXFLAGS}"
1 by brian
clean slate
236
    ;;
237
  esac
919.2.21 by Monty Taylor
Fixes for c++0x and shared_ptr support for Solaris.
238
919.2.16 by Monty Taylor
Added check for setting -std=gnu++0x if available.
239
  CFLAGS="-ggdb3 -std=gnu99 ${CFLAGS}"
919.2.19 by Monty Taylor
Added check for shared_ptr in advance of actually thinking about using it. I think this should cover all platforms we care about... but let's doublecheck.
240
  CXXFLAGS="-ggdb3 ${CXXFLAGS}"
919.2.21 by Monty Taylor
Fixes for c++0x and shared_ptr support for Solaris.
241
  AC_CXX_CHECK_STANDARD
919.2.16 by Monty Taylor
Added check for setting -std=gnu++0x if available.
242
  
873.2.36 by Monty Taylor
Fix to clean up flags.
243
244
  DEBUG_CFLAGS="-O0"
245
  DEBUG_CXXFLAGS="-O0"
246
520.4.40 by mordred
Added an option to specify --with-probuf=<location>
247
  OPTIMIZE_CFLAGS="-O3"
248
  OPTIMIZE_CXXFLAGS="-O3"
249
fi
250
if test "$SUNCC" = "yes"
251
then
919.2.22 by Monty Taylor
Fixed the latest stuff on Solaris.
252
  dnl we put CPPFLAGS and LDFLAGS first here, because if the user has specified
253
  dnl command line CPPFLAGS or LDFLAGS, their -I or -L should come _first_
908.1.11 by Monty Taylor
Fixed 64-bit flags for Solaris.
254
  isainfo_k=`isainfo -k`
685.1.20 by Monty Taylor
Fixed memalign for only on sparc.
255
  if test "$target_cpu" = "sparc"
256
  then
257
    MEMALIGN_FLAGS="-xmemalign=8s"
907.3.2 by Monty Taylor
Added tests for 64-bit solaris. Look in /usr/lib/amd64 and /usr/local/lib/amd64 if we are 64-bit.
258
    IS_64="-m64"
259
  else
260
    if test "$isainfo_k" = "amd64"
261
    then
907.3.3 by Monty Taylor
A whole crapload of build fixes. OpenSolaris AMD64 builds with -m64 now by default... still isn't warning clean yet though. Also cleaned up the AM_*FLAGS situation.
262
      IS_64="-m64"
907.3.2 by Monty Taylor
Added tests for 64-bit solaris. Look in /usr/lib/amd64 and /usr/local/lib/amd64 if we are 64-bit.
263
    fi
685.1.20 by Monty Taylor
Fixed memalign for only on sparc.
264
  fi
919.2.22 by Monty Taylor
Fixed the latest stuff on Solaris.
265
  LDFLAGS="${LDFLAGS} -L/usr/local/lib/${isainfo_k} -L/usr/local/lib -L/opt/csw/lib/${isainfo_k} -L/opt/csw/lib -L/usr/lib/${isainfo_k}"
266
  CPPFLAGS="${CPPFLAGS} -I/usr/local/include -I/opt/csw/include"
908.1.11 by Monty Taylor
Fixed 64-bit flags for Solaris.
267
919.2.18 by Monty Taylor
Restructured CFLAGS processing to always keep user-supplied options last on the command line, so they take precedence.
268
  CXXFLAGS="-xlang=c99 -g -mt -compat=5 -library=stlport4 -template=no%extdef ${IS_64} ${MEMALIGN_FLAGS} ${CXXFLAGS}"
269
  CFLAGS="-g -mt -xc99=all ${IS_64} ${MEMALIGN_FLAGS} ${CFLAGS}"
873.2.36 by Monty Taylor
Fix to clean up flags.
270
  DEBUG_CFLAGS="-xO0"
271
  DEBUG_CXXFLAGS="-xO0" 
272
907.3.3 by Monty Taylor
A whole crapload of build fixes. OpenSolaris AMD64 builds with -m64 now by default... still isn't warning clean yet though. Also cleaned up the AM_*FLAGS situation.
273
  dnl TODO: -xO4 causes a Sun Studio failure in innodb... let's check back
274
  dnl       in on this one.
275
  OPTIMIZE_FLAGS="-xO3 -xlibmil -xdepend"
873.2.41 by Monty Taylor
Fixed the ol build for ol Solaris.
276
  OPTIMIZE_CFLAGS="${OPTIMIZE_FLAGS} -Xa -xstrconst"
779.1.12 by Monty Taylor
Possible build fixes for Solaris.
277
  OPTIMIZE_CXXFLAGS="${OPTIMIZE_FLAGS}"
907.3.2 by Monty Taylor
Added tests for 64-bit solaris. Look in /usr/lib/amd64 and /usr/local/lib/amd64 if we are 64-bit.
278
520.4.40 by mordred
Added an option to specify --with-probuf=<location>
279
fi
280
919.2.22 by Monty Taylor
Fixed the latest stuff on Solaris.
281
m4_include(m4/gettext.m4)
282
AM_GNU_GETTEXT(external, need-formatstring-macros)
283
if test "x$MSGMERGE" = "x" -o "x$MSGMERGE" = "x:"
284
then
285
  AM_PATH_PROG_WITH_TEST(GMSGMERGE, gmsgmerge,
286
    [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
287
  MSGMERGE="${GMSGMERGE}"
288
fi
289
AM_CONDITIONAL([BUILD_GETTEXT],[test "x$MSGMERGE" != "x" -a "x$MSGMERGE" != "x:"])
290
291
779.3.18 by Monty Taylor
Cleaned up warnings up through innodb.
292
# We use libtool
293
AC_PROG_LIBTOOL
294
520.4.40 by mordred
Added an option to specify --with-probuf=<location>
295
dnl TODO: Remove this define once we are using 2.61 across the board.
296
# AX_HEADER_ASSERT
297
# ----------------
298
# Check whether to enable assertions.
299
AC_DEFUN([AX_HEADER_ASSERT],
300
[
301
  AC_MSG_CHECKING([whether to enable assertions])
302
  AC_ARG_ENABLE([assert],
303
    [AS_HELP_STRING([--disable-assert],
304
       [Turn off assertions])],
305
    [ac_cv_assert="no"],
306
    [ac_cv_assert="yes"])
307
  AC_MSG_RESULT([$ac_cv_assert])
308
])
309
310
AX_HEADER_ASSERT
311
312
AC_ARG_WITH([debug],
313
    [AS_HELP_STRING([--with-debug],
314
       [Add debug code/turns off optimizations (yes|no) @<:@default=no@:>@])],
315
    [with_debug=$withval],
316
    [with_debug=no])
317
if test "$with_debug" = "yes"
318
then
873.2.36 by Monty Taylor
Fix to clean up flags.
319
  # Debuging. No optimization.
917.1.3 by Monty Taylor
Removed -DDEBUG - we don't use it and it breaks on Solaris.
320
  CFLAGS="${DEBUG_CFLAGS} ${CFLAGS}"
321
  CXXFLAGS="${DEBUG_CXXFLAGS} ${CXXFLAGS}"
520.4.40 by mordred
Added an option to specify --with-probuf=<location>
322
else
323
  # Optimized version. No debug
907.3.3 by Monty Taylor
A whole crapload of build fixes. OpenSolaris AMD64 builds with -m64 now by default... still isn't warning clean yet though. Also cleaned up the AM_*FLAGS situation.
324
  CFLAGS="${OPTIMIZE_CFLAGS} ${CFLAGS}"
325
  CXXFLAGS="${OPTIMIZE_CXXFLAGS} ${CXXFLAGS}"
520.4.40 by mordred
Added an option to specify --with-probuf=<location>
326
fi
1 by brian
clean slate
327
328
520.4.44 by mordred
A whole bunch of solaris/sun studio compile fixes.
329
AC_CXX_STL_HASH
330
AC_CXX_CSTDINT
331
AC_CXX_CINTTYPES
919.2.19 by Monty Taylor
Added check for shared_ptr in advance of actually thinking about using it. I think this should cover all platforms we care about... but let's doublecheck.
332
AC_CXX_SHARED_PTR
1 by brian
clean slate
333
319.1.1 by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_
334
DRIZZLE_PROG_AR
1 by brian
clean slate
335
261.2.3 by Monty Taylor
Moved libdrizzle.ver.in to libdrizzle.ver.
336
# libdrizzle versioning when linked with GNU ld.
632.1.7 by Monty
Reworked grep change to work with old crappy autoconfs.
337
if test "x$EGREP" != "x"
338
then
339
  if test "$lt_cv_prog_gnu_ld" = "yes" -a $LD --version 2>/dev/null|${EGREP} -q GNU
340
  then
779.3.37 by Monty Taylor
Renmaed libdrizzle in the tree to libdrizzleclient to avoid namespace clashes
341
    LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_srcdir)/libdrizzleclient/libdrizzleclient.ver"
632.1.7 by Monty
Reworked grep change to work with old crappy autoconfs.
342
  fi
1 by brian
clean slate
343
fi
344
AC_SUBST(LD_VERSION_SCRIPT)
345
779.2.1 by Monty Taylor
Added new pthread m4 file. Changing lib checks to use AC_LIB_HAVE_LINKFLAGS
346
AC_LIB_PREFIX
347
287.3.30 by Monty Taylor
Added step one of finding libprotobuf.
348
#--------------------------------------------------------------------
349
# Check for Google Proto Buffers
350
#--------------------------------------------------------------------
351
629.2.4 by Monty Taylor
Cleaned up the lib searching - now base some searches off of the prefix.
352
AC_LANG_PUSH([C++])
779.2.1 by Monty Taylor
Added new pthread m4 file. Changing lib checks to use AC_LIB_HAVE_LINKFLAGS
353
AC_LIB_HAVE_LINKFLAGS(protobuf,,
354
[#include <google/protobuf/descriptor.h>
355
],
356
[google::protobuf::FileDescriptor* file;])
357
AS_IF([test x$ac_cv_libprotobuf = xno],
917.1.5 by Monty Taylor
Added more verbose failure messages.
358
      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.]))
629.2.4 by Monty Taylor
Cleaned up the lib searching - now base some searches off of the prefix.
359
910.2.2 by Monty Taylor
Split out protobuf version check from the check for protobuf version so that we can give better error message.
360
AC_CACHE_CHECK([if protobuf is recent enough], [drizzle_cv_protobuf_recent],
361
  [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
362
#include <google/protobuf/descriptor.h>
363
#if GOOGLE_PROTOBUF_VERSION < 2000002
364
# error Your version of Protobuf is too old
365
#endif
366
    ]])],
367
    [drizzle_cv_protobuf_recent=yes],
368
    [drizzle_cv_protobuf_recent=no])])
369
if test "$drizzle_cv_protobuf_recent" = "no"
370
then
371
  AC_MSG_ERROR([Your version of Google Protocol Buffers is too old. Drizzle requires at least version 2.0.2])
372
fi
373
779.2.1 by Monty Taylor
Added new pthread m4 file. Changing lib checks to use AC_LIB_HAVE_LINKFLAGS
374
AC_PATH_PROG([PROTOC],[protoc],[no],[$LIBPROTOBUF_PREFIX/bin:$PATH])
520.4.47 by Monty Taylor
Added check for protoc to protobuf checks.
375
if test "x$PROTOC" = "xno"
376
then
917.1.5 by Monty Taylor
Added more verbose failure messages.
377
  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.])
520.4.47 by Monty Taylor
Added check for protoc to protobuf checks.
378
fi
379
287.3.30 by Monty Taylor
Added step one of finding libprotobuf.
380
AC_LANG_POP()
77.1.111 by Monty Taylor
Added --enable-tcmalloc which will enable searching for and linking with tcmalloc if you have it.
381
77.1.63 by Monty Taylor
Fail also if we can't find libevent or pthread.h.
382
#--------------------------------------------------------------------
520.4.27 by Monty Taylor
Fail if we don't find uuid/uuid.h.
383
# Check for libuuid
384
#--------------------------------------------------------------------
385
779.2.1 by Monty Taylor
Added new pthread m4 file. Changing lib checks to use AC_LIB_HAVE_LINKFLAGS
386
dnl Do this by hand. Need to check for uuid/uuid.h, but uuid may or may
387
dnl not be a lib is weird.
388
590.2.13 by Monty Taylor
Reverted libuuid check code.
389
AC_CHECK_HEADERS(uuid/uuid.h)
390
if test "x$ac_cv_header_uuid_uuid_h" = "xno"
391
then
917.1.5 by Monty Taylor
Added more verbose failure messages.
392
  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.])
590.2.13 by Monty Taylor
Reverted libuuid check code.
393
fi
779.2.3 by Monty Taylor
Added stdlib.h depend for readline.
394
AC_LIB_HAVE_LINKFLAGS(uuid,,
395
[
396
#include <uuid/uuid.h>
397
],
398
[
399
  uuid_t uout;
400
  uuid_generate(uout);
401
])
402
134.2.1 by Antony Curtis
Changes for proper detection of libraries
403
77.1.63 by Monty Taylor
Fail also if we can't find libevent or pthread.h.
404
405
#--------------------------------------------------------------------
406
# Check for libpthread
407
#--------------------------------------------------------------------
408
779.2.1 by Monty Taylor
Added new pthread m4 file. Changing lib checks to use AC_LIB_HAVE_LINKFLAGS
409
ACX_PTHREAD(,AC_MSG_ERROR(could not find libpthread))
410
LIBS="$PTHREAD_LIBS $LIBS"
907.3.3 by Monty Taylor
A whole crapload of build fixes. OpenSolaris AMD64 builds with -m64 now by default... still isn't warning clean yet though. Also cleaned up the AM_*FLAGS situation.
411
CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS}"
779.2.1 by Monty Taylor
Added new pthread m4 file. Changing lib checks to use AC_LIB_HAVE_LINKFLAGS
412
CC="$PTHREAD_CC"
77.1.63 by Monty Taylor
Fail also if we can't find libevent or pthread.h.
413
414
#--------------------------------------------------------------------
612.2.5 by Monty Taylor
Added test for mtmalloc, if we haven't explicitly asked for tcmalloc.
415
# Check for tcmalloc/mtmalloc
77.1.111 by Monty Taylor
Added --enable-tcmalloc which will enable searching for and linking with tcmalloc if you have it.
416
#--------------------------------------------------------------------
417
418
AC_ARG_ENABLE([tcmalloc],
419
    [AS_HELP_STRING([--enable-tcmalloc],
420
       [Enable linking with tcmalloc @<:@default=off@:>@])],
236.1.14 by Monty Taylor
Merged build changes from Antony.
421
    [ac_enable_tcmalloc="$enableval"],
422
    [ac_enable_tcmalloc="no"])
77.1.111 by Monty Taylor
Added --enable-tcmalloc which will enable searching for and linking with tcmalloc if you have it.
423
612.2.5 by Monty Taylor
Added test for mtmalloc, if we haven't explicitly asked for tcmalloc.
424
if test "x$ac_enable_tcmalloc" != "xno"
77.1.111 by Monty Taylor
Added --enable-tcmalloc which will enable searching for and linking with tcmalloc if you have it.
425
then
426
  AC_CHECK_LIB(tcmalloc,malloc,[],[])
427
fi
428
612.2.5 by Monty Taylor
Added test for mtmalloc, if we haven't explicitly asked for tcmalloc.
429
if test "x$ac_cv_lib_tcmalloc_malloc" != "xyes"
430
then
431
  AC_CHECK_LIB(mtmalloc,malloc,[],[])
432
fi
433
779.2.1 by Monty Taylor
Added new pthread m4 file. Changing lib checks to use AC_LIB_HAVE_LINKFLAGS
434
77.1.111 by Monty Taylor
Added --enable-tcmalloc which will enable searching for and linking with tcmalloc if you have it.
435
#--------------------------------------------------------------------
779.1.15 by Monty Taylor
Added libdrizzle configure support.
436
# Check for libdrizzle
437
#--------------------------------------------------------------------
438
439
AC_LIB_HAVE_LINKFLAGS(drizzle,,
440
[#include <libdrizzle/drizzle.h>],
441
[
442
  const char *version= drizzle_version()
443
])
444
dnl AS_IF([test x$ac_cv_libdrizzle = xno],
445
dnl       AC_MSG_ERROR([libdrizzle is required for Drizzle])
446
447
448
#--------------------------------------------------------------------
77.1.63 by Monty Taylor
Fail also if we can't find libevent or pthread.h.
449
# Check for libz
450
#--------------------------------------------------------------------
451
779.2.1 by Monty Taylor
Added new pthread m4 file. Changing lib checks to use AC_LIB_HAVE_LINKFLAGS
452
AC_LIB_HAVE_LINKFLAGS(z,,
453
[#include <zlib.h>],
454
[
455
  crc32(0, Z_NULL, 0);
456
])
457
AS_IF([test x$ac_cv_libz = xno],
917.1.5 by Monty Taylor
Added more verbose failure messages.
458
      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.]))
201.2.3 by Monty Taylor
Cleaned up some LIBS bits in the build.
459
612.2.9 by Monty Taylor
Woot. No more extra CFLAGS on the command line!
460
#--------------------------------------------------------------------
910.5.2 by Monty Taylor
Applied atomic patch to current tree.
461
# Check for TBB
462
#--------------------------------------------------------------------
463
464
AC_LANG_PUSH(C++)
465
AC_LIB_HAVE_LINKFLAGS(tbb,,
466
[#include <tbb/atomic.h>
467
 #include <stdint.h>
468
],
469
[
470
  tbb::atomic<uint64_t> x;
471
  tbb::atomic<uint8_t> y;
472
  x=0;
473
  y=0;
474
  x++;
475
  y++;
476
])
477
AC_LANG_POP()
478
479
#--------------------------------------------------------------------
182.1.5 by Jim Winstead
Detect and make the Mac OS X libedit readline interface look like the
480
# Check for libreadline or compatible (libedit on Mac OS X)
481
#--------------------------------------------------------------------
77.1.63 by Monty Taylor
Fail also if we can't find libevent or pthread.h.
482
779.2.5 by Monty Taylor
Split out readline.
483
save_LIBS="${LIBS}"
484
LIBS=""
779.2.4 by Monty Taylor
Updated some more build stuff.
485
VL_LIB_READLINE
873.2.4 by Monty Taylor
Fixed some configure errors.
486
AS_IF([test "x$vl_cv_lib_readline" = "xno"],
917.1.5 by Monty Taylor
Added more verbose failure messages.
487
      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.]))
779.2.5 by Monty Taylor
Split out readline.
488
READLINE_LIBS="${LIBS}"
489
LIBS="${save_LIBS}"
490
AC_SUBST(READLINE_LIBS)
207.1.2 by Jim Winstead
Fix test for libreadline to test a function that exists in all usable
491
319.1.1 by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_
492
DRIZZLE_CHECK_NEW_RL_INTERFACE
287.3.30 by Monty Taylor
Added step one of finding libprotobuf.
493
77.1.63 by Monty Taylor
Fail also if we can't find libevent or pthread.h.
494
#--------------------------------------------------------------------
495
# Check for libpcre
496
#--------------------------------------------------------------------
497
873.2.41 by Monty Taylor
Fixed the ol build for ol Solaris.
498
AC_LIB_HAVE_LINKFLAGS(pcre,, [#include <pcre.h>], [pcre *re= NULL])
499
AS_IF([test "x$ac_cv_libpcre" = "xno"],[
914.1.1 by Monty Taylor
Quick OpenSolaris build fix.
500
  unset ac_cv_libpcre
873.2.41 by Monty Taylor
Fixed the ol build for ol Solaris.
501
  AC_LIB_HAVE_LINKFLAGS(pcre,, [#include <pcre/pcre.h>], [pcre *re= NULL])
914.1.1 by Monty Taylor
Quick OpenSolaris build fix.
502
  AS_IF([test "x$ac_cv_libpcre" = "xno"],
917.1.5 by Monty Taylor
Added more verbose failure messages.
503
        [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.])]
914.1.1 by Monty Taylor
Quick OpenSolaris build fix.
504
        [AC_DEFINE(PCRE_HEADER,[<pcre/pcre.h>],[Location of pcre header])])
505
],[
506
  AC_DEFINE(PCRE_HEADER,[<pcre.h>],[Location of pcre header])
507
])
779.2.9 by Monty Taylor
Put back in pkg-config check- pcre.h is in /usr/include for older versions and
508
77.1.63 by Monty Taylor
Fail also if we can't find libevent or pthread.h.
509
1 by brian
clean slate
510
dnl Find paths to some shell programs
511
AC_PATH_PROG(LN, ln, ln)
512
# This must be able to take a -f flag like normal unix ln.
513
AC_PATH_PROG(LN_CP_F, ln, ln)
514
515
AC_PATH_PROG(MV, mv, mv)
516
AC_PATH_PROG(RM, rm, rm)
517
AC_PATH_PROG(CP, cp, cp)
518
AC_PATH_PROG(SED, sed, sed)
519
AC_PATH_PROG(CMP, cmp, cmp)
520
AC_PATH_PROG(CHMOD, chmod, chmod)
521
AC_PATH_PROG(HOSTNAME, hostname, hostname)
522
# Check for a GNU tar named 'gtar', or 'gnutar' (MacOS X) and
523
# fall back to 'tar' otherwise and hope that it's a GNU tar as well
524
AC_CHECK_PROGS(TAR, gnutar gtar tar)
525
526
dnl We use a path for perl so the script startup works
527
dnl We make sure to use perl, not perl5, in hopes that the RPMs will
528
dnl not depend on the perl5 binary being installed (probably a bug in RPM)
529
AC_PATH_PROG(PERL, perl, no)
530
if test "$PERL" != "no" && $PERL -e 'require 5' > /dev/null 2>&1
531
then
532
  PERL5=$PERL
533
else
534
  AC_PATH_PROG(PERL5, perl5, no)
535
  if test "$PERL5" != no
536
  then
537
    PERL=$PERL5
538
    ac_cv_path_PERL=$ac_cv_path_PERL5
539
  fi
540
fi
541
542
AC_SUBST(HOSTNAME)
543
AC_SUBST(PERL)
544
AC_SUBST(PERL5)
545
546
# icheck, used for ABI check
547
AC_PATH_PROG(ICHECK, icheck, no)
548
# "icheck" is also the name of a file system check program on Tru64.
549
# Verify the program found is really the interface checker.
550
if test "x$ICHECK" != "xno"
551
then
552
  AC_MSG_CHECKING(if $ICHECK works as expected)
553
  echo "int foo;" > conftest.h
554
  $ICHECK --canonify -o conftest.ic conftest.h 2>/dev/null
555
  if test -f "conftest.ic"
556
  then
557
    AC_MSG_RESULT(yes)
558
  else
559
    AC_MSG_RESULT(no)
560
    ICHECK=no
561
  fi
562
  rm -f conftest.ic conftest.h
563
fi
564
AC_SUBST(ICHECK)
565
566
# Lock for PS
567
AC_PATH_PROG(PS, ps, ps)
568
AC_MSG_CHECKING("how to check if pid exists")
569
PS=$ac_cv_path_PS
570
# Linux style
632.1.7 by Monty
Reworked grep change to work with old crappy autoconfs.
571
if $PS p $$ 2> /dev/null | grep `echo $0 | sed s/\-//` > /dev/null
1 by brian
clean slate
572
then
632.1.7 by Monty
Reworked grep change to work with old crappy autoconfs.
573
  FIND_PROC="$PS p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
1 by brian
clean slate
574
# Solaris
632.1.7 by Monty
Reworked grep change to work with old crappy autoconfs.
575
elif $PS -fp $$ 2> /dev/null | grep $0 > /dev/null
1 by brian
clean slate
576
then
632.1.7 by Monty
Reworked grep change to work with old crappy autoconfs.
577
  FIND_PROC="$PS -p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
1 by brian
clean slate
578
# BSD style
632.1.7 by Monty
Reworked grep change to work with old crappy autoconfs.
579
elif $PS -uaxww 2> /dev/null | grep $0 > /dev/null
1 by brian
clean slate
580
then
632.1.7 by Monty
Reworked grep change to work with old crappy autoconfs.
581
  FIND_PROC="$PS -uaxww | grep -v grep | grep \$\$MYSQLD | grep \" \$\$PID \" > /dev/null"
1 by brian
clean slate
582
# SysV style
632.1.7 by Monty
Reworked grep change to work with old crappy autoconfs.
583
elif $PS -ef 2> /dev/null | grep $0 > /dev/null
1 by brian
clean slate
584
then
632.1.7 by Monty
Reworked grep change to work with old crappy autoconfs.
585
  FIND_PROC="$PS -ef | grep -v grep | grep \$\$MYSQLD | grep \" \$\$PID \" > /dev/null"
1 by brian
clean slate
586
# Do anybody use this?
632.1.7 by Monty
Reworked grep change to work with old crappy autoconfs.
587
elif $PS $$ 2> /dev/null | grep $0 > /dev/null
1 by brian
clean slate
588
then
632.1.7 by Monty
Reworked grep change to work with old crappy autoconfs.
589
  FIND_PROC="$PS \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
1 by brian
clean slate
590
else
591
  case $SYSTEM_TYPE in
394 by Monty Taylor
Fix configure problem on cygwin. Thanks awfief.
592
    *freebsd*|*dragonfly*|*cygwin*)
632.1.7 by Monty
Reworked grep change to work with old crappy autoconfs.
593
      FIND_PROC="$PS p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
1 by brian
clean slate
594
      ;;
595
    *darwin*)
632.1.7 by Monty
Reworked grep change to work with old crappy autoconfs.
596
      FIND_PROC="$PS -uaxww | grep -v grep | grep \$\$MYSQLD | grep \" \$\$PID \" > /dev/null"
1 by brian
clean slate
597
      ;;
598
    *)
599
      AC_MSG_ERROR([Could not find the right ps switches. Which OS is this ?. See the Installation chapter in the Reference Manual.])
236.1.39 by Monty Taylor
autoconf warning cleanups.
600
      ;;
1 by brian
clean slate
601
  esac
602
fi
603
AC_SUBST(FIND_PROC)
604
AC_MSG_RESULT("$FIND_PROC")
605
606
# Check if a pid is valid
607
AC_PATH_PROG(KILL, kill, kill)
608
AC_MSG_CHECKING("for kill switches")
609
if $ac_cv_path_KILL -0 $$
610
then
611
  CHECK_PID="$ac_cv_path_KILL -0 \$\$PID > /dev/null 2> /dev/null"
612
elif kill -s 0 $$
613
then
614
  CHECK_PID="$ac_cv_path_KILL -s 0 \$\$PID > /dev/null 2> /dev/null"
615
else
616
  AC_MSG_WARN([kill -0 to check for pid seems to fail])
617
    CHECK_PID="$ac_cv_path_KILL -s SIGCONT \$\$PID > /dev/null 2> /dev/null"
618
fi
619
AC_SUBST(CHECK_PID)
620
AC_MSG_RESULT("$CHECK_PID")
621
622
623
# Check if we need noexec stack for assembler
624
AC_CHECK_NOEXECSTACK
625
28.1.39 by Monty Taylor
Made everything use AS_HELP_STRING (except for charsets, which are dying anyway)
626
AC_ARG_WITH([server-suffix],
627
    [AS_HELP_STRING([--with-server-suffix],
628
      [Append value to the version string.])],
319.1.1 by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_
629
    [ DRIZZLE_SERVER_SUFFIX=`echo "$withval" | sed -e  's/^\(...................................\)..*$/\1/'` ],
630
    [ DRIZZLE_SERVER_SUFFIX= ]
1 by brian
clean slate
631
    )
546 by Monty Taylor
Cleaned up version.h. (And by cleaned, I mean removed)
632
AC_DEFINE_UNQUOTED([DRIZZLE_SERVER_SUFFIX],[$DRIZZLE_SERVER_SUFFIX],
633
                   [Append value to the version string])
1 by brian
clean slate
634
635
# Force use of a curses libs
28.1.39 by Monty Taylor
Made everything use AS_HELP_STRING (except for charsets, which are dying anyway)
636
AC_ARG_WITH([named-curses-libs],
637
    [AS_HELP_STRING([--with-named-curses-libs=ARG],
638
            [Use specified curses libraries instead of those
639
		automatically found by configure.])],
1 by brian
clean slate
640
    [ with_named_curses=$withval ],
641
    [ with_named_curses=no ]
642
    )
643
28.1.39 by Monty Taylor
Made everything use AS_HELP_STRING (except for charsets, which are dying anyway)
644
AC_ARG_WITH([tcp-port],
645
    [AS_HELP_STRING([--with-tcp-port=port-number],
165.1.1 by Elliot Murphy
new port number from IANA
646
            [Which port to use for Drizzle services @<:@default=4427@:>@])],
301 by Brian Aker
Clean up port startup
647
    [ DRIZZLE_TCP_PORT=$withval ],
648
    [ DRIZZLE_TCP_PORT=$DRIZZLE_TCP_PORT_DEFAULT
1 by brian
clean slate
649
      # if we actually defaulted (as opposed to the pathological case of
301 by Brian Aker
Clean up port startup
650
      # --with-tcp-port=<DRIZZLE_TCP_PORT_DEFAULT> which might in theory
1 by brian
clean slate
651
      # happen if whole batch of servers was built from a script), set
652
      # the default to zero to indicate that; we don't lose information
653
      # that way, because 0 obviously indicates that we can get the
301 by Brian Aker
Clean up port startup
654
      # default value from DRIZZLE_TCP_PORT. this seems really evil, but
655
      # testing for DRIZZLE_TCP_PORT==DRIZZLE_TCP_PORT_DEFAULT would make a
656
      # a port of DRIZZLE_TCP_PORT_DEFAULT magic even if the builder did not
1 by brian
clean slate
657
      # intend it to mean "use the default, in fact, look up a good default
165.1.1 by Elliot Murphy
new port number from IANA
658
      # from /etc/services if you can", but really, really meant 4427 when
659
      # they passed in 4427. When they pass in a specific value, let them
1 by brian
clean slate
660
      # have it; don't second guess user and think we know better, this will
661
      # just make people cross.  this makes the the logic work like this
662
      # (which is complicated enough):
663
      #
664
      # - if a port was set during build, use that as a default.
665
      #
666
      # - otherwise, try to look up a port in /etc/services; if that fails,
301 by Brian Aker
Clean up port startup
667
      #   use DRIZZLE_TCP_PORT_DEFAULT (at the time of this writing 4427)
1 by brian
clean slate
668
      #
301 by Brian Aker
Clean up port startup
669
      # - allow the DRIZZLE_TCP_PORT environment variable to override that.
1 by brian
clean slate
670
      #
671
      # - allow command-line parameters to override all of the above.
672
      #
301 by Brian Aker
Clean up port startup
673
      # the top-most DRIZZLE_TCP_PORT_DEFAULT is read from win/configure.js,
1 by brian
clean slate
674
      # so don't mess with that.
301 by Brian Aker
Clean up port startup
675
      DRIZZLE_TCP_PORT_DEFAULT=0 ]
1 by brian
clean slate
676
    )
301 by Brian Aker
Clean up port startup
677
AC_SUBST(DRIZZLE_TCP_PORT)
1 by brian
clean slate
678
# We might want to document the assigned port in the manual.
301 by Brian Aker
Clean up port startup
679
AC_SUBST(DRIZZLE_TCP_PORT_DEFAULT)
546 by Monty Taylor
Cleaned up version.h. (And by cleaned, I mean removed)
680
AC_DEFINE_UNQUOTED([DRIZZLE_PORT],[$DRIZZLE_TCP_PORT],
681
                   [Drizzle port to use])
682
AC_DEFINE_UNQUOTED([DRIZZLE_PORT_DEFAULT],[$DRIZZLE_TCP_PORT_DEFAULT],
683
		   [If we defaulted to DRIZZLE_PORT, then this will be zero])
1 by brian
clean slate
684
685
# Use this to set the place used for unix socket used to local communication.
572.2.1 by ysano
Replace --with-mysqld-user configure option with --with-drizzled-user.
686
AC_ARG_WITH([drizzled-user],
687
    [AS_HELP_STRING([--with-drizzled-user=username],
688
            [What user the drizzled daemon shall be run as.
689
		@<:@default=drizzle@:>@])],
690
    [ DRIZZLED_USER=$withval ],
691
    [ DRIZZLED_USER=drizzle ]
1 by brian
clean slate
692
    )
572.2.1 by ysano
Replace --with-mysqld-user configure option with --with-drizzled-user.
693
AC_SUBST(DRIZZLED_USER)
1 by brian
clean slate
694
695
# If we should allow LOAD DATA LOCAL
696
AC_MSG_CHECKING(If we should should enable LOAD DATA LOCAL by default)
697
AC_ARG_ENABLE(local-infile,
698
    [  --enable-local-infile   Enable LOAD DATA LOCAL INFILE (default: disabled)],
699
    [ ENABLED_LOCAL_INFILE=$enableval ],
700
    [ ENABLED_LOCAL_INFILE=no ]
701
    )
702
if test "$ENABLED_LOCAL_INFILE" = "yes"
703
then
704
  AC_MSG_RESULT([yes])
705
  AC_DEFINE([ENABLED_LOCAL_INFILE], [1],
706
            [If LOAD DATA LOCAL INFILE should be enabled by default])
707
else
708
  AC_MSG_RESULT([no])
709
fi
710
711
# Types that must be checked AFTER large file support is checked
712
AC_TYPE_SIZE_T
713
714
#--------------------------------------------------------------------
715
# Check for system header files
716
#--------------------------------------------------------------------
717
718
AC_HEADER_DIRENT
719
AC_HEADER_STDC
720
AC_HEADER_SYS_WAIT
53.2.2 by Monty Taylor
Updated everything that needs updating to compile with -std=gnu99 -pedantic
721
AC_HEADER_STDBOOL
77.1.22 by Monty Taylor
Removed refs to floatingpoint.h (which we only used for fconvert) and fconvert
722
AC_CHECK_HEADERS(fcntl.h float.h fpu_control.h ieeefp.h)
53.2.29 by Monty Taylor
Cleaned up headers a little more.
723
AC_CHECK_HEADERS(limits.h pwd.h select.h linux/config.h)
724
AC_CHECK_HEADERS(sys/fpu.h utime.h sys/utime.h )
572.1.4 by Monty Taylor
Removed a bunch of unusued tests and defines from autoconf.
725
AC_CHECK_HEADERS(synch.h sys/mman.h sys/socket.h)
520.4.41 by mordred
Fixed configure.ac to work cleanly on Solaris - and define some good compile flags.
726
AC_CHECK_HEADERS([curses.h term.h],[],[],
727
[[#ifdef HAVE_CURSES_H
728
# include <curses.h>
729
#endif
730
]])
202.1.4 by Monty Taylor
Removed openssl refs.
731
AC_CHECK_HEADERS(termio.h termios.h sched.h alloca.h)
572.1.4 by Monty Taylor
Removed a bunch of unusued tests and defines from autoconf.
732
AC_CHECK_HEADERS(sys/prctl.h ieeefp.h)
53.2.29 by Monty Taylor
Cleaned up headers a little more.
733
AC_CHECK_HEADERS(execinfo.h)
1 by brian
clean slate
734
77.1.31 by Monty Taylor
Replaced regex lib with pcre. Reworked mysqltest to use it.
735
#--------------------------------------------------------------------
1 by brian
clean slate
736
# Check for system libraries. Adds the library to $LIBS
737
# and defines HAVE_LIBM etc
738
#--------------------------------------------------------------------
739
740
AC_CHECK_LIB(m, floor, [], AC_CHECK_LIB(m, __infinity))
741
236.1.39 by Monty Taylor
autoconf warning cleanups.
742
AC_CHECK_FUNC(setsockopt, [], [AC_CHECK_LIB(socket, setsockopt)])
743
AC_CHECK_FUNC(yp_get_default_domain, [],
744
  [AC_CHECK_LIB(nsl, yp_get_default_domain)])
745
AC_CHECK_FUNC(p2open, [], [AC_CHECK_LIB(gen, p2open)])
1 by brian
clean slate
746
# This may get things to compile even if bind-8 is installed
236.1.39 by Monty Taylor
autoconf warning cleanups.
747
AC_CHECK_FUNC(bind, [], [AC_CHECK_LIB(bind, bind)])
1 by brian
clean slate
748
# Check if crypt() exists in libc or libcrypt, sets LIBS if needed
749
AC_SEARCH_LIBS(crypt, crypt, AC_DEFINE(HAVE_CRYPT, 1, [crypt]))
750
751
# Check rt for aio_read
752
AC_CHECK_LIB(rt, aio_read)
753
754
# For the sched_yield() function on Solaris
236.1.39 by Monty Taylor
autoconf warning cleanups.
755
AC_CHECK_FUNC(sched_yield, [],
756
  [AC_CHECK_LIB(posix4, [sched_yield],
757
    [AC_DEFINE(HAVE_SCHED_YIELD) LIBS="$LIBS -lposix4"])])
1 by brian
clean slate
758
759
if test "$ac_cv_header_termio_h" = "no" -a "$ac_cv_header_termios_h" = "no"
760
then
236.1.39 by Monty Taylor
autoconf warning cleanups.
761
  AC_CHECK_FUNC(gtty, [], [AC_CHECK_LIB(compat, gtty)])
1 by brian
clean slate
762
fi
763
764
AC_CHECK_TYPES([fp_except], [], [], [
765
#include <sys/types.h>
766
#include <ieeefp.h>
767
])
768
25 by Brian Aker
Clean up of configure.in
769
my_save_LIBS="$LIBS"
770
LIBS=""
771
AC_CHECK_LIB(dl,dlopen)
572.1.4 by Monty Taylor
Removed a bunch of unusued tests and defines from autoconf.
772
AC_CHECK_FUNCS(dlopen)
177.3.1 by mark
remove ifdef HAVE_DLOPEN, make configure require dlopen()
773
if test "$ac_cv_func_dlopen" != "yes"
774
then
775
  AC_MSG_ERROR([Drizzle requires dlopen])
776
fi
201.2.3 by Monty Taylor
Cleaned up some LIBS bits in the build.
777
LIBDL_LIBS="$LIBS"
25 by Brian Aker
Clean up of configure.in
778
LIBS="$my_save_LIBS"
201.2.3 by Monty Taylor
Cleaned up some LIBS bits in the build.
779
AC_SUBST(LIBDL_LIBS)
25 by Brian Aker
Clean up of configure.in
780
201.2.4 by Monty Taylor
Re-enabled optimizations for the normal build, and added back the --with-debug option to turn them off.
781
1 by brian
clean slate
782
AC_ARG_WITH([fast-mutexes],
28.1.39 by Monty Taylor
Made everything use AS_HELP_STRING (except for charsets, which are dying anyway)
783
    [AS_HELP_STRING([--with-fast-mutexes],
784
	    [Compile with fast mutexes  @<:@default=off@:>@])],
785
    [with_fast_mutexes=$withval],
786
    [with_fast_mutexes=no])
1 by brian
clean slate
787
788
if test "$with_fast_mutexes" != "no"
789
then
51.3.26 by Jay Pipes
Final removal of DBUG library and cleanup of Makefiles
790
	AC_DEFINE([MY_PTHREAD_FASTMUTEX], [1], 
791
			[Define to 1 if you want to use fast mutexes])
1 by brian
clean slate
792
fi
793
236.1.56 by Monty Taylor
Made build of thr_mutex.c conditional on --with-fast-mutexes, since that's
794
AM_CONDITIONAL(BUILD_FAST_MUTEX,[test "$with_fast_mutexes" != "no"])
795
840.1.6 by Monty Taylor
Added back atomic builtins check.
796
AC_ARG_WITH([atomic-ops],
840.1.12 by Monty Taylor
Updated AC_HELP_STRING to AS_HELP_STRING
797
    [AS_HELP_STRING([--with-atomic-ops=rwlocks|smp|up],
798
       [Implement atomic operations using pthread rwlocks or atomic CPU
799
        instructions for multi-processor or uniprocessor
800
        configuration. By default gcc built-in sync functions are used,
801
        if available and 'smp' configuration otherwise.])],
802
    [with_atomic_ops="$withval"],
803
    [with_atomic_ops=smp])
840.1.6 by Monty Taylor
Added back atomic builtins check.
804
805
case "$with_atomic_ops" in
806
  "up") AC_DEFINE([MY_ATOMIC_MODE_DUMMY], [1],
807
                  [Assume single-CPU mode, no concurrency]) ;;
808
  "rwlocks") AC_DEFINE([MY_ATOMIC_MODE_RWLOCKS], [1],
809
                  [Use pthread rwlocks for atomic ops]) ;;
910.5.2 by Monty Taylor
Applied atomic patch to current tree.
810
  "smp") 
840.1.6 by Monty Taylor
Added back atomic builtins check.
811
    AC_CACHE_CHECK(
812
      [whether the compiler provides atomic builtins],
813
      [ac_cv_gcc_atomic_builtins],
814
      [AC_TRY_COMPILE([],
815
        [int main()
816
        {
817
          int foo= -10; int bar= 10;
818
          if (!__sync_fetch_and_add(&foo, bar) || foo)
819
            return -1;
820
          bar= __sync_lock_test_and_set(&foo, bar);
821
          if (bar || foo != 10)
822
            return -1;
823
          bar= __sync_val_compare_and_swap(&bar, foo, 15);
824
          if (bar)
825
            return -1;
826
          return 0;
827
        }],
828
       [ac_cv_gcc_atomic_builtins=yes],
829
       [ac_cv_gcc_atomic_builtins=no])])
830
831
    if test "x$ac_cv_gcc_atomic_builtins" = "xyes"; then
832
      AC_DEFINE(HAVE_GCC_ATOMIC_BUILTINS, 1,
833
                [Define to 1 if compiler provides atomic builtins.])
834
    fi
835
   ;;
836
   *) AC_MSG_ERROR(["$with_atomic_ops" is not a valid value for --with-atomic-ops]) ;;
837
esac
838
839
28.1.39 by Monty Taylor
Made everything use AS_HELP_STRING (except for charsets, which are dying anyway)
840
AC_ARG_WITH([comment],
841
    [AS_HELP_STRING([--with-comment],
842
            [Comment about compilation environment. @<:@default=off@:>@])],
1 by brian
clean slate
843
    [with_comment=$withval],
844
    [with_comment=no])
845
if test "$with_comment" != "no"
846
then
847
  COMPILATION_COMMENT=$with_comment
848
else
849
  COMPILATION_COMMENT="Source distribution"
850
fi
546 by Monty Taylor
Cleaned up version.h. (And by cleaned, I mean removed)
851
AC_DEFINE_UNQUOTED([COMPILATION_COMMENT],["$COMPILATION_COMMENT"],
852
                   [Comment about compilation environment])
1 by brian
clean slate
853
854
dnl Checks for typedefs, structures, and compiler characteristics.
855
AC_C_CONST
856
AC_C_INLINE
590.2.2 by Monty Taylor
Configure cleanups. Added generic search_for_lib m4 macro.
857
AC_C_VOLATILE
1 by brian
clean slate
858
AC_TYPE_OFF_T
859
AC_HEADER_TIME
860
AC_STRUCT_TM
861
# off_t is not a builtin type
862
AC_CHECK_SIZEOF(off_t, 4)
863
if test "$ac_cv_sizeof_off_t" -eq 0
864
then
91 by Brian Aker
Main binary now named drizzled
865
  AC_MSG_ERROR("Drizzle needs a off_t type.")
1 by brian
clean slate
866
fi
867
868
dnl
869
dnl check if time_t is unsigned
870
dnl
871
319.1.1 by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_
872
DRIZZLE_CHECK_TIME_T
1 by brian
clean slate
873
874
875
# This always gives a warning. Ignore it unless you are cross compiling
876
AC_C_BIGENDIAN
877
#---START: Used in for client configure
878
# Check base type of last arg to accept
319.1.1 by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_
879
DRIZZLE_TYPE_ACCEPT
1 by brian
clean slate
880
#---END:
881
# Figure out what type of struct rlimit to use with setrlimit
319.1.1 by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_
882
DRIZZLE_TYPE_STRUCT_RLIMIT
1 by brian
clean slate
883
# Find where the stack goes
319.1.1 by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_
884
DRIZZLE_STACK_DIRECTION
1 by brian
clean slate
885
# We want to skip alloca on irix unconditionally. It may work on some version..
319.1.1 by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_
886
DRIZZLE_FUNC_ALLOCA
1 by brian
clean slate
887
# Do struct timespec have members tv_sec or ts_sec
236.1.24 by Monty Taylor
Renamed MYSQL_TIME to DRIZZLE_TIME.
888
DRIZZLE_TIMESPEC_TS
1 by brian
clean slate
889
# Do we have the tzname variable
319.1.1 by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_
890
DRIZZLE_TZNAME
1 by brian
clean slate
891
AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>])
520.4.43 by mordred
A set of Solaris fixes.
892
AC_CHECK_TYPES([uint, ulong])
1 by brian
clean slate
893
319.1.1 by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_
894
DRIZZLE_PTHREAD_YIELD
1 by brian
clean slate
895
134.2.1 by Antony Curtis
Changes for proper detection of libraries
896
1 by brian
clean slate
897
dnl Checks for header files.
572.1.4 by Monty Taylor
Removed a bunch of unusued tests and defines from autoconf.
898
AC_CHECK_HEADERS(malloc.h)
1 by brian
clean slate
899
900
dnl Checks for library functions.
901
AC_FUNC_ALLOCA
902
AC_PROG_GCC_TRADITIONAL
903
AC_TYPE_SIGNAL
572.1.4 by Monty Taylor
Removed a bunch of unusued tests and defines from autoconf.
904
1 by brian
clean slate
905
AC_CHECK_FUNCS(issetugid)
906
907
# from old readline settting:
908
909
MAKE_SHELL=/bin/sh
910
AC_SUBST(MAKE_SHELL)
911
912
# Already-done: stdlib.h string.h unistd.h termios.h
398.1.9 by Monty Taylor
Cleaned up stuff out of global.h.
913
AC_CHECK_HEADERS(stdarg.h dirent.h locale.h ndir.h sys/dir.h \
572.1.4 by Monty Taylor
Removed a bunch of unusued tests and defines from autoconf.
914
 sys/ndir.h sys/select.h \
915
 sys/mman.h termcap.h termio.h asm/termbits.h grp.h \
916
 paths.h)
1 by brian
clean slate
917
918
# Already-done: strcasecmp
572.1.4 by Monty Taylor
Removed a bunch of unusued tests and defines from autoconf.
919
AC_CHECK_FUNCS(lstat select)
1 by brian
clean slate
920
28.1.33 by Monty Taylor
Added -Wall
921
AC_HEADER_STAT
319.1.1 by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_
922
DRIZZLE_SIGNAL_CHECK
923
DRIZZLE_CHECK_GETPW_FUNCS
924
DRIZZLE_HAVE_TIOCGWINSZ
925
DRIZZLE_HAVE_TIOCSTAT
1 by brian
clean slate
926
927
#########################################################################
928
929
dnl Checks for library functions.
930
931
AC_FUNC_UTIME_NULL
932
AC_FUNC_VPRINTF
933
77.1.24 by Monty Taylor
Removed non-fcntl code and made it a fatal configure error if it's not there.
934
AC_CHECK_FUNCS(fcntl)
935
if test "x$ac_cv_func_fcntl" != "xyes"
936
then
937
  AC_MSG_ERROR("Drizzle requires fcntl.")
938
fi
939
815.1.6 by Monty Taylor
Some tweaks to get timegm working on Solaris.
940
AC_CONFIG_LIBOBJ_DIR([gnulib])
236.1.50 by Monty Taylor
Added automake conditional compilation of distributed system replacement functions.
941
572.1.4 by Monty Taylor
Removed a bunch of unusued tests and defines from autoconf.
942
AC_CHECK_FUNCS( \
77.1.24 by Monty Taylor
Removed non-fcntl code and made it a fatal configure error if it's not there.
943
  cuserid fchmod \
572.1.4 by Monty Taylor
Removed a bunch of unusued tests and defines from autoconf.
944
  fdatasync fpresetsticky fpsetmask fsync \
575.4.6 by Monty Taylor
Removed my_getwd.
945
  getpassphrase getpwnam \
946
  getpwuid getrlimit getrusage index initgroups isnan \
1 by brian
clean slate
947
  localtime_r gethrtime gmtime_r \
572.1.4 by Monty Taylor
Removed a bunch of unusued tests and defines from autoconf.
948
  madvise \
949
  mkstemp mlockall poll pread pthread_attr_create mmap mmap64 \
1 by brian
clean slate
950
  pthread_attr_getstacksize pthread_attr_setprio pthread_attr_setschedparam \
951
  pthread_attr_setstacksize pthread_condattr_create pthread_getsequence_np \
952
  pthread_key_delete pthread_rwlock_rdlock pthread_setprio \
953
  pthread_setprio_np pthread_setschedparam pthread_sigmask readlink \
449 by Monty Taylor
Removed rint check - rint is part of C99.
954
  realpath rename rwlock_init setupterm \
572.1.4 by Monty Taylor
Removed a bunch of unusued tests and defines from autoconf.
955
  sigaction \
956
  sigthreadmask \
957
  snprintf strpbrk \
958
  tell tempnam \
959
  backtrace backtrace_symbols backtrace_symbols_fd)
1 by brian
clean slate
960
287.3.18 by Monty Taylor
Put -fno-exceptions flag in selectively. Add back HAVE_DECL_MADVISE check so
961
AC_LANG_PUSH(C++)
962
# Test whether madvise() is declared in C++ code -- it is not on some
963
# systems, such as Solaris
373.1.3 by Monty Taylor
Fixed test for HAVE_DECL_MADVISE to actually work.
964
AC_CHECK_DECLS([madvise], [], [], [AC_INCLUDES_DEFAULT[
965
#if HAVE_SYS_MMAN_H
287.3.18 by Monty Taylor
Put -fno-exceptions flag in selectively. Add back HAVE_DECL_MADVISE check so
966
#include <sys/types.h>
967
#include <sys/mman.h>
373.1.3 by Monty Taylor
Fixed test for HAVE_DECL_MADVISE to actually work.
968
#endif
969
]])
287.3.18 by Monty Taylor
Put -fno-exceptions flag in selectively. Add back HAVE_DECL_MADVISE check so
970
AC_LANG_POP()
971
972
236.1.59 by Monty Taylor
Turn thr_rwlock.c into a conditionally built source file.
973
AM_CONDITIONAL(BUILD_THR_RWLOCK,[test "$ac_cv_func_rwlock_init" -a "$ac_cv_funn_pthread_rwlock_rdlock"])
974
28.1.33 by Monty Taylor
Added -Wall
975
1 by brian
clean slate
976
# Sanity check: We chould not have any fseeko symbol unless
977
# large_file_support=yes
978
AC_CHECK_FUNC(fseeko,
520.4.41 by mordred
Fixed configure.ac to work cleanly on Solaris - and define some good compile flags.
979
[if test "$large_file_support" = no -a "x$TARGET_LINUX" = "xtrue";
1 by brian
clean slate
980
then
981
  AC_MSG_ERROR("Found fseeko symbol but large_file_support is not enabled!")
982
fi]
983
)
984
985
# Check definition of pthread_getspecific
236.1.39 by Monty Taylor
autoconf warning cleanups.
986
AC_CACHE_CHECK([args to pthread_getspecific], [mysql_cv_getspecific_args],
632.1.11 by Monty Taylor
Fixed Sun Studio warnings in mysys.
987
  [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
988
#if !defined(_REENTRANT)
1 by brian
clean slate
989
#define _REENTRANT
990
#endif
632.1.11 by Monty Taylor
Fixed Sun Studio warnings in mysys.
991
#ifndef _POSIX_PTHREAD_SEMANTICS 
1 by brian
clean slate
992
#define _POSIX_PTHREAD_SEMANTICS 
632.1.11 by Monty Taylor
Fixed Sun Studio warnings in mysys.
993
#endif
28.1.33 by Monty Taylor
Added -Wall
994
#include <pthread.h> ]], [[ void *pthread_getspecific(pthread_key_t key);
236.1.39 by Monty Taylor
autoconf warning cleanups.
995
pthread_getspecific((pthread_key_t) NULL); ]])],
996
    [mysql_cv_getspecific_args=POSIX],
997
    [mysql_cv_getspecific_args=other])])
1 by brian
clean slate
998
  if test "$mysql_cv_getspecific_args" = "other"
999
  then
1000
    AC_DEFINE([HAVE_NONPOSIX_PTHREAD_GETSPECIFIC], [1],
1001
              [For some non posix threads])
1002
  fi
1003
1004
  # Check definition of pthread_mutex_init
236.1.39 by Monty Taylor
autoconf warning cleanups.
1005
  AC_CACHE_CHECK([args to pthread_mutex_init], [mysql_cv_mutex_init_args],
632.1.11 by Monty Taylor
Fixed Sun Studio warnings in mysys.
1006
    [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1007
#ifndef _REENTRANT
1008
#define _REENTRANT
1009
#endif
1010
#ifndef _POSIX_PTHREAD_SEMANTICS
1 by brian
clean slate
1011
#define _POSIX_PTHREAD_SEMANTICS 
632.1.11 by Monty Taylor
Fixed Sun Studio warnings in mysys.
1012
#endif
28.1.33 by Monty Taylor
Added -Wall
1013
#include <pthread.h> ]], [[ 
1 by brian
clean slate
1014
  pthread_mutexattr_t attr;
1015
  pthread_mutex_t mp;
236.1.39 by Monty Taylor
autoconf warning cleanups.
1016
  pthread_mutex_init(&mp,&attr); ]])],
1017
      [mysql_cv_mutex_init_args=POSIX],
1018
      [mysql_cv_mutex_init_args=other])])
1 by brian
clean slate
1019
  if test "$mysql_cv_mutex_init_args" = "other"
1020
  then
1021
    AC_DEFINE([HAVE_NONPOSIX_PTHREAD_MUTEX_INIT], [1],
1022
              [For some non posix threads])
1023
  fi
1024
#---END:
1025
1026
#---START: Used in for client configure
1027
# Check definition of readdir_r
236.1.39 by Monty Taylor
autoconf warning cleanups.
1028
AC_CACHE_CHECK([args to readdir_r], [mysql_cv_readdir_r],
632.1.11 by Monty Taylor
Fixed Sun Studio warnings in mysys.
1029
  [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1030
#ifndef _REENTRANT
1031
#define _REENTRANT
1032
#endif
1033
#ifndef _POSIX_PTHREAD_SEMANTICS 
1 by brian
clean slate
1034
#define _POSIX_PTHREAD_SEMANTICS 
632.1.11 by Monty Taylor
Fixed Sun Studio warnings in mysys.
1035
#endif
1 by brian
clean slate
1036
#include <pthread.h>
28.1.33 by Monty Taylor
Added -Wall
1037
#include <dirent.h>]], [[ int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result);
236.1.39 by Monty Taylor
autoconf warning cleanups.
1038
readdir_r((DIR *) NULL, (struct dirent *) NULL, (struct dirent **) NULL); ]])],
1039
    [mysql_cv_readdir_r=POSIX],
1040
    [mysql_cv_readdir_r=other])])
1 by brian
clean slate
1041
if test "$mysql_cv_readdir_r" = "POSIX"
1042
then
1043
  AC_DEFINE([HAVE_READDIR_R], [1], [POSIX readdir_r])
1044
fi
1045
1046
# Check definition of posix sigwait()
236.1.39 by Monty Taylor
autoconf warning cleanups.
1047
AC_CACHE_CHECK([style of sigwait], [mysql_cv_sigwait],
1048
  [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
632.1.11 by Monty Taylor
Fixed Sun Studio warnings in mysys.
1049
#ifndef _REENTRANT
236.1.39 by Monty Taylor
autoconf warning cleanups.
1050
#define _REENTRANT
632.1.11 by Monty Taylor
Fixed Sun Studio warnings in mysys.
1051
#endif
1052
#ifndef _POSIX_PTHREAD_SEMANTICS
1 by brian
clean slate
1053
#define _POSIX_PTHREAD_SEMANTICS 
632.1.11 by Monty Taylor
Fixed Sun Studio warnings in mysys.
1054
#endif
1 by brian
clean slate
1055
#include <pthread.h>
236.1.39 by Monty Taylor
autoconf warning cleanups.
1056
#include <signal.h>
1057
      ]], [[
1058
#ifndef _AIX
1 by brian
clean slate
1059
sigset_t set;
1060
int sig;
1061
sigwait(&set,&sig);
236.1.39 by Monty Taylor
autoconf warning cleanups.
1062
#endif
1063
      ]])],
1064
    [mysql_cv_sigwait=POSIX],
1065
    [mysql_cv_sigwait=other])])
1 by brian
clean slate
1066
if test "$mysql_cv_sigwait" = "POSIX"
1067
then
1068
  AC_DEFINE([HAVE_SIGWAIT], [1], [POSIX sigwait])
1069
fi
1070
1071
if test "$mysql_cv_sigwait" != "POSIX"
1072
then
1073
unset mysql_cv_sigwait
1074
# Check definition of posix sigwait()
236.1.39 by Monty Taylor
autoconf warning cleanups.
1075
AC_CACHE_CHECK([style of sigwait], [mysql_cv_sigwait],
1076
  [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
632.1.11 by Monty Taylor
Fixed Sun Studio warnings in mysys.
1077
#ifndef _REENTRANT
236.1.39 by Monty Taylor
autoconf warning cleanups.
1078
#define _REENTRANT
632.1.11 by Monty Taylor
Fixed Sun Studio warnings in mysys.
1079
#endif
1080
#ifndef _POSIX_PTHREAD_SEMANTICS
1 by brian
clean slate
1081
#define _POSIX_PTHREAD_SEMANTICS 
632.1.11 by Monty Taylor
Fixed Sun Studio warnings in mysys.
1082
#endif
1 by brian
clean slate
1083
#include <pthread.h>
236.1.39 by Monty Taylor
autoconf warning cleanups.
1084
#include <signal.h>
1085
      ]], [[
1086
sigset_t set;
1 by brian
clean slate
1087
int sig;
236.1.39 by Monty Taylor
autoconf warning cleanups.
1088
sigwait(&set);
1089
      ]])],
1090
    [mysql_cv_sigwait=NONPOSIX],
1091
    [mysql_cv_sigwait=other])])
1 by brian
clean slate
1092
if test "$mysql_cv_sigwait" = "NONPOSIX"
1093
then
1094
  AC_DEFINE([HAVE_NONPOSIX_SIGWAIT], [1], [sigwait with one argument])
1095
fi
1096
fi
1097
#---END:
1098
1099
# Check if pthread_attr_setscope() exists
236.1.39 by Monty Taylor
autoconf warning cleanups.
1100
AC_CACHE_CHECK([for pthread_attr_setscope], [mysql_cv_pthread_attr_setscope],
1101
  [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
632.1.11 by Monty Taylor
Fixed Sun Studio warnings in mysys.
1102
#ifndef _REENTRANT
236.1.39 by Monty Taylor
autoconf warning cleanups.
1103
#define _REENTRANT
632.1.11 by Monty Taylor
Fixed Sun Studio warnings in mysys.
1104
#endif
1105
#ifndef _POSIX_PTHREAD_SEMANTICS
1 by brian
clean slate
1106
#define _POSIX_PTHREAD_SEMANTICS 
632.1.11 by Monty Taylor
Fixed Sun Studio warnings in mysys.
1107
#endif
236.1.39 by Monty Taylor
autoconf warning cleanups.
1108
#include <pthread.h>
1109
      ]], [[
1110
pthread_attr_t thr_attr;
1111
pthread_attr_setscope(&thr_attr,0);
1112
      ]])],
1113
    [mysql_cv_pthread_attr_setscope=yes],
1114
    [mysql_cv_pthread_attr_setscope=no])])
1 by brian
clean slate
1115
if test "$mysql_cv_pthread_attr_setscope" = "yes"
1116
then
1117
  AC_DEFINE([HAVE_PTHREAD_ATTR_SETSCOPE], [1], [pthread_attr_setscope])
1118
fi
1119
28.1.33 by Monty Taylor
Added -Wall
1120
AC_LANG_PUSH([C++])
1 by brian
clean slate
1121
AC_CHECK_HEADERS(cxxabi.h)
1122
AC_CACHE_CHECK([checking for abi::__cxa_demangle], mysql_cv_cxa_demangle,
28.1.33 by Monty Taylor
Added -Wall
1123
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <cxxabi.h>]], [[
1 by brian
clean slate
1124
  char *foo= 0; int bar= 0;
1125
  foo= abi::__cxa_demangle(foo, foo, 0, &bar);
28.1.33 by Monty Taylor
Added -Wall
1126
]])],[mysql_cv_cxa_demangle=yes],[mysql_cv_cxa_demangle=no])])
1127
AC_LANG_POP([])
1 by brian
clean slate
1128
1129
if test "x$mysql_cv_cxa_demangle" = xyes; then
1130
  AC_DEFINE(HAVE_ABI_CXA_DEMANGLE, 1,
1131
            [Define to 1 if you have the `abi::__cxa_demangle' function.])
1132
fi
1133
1134
#--------------------------------------------------------------------
1135
# Check for requested features
1136
#--------------------------------------------------------------------
1137
319.1.1 by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_
1138
DRIZZLE_CHECK_MAX_INDEXES
1 by brian
clean slate
1139
1140
#--------------------------------------------------------------------
1141
# Declare our plugin modules
1142
# Has to be done late, as the plugin may need to check for existence of
1143
# functions tested above
1144
#--------------------------------------------------------------------
1145
319.1.1 by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_
1146
DRIZZLE_CONFIGURE_PLUGINS([none])
1 by brian
clean slate
1147
1148
AC_SUBST(mysql_plugin_dirs)
1149
AC_SUBST(mysql_plugin_libs)
1150
AC_SUBST(mysql_plugin_defs)
722.2.7 by Monty Taylor
Fixed the stupid build problem
1151
AC_SUBST(DRIZZLED_PLUGIN_DEP_LIBS)
1 by brian
clean slate
1152
435.1.1 by Monty Taylor
Fixed -O3 optimization for gcc.
1153
189 by Brian Aker
Refactor of configure.ac. Added profile. One note... I believe this should
1154
AC_ARG_ENABLE([profiling],
1155
    [AS_HELP_STRING([--enable-profiling],
1156
       [Toggle profiling @<:@default=off@:>@])],
1157
    [ac_profiling="$enableval"],
1158
    [ac_profiling="no"])
1159
1160
AC_ARG_ENABLE([coverage],
1161
    [AS_HELP_STRING([--enable-coverage],
1162
       [Toggle coverage @<:@default=off@:>@])],
1163
    [ac_coverage="$enableval"],
1164
    [ac_coverage="no"])
1165
53.2.1 by Monty Taylor
Added --disable-pedantic-warnings and --enable-fail.
1166
AC_ARG_ENABLE([pedantic-warnings],
1167
    [AS_HELP_STRING([--disable-pedantic-warnings],
1168
       [Toggle pedanticness @<:@default=on@:>@])],
1169
    [ac_warn_pedantic="$enableval"],
1170
    [ac_warn_pedantic="yes"])
1171
1172
AC_ARG_ENABLE([fail],
77.1.112 by Monty Taylor
Fixed comment on --enable-fail -> --disable-fail.
1173
    [AS_HELP_STRING([--disable-fail],
1174
       [Turn warnings into failures @<:@default=on@:>@])],
53.2.1 by Monty Taylor
Added --disable-pedantic-warnings and --enable-fail.
1175
    [ac_warn_fail="$enableval"],
77.1.108 by Monty Taylor
Turn on -Werror again by default.
1176
    [ac_warn_fail="yes"])
53.2.1 by Monty Taylor
Added --disable-pedantic-warnings and --enable-fail.
1177
53.2.6 by Monty Taylor
Turned unreachable code warnings into a configure option.
1178
AC_ARG_ENABLE([unreachable],
1179
    [AS_HELP_STRING([--enable-unreachable],
1180
       [Enable warnings about unreachable code @<:@default=off@:>@])],
1181
    [ac_warn_unreachable="$enableval"],
1182
    [ac_warn_unreachable="no"])
1183
77.1.109 by Monty Taylor
Made --disable-pedantic-warnings only disable the pedantic warnings, rather than also removing the -std=gnu99 part.
1184
AC_ARG_ENABLE([longlong-warnings],
1185
    [AS_HELP_STRING([--enable-longlong-warnings],
1186
       [Enable warnings about longlong in C++ @<:@default=off@:>@])],
1187
    [ac_warn_longlong="$enableval"],
421 by Monty
Made including stdint.h work.
1188
    [ac_warn_longlong="no"])
77.1.109 by Monty Taylor
Made --disable-pedantic-warnings only disable the pedantic warnings, rather than also removing the -std=gnu99 part.
1189
1190
AC_ARG_ENABLE([strict-aliasing],
919.2.15 by Monty Taylor
Enabled -Wstrict-aliasing by default.
1191
    [AS_HELP_STRING([--disable-strict-aliasing],
1192
       [Enable warnings about stict-aliasing @<:@default=on@:>@])],
77.1.109 by Monty Taylor
Made --disable-pedantic-warnings only disable the pedantic warnings, rather than also removing the -std=gnu99 part.
1193
    [ac_warn_strict_aliasing="$enableval"],
919.2.15 by Monty Taylor
Enabled -Wstrict-aliasing by default.
1194
    [ac_warn_strict_aliasing="yes"])
77.1.109 by Monty Taylor
Made --disable-pedantic-warnings only disable the pedantic warnings, rather than also removing the -std=gnu99 part.
1195
509.2.1 by Monty Taylor
Added some more warning options to configure.
1196
AC_ARG_ENABLE([cast-warnings],
1197
    [AS_HELP_STRING([--enable-cast-warnings],
1198
       [Enable warnings about use of old C-style casts @<:@default=off@:>@])],
1199
    [ac_warn_cast="$enableval"],
1200
    [ac_warn_cast="no"])
1201
1202
AC_ARG_ENABLE([effective-style],
1203
    [AS_HELP_STRING([--enable-effective-style],
1204
       [Enable warnings violating Effective C++ Style Guidelines @<:@default=off@:>@])],
1205
    [ac_warn_effc="$enableval"],
1206
    [ac_warn_effc="no"])
1207
779.3.10 by Monty Taylor
Turned on -Wshadow.
1208
AC_ARG_ENABLE([shadow],
1209
    [AS_HELP_STRING([--disable-shadow],
1210
       [Disables warnings about scope shadowing @<:@default=on@:>@])],
1211
    [ac_warn_shadow="$enableval"],
1212
    [ac_warn_shadow="yes"])
1213
892.1.7 by Monty Taylor
Added two more C++ warnings. We pass them now. Oh, look. We had an empty class.
1214
AC_ARG_ENABLE([conversion],
1215
    [AS_HELP_STRING([--enable-conversion],
1216
       [Enables conversion warnings @<:@default=off@:>@])],
1217
    [ac_warn_conversion="$enableval"],
1218
    [ac_warn_conversion="no"])
509.2.2 by Monty Taylor
Added one more set of possible warnings.
1219
713.1.8 by Monty Taylor
Moved a little code...
1220
AC_ARG_ENABLE([datarace],
1221
    [AS_HELP_STRING([--enable-datarace],
1222
       [Enables Sun Studio data race detection @<:@default=off@:>@])],
1223
    [ac_datarace="$enableval"],
1224
    [ac_datarace="no"])
53.2.2 by Monty Taylor
Updated everything that needs updating to compile with -std=gnu99 -pedantic
1225
779.1.16 by Monty Taylor
Turned on exceptions, but made it configurable.
1226
AC_ARG_ENABLE([exceptions],
1227
    [AS_HELP_STRING([--disable-exceptions],
1228
        [Disables use of Exceptions in the build @<:@default=on@:>@])],
1229
    [ac_exceptions="$enableval"],
873.2.42 by Monty Taylor
Ooops. This was a bad idea.
1230
    [ac_exceptions="yes"])
713.1.7 by Monty Taylor
Added support for thread data tracing to the build for Sun Studio.
1231
53.2.1 by Monty Taylor
Added --disable-pedantic-warnings and --enable-fail.
1232
if test "$GCC" = "yes"
1233
then
53.2.2 by Monty Taylor
Updated everything that needs updating to compile with -std=gnu99 -pedantic
1234
558 by Monty Taylor
Added autoconf test to turn off -Wredundant-decls if it doesn't work right.
1235
  if test "$ac_warn_fail" = "yes"
1236
  then
1237
    W_FAIL="-Werror"
1238
  fi
722.1.4 by Monty Taylor
Removed all the setting of DEFS everywhere. Use configmake.h to get the values
1239
  BASE_WARNINGS="-Wall -Wextra ${W_FAIL}"
558 by Monty Taylor
Added autoconf test to turn off -Wredundant-decls if it doesn't work right.
1240
77.1.109 by Monty Taylor
Made --disable-pedantic-warnings only disable the pedantic warnings, rather than also removing the -std=gnu99 part.
1241
  if test "$ac_warn_longlong" = "yes"
1242
  then
1243
    W_LONGLONG="-Wlong-long"
1244
  else
1245
    W_LONGLONG="-Wno-long-long"
1246
  fi
53.2.1 by Monty Taylor
Added --disable-pedantic-warnings and --enable-fail.
1247
77.1.109 by Monty Taylor
Made --disable-pedantic-warnings only disable the pedantic warnings, rather than also removing the -std=gnu99 part.
1248
  if test "$ac_warn_strict_aliasing" = "yes"
1249
  then
1250
    W_STRICT_ALIASING="-Wstrict-aliasing"
1251
  else
509.2.3 by Monty Taylor
Re-worked strict-aliasing again.
1252
    W_STRICT_ALIASING="-Wno-strict-aliasing"
77.1.109 by Monty Taylor
Made --disable-pedantic-warnings only disable the pedantic warnings, rather than also removing the -std=gnu99 part.
1253
  fi
53.2.1 by Monty Taylor
Added --disable-pedantic-warnings and --enable-fail.
1254
779.3.10 by Monty Taylor
Turned on -Wshadow.
1255
  if test "$ac_warn_shadow" = "yes"
1256
  then
1257
    W_SHADOW="-Wshadow"
1258
    NO_SHADOW="-Wno-shadow"
1259
  else
1260
    W_SHADOW="-Wno-shadow"
1261
    NO_SHADOW=""
1262
  fi
1263
189 by Brian Aker
Refactor of configure.ac. Added profile. One note... I believe this should
1264
  if test "$ac_profiling" = "yes"
1265
  then
1266
    GPROF_PROFILING="-pg"
873.2.37 by Monty Taylor
Added support for profiling version of libc.
1267
    save_LIBS="${LIBS}"
1268
    LIBS=""
1269
    AC_CHECK_LIB(c_p, read)
1270
    LIBC_P="${LIBS}"
1271
    LIBS="${save_LIBS}"
189 by Brian Aker
Refactor of configure.ac. Added profile. One note... I believe this should
1272
  else
1273
    GPROF_PROFILING=" "
1274
  fi
1275
1276
  if test "$ac_coverage" = "yes"
1277
  then
1278
    GPROF_COVERAGE="-fprofile-arcs -ftest-coverage"
1279
  else
1280
    GPROF_COVERAGE=" "
1281
  fi
1282
53.2.1 by Monty Taylor
Added --disable-pedantic-warnings and --enable-fail.
1283
  if test "$ac_warn_pedantic" = "yes"
1284
  then
520.4.36 by Monty Taylor
Added autoconf check for usability of __attribute__((visibility("hidden"))).
1285
    AC_CACHE_CHECK([whether it is safe to use -Wredundant-decls],
1286
      [ac_cv_safe_to_use_Wredundant_decls_],
1287
      [AC_LANG_PUSH(C++)
919.2.18 by Monty Taylor
Restructured CFLAGS processing to always keep user-supplied options last on the command line, so they take precedence.
1288
       save_CXXFLAGS="${CXXFLAGS}"
1289
       CXXFLAGS="${CXXFLAGS} ${W_FAIL} -Wredundant-decls"
520.4.36 by Monty Taylor
Added autoconf check for usability of __attribute__((visibility("hidden"))).
1290
       AC_COMPILE_IFELSE(
1291
         [AC_LANG_PROGRAM([
558 by Monty Taylor
Added autoconf test to turn off -Wredundant-decls if it doesn't work right.
1292
template <typename E> struct C { void foo(); };
1293
template <typename E> void C<E>::foo() { }
1294
template <> void C<int>::foo();
520.4.36 by Monty Taylor
Added autoconf check for usability of __attribute__((visibility("hidden"))).
1295
            AC_INCLUDES_DEFAULT])],
1296
          [ac_cv_safe_to_use_Wredundant_decls_=yes],
1297
          [ac_cv_safe_to_use_Wredundant_decls_=no])
919.2.18 by Monty Taylor
Restructured CFLAGS processing to always keep user-supplied options last on the command line, so they take precedence.
1298
        CXXFLAGS="${save_CXXFLAGS}"
520.4.36 by Monty Taylor
Added autoconf check for usability of __attribute__((visibility("hidden"))).
1299
        AC_LANG_POP()])
559.1.1 by Kristian Nielsen
Fix a few problems with the -Wredundant-decls configure check.
1300
    if test $ac_cv_safe_to_use_Wredundant_decls_ = yes
558 by Monty Taylor
Added autoconf test to turn off -Wredundant-decls if it doesn't work right.
1301
    then
559.1.1 by Kristian Nielsen
Fix a few problems with the -Wredundant-decls configure check.
1302
      GXX_W_REDUNDANT_DECLS="-Wredundant-decls"
558 by Monty Taylor
Added autoconf test to turn off -Wredundant-decls if it doesn't work right.
1303
    else
559.1.1 by Kristian Nielsen
Fix a few problems with the -Wredundant-decls configure check.
1304
      GXX_W_REDUNDANT_DECLS="-Wno-redundant-decls"
558 by Monty Taylor
Added autoconf test to turn off -Wredundant-decls if it doesn't work right.
1305
    fi
520.4.36 by Monty Taylor
Added autoconf check for usability of __attribute__((visibility("hidden"))).
1306
    
559.1.1 by Kristian Nielsen
Fix a few problems with the -Wredundant-decls configure check.
1307
    GCC_PEDANTIC="-pedantic -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls ${W_STRICT_ALIASING}"
892.1.7 by Monty Taylor
Added two more C++ warnings. We pass them now. Oh, look. We had an empty class.
1308
    GXX_PEDANTIC="-pedantic -Wundef -Woverloaded-virtual  -Wnon-virtual-dtor -Wctor-dtor-privacy ${GXX_W_REDUNDANT_DECLS} ${W_LONGLONG} ${W_STRICT_ALIASING}"
520.4.36 by Monty Taylor
Added autoconf check for usability of __attribute__((visibility("hidden"))).
1309
1310
    AC_CACHE_CHECK([whether __attribute__ visibility "hidden" is supported],
1311
      [ac_cv_can_use_hidden_],
1312
      [AC_LANG_PUSH(C++)
1313
       AC_COMPILE_IFELSE(
1314
         [AC_LANG_PROGRAM([
1315
          AC_INCLUDES_DEFAULT
1316
__attribute__((visibility ("hidden")))
1317
void testme() {  };],[
1318
     testme();])],  
1319
         [ac_cv_can_use_hidden_=yes],
1320
         [ac_cv_can_use_hidden_=no])
1321
       AC_LANG_POP()])
1322
    if test "$ac_cv_can_use_hidden_" = "yes"
1323
    then
1324
      AC_DEFINE(HAVE_ATTR_HIDDEN, 1,
1325
                [Define to 1 if you have support for __attribute__((visibility("hidden")))])
1326
    fi
53.2.1 by Monty Taylor
Added --disable-pedantic-warnings and --enable-fail.
1327
  fi
1328
53.2.6 by Monty Taylor
Turned unreachable code warnings into a configure option.
1329
  if test "$ac_warn_unreachable" = "yes"
1330
  then
77.1.109 by Monty Taylor
Made --disable-pedantic-warnings only disable the pedantic warnings, rather than also removing the -std=gnu99 part.
1331
    W_UNREACHABLE="-Wunreachable-code"
53.2.6 by Monty Taylor
Turned unreachable code warnings into a configure option.
1332
  fi
892.1.6 by Monty Taylor
Added overloaded-virtual to the list of standard warnings. We are now clean with
1333
509.2.1 by Monty Taylor
Added some more warning options to configure.
1334
  if test "$ac_warn_cast" = "yes"
1335
  then
1336
    W_CAST="-Wold-style-cast"
1337
  fi
1338
1339
  if test "$ac_warn_effc" = "yes"
1340
  then
1341
    W_EFFC="-Weffc++"
1342
  fi
1343
892.1.7 by Monty Taylor
Added two more C++ warnings. We pass them now. Oh, look. We had an empty class.
1344
  if test "$ac_warn_conversion" = "yes"
509.2.2 by Monty Taylor
Added one more set of possible warnings.
1345
  then
892.1.7 by Monty Taylor
Added two more C++ warnings. We pass them now. Oh, look. We had an empty class.
1346
    W_CONVERSION="-Wconversion"
509.2.2 by Monty Taylor
Added one more set of possible warnings.
1347
  fi
1348
919.2.18 by Monty Taylor
Restructured CFLAGS processing to always keep user-supplied options last on the command line, so they take precedence.
1349
  CC_WARNINGS="${BASE_WARNINGS} ${GCC_PEDANTIC} ${W_UNREACHABLE} ${GPROF_PROFILING} ${GPROF_COVERAGE} ${W_SHADOW} ${W_CONVERSION}"
892.1.7 by Monty Taylor
Added two more C++ warnings. We pass them now. Oh, look. We had an empty class.
1350
  CXX_WARNINGS="${BASE_WARNINGS} ${GXX_PEDANTIC} ${W_UNREACHABLE} ${GPROF_PROFILING} ${GPROF_COVERAGE} ${W_CAST} ${W_SHADOW} ${W_EFFC} ${W_CONVERSION}"
77.1.109 by Monty Taylor
Made --disable-pedantic-warnings only disable the pedantic warnings, rather than also removing the -std=gnu99 part.
1351
779.1.16 by Monty Taylor
Turned on exceptions, but made it configurable.
1352
  if test "$ac_exceptions" = "no"
1353
  then
1354
    NO_EXCEPTIONS="-fno-exceptions"
1355
    W_EXCEPTIONS="-fexceptions"
1356
  fi
520.4.44 by mordred
A whole bunch of solaris/sun studio compile fixes.
1357
  NO_REDUNDANT_DECLS="-Wno-redundant-decls"
919.2.15 by Monty Taylor
Enabled -Wstrict-aliasing by default.
1358
  PROTOSKIP_WARNINGS="-Wno-effc++"
53.2.1 by Monty Taylor
Added --disable-pedantic-warnings and --enable-fail.
1359
fi
520.4.37 by Monty Taylor
Added some Sun compile flags.
1360
if test "$SUNCC" = "yes"
1361
then
713.1.7 by Monty Taylor
Added support for thread data tracing to the build for Sun Studio.
1362
  if test "$ac_datarace" = "yes"
1363
  then
919.2.18 by Monty Taylor
Restructured CFLAGS processing to always keep user-supplied options last on the command line, so they take precedence.
1364
    CFLAGS="-xinstrument=datarace ${CFLAGS}"
1365
    CXXFLAGS="-xinstrument=datarace ${CXXFLAGS}"
713.1.7 by Monty Taylor
Added support for thread data tracing to the build for Sun Studio.
1366
  fi
898.1.1 by Monty Taylor
Fix to make --disable-fail function on Solaris.
1367
1368
  if test "$ac_warn_fail" = "yes"
1369
  then
1370
    W_FAIL="-errwarn=%all"
1371
  fi
1372
907.3.2 by Monty Taylor
Added tests for 64-bit solaris. Look in /usr/lib/amd64 and /usr/local/lib/amd64 if we are 64-bit.
1373
  CC_WARNINGS="-v -errtags=yes -erroff=E_ATTRIBUTE_NOT_VAR ${W_FAIL}"
907.3.5 by Monty Taylor
Fixed new 64-bit caused solaris warnings.
1374
  CXX_WARNINGS="+w +w2 -xport64 -errtags=yes -erroff=attrskipunsup,doubunder,reftotemp,inllargeuse,truncwarn1,signextwarn ${W_FAIL}" 
919.2.7 by Monty Taylor
Added back PROTOSKIP_WARNINGS - we still need it on Solaris. But it's empty now for GCC.
1375
  PROTOSKIP_WARNINGS="-erroff=attrskipunsup,doubunder,reftotemp,wbadinitl,identexpected,inllargeuse,truncwarn1,signextwarn"
779.3.18 by Monty Taylor
Cleaned up warnings up through innodb.
1376
  NO_UNREACHED="-erroff=E_STATEMENT_NOT_REACHED"
779.1.16 by Monty Taylor
Turned on exceptions, but made it configurable.
1377
  if test "$ac_exceptions" = "no"
1378
  then
1379
    NO_EXCEPTIONS="-features=no%except"
1380
    W_EXCEPTIONS="-features=except"
1381
  fi
520.4.37 by Monty Taylor
Added some Sun compile flags.
1382
fi
520.4.44 by mordred
A whole bunch of solaris/sun studio compile fixes.
1383
AC_SUBST(NO_EXCEPTIONS)
1384
AC_SUBST(W_EXCEPTIONS)
779.3.10 by Monty Taylor
Turned on -Wshadow.
1385
AC_SUBST(NO_SHADOW)
1386
AC_SUBST(W_SHADOW)
520.4.44 by mordred
A whole bunch of solaris/sun studio compile fixes.
1387
AC_SUBST(NO_REDUNDANT_DECLS)
919.2.7 by Monty Taylor
Added back PROTOSKIP_WARNINGS - we still need it on Solaris. But it's empty now for GCC.
1388
AC_SUBST(PROTOSKIP_WARNINGS)
779.3.18 by Monty Taylor
Cleaned up warnings up through innodb.
1389
AC_SUBST(NO_UNREACHED)
53.2.1 by Monty Taylor
Added --disable-pedantic-warnings and --enable-fail.
1390
815.1.4 by Monty Taylor
Added check for getopt.
1391
if test "$ac_cv_func_timegm" = "no" -o "$gl_cv_func_gnu_getopt" = "no"
815.1.2 by Monty Taylor
Added -Ignulib to the includes if it's needed.
1392
then
908.1.12 by Monty Taylor
mmm.
1393
  CPPFLAGS="-I\$(top_srcdir)/gnulib -I\$(top_builddir)/gnulib ${CPPFLAGS}"
815.1.2 by Monty Taylor
Added -Ignulib to the includes if it's needed.
1394
fi
908.1.12 by Monty Taylor
mmm.
1395
CPPFLAGS="-I\$(top_srcdir) -I\$(top_builddir) ${CPPFLAGS}"
907.3.3 by Monty Taylor
A whole crapload of build fixes. OpenSolaris AMD64 builds with -m64 now by default... still isn't warning clean yet though. Also cleaned up the AM_*FLAGS situation.
1396
1397
AM_CPPFLAGS="${CPPFLAGS}"
1398
AM_CFLAGS="${CC_WARNINGS} ${CFLAGS}"
919.2.6 by Monty Taylor
Removed some checks on ancient GNUC versions. Removed -fno-exceptions.
1399
AM_CXXFLAGS="${CXX_WARNINGS} ${W_EXCEPTIONS} ${CXXFLAGS}"
907.3.3 by Monty Taylor
A whole crapload of build fixes. OpenSolaris AMD64 builds with -m64 now by default... still isn't warning clean yet though. Also cleaned up the AM_*FLAGS situation.
1400
1401
AC_SUBST([AM_CPPFLAGS])
287.3.26 by Monty Taylor
Put warnings into AM_C*FLAGS so they can be overridden per lib.
1402
AC_SUBST([AM_CFLAGS])
1403
AC_SUBST([AM_CXXFLAGS])
202.1.23 by Monty Taylor
Moved the includes we use everywhere to to GLOBAL_CPPFLAGS and added AM_CPPFLAGS to an AC_SUBST, so that we could take out the redundant declaration from most fof the Makefiles.
1404
907.3.3 by Monty Taylor
A whole crapload of build fixes. OpenSolaris AMD64 builds with -m64 now by default... still isn't warning clean yet though. Also cleaned up the AM_*FLAGS situation.
1405
dnl We've collected the flags in AM_*FLAGS now, so blank these.
1406
CFLAGS=""
1407
CXXFLAGS=""
1408
CPPFLAGS=""
1 by brian
clean slate
1409
722.1.4 by Monty Taylor
Removed all the setting of DEFS everywhere. Use configmake.h to get the values
1410
AC_SUBST(pkgplugindir,"\$(pkglibdir)/plugin")
1411
492.1.7 by Monty Taylor
Moved test() to its own file.
1412
dnl GCC Precompiled Header Support
584.4.3 by Monty Taylor
Disabled pre-compiled headers for now.
1413
dnl re-enable later
632.1.25 by Monty Taylor
Removed AM_CONDITIONAL from SEARCH_FOR_LIB. Aligned naming of AM_CONDITIONALS.
1414
dnl AM_CONDITIONAL([BUILD_GCC_PCH],[test "$GCC" = "yes"])
1415
AM_CONDITIONAL([BUILD_GCC_PCH],[test "no" = "yes"])
492.1.7 by Monty Taylor
Moved test() to its own file.
1416
287.3.1 by Monty Taylor
Removed mysys/tests.
1417
AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl
815.1.1 by Monty Taylor
Add timegm which is missing on Solaris.
1418
 gnulib/Makefile dnl
264.1.15 by Monty Taylor
Removed a bunch of files from mystrings that aren't build or used at all.
1419
 mystrings/Makefile storage/Makefile dnl
575.2.2 by Monty Taylor
Moved vio stuff into libdrizzle.
1420
 po/Makefile.in dnl
779.3.37 by Monty Taylor
Renmaed libdrizzle in the tree to libdrizzleclient to avoid namespace clashes
1421
 libdrizzleclient/Makefile client/Makefile dnl
214 by Brian Aker
Rename of fields (fix issue with string and decimal .h clashing).
1422
 drizzled/Makefile dnl
316 by Brian Aker
First pass of new sql_db.cc work
1423
 drizzled/serialize/Makefile dnl
214 by Brian Aker
Rename of fields (fix issue with string and decimal .h clashing).
1424
 drizzled/sql_builtin.cc dnl
28.1.31 by Monty Taylor
Deleted tons of pointless garbage from scripts.
1425
 support-files/Makefile dnl
77.1.47 by Monty Taylor
Moved test to tests...
1426
 tests/Makefile tests/install_test_db dnl
546 by Monty Taylor
Cleaned up version.h. (And by cleaned, I mean removed)
1427
 plugin/Makefile dnl
779.3.37 by Monty Taylor
Renmaed libdrizzle in the tree to libdrizzleclient to avoid namespace clashes
1428
 drizzled/drizzled_safe support-files/libdrizzleclient.pc dnl
77.1.38 by Monty Taylor
Renamed more stuff to drizzle.
1429
 support-files/drizzle.server support-files/drizzle-log-rotate)
1 by brian
clean slate
1430
512.2.2 by C.J. Adams-Collier
added checks to determine which threading plugins have been enabled on
1431
scheduling_plugins_available="
1432
  pool_of_threads 
1433
  single_thread
1434
"
1435
1436
for sched_plugin in $scheduling_plugins_available
1437
do
1438
  varname="\${with_plugin_${sched_plugin}}"
1439
  result=`eval "echo $varname"`
1440
  if test "x$result" = "xyes"
1441
  then
1442
    scheduling_plugins="$sched_plugin $scheduling_plugins"
1443
  fi
1444
done
1445
824.1.1 by Monty Taylor
Added code to automatically build a new list of POTFILES.in, then updated the translations.
1446
AC_CONFIG_COMMANDS([timestamp-h], , test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h)
1447
917.1.4 by Monty Taylor
Fixed POTFILES.in generation.
1448
AC_CONFIG_COMMANDS_PRE([
824.1.1 by Monty Taylor
Added code to automatically build a new list of POTFILES.in, then updated the translations.
1449
if test "x$EGREP" != "x"
1450
then
1451
  echo "# This file is auto-generated from configure. Do not edit directly" > po/POTFILES.in.in
779.3.51 by Monty Taylor
Some cleanup. Don't add things from distcheck leftovers to POTFILES
1452
  # The grep -v 'drizzle-' is to exclude any distcheck leftovers
1453
  for f in `find . | grep -v 'drizzle-' | ${EGREP} '\.(cc|c|h|yy)$' | cut -c3- | sort`
824.1.1 by Monty Taylor
Added code to automatically build a new list of POTFILES.in, then updated the translations.
1454
  do
1455
    if grep gettext.h "$f" | grep include >/dev/null 2>&1
1456
    then
1457
      echo "$f" >> po/POTFILES.in.in
1458
    fi
1459
  done
1460
  if ! diff po/POTFILES.in.in po/POTFILES.in >/dev/null 2>&1
1461
  then
1462
    mv po/POTFILES.in.in po/POTFILES.in
1463
  else
1464
    rm po/POTFILES.in.in
1465
  fi
917.1.4 by Monty Taylor
Fixed POTFILES.in generation.
1466
else
1467
  touch po/POTFILES.in
824.1.1 by Monty Taylor
Added code to automatically build a new list of POTFILES.in, then updated the translations.
1468
fi
1469
])
1 by brian
clean slate
1470
1471
# Ensure that table handlers gets all modifications to CFLAGS/CXXFLAGS
287.3.28 by Monty Taylor
Expanded the move to AM_CFLAGS and AM_CXXFLAGS. Now we should be more correct.
1472
AC_CONFIG_COMMANDS_POST(ac_configure_args="$ac_configure_args CFLAGS='$CFLAGS' CXXFLAGS='$CXXFLAGS' AM_CFLAGS='$AM_CFLAGS' AM_CXXFLAGS='$AM_CXXFLAGS'")
1 by brian
clean slate
1473
1474
AC_OUTPUT
489.2.1 by C.J. Adams-Collier
2008-10-07T1437 C.J. Adams-Collier <cjac@colliertech.org>
1475
1476
echo "---"
1477
echo "Configuration summary for $PACKAGE_NAME version $VERSION"
1478
echo ""
1479
echo "   * Installation prefix:       $prefix"
1480
echo "   * System type:               $SYSTEM_TYPE"
492.2.1 by C.J. Adams-Collier
* fixed --disable-assert code (thanks Monty)
1481
echo "   * Host CPU:                  $host_cpu"
489.2.1 by C.J. Adams-Collier
2008-10-07T1437 C.J. Adams-Collier <cjac@colliertech.org>
1482
echo "   * C Compiler:                $CC_VERSION"
632.1.21 by Monty Taylor
Cleaned up compiler version checking.
1483
echo "   * C++ Compiler:              $CXX_VERSION"
492.2.1 by C.J. Adams-Collier
* fixed --disable-assert code (thanks Monty)
1484
echo "   * Build auth_pam:            $ac_cv_header_security_pam_appl_h"
1485
echo "   * Assertions enabled:        $ac_cv_assert"
489.2.1 by C.J. Adams-Collier
2008-10-07T1437 C.J. Adams-Collier <cjac@colliertech.org>
1486
echo "   * Debug enabled:             $with_debug"
1487
echo "   * Profiling enabled:         $ac_profiling"
1488
echo "   * Coverage enabled:          $ac_coverage"
1489
echo "   * Warnings as failure:       $ac_warn_fail"
512.2.2 by C.J. Adams-Collier
added checks to determine which threading plugins have been enabled on
1490
echo "   * Scheduling Plugins:        $scheduling_plugins"
492.2.1 by C.J. Adams-Collier
* fixed --disable-assert code (thanks Monty)
1491
echo "   * C++ cstdint location:      $ac_cv_cxx_cstdint"
1492
echo "   * C++ hash_map location:     $ac_cv_cxx_hash_map"
1493
echo "   * C++ hash namespace:        $ac_cv_cxx_hash_namespace"
919.2.19 by Monty Taylor
Added check for shared_ptr in advance of actually thinking about using it. I think this should cover all platforms we care about... but let's doublecheck.
1494
echo "   * C++ shared_ptr namespace:  $ac_cv_shared_ptr_namespace"
489.2.1 by C.J. Adams-Collier
2008-10-07T1437 C.J. Adams-Collier <cjac@colliertech.org>
1495
echo ""
1496
echo "---"
908.1.4 by Monty Taylor
Fix to fake-out libtoolize, since AC_INIT is in bzr_version.m4 now.
1497
1498
dnl libtoolize scans configure.ac  and needs to see some text
1499
m4_define([LIBTOOLIZE_AC_INIT], [])