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