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