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