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