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