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