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