~drizzle-trunk/drizzle/development

1 by brian
clean slate
1
dnl -*- ksh -*-
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
28.1.33 by Monty Taylor
Added -Wall
6
AC_INIT
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])
28.1.33 by Monty Taylor
Added -Wall
10
AC_CANONICAL_TARGET
91 by Brian Aker
Main binary now named drizzled
11
AM_INIT_AUTOMAKE(drizzle, 7.0.0, no-define)
1 by brian
clean slate
12
13
PROTOCOL_VERSION=10
14
DOT_FRM_VERSION=6
15
# See the libtool docs for information on how to do shared lib versions.
16
SHARED_LIB_MAJOR_VERSION=16
17
SHARED_LIB_VERSION=$SHARED_LIB_MAJOR_VERSION:0:0
18
19
20
21
# Set all version vars based on $VERSION. How do we do this more elegant ?
22
# Remember that regexps needs to quote [ and ] since this is run through m4
23
# We take some made up examples
24
#
25
#  VERSION                  5.1.40sp1-alpha     5.0.34a
26
#  MYSQL_NO_DASH_VERSION    5.1.40sp1           5.0.34a
27
#  MYSQL_NUMERIC_VERSION    5.1.40              5.0.34
28
#  MYSQL_BASE_VERSION       5.1                 5.0
29
#  MYSQL_VERSION_ID         50140               50034
30
#
31
MYSQL_NO_DASH_VERSION=`echo $VERSION | sed -e "s|-.*$||"`
32
MYSQL_NUMERIC_VERSION=`echo $MYSQL_NO_DASH_VERSION | sed -e "s|[[a-z]][[a-z0-9]]*$||"`
33
MYSQL_BASE_VERSION=`echo $MYSQL_NUMERIC_VERSION | sed -e "s|\.[[^.]]*$||"`
34
MYSQL_VERSION_ID=`echo $MYSQL_NUMERIC_VERSION | \
35
    awk -F. '{printf "%d%0.2d%0.2d", $1, $2, $3}'`
36
37
# The port should be constant for a LONG time
165.1.1 by Elliot Murphy
new port number from IANA
38
MYSQL_TCP_PORT_DEFAULT=4427
1 by brian
clean slate
39
40
dnl Include m4 
41
sinclude(config/ac-macros/alloca.m4)
42
sinclude(config/ac-macros/check_cpu.m4)
43
sinclude(config/ac-macros/character_sets.m4)
44
sinclude(config/ac-macros/compiler_flag.m4)
45
sinclude(config/ac-macros/dtrace.m4)
46
sinclude(config/ac-macros/plugins.m4)
47
sinclude(config/ac-macros/large_file.m4)
48
sinclude(config/ac-macros/misc.m4)
49
sinclude(config/ac-macros/readline.m4)
50
sinclude(config/ac-macros/ssl.m4)
77.1.73 by Monty Taylor
Added sinclude of pkg.m4
51
sinclude(config/ac-macros/pkg.m4)
236.1.10 by Monty Taylor
Changed C++ check to actually check for CXX98 instead (since the plain C++ check can't be trusted)
52
sinclude(config/ac-macros/ac_cxx_header_stdcxx_98.m4)
1 by brian
clean slate
53
214 by Brian Aker
Rename of fields (fix issue with string and decimal .h clashing).
54
# Remember to add a directory drizzled/share/LANGUAGE
1 by brian
clean slate
55
AVAILABLE_LANGUAGES="\
56
czech danish dutch english estonian french german greek hungarian \
57
italian japanese korean norwegian norwegian-ny polish portuguese \
58
romanian russian serbian slovak spanish swedish ukrainian"
59
60
#####
61
#####
62
63
AC_SUBST(MYSQL_NO_DASH_VERSION)
64
AC_SUBST(MYSQL_BASE_VERSION)
65
AC_SUBST(MYSQL_VERSION_ID)
66
AC_SUBST(MYSQL_PREVIOUS_BASE_VERSION)
67
AC_SUBST(PROTOCOL_VERSION)
68
AC_DEFINE_UNQUOTED([PROTOCOL_VERSION], [$PROTOCOL_VERSION],
69
                   [mysql client protocol version])
70
AC_SUBST(DOT_FRM_VERSION)
71
AC_DEFINE_UNQUOTED([DOT_FRM_VERSION], [$DOT_FRM_VERSION],
72
                   [Version of .frm files])
73
AC_SUBST(SHARED_LIB_MAJOR_VERSION)
74
AC_SUBST(SHARED_LIB_VERSION)
75
AC_SUBST(AVAILABLE_LANGUAGES)
76
77
78
# Canonicalize the configuration name.
79
80
# Check whether --with-system-type or --without-system-type was given.
28.1.33 by Monty Taylor
Added -Wall
81
AC_ARG_WITH([system-type],
82
    [AS_HELP_STRING([--with-system-type],
83
       [Set the system type, like "sun-solaris10"])],
1 by brian
clean slate
84
    [SYSTEM_TYPE="$withval"],
85
    [SYSTEM_TYPE="$host_vendor-$host_os"])
28.1.33 by Monty Taylor
Added -Wall
86
AC_ARG_WITH([machine-type],
87
    [AS_HELP_STRING([--with-machine-type],
88
       [Set the machine type, like "powerpc"])],
1 by brian
clean slate
89
    [MACHINE_TYPE="$withval"],
90
    [MACHINE_TYPE="$host_cpu"])
91
AC_SUBST(SYSTEM_TYPE)
92
AC_DEFINE_UNQUOTED([SYSTEM_TYPE], ["$SYSTEM_TYPE"],
93
                   [Name of system, eg sun-solaris])
94
AC_SUBST(MACHINE_TYPE)
95
AC_DEFINE_UNQUOTED([MACHINE_TYPE], ["$MACHINE_TYPE"],
96
                   [Machine type name, eg sparc])
97
98
# Detect intel x86 like processor
99
BASE_MACHINE_TYPE=$MACHINE_TYPE
100
case $MACHINE_TYPE in
101
  i?86) BASE_MACHINE_TYPE=i386 ;;
102
esac
103
104
# Save some variables and the command line options for mysqlbug
105
SAVE_CC="$CC"
106
SAVE_CXX="$CXX"
107
SAVE_ASFLAGS="$ASFLAGS"
108
SAVE_CFLAGS="$CFLAGS"
109
SAVE_CXXFLAGS="$CXXFLAGS"
110
SAVE_LDFLAGS="$LDFLAGS"
111
SAVE_CXXLDFLAGS="$CXXLDFLAGS"
112
CONF_COMMAND="$0 $ac_configure_args"
113
AC_SUBST(CONF_COMMAND)
114
AC_SUBST(SAVE_CC)
115
AC_SUBST(SAVE_CXX)
116
AC_SUBST(SAVE_ASFLAGS)
117
AC_SUBST(SAVE_CFLAGS)
118
AC_SUBST(SAVE_CXXFLAGS)
119
AC_SUBST(SAVE_LDFLAGS)
120
AC_SUBST(SAVE_CXXLDFLAGS)
121
AC_SUBST(CXXLDFLAGS)
122
123
AM_SANITY_CHECK
124
# This is needed is SUBDIRS is set
125
AC_PROG_MAKE_SET
126
127
##############################################################################
128
# The below section needs to be done before AC_PROG_CC
129
##############################################################################
130
131
if test "x${CFLAGS-}" = x ; then
132
  cflags_is_set=no
133
else
134
  cflags_is_set=yes
135
fi
136
137
if test "x${CPPFLAGS-}" = x ; then
138
  cppflags_is_set=no
139
else
140
  cppflags_is_set=yes
141
fi
142
143
if test "x${LDFLAGS-}" = x ; then
144
  ldflags_is_set=no
145
else
146
  ldflags_is_set=yes
147
fi
148
149
################ End of section to be done before AC_PROG_CC #################
150
151
# The following hack should ensure that configure doesn't add optimizing
152
# or debugging flags to CFLAGS or CXXFLAGS
153
# C_EXTRA_FLAGS are flags that are automaticly added to both
154
# CFLAGS and CXXFLAGS
155
CFLAGS="$CFLAGS $C_EXTRA_FLAGS "
156
CXXFLAGS="$CXXFLAGS $C_EXTRA_FLAGS "
157
158
dnl Checks for programs.
159
AC_PROG_CC
236.1.2 by Monty Taylor
Changed the way we work around autoconf2.59
160
ifdef([AC_PROG_CC_C99],[
161
  AC_PROG_CC_C99([],[AC_MSG_ERROR([C99 support required for compiling Drizzle])])
162
  C99_SUPPORT_HACK=""
163
],[C99_SUPPORT_HACK="-std=gnu99"])
1 by brian
clean slate
164
AC_PROG_CXX
236.1.10 by Monty Taylor
Changed C++ check to actually check for CXX98 instead (since the plain C++ check can't be trusted)
165
AC_CXX_HEADER_STDCXX_98
166
if test "$ac_cv_cxx_stdcxx_98" = "no"
230.3.1 by Monty Taylor
Bug 252805: ./configure not detecting missing g++
167
then
168
  AC_MSG_ERROR([C++ Compiler required to compile Drizzle])
169
fi
1 by brian
clean slate
170
AC_PROG_CPP
171
AM_PROG_CC_C_O
172
173
# Print version of CC and CXX compiler (if they support --version)
174
case $SYSTEM_TYPE in
175
  *netware*)
176
CC_VERSION=`$CC -version | grep -i version`
177
    ;;
178
  *)
179
CC_VERSION=`$CC --version | sed 1q`
180
    ;;
181
esac
182
if test $? -eq "0"
183
then
184
  AC_MSG_CHECKING("C Compiler version")
185
  AC_MSG_RESULT("$CC $CC_VERSION")
186
else
187
CC_VERSION=""
188
fi
189
AC_SUBST(CC_VERSION)
190
MYSQL_CHECK_CXX_VERSION
191
230.3.1 by Monty Taylor
Bug 252805: ./configure not detecting missing g++
192
AC_PROG_AWK
193
28.1.33 by Monty Taylor
Added -Wall
194
if test "$ac_cv_c_compiler_gnu" = "yes"
1 by brian
clean slate
195
then
196
  AS="$CC -c"
197
  AC_SUBST(AS)
198
else
199
  AC_PATH_PROG(AS, as, as)
200
fi
201
202
# We use libtool
203
#AC_LIBTOOL_WIN32_DLL
204
AC_PROG_LIBTOOL
205
206
# Ensure that we have --preserve-dup-deps defines, otherwise we get link
207
# problems of 'mysql' with CXX=g++
208
LIBTOOL="$LIBTOOL --preserve-dup-deps"
209
AC_SUBST(LIBTOOL)dnl
210
211
AC_SUBST(NM)dnl
212
213
AC_PROG_INSTALL
214
test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
215
216
# Not critical since the generated file is distributed
217
AC_CHECK_PROGS(YACC, ['bison -y -p MYSQL'])
77.1.70 by Monty Taylor
Added a failure if you don't have bison and you're building from a .bzr branch.
218
if test -z "$YACC" && test -d ".bzr"
219
then
220
  AC_MSG_ERROR(["bison is required for Drizzle to build from a bzr branch"])
221
fi
1 by brian
clean slate
222
223
AC_PATH_PROG(uname_prog, uname, no)
224
225
# We should go through this and put all the explictly system dependent
226
# stuff in one place
227
AC_MSG_CHECKING(operating system)
228
AC_CACHE_VAL(mysql_cv_sys_os,
229
[
230
if test "$uname_prog" != "no"; then
231
  mysql_cv_sys_os="`uname`"
232
else
233
  mysql_cv_sys_os="Not Solaris"
234
fi
235
])
236
AC_MSG_RESULT($mysql_cv_sys_os)
237
238
# This should be rewritten to use $target_os
239
case "$target_os" in
240
  *solaris*)
241
    TARGET_SOLARIS="true"
242
    AC_DEFINE([TARGET_OS_SOLARIS], [1], [Whether we are building for Solaris])
243
    AC_SUBST(TARGET_SOLARIS)
244
  ;;
245
esac
246
247
# The following is required for portable results of floating point calculations
248
# on PowerPC. The same must also be done for IA-64, but this options is missing
249
# in the IA-64 gcc backend.
250
251
if test "$GCC" = "yes"
252
then
253
  case "$host_cpu" in
254
    *ppc* | *powerpc*)
255
      CFLAGS="$CFLAGS -mno-fused-madd"
256
      CXXFLAGS="$CXXFLAGS -mno-fused-madd"
257
    ;;
258
  esac
259
fi
260
261
AC_SUBST(CC)
262
AC_SUBST(CFLAGS)
263
AC_SUBST(CXX)
264
AC_SUBST(CXXFLAGS)
265
AC_SUBST(ASFLAGS)
266
AC_SUBST(LD)
267
AC_SUBST(INSTALL_SCRIPT)
268
53.2.1 by Monty Taylor
Added --disable-pedantic-warnings and --enable-fail.
269
1 by brian
clean slate
270
export CC CXX CFLAGS LD LDFLAGS AR ARFLAGS
271
272
if test "$GCC" = "yes"
273
then
274
  # mysqld requires -fno-implicit-templates.
275
  # Disable exceptions as they seams to create problems with gcc and threads.
276
  # mysqld doesn't use run-time-type-checking, so we disable it.
277
  # We should use -Wno-invalid-offsetof flag to disable some warnings from gcc
278
  # regarding offset() usage in C++ which are done in a safe manner in the
279
  # server
77.1.68 by Monty Taylor
Turned on -g and optimization for normal builds. -ggdb3 for gcc builds.
280
  CXXFLAGS="$CXXFLAGS -fno-implicit-templates -fno-exceptions -fno-rtti"
1 by brian
clean slate
281
  AC_DEFINE([HAVE_EXPLICIT_TEMPLATE_INSTANTIATION],
282
    [1], [Defined by configure. Use explicit template instantiation.])
283
fi
284
285
MYSQL_PROG_AR
286
287
# libmysqlclient versioning when linked with GNU ld.
288
if $LD --version 2>/dev/null|grep -q GNU; then
77.1.38 by Monty Taylor
Renamed more stuff to drizzle.
289
  LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_builddir)/libdrizzle/libdrizzle.ver"
290
  AC_CONFIG_FILES(libdrizzle/libdrizzle.ver)
1 by brian
clean slate
291
fi
292
AC_SUBST(LD_VERSION_SCRIPT)
293
77.1.111 by Monty Taylor
Added --enable-tcmalloc which will enable searching for and linking with tcmalloc if you have it.
294
77.1.63 by Monty Taylor
Fail also if we can't find libevent or pthread.h.
295
#--------------------------------------------------------------------
296
# Check for libevent
297
#--------------------------------------------------------------------
298
134.2.1 by Antony Curtis
Changes for proper detection of libraries
299
AC_MSG_CHECKING(for libevent)
300
AC_ARG_WITH(libevent,
236.1.14 by Monty Taylor
Merged build changes from Antony.
301
  [AS_HELP_STRING([--with-libevent],
236.1.15 by Monty Taylor
Fixed the previous merge. (since I suck)
302
       [Use libevent build directory])],
236.1.14 by Monty Taylor
Merged build changes from Antony.
303
  [ with_libevent=$withval ],
304
  [ with_libevent=yes ])
305
236.1.35 by Monty Taylor
Fixed another libevent on OSX searching problem.
306
if test "$with_libevent" = "yes"
77.1.63 by Monty Taylor
Fail also if we can't find libevent or pthread.h.
307
then
236.1.14 by Monty Taylor
Merged build changes from Antony.
308
    AC_CHECK_HEADERS(event.h)
309
    if test "x$ac_cv_header_event_h" != "xyes"
310
    then
311
      AC_MSG_ERROR([Couldn't find event.h. Try installing libevent development packages])
312
    fi
313
    my_save_LIBS="$LIBS"
314
    LIBS=""
315
    AC_CHECK_LIB(event, event_loop, [], [AC_MSG_ERROR(could not find libevent)])
316
    LIBEVENT_LIBS="${LIBS}"
317
    LIBS="${my_save_LIBS}"
318
    LIBEVENT_CFLAGS=""
319
else
320
    AC_MSG_RESULT($withval)
321
    if test -f $withval/event.h -a -f $withval/libevent.a; then
322
       owd=`pwd`
323
       if cd $withval; then withval=`pwd`; cd $owd; fi
324
       LIBEVENT_CFLAGS="-I$withval"
325
       LIBEVENT_LIBS="-L$withval -levent"
326
    elif test -f $withval/include/event.h -a -f $withval/lib/libevent.a; then
327
       owd=`pwd`
328
       if cd $withval; then withval=`pwd`; cd $owd; fi
329
       LIBEVENT_CFLAGS="-I$withval/include"
330
       LIBEVENT_LIBS="-L$withval/lib -levent"
331
    else
332
       AC_ERROR(event.h or libevent.a not found in $withval)
333
    fi
77.1.63 by Monty Taylor
Fail also if we can't find libevent or pthread.h.
334
fi
236.1.14 by Monty Taylor
Merged build changes from Antony.
335
336
AC_SUBST(LIBEVENT_CFLAGS)
201.2.3 by Monty Taylor
Cleaned up some LIBS bits in the build.
337
AC_SUBST(LIBEVENT_LIBS)
134.2.1 by Antony Curtis
Changes for proper detection of libraries
338
339
AC_CACHE_CHECK([for bufferevent in libevent], ac_libevent_works, [
340
  save_CFLAGS="$CFLAGS"
341
  save_LIBS="$LIBS"
236.1.14 by Monty Taylor
Merged build changes from Antony.
342
  CFLAGS="$LIBEVENT_CFLAGS"
343
  LIBS="$LIBEVENT_LIBS"
134.2.1 by Antony Curtis
Changes for proper detection of libraries
344
  AC_TRY_LINK([
345
#include <sys/types.h>
346
#include <sys/time.h>
347
#include <stdlib.h>
348
#include <event.h>],[
349
	struct bufferevent bev;
350
	bufferevent_settimeout(&bev, 1, 1);
351
  ], ac_libevent_works=yes, [
352
        AC_ERROR([you need to install a more recent version of libevent,
353
	check http://www.monkey.org/~provos/libevent/])
354
  ])
355
356
  CFLAGS="$save_CFLAGS"
357
  LIBS="$save_LIBS"
358
])
359
77.1.63 by Monty Taylor
Fail also if we can't find libevent or pthread.h.
360
361
#--------------------------------------------------------------------
362
# Check for libpthread
363
#--------------------------------------------------------------------
364
365
AC_CHECK_HEADERS(pthread.h)
366
if test "x$ac_cv_header_pthread_h" != "xyes"
367
then
368
  AC_MSG_ERROR([Couldn't find pthread.h.])
369
fi
370
AC_CHECK_LIB(pthread, pthread_create, [], [AC_MSG_ERROR(could not find libpthread)])
371
372
#--------------------------------------------------------------------
77.1.111 by Monty Taylor
Added --enable-tcmalloc which will enable searching for and linking with tcmalloc if you have it.
373
# Check for tcmalloc
374
#--------------------------------------------------------------------
375
376
AC_ARG_ENABLE([tcmalloc],
377
    [AS_HELP_STRING([--enable-tcmalloc],
378
       [Enable linking with tcmalloc @<:@default=off@:>@])],
236.1.14 by Monty Taylor
Merged build changes from Antony.
379
    [ac_enable_tcmalloc="$enableval"],
380
    [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.
381
236.1.14 by Monty Taylor
Merged build changes from Antony.
382
if test "x$ac_enable_tcmalloc" = "xyes"
77.1.111 by Monty Taylor
Added --enable-tcmalloc which will enable searching for and linking with tcmalloc if you have it.
383
then
384
  AC_CHECK_LIB(tcmalloc,malloc,[],[])
385
fi
386
387
#--------------------------------------------------------------------
77.1.63 by Monty Taylor
Fail also if we can't find libevent or pthread.h.
388
# Check for libz
389
#--------------------------------------------------------------------
390
201.2.3 by Monty Taylor
Cleaned up some LIBS bits in the build.
391
my_save_LIBS="$LIBS"
392
LIBS=""
77.1.63 by Monty Taylor
Fail also if we can't find libevent or pthread.h.
393
AC_CHECK_HEADERS(zlib.h)
394
if test "x$ac_cv_header_zlib_h" != "xyes"
395
then
396
  AC_MSG_ERROR([Couldn't find zlib.h. Try installing zlib development packages])
397
fi
398
AC_CHECK_LIB(z, crc32, [], [AC_MSG_ERROR(could not find libz)])
201.2.3 by Monty Taylor
Cleaned up some LIBS bits in the build.
399
ZLIB_LIBS="$LIBS"
400
LIBS="$my_save_LIBS"
401
AC_SUBST(ZLIB_LIBS)
402
77.1.63 by Monty Taylor
Fail also if we can't find libevent or pthread.h.
403
182.1.5 by Jim Winstead
Detect and make the Mac OS X libedit readline interface look like the
404
#--------------------------------------------------------------------
405
# Check for libreadline or compatible (libedit on Mac OS X)
406
#--------------------------------------------------------------------
77.1.63 by Monty Taylor
Fail also if we can't find libevent or pthread.h.
407
236.1.14 by Monty Taylor
Merged build changes from Antony.
408
AC_CHECK_HEADERS(readline/history.h readline/readline.h)
77.1.63 by Monty Taylor
Fail also if we can't find libevent or pthread.h.
409
if test "x$ac_cv_header_readline_readline_h" != "xyes"
410
then
411
  AC_MSG_ERROR([Couldn't find readline/readline.h. Try installing readline development packages.])
412
fi
236.1.14 by Monty Taylor
Merged build changes from Antony.
413
AC_CHECK_TYPES([HIST_ENTRY], [], [], [AC_INCLUDES_DEFAULT[
414
#ifdef HAVE_READLINE_HISTORY_H
415
#include <readline/history.h>
416
#endif
417
#include <readline/readline.h>
418
]])
419
AC_CHECK_DECLS([completion_matches], [], [], [AC_INCLUDES_DEFAULT[
420
#ifdef HAVE_READLINE_HISTORY_H
421
#include <readline/history.h>
422
#endif
423
#include <readline/readline.h>
424
]])
207.1.2 by Jim Winstead
Fix test for libreadline to test a function that exists in all usable
425
426
MYSQL_CHECK_NEW_RL_INTERFACE
427
201.2.3 by Monty Taylor
Cleaned up some LIBS bits in the build.
428
my_save_LIBS="$LIBS"
429
LIBS=""
207.1.2 by Jim Winstead
Fix test for libreadline to test a function that exists in all usable
430
AC_CHECK_LIB(readline, rl_initialize, [],
224.1.1 by Monty Taylor
Fixed readline build problem on Centos.
431
  [AC_CHECK_LIB(ncurses, tgetent, [], [AC_MSG_ERROR(Couldn't find ncurses)]) 
432
   AC_SEARCH_LIBS(rl_initialize, readline, [],
433
    [AC_MSG_ERROR(Couldn't find libreadline.)])])
201.2.3 by Monty Taylor
Cleaned up some LIBS bits in the build.
434
READLINE_LIBS="$LIBS"
435
LIBS="$my_save_LIBS"
436
AC_SUBST(READLINE_LIBS)
77.1.63 by Monty Taylor
Fail also if we can't find libevent or pthread.h.
437
438
#--------------------------------------------------------------------
439
# Check for libpcre
440
#--------------------------------------------------------------------
441
442
AC_LANG_PUSH([C++])
443
AC_PATH_PROG(PKG_CONFIG, pkg-config, AC_MSG_ERROR([pkg-config wasn't found.]))
236.1.18 by Monty Taylor
Put in actual PCRE linking test.
444
PKG_CHECK_MODULES(PCRE, [libpcrecpp >= 3], [found_pcre="yes"],[found_pcre="no"])
445
446
if test "$found_pcre" = "no"
447
then
77.1.64 by Monty Taylor
YA fix for libpcrecpp finding...
448
  dnl Only check the header here, because autoconf can't handle
449
  dnl checking for C++ methods without C linkages
77.1.63 by Monty Taylor
Fail also if we can't find libevent or pthread.h.
450
  AC_CHECK_HEADERS(pcrecpp.h)
77.1.102 by Monty Taylor
Fixed a PCRE detection bug.
451
  if test "x$ac_cv_header_pcrecpp_h" != "xyes" 
77.1.63 by Monty Taylor
Fail also if we can't find libevent or pthread.h.
452
  then
453
    AC_MSG_ERROR([Couldn't find pcrecpp.h. Try installing the development package associated with libpcre on your system.])
236.1.18 by Monty Taylor
Put in actual PCRE linking test.
454
  else
455
    # Found headers, now see if we can link
456
    AC_MSG_CHECKING(for libpcrecpp)
457
    save_LDFLAGS="$LDFLAGS"
458
    LDFLAGS="-lpcrecpp -lpcre"
459
    AC_TRY_LINK([
460
#include <pcrecpp.h>
461
    ],
462
    [pcrecpp::RE_Options opt;],
463
    [found_pcre="yes"],
464
    [AC_MSG_ERROR([Couldn't link libpcrecpp])])
465
466
    PCRE_LIBS="$LDFLAGS"
467
    LDFLAGS="$save_LDFLAGS"
468
    AC_MSG_RESULT([yes])
469
  fi
77.1.63 by Monty Taylor
Fail also if we can't find libevent or pthread.h.
470
fi
471
AC_LANG_POP([])
472
AC_SUBST(PCRE_LIBS)
473
AC_SUBST(PCRE_CFLAGS)
474
1 by brian
clean slate
475
dnl Find paths to some shell programs
476
AC_PATH_PROG(LN, ln, ln)
477
# This must be able to take a -f flag like normal unix ln.
478
AC_PATH_PROG(LN_CP_F, ln, ln)
479
480
AC_PATH_PROG(MV, mv, mv)
481
AC_PATH_PROG(RM, rm, rm)
482
AC_PATH_PROG(CP, cp, cp)
483
AC_PATH_PROG(SED, sed, sed)
484
AC_PATH_PROG(CMP, cmp, cmp)
485
AC_PATH_PROG(CHMOD, chmod, chmod)
486
AC_PATH_PROG(HOSTNAME, hostname, hostname)
487
# Check for a GNU tar named 'gtar', or 'gnutar' (MacOS X) and
488
# fall back to 'tar' otherwise and hope that it's a GNU tar as well
489
AC_CHECK_PROGS(TAR, gnutar gtar tar)
490
491
dnl We use a path for perl so the script startup works
492
dnl We make sure to use perl, not perl5, in hopes that the RPMs will
493
dnl not depend on the perl5 binary being installed (probably a bug in RPM)
494
AC_PATH_PROG(PERL, perl, no)
495
if test "$PERL" != "no" && $PERL -e 'require 5' > /dev/null 2>&1
496
then
497
  PERL5=$PERL
498
else
499
  AC_PATH_PROG(PERL5, perl5, no)
500
  if test "$PERL5" != no
501
  then
502
    PERL=$PERL5
503
    ac_cv_path_PERL=$ac_cv_path_PERL5
504
  fi
505
fi
506
507
AC_SUBST(HOSTNAME)
508
AC_SUBST(PERL)
509
AC_SUBST(PERL5)
510
511
# icheck, used for ABI check
512
AC_PATH_PROG(ICHECK, icheck, no)
513
# "icheck" is also the name of a file system check program on Tru64.
514
# Verify the program found is really the interface checker.
515
if test "x$ICHECK" != "xno"
516
then
517
  AC_MSG_CHECKING(if $ICHECK works as expected)
518
  echo "int foo;" > conftest.h
519
  $ICHECK --canonify -o conftest.ic conftest.h 2>/dev/null
520
  if test -f "conftest.ic"
521
  then
522
    AC_MSG_RESULT(yes)
523
  else
524
    AC_MSG_RESULT(no)
525
    ICHECK=no
526
  fi
527
  rm -f conftest.ic conftest.h
528
fi
529
AC_SUBST(ICHECK)
530
531
# Lock for PS
532
AC_PATH_PROG(PS, ps, ps)
533
AC_MSG_CHECKING("how to check if pid exists")
534
PS=$ac_cv_path_PS
535
# Linux style
536
if $PS p $$ 2> /dev/null | grep `echo $0 | sed s/\-//` > /dev/null
537
then
538
  FIND_PROC="$PS p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
539
# Solaris
540
elif $PS -fp $$ 2> /dev/null | grep $0 > /dev/null
541
then
542
  FIND_PROC="$PS -p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
543
# BSD style
544
elif $PS -uaxww 2> /dev/null | grep $0 > /dev/null
545
then
546
  FIND_PROC="$PS -uaxww | grep -v grep | grep \$\$MYSQLD | grep \" \$\$PID \" > /dev/null"
547
# SysV style
548
elif $PS -ef 2> /dev/null | grep $0 > /dev/null
549
then
550
  FIND_PROC="$PS -ef | grep -v grep | grep \$\$MYSQLD | grep \" \$\$PID \" > /dev/null"
551
# Do anybody use this?
552
elif $PS $$ 2> /dev/null | grep $0 > /dev/null
553
then
554
  FIND_PROC="$PS \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
555
else
556
  case $SYSTEM_TYPE in
557
    *freebsd*|*dragonfly*)
558
      FIND_PROC="$PS p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
559
      ;;
560
    *darwin*)
561
      FIND_PROC="$PS -uaxww | grep -v grep | grep \$\$MYSQLD | grep \" \$\$PID \" > /dev/null"
562
      ;;
563
    *)
564
      AC_MSG_ERROR([Could not find the right ps switches. Which OS is this ?. See the Installation chapter in the Reference Manual.])
565
  esac
566
fi
567
AC_SUBST(FIND_PROC)
568
AC_MSG_RESULT("$FIND_PROC")
569
570
# Check if a pid is valid
571
AC_PATH_PROG(KILL, kill, kill)
572
AC_MSG_CHECKING("for kill switches")
573
if $ac_cv_path_KILL -0 $$
574
then
575
  CHECK_PID="$ac_cv_path_KILL -0 \$\$PID > /dev/null 2> /dev/null"
576
elif kill -s 0 $$
577
then
578
  CHECK_PID="$ac_cv_path_KILL -s 0 \$\$PID > /dev/null 2> /dev/null"
579
else
580
  AC_MSG_WARN([kill -0 to check for pid seems to fail])
581
    CHECK_PID="$ac_cv_path_KILL -s SIGCONT \$\$PID > /dev/null 2> /dev/null"
582
fi
583
AC_SUBST(CHECK_PID)
584
AC_MSG_RESULT("$CHECK_PID")
585
586
# We need an ANSI C compiler
587
AM_PROG_CC_STDC
588
589
# We need an assembler, too
590
AM_PROG_AS
591
CCASFLAGS="$CCASFLAGS $ASFLAGS"
592
593
# Check if we need noexec stack for assembler
594
AC_CHECK_NOEXECSTACK
595
596
if test "$am_cv_prog_cc_stdc" = "no"
597
then
91 by Brian Aker
Main binary now named drizzled
598
  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
599
fi
600
601
28.1.39 by Monty Taylor
Made everything use AS_HELP_STRING (except for charsets, which are dying anyway)
602
AC_ARG_WITH([server-suffix],
603
    [AS_HELP_STRING([--with-server-suffix],
604
      [Append value to the version string.])],
1 by brian
clean slate
605
    [ MYSQL_SERVER_SUFFIX=`echo "$withval" | sed -e  's/^\(...................................\)..*$/\1/'` ],
606
    [ MYSQL_SERVER_SUFFIX= ]
607
    )
608
AC_SUBST(MYSQL_SERVER_SUFFIX)
609
610
# 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)
611
AC_ARG_WITH([named-curses-libs],
612
    [AS_HELP_STRING([--with-named-curses-libs=ARG],
613
            [Use specified curses libraries instead of those
614
		automatically found by configure.])],
1 by brian
clean slate
615
    [ with_named_curses=$withval ],
616
    [ with_named_curses=no ]
617
    )
618
619
# compile with strings functions in assembler
28.1.39 by Monty Taylor
Made everything use AS_HELP_STRING (except for charsets, which are dying anyway)
620
AC_ARG_ENABLE([assembler],
621
    [AS_HELP_STRING([--enable-assembler],
622
	    [Use assembler versions of some string functions if available.])],
1 by brian
clean slate
623
    [ ENABLE_ASSEMBLER=$enableval ],
624
    [ ENABLE_ASSEMBLER=no ]
625
    )
626
627
AC_MSG_CHECKING(if we should use assembler functions)
628
# For now we only support assembler on i386 and sparc systems
212.5.4 by Monty Taylor
Renamed strings to mystrings, for include/lib naming consistency.
629
AM_CONDITIONAL(ASSEMBLER_x86, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "i386" && $AS mystrings/strings-x86.s -o checkassembler >/dev/null 2>&1 && test -f checkassembler && (rm -f checkassembler; exit 0;))
1 by brian
clean slate
630
AM_CONDITIONAL(ASSEMBLER_sparc32, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "sparc")
631
AM_CONDITIONAL(ASSEMBLER_sparc64, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "sparcv9")
632
AM_CONDITIONAL(ASSEMBLER, test "$ASSEMBLER_x86_TRUE" = "" -o "$ASSEMBLER_sparc32_TRUE" = "")
633
634
if test "$ASSEMBLER_TRUE" = ""
635
then
636
  AC_MSG_RESULT([yes])
637
else
638
  AC_MSG_RESULT([no])
639
fi
640
28.1.39 by Monty Taylor
Made everything use AS_HELP_STRING (except for charsets, which are dying anyway)
641
AC_ARG_WITH([tcp-port],
642
    [AS_HELP_STRING([--with-tcp-port=port-number],
165.1.1 by Elliot Murphy
new port number from IANA
643
            [Which port to use for Drizzle services @<:@default=4427@:>@])],
1 by brian
clean slate
644
    [ MYSQL_TCP_PORT=$withval ],
645
    [ MYSQL_TCP_PORT=$MYSQL_TCP_PORT_DEFAULT
646
      # if we actually defaulted (as opposed to the pathological case of
647
      # --with-tcp-port=<MYSQL_TCP_PORT_DEFAULT> which might in theory
648
      # happen if whole batch of servers was built from a script), set
649
      # the default to zero to indicate that; we don't lose information
650
      # that way, because 0 obviously indicates that we can get the
651
      # default value from MYSQL_TCP_PORT. this seems really evil, but
652
      # testing for MYSQL_TCP_PORT==MYSQL_TCP_PORT_DEFAULT would make a
653
      # a port of MYSQL_TCP_PORT_DEFAULT magic even if the builder did not
654
      # 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
655
      # from /etc/services if you can", but really, really meant 4427 when
656
      # they passed in 4427. When they pass in a specific value, let them
1 by brian
clean slate
657
      # have it; don't second guess user and think we know better, this will
658
      # just make people cross.  this makes the the logic work like this
659
      # (which is complicated enough):
660
      #
661
      # - if a port was set during build, use that as a default.
662
      #
663
      # - otherwise, try to look up a port in /etc/services; if that fails,
165.1.1 by Elliot Murphy
new port number from IANA
664
      #   use MYSQL_TCP_PORT_DEFAULT (at the time of this writing 4427)
1 by brian
clean slate
665
      #
666
      # - allow the MYSQL_TCP_PORT environment variable to override that.
667
      #
668
      # - allow command-line parameters to override all of the above.
669
      #
670
      # the top-most MYSQL_TCP_PORT_DEFAULT is read from win/configure.js,
671
      # so don't mess with that.
672
      MYSQL_TCP_PORT_DEFAULT=0 ]
673
    )
674
AC_SUBST(MYSQL_TCP_PORT)
675
# We might want to document the assigned port in the manual.
676
AC_SUBST(MYSQL_TCP_PORT_DEFAULT)
677
678
# Use this to set the place used for unix socket used to local communication.
28.1.39 by Monty Taylor
Made everything use AS_HELP_STRING (except for charsets, which are dying anyway)
679
AC_ARG_WITH([mysqld-user],
680
    [AS_HELP_STRING([--with-mysqld-user=username],
681
            [What user the mysqld daemon shall be run as.
682
		@<:@default=mysql@:>@])],
1 by brian
clean slate
683
    [ MYSQLD_USER=$withval ],
684
    [ MYSQLD_USER=mysql ]
685
    )
686
AC_SUBST(MYSQLD_USER)
687
688
# If we should allow LOAD DATA LOCAL
689
AC_MSG_CHECKING(If we should should enable LOAD DATA LOCAL by default)
690
AC_ARG_ENABLE(local-infile,
691
    [  --enable-local-infile   Enable LOAD DATA LOCAL INFILE (default: disabled)],
692
    [ ENABLED_LOCAL_INFILE=$enableval ],
693
    [ ENABLED_LOCAL_INFILE=no ]
694
    )
695
if test "$ENABLED_LOCAL_INFILE" = "yes"
696
then
697
  AC_MSG_RESULT([yes])
698
  AC_DEFINE([ENABLED_LOCAL_INFILE], [1],
699
            [If LOAD DATA LOCAL INFILE should be enabled by default])
700
else
701
  AC_MSG_RESULT([no])
702
fi
703
704
MYSQL_SYS_LARGEFILE
705
706
# Types that must be checked AFTER large file support is checked
707
AC_TYPE_SIZE_T
708
709
#--------------------------------------------------------------------
710
# Check for system header files
711
#--------------------------------------------------------------------
712
713
AC_HEADER_DIRENT
714
AC_HEADER_STDC
715
AC_HEADER_SYS_WAIT
53.2.2 by Monty Taylor
Updated everything that needs updating to compile with -std=gnu99 -pedantic
716
AC_HEADER_STDBOOL
77.1.22 by Monty Taylor
Removed refs to floatingpoint.h (which we only used for fconvert) and fconvert
717
AC_CHECK_HEADERS(fcntl.h float.h fpu_control.h ieeefp.h)
53.2.29 by Monty Taylor
Cleaned up headers a little more.
718
AC_CHECK_HEADERS(limits.h pwd.h select.h linux/config.h)
719
AC_CHECK_HEADERS(sys/fpu.h utime.h sys/utime.h )
720
AC_CHECK_HEADERS(synch.h sys/mman.h sys/socket.h netinet/in.h arpa/inet.h)
77.1.57 by Monty Taylor
Removed dual-compile needs on client.c. Get the symbols now from libdrizzle.
721
AC_CHECK_HEADERS(sys/timeb.h sys/vadvise.h sys/wait.h term.h)
202.1.4 by Monty Taylor
Removed openssl refs.
722
AC_CHECK_HEADERS(termio.h termios.h sched.h alloca.h)
53.2.29 by Monty Taylor
Cleaned up headers a little more.
723
AC_CHECK_HEADERS(sys/ioctl.h malloc.h sys/malloc.h sys/ipc.h sys/shm.h)
724
AC_CHECK_HEADERS(sys/prctl.h sys/resource.h sys/param.h port.h ieeefp.h)
725
AC_CHECK_HEADERS(execinfo.h)
1 by brian
clean slate
726
727
AC_CHECK_HEADERS([xfs/xfs.h])
77.1.62 by Monty Taylor
Added checks for libz and readline devel files.
728
77.1.31 by Monty Taylor
Replaced regex lib with pcre. Reworked mysqltest to use it.
729
#--------------------------------------------------------------------
1 by brian
clean slate
730
# Check for system libraries. Adds the library to $LIBS
731
# and defines HAVE_LIBM etc
732
#--------------------------------------------------------------------
733
734
AC_CHECK_LIB(m, floor, [], AC_CHECK_LIB(m, __infinity))
735
AC_CHECK_FUNCS(log2)
736
737
AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
738
AC_CHECK_FUNC(yp_get_default_domain, ,
739
  AC_CHECK_LIB(nsl, yp_get_default_domain))
740
AC_CHECK_FUNC(p2open, , AC_CHECK_LIB(gen, p2open))
741
# This may get things to compile even if bind-8 is installed
742
AC_CHECK_FUNC(bind, , AC_CHECK_LIB(bind, bind))
743
# Check if crypt() exists in libc or libcrypt, sets LIBS if needed
744
AC_SEARCH_LIBS(crypt, crypt, AC_DEFINE(HAVE_CRYPT, 1, [crypt]))
745
746
# Check rt for aio_read
747
AC_CHECK_LIB(rt, aio_read)
748
749
# For the sched_yield() function on Solaris
750
AC_CHECK_FUNC(sched_yield, , AC_CHECK_LIB(posix4, sched_yield,
751
[AC_DEFINE(HAVE_SCHED_YIELD) LIBS="$LIBS -lposix4"]))
752
753
if test "$ac_cv_header_termio_h" = "no" -a "$ac_cv_header_termios_h" = "no"
754
then
755
  AC_CHECK_FUNC(gtty, , AC_CHECK_LIB(compat, gtty))
756
fi
757
758
AC_CHECK_TYPES([int8, uint8, int16, uint16, int32, uint32, int64, uint64,
759
                uchar, uint, ulong],[],[], [
760
#include <sys/types.h>
761
])
762
AC_CHECK_TYPES([fp_except], [], [], [
763
#include <sys/types.h>
764
#include <ieeefp.h>
765
])
766
25 by Brian Aker
Clean up of configure.in
767
my_save_LIBS="$LIBS"
768
LIBS=""
769
AC_CHECK_LIB(dl,dlopen)
177.3.1 by mark
remove ifdef HAVE_DLOPEN, make configure require dlopen()
770
AC_CHECK_FUNCS(dlopen dlerror)
771
if test "$ac_cv_func_dlopen" != "yes"
772
then
773
  AC_MSG_ERROR([Drizzle requires dlopen])
774
fi
201.2.3 by Monty Taylor
Cleaned up some LIBS bits in the build.
775
LIBDL_LIBS="$LIBS"
25 by Brian Aker
Clean up of configure.in
776
LIBS="$my_save_LIBS"
201.2.3 by Monty Taylor
Cleaned up some LIBS bits in the build.
777
AC_SUBST(LIBDL_LIBS)
25 by Brian Aker
Clean up of configure.in
778
779
AC_CHECK_FUNCS(strtok_r)
1 by brian
clean slate
780
781
# Build optimized or debug version ?
782
# First check for gcc and g++
28.1.33 by Monty Taylor
Added -Wall
783
if test "$ac_cv_c_compiler_gnu" = "yes"
1 by brian
clean slate
784
then
77.1.68 by Monty Taylor
Turned on -g and optimization for normal builds. -ggdb3 for gcc builds.
785
  SYMBOLS_CFLAGS="-ggdb3"
77.1.78 by Monty Taylor
One last bunch of warnings edits.
786
  DEBUG_OPTIMIZE_CC="-O0"
787
  OPTIMIZE_CFLAGS="-O2"
1 by brian
clean slate
788
else
77.1.68 by Monty Taylor
Turned on -g and optimization for normal builds. -ggdb3 for gcc builds.
789
  SYMBOLS_CFLAGS="-g"
1 by brian
clean slate
790
  DEBUG_OPTIMIZE_CC=""
791
  OPTIMIZE_CFLAGS="-O"
792
fi
793
if test "$ac_cv_prog_cxx_g" = "yes"
794
then
77.1.68 by Monty Taylor
Turned on -g and optimization for normal builds. -ggdb3 for gcc builds.
795
  SYMBOLS_CXXFLAGS="-ggdb3"
77.1.78 by Monty Taylor
One last bunch of warnings edits.
796
  DEBUG_OPTIMIZE_CXX="-O0"
797
  OPTIMIZE_CXXFLAGS="-O2"
1 by brian
clean slate
798
else
77.1.68 by Monty Taylor
Turned on -g and optimization for normal builds. -ggdb3 for gcc builds.
799
  SYMBOLS_CXXFLAGS="-g"
1 by brian
clean slate
800
  DEBUG_OPTIMIZE_CXX=""
801
  OPTIMIZE_CXXFLAGS="-O"
802
fi
803
804
# If the user specified CFLAGS, we won't add any optimizations
805
if test -n "$SAVE_CFLAGS"
806
then
807
  OPTIMIZE_CFLAGS=""
808
  DEBUG_OPTIMIZE_CC=""
809
fi
810
# Ditto for CXXFLAGS
811
if test -n "$SAVE_CXXFLAGS"
812
then
813
  OPTIMIZE_CXXFLAGS=""
814
  DEBUG_OPTIMIZE_CXX=""
815
fi
816
224.1.2 by Monty Taylor
Added local define of AC_HEADER_ASSERT.
817
dnl TODO: Remove this define once we are using 2.61 across the board.
818
# AC_HEADER_ASSERT
819
# ----------------
820
# Check whether to enable assertions.
224.1.3 by Monty Taylor
Wrapped the define in an ifdef() so that we can still track upstream on
821
ifdef([AC_HEADER_ASSERT],[],AC_DEFUN([AC_HEADER_ASSERT],
224.1.2 by Monty Taylor
Added local define of AC_HEADER_ASSERT.
822
[
823
  AC_MSG_CHECKING([whether to enable assertions])
824
  AC_ARG_ENABLE([assert],
825
    [  --disable-assert        turn off assertions],
826
    [AC_MSG_RESULT([no])
827
     AC_DEFINE(NDEBUG, 1, [Define to 1 if assertions should be disabled.])],
828
    [AC_MSG_RESULT(yes)])
224.1.3 by Monty Taylor
Wrapped the define in an ifdef() so that we can still track upstream on
829
]))
224.1.2 by Monty Taylor
Added local define of AC_HEADER_ASSERT.
830
202.1.12 by Monty Taylor
Added --disable-assert compile option.
831
AC_HEADER_ASSERT
832
77.1.68 by Monty Taylor
Turned on -g and optimization for normal builds. -ggdb3 for gcc builds.
833
CFLAGS="${SYMBOLS_CFLAGS} ${CFLAGS}"
834
CXXFLAGS="${SYMBOLS_CXXFLAGS} ${CXXFLAGS}"
835
201.2.4 by Monty Taylor
Re-enabled optimizations for the normal build, and added back the --with-debug option to turn them off.
836
AC_ARG_WITH([debug],
837
    [AS_HELP_STRING([--with-debug],
838
       [Add debug code/turns off optimizations (yes|no) @<:@default=no@:>@])],
839
    [with_debug=$withval],
840
    [with_debug=no])
841
if test "$with_debug" = "yes"
842
then
843
  # Medium debug.
844
  CFLAGS="$DEBUG_OPTIMIZE_CC $CFLAGS"
845
  CXXFLAGS="$DEBUG_OPTIMIZE_CXX $CXXFLAGS"
846
else
847
  # Optimized version. No debug
848
  CFLAGS="$OPTIMIZE_CFLAGS $CFLAGS"
849
  CXXFLAGS="$OPTIMIZE_CXXFLAGS $CXXFLAGS"
850
fi
851
852
1 by brian
clean slate
853
AC_ARG_WITH([fast-mutexes],
28.1.39 by Monty Taylor
Made everything use AS_HELP_STRING (except for charsets, which are dying anyway)
854
    [AS_HELP_STRING([--with-fast-mutexes],
855
	    [Compile with fast mutexes  @<:@default=off@:>@])],
856
    [with_fast_mutexes=$withval],
857
    [with_fast_mutexes=no])
1 by brian
clean slate
858
859
if test "$with_fast_mutexes" != "no"
860
then
51.3.26 by Jay Pipes
Final removal of DBUG library and cleanup of Makefiles
861
	AC_DEFINE([MY_PTHREAD_FASTMUTEX], [1], 
862
			[Define to 1 if you want to use fast mutexes])
1 by brian
clean slate
863
fi
864
28.1.39 by Monty Taylor
Made everything use AS_HELP_STRING (except for charsets, which are dying anyway)
865
AC_ARG_WITH([comment],
866
    [AS_HELP_STRING([--with-comment],
867
            [Comment about compilation environment. @<:@default=off@:>@])],
1 by brian
clean slate
868
    [with_comment=$withval],
869
    [with_comment=no])
870
if test "$with_comment" != "no"
871
then
872
  COMPILATION_COMMENT=$with_comment
873
else
874
  COMPILATION_COMMENT="Source distribution"
875
fi
876
AC_SUBST(COMPILATION_COMMENT)
877
77.1.96 by Monty Taylor
Removed skip-external-locking.
878
if expr "$target_os" : "[[Ll]]inux.*" > /dev/null
879
then
880
  TARGET_LINUX="true"
881
  AC_DEFINE([TARGET_OS_LINUX], [1], [Whether we build for Linux])
882
else
883
  TARGET_LINUX="false"
884
fi
885
1 by brian
clean slate
886
dnl Checks for typedefs, structures, and compiler characteristics.
887
AC_C_CONST
888
AC_C_INLINE
889
AC_TYPE_OFF_T
890
AC_HEADER_TIME
891
AC_STRUCT_TM
892
MYSQL_NEEDS_MYSYS_NEW
893
# AC_CHECK_SIZEOF return 0 when it does not find the size of a
894
# type. We want a error instead.
895
AC_CHECK_SIZEOF(char, 1)
896
if test "$ac_cv_sizeof_char" -eq 0
897
then
77.1.28 by Monty Taylor
Removed a crapload of files I hate.
898
  AC_MSG_ERROR([No size for char type.])
1 by brian
clean slate
899
fi
900
AC_CHECK_SIZEOF(char*, 4)
901
AC_CHECK_SIZEOF(short, 2)
902
AC_CHECK_SIZEOF(int, 4)
903
if test "$ac_cv_sizeof_int" -eq 0
904
then
905
  AC_MSG_ERROR("No size for int type.")
906
fi
907
AC_CHECK_SIZEOF(long, 4)
908
if test "$ac_cv_sizeof_long" -eq 0
909
then
910
  AC_MSG_ERROR("No size for long type.")
911
fi
912
AC_CHECK_SIZEOF(long long, 8)
913
if test "$ac_cv_sizeof_long_long" -eq 0
914
then
91 by Brian Aker
Main binary now named drizzled
915
  AC_MSG_ERROR("Drizzle needs a long long type.")
1 by brian
clean slate
916
fi
917
# off_t is not a builtin type
918
AC_CHECK_SIZEOF(off_t, 4)
919
if test "$ac_cv_sizeof_off_t" -eq 0
920
then
91 by Brian Aker
Main binary now named drizzled
921
  AC_MSG_ERROR("Drizzle needs a off_t type.")
1 by brian
clean slate
922
fi
923
924
dnl
925
dnl check if time_t is unsigned
926
dnl
927
928
MYSQL_CHECK_TIME_T
929
930
931
# do we need #pragma interface/#pragma implementation ?
932
# yes if it's gcc 2.x, and not icc pretending to be gcc, and not cygwin
933
AC_MSG_CHECKING(the need for @%:@pragma interface/implementation)
934
# instead of trying to match SYSTEM_TYPE and CC_VERSION (that doesn't
935
# follow any standard), we'll use well-defined preprocessor macros:
28.1.33 by Monty Taylor
Added -Wall
936
AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
1 by brian
clean slate
937
#if !defined(__CYGWIN__) && !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ < 3)
938
#error USE_PRAGMA_IMPLEMENTATION
939
#endif
28.1.33 by Monty Taylor
Added -Wall
940
]])],[AC_MSG_RESULT(no) ],[AC_MSG_RESULT(yes) ; CXXFLAGS="$CXXFLAGS -DUSE_PRAGMA_IMPLEMENTATION"])
1 by brian
clean slate
941
942
# This always gives a warning. Ignore it unless you are cross compiling
943
AC_C_BIGENDIAN
944
#---START: Used in for client configure
945
# Check base type of last arg to accept
946
MYSQL_TYPE_ACCEPT
947
#---END:
948
# Figure out what type of struct rlimit to use with setrlimit
949
MYSQL_TYPE_STRUCT_RLIMIT
950
# Find where the stack goes
951
MYSQL_STACK_DIRECTION
952
# We want to skip alloca on irix unconditionally. It may work on some version..
953
MYSQL_FUNC_ALLOCA
954
# Do struct timespec have members tv_sec or ts_sec
236.1.24 by Monty Taylor
Renamed MYSQL_TIME to DRIZZLE_TIME.
955
DRIZZLE_TIMESPEC_TS
1 by brian
clean slate
956
# Do we have the tzname variable
957
MYSQL_TZNAME
958
# Do the c++ compiler have a bool type
959
MYSQL_CXX_BOOL
960
AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>])
961
AC_CHECK_TYPES([size_t], [], [], [#include <stdio.h>])
962
AC_CHECK_TYPES([u_int32_t])
963
964
MYSQL_PTHREAD_YIELD
965
134.2.1 by Antony Curtis
Changes for proper detection of libraries
966
1 by brian
clean slate
967
dnl Checks for header files.
968
AC_CHECK_HEADERS(malloc.h sys/cdefs.h)
969
970
dnl Checks for library functions.
971
AC_FUNC_ALLOCA
972
AC_PROG_GCC_TRADITIONAL
973
AC_TYPE_SIGNAL
974
AC_CHECK_FUNCS(re_comp regcomp strdup)
975
976
dnl Sun compilers have their own vis.h that is about something
977
dnl totally different. So, not to change the libedit source, we
978
dnl do some additional checks before we define HAVE_VIS_H.
979
AC_CHECK_HEADER(vis.h,
980
  [AC_CHECK_FUNC(strvis,
981
    [AC_DEFINE([HAVE_VIS_H], [1],[Found vis.h and the strvis() function])])])
982
983
AC_CHECK_FUNCS(strlcat strlcpy)
984
AC_CHECK_FUNCS(issetugid)
985
AC_CHECK_FUNCS(getline flockfile)
986
987
# from old readline settting:
988
989
MAKE_SHELL=/bin/sh
990
AC_SUBST(MAKE_SHELL)
991
992
# Already-done: stdlib.h string.h unistd.h termios.h
993
AC_CHECK_HEADERS(varargs.h stdarg.h dirent.h locale.h ndir.h sys/dir.h \
994
 sys/file.h sys/ndir.h sys/ptem.h sys/pte.h sys/select.h sys/stream.h \
995
 sys/mman.h curses.h termcap.h termio.h termbits.h asm/termbits.h grp.h \
996
paths.h semaphore.h)
997
998
# Already-done: strcasecmp
999
AC_CHECK_FUNCS(lstat putenv select setenv setlocale strcoll tcgetattr)
1000
28.1.33 by Monty Taylor
Added -Wall
1001
AC_HEADER_STAT
1 by brian
clean slate
1002
MYSQL_SIGNAL_CHECK
1003
MYSQL_CHECK_GETPW_FUNCS
1004
MYSQL_HAVE_TIOCGWINSZ
1005
MYSQL_HAVE_FIONREAD
1006
MYSQL_HAVE_TIOCSTAT
1007
MYSQL_STRUCT_DIRENT_D_INO
1008
MYSQL_STRUCT_DIRENT_D_NAMLEN
1009
MYSQL_TYPE_SIGHANDLER
1010
MYSQL_CHECK_MULTIBYTE
1011
if test "$with_named_curses" = "no"
1012
then
1013
  MYSQL_CHECK_LIB_TERMCAP
1014
else
201.2.3 by Monty Taylor
Cleaned up some LIBS bits in the build.
1015
  TERMCAP_LIBS="$with_named_curses"
1 by brian
clean slate
1016
fi
201.2.3 by Monty Taylor
Cleaned up some LIBS bits in the build.
1017
AC_SUBST(TERMCAP_LIBS)
1 by brian
clean slate
1018
1019
# Check if the termcap function 'tgoto' is already declared in
1020
# system header files or if it need to be declared locally
1021
AC_CHECK_DECLS(tgoto,,,[
1022
#ifdef HAVE_CURSES_H
1023
# include <curses.h>
1024
#elif HAVE_NCURSES_H
1025
# include <ncurses.h>
1026
#endif
1027
#ifdef HAVE_TERM_H
1028
# include <term.h>
1029
#endif
1030
])
1031
1032
# End of readline/libedit stuff
1033
#########################################################################
1034
1035
dnl Checks for library functions.
1036
1037
#
1038
# The following code disables intrinsic function support while we test for
1039
# library functions.  This is to avoid configure problems with Intel ecc
1040
# compiler
1041
1042
ORG_CFLAGS="$CFLAGS"
1043
if test "$GCC" != "yes"; then
1044
  AC_SYS_COMPILER_FLAG(-nolib_inline,nolib_inline,CFLAGS,[],[])
1045
fi
1046
1047
#AC_FUNC_MMAP
1048
AC_TYPE_SIGNAL
1049
MYSQL_TYPE_QSORT
1050
AC_FUNC_UTIME_NULL
1051
AC_FUNC_VPRINTF
1052
77.1.24 by Monty Taylor
Removed non-fcntl code and made it a fatal configure error if it's not there.
1053
AC_CHECK_FUNCS(fcntl)
1054
if test "x$ac_cv_func_fcntl" != "xyes"
1055
then
1056
  AC_MSG_ERROR("Drizzle requires fcntl.")
1057
fi
1058
212.6.3 by Mats Kindahl
Removing deprecated functions from code and replacing them with C99 equivalents:
1059
AC_CHECK_FUNCS(bsearch \
77.1.24 by Monty Taylor
Removed non-fcntl code and made it a fatal configure error if it's not there.
1060
  cuserid fchmod \
77.1.22 by Monty Taylor
Removed refs to floatingpoint.h (which we only used for fconvert) and fconvert
1061
  fdatasync finite fpresetsticky fpsetmask fsync ftruncate \
1 by brian
clean slate
1062
  getcwd getpass getpassphrase getpwnam \
1063
  getpwuid getrlimit getrusage getwd index initgroups isnan \
1064
  localtime_r gethrtime gmtime_r \
212.6.1 by Mats Kindahl
Replacing all bzero() calls with memset() calls and removing the bzero.c file.
1065
  locking longjmp lrand48 madvise mallinfo \
212.6.3 by Mats Kindahl
Removing deprecated functions from code and replacing them with C99 equivalents:
1066
  memmove \
1 by brian
clean slate
1067
  mkstemp mlockall perror poll pread pthread_attr_create mmap mmap64 getpagesize \
1068
  pthread_attr_getstacksize pthread_attr_setprio pthread_attr_setschedparam \
1069
  pthread_attr_setstacksize pthread_condattr_create pthread_getsequence_np \
1070
  pthread_key_delete pthread_rwlock_rdlock pthread_setprio \
1071
  pthread_setprio_np pthread_setschedparam pthread_sigmask readlink \
1072
  realpath rename rint rwlock_init setupterm \
1073
  shmget shmat shmdt shmctl sigaction sigemptyset sigaddset \
1074
  sighold sigset sigthreadmask port_create sleep \
1075
  snprintf socket stpcpy strcasecmp strerror strsignal strnlen strpbrk strstr \
6 by Brian Aker
Second pass on pthread cleanup
1076
  strtol strtoll strtoul strtoull tell tempnam vidattr \
1 by brian
clean slate
1077
  posix_fallocate backtrace backtrace_symbols backtrace_symbols_fd)
1078
28.1.33 by Monty Taylor
Added -Wall
1079
# Check that isinf() is available in math.h and can be used in both C and C++
1 by brian
clean slate
1080
# code
28.1.33 by Monty Taylor
Added -Wall
1081
AC_MSG_CHECKING(for isinf in math.h)
1082
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]], [[
1083
    float f = 0.0; 
1084
    int r = isinf(f); 
1085
    return r;
1086
  ]])],[
1 by brian
clean slate
1087
    AC_MSG_RESULT(yes)
28.1.33 by Monty Taylor
Added -Wall
1088
    AC_MSG_CHECKING(whether isinf() can be used in C++ code)
1089
    AC_LANG_PUSH([C++])
1090
    AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]], [[
1091
      float f = 0.0;
1092
      int r = isinf(f);
1093
      return r;
1094
    ]])],[
1095
      AC_MSG_RESULT(yes)
1096
      AC_DEFINE(HAVE_ISINF, [1], [isinf() macro or function])
1097
    ],[
1098
      AC_MSG_RESULT(no)
1099
    ])
1100
    AC_LANG_POP([])
1101
  ],[
1102
  AC_MSG_RESULT(no)])
1103
1104
1 by brian
clean slate
1105
CFLAGS="$ORG_CFLAGS"
1106
1107
# Sanity check: We chould not have any fseeko symbol unless
1108
# large_file_support=yes
1109
AC_CHECK_FUNC(fseeko,
1110
[if test "$large_file_support" = no -a "$TARGET_LINUX" = "true";
1111
then
1112
  AC_MSG_ERROR("Found fseeko symbol but large_file_support is not enabled!")
1113
fi]
1114
)
1115
1116
# Check definition of pthread_getspecific
1117
AC_CACHE_CHECK("args to pthread_getspecific", mysql_cv_getspecific_args,
28.1.33 by Monty Taylor
Added -Wall
1118
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if !defined(_REENTRANT)
1 by brian
clean slate
1119
#define _REENTRANT
1120
#endif
1121
#define _POSIX_PTHREAD_SEMANTICS 
28.1.33 by Monty Taylor
Added -Wall
1122
#include <pthread.h> ]], [[ void *pthread_getspecific(pthread_key_t key);
1123
pthread_getspecific((pthread_key_t) NULL); ]])],[mysql_cv_getspecific_args=POSIX],[mysql_cv_getspecific_args=other]))
1 by brian
clean slate
1124
  if test "$mysql_cv_getspecific_args" = "other"
1125
  then
1126
    AC_DEFINE([HAVE_NONPOSIX_PTHREAD_GETSPECIFIC], [1],
1127
              [For some non posix threads])
1128
  fi
1129
1130
  # Check definition of pthread_mutex_init
1131
  AC_CACHE_CHECK("args to pthread_mutex_init", mysql_cv_mutex_init_args,
28.1.33 by Monty Taylor
Added -Wall
1132
  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#define _REENTRANT
1 by brian
clean slate
1133
#define _POSIX_PTHREAD_SEMANTICS 
28.1.33 by Monty Taylor
Added -Wall
1134
#include <pthread.h> ]], [[ 
1 by brian
clean slate
1135
  pthread_mutexattr_t attr;
1136
  pthread_mutex_t mp;
28.1.33 by Monty Taylor
Added -Wall
1137
  pthread_mutex_init(&mp,&attr); ]])],[mysql_cv_mutex_init_args=POSIX],[mysql_cv_mutex_init_args=other]))
1 by brian
clean slate
1138
  if test "$mysql_cv_mutex_init_args" = "other"
1139
  then
1140
    AC_DEFINE([HAVE_NONPOSIX_PTHREAD_MUTEX_INIT], [1],
1141
              [For some non posix threads])
1142
  fi
1143
#---END:
1144
1145
#---START: Used in for client configure
1146
# Check definition of readdir_r
1147
AC_CACHE_CHECK("args to readdir_r", mysql_cv_readdir_r,
28.1.33 by Monty Taylor
Added -Wall
1148
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define _REENTRANT
1 by brian
clean slate
1149
#define _POSIX_PTHREAD_SEMANTICS 
1150
#include <pthread.h>
28.1.33 by Monty Taylor
Added -Wall
1151
#include <dirent.h>]], [[ int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result);
1152
readdir_r((DIR *) NULL, (struct dirent *) NULL, (struct dirent **) NULL); ]])],[mysql_cv_readdir_r=POSIX],[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()
1159
AC_CACHE_CHECK("style of sigwait", mysql_cv_sigwait,
28.1.33 by Monty Taylor
Added -Wall
1160
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define _REENTRANT
1 by brian
clean slate
1161
#define _POSIX_PTHREAD_SEMANTICS 
1162
#include <pthread.h>
28.1.33 by Monty Taylor
Added -Wall
1163
#include <signal.h>]], [[#ifndef _AIX
1 by brian
clean slate
1164
sigset_t set;
1165
int sig;
1166
sigwait(&set,&sig);
28.1.33 by Monty Taylor
Added -Wall
1167
#endif]])],[mysql_cv_sigwait=POSIX],[mysql_cv_sigwait=other]))
1 by brian
clean slate
1168
if test "$mysql_cv_sigwait" = "POSIX"
1169
then
1170
  AC_DEFINE([HAVE_SIGWAIT], [1], [POSIX sigwait])
1171
fi
1172
1173
if test "$mysql_cv_sigwait" != "POSIX"
1174
then
1175
unset mysql_cv_sigwait
1176
# Check definition of posix sigwait()
1177
AC_CACHE_CHECK("style of sigwait", mysql_cv_sigwait,
28.1.33 by Monty Taylor
Added -Wall
1178
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define _REENTRANT
1 by brian
clean slate
1179
#define _POSIX_PTHREAD_SEMANTICS 
1180
#include <pthread.h>
28.1.33 by Monty Taylor
Added -Wall
1181
#include <signal.h>]], [[sigset_t set;
1 by brian
clean slate
1182
int sig;
28.1.33 by Monty Taylor
Added -Wall
1183
sigwait(&set);]])],[mysql_cv_sigwait=NONPOSIX],[mysql_cv_sigwait=other]))
1 by brian
clean slate
1184
if test "$mysql_cv_sigwait" = "NONPOSIX"
1185
then
1186
  AC_DEFINE([HAVE_NONPOSIX_SIGWAIT], [1], [sigwait with one argument])
1187
fi
1188
fi
1189
#---END:
1190
1191
# Check if pthread_attr_setscope() exists
1192
AC_CACHE_CHECK("for pthread_attr_setscope", mysql_cv_pthread_attr_setscope,
28.1.33 by Monty Taylor
Added -Wall
1193
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define _REENTRANT
1 by brian
clean slate
1194
#define _POSIX_PTHREAD_SEMANTICS 
28.1.33 by Monty Taylor
Added -Wall
1195
#include <pthread.h>]], [[pthread_attr_t thr_attr;
1196
pthread_attr_setscope(&thr_attr,0);]])],[mysql_cv_pthread_attr_setscope=yes],[mysql_cv_pthread_attr_setscope=no]))
1 by brian
clean slate
1197
if test "$mysql_cv_pthread_attr_setscope" = "yes"
1198
then
1199
  AC_DEFINE([HAVE_PTHREAD_ATTR_SETSCOPE], [1], [pthread_attr_setscope])
1200
fi
1201
1202
# Check for bad includes
1203
AC_MSG_CHECKING("can netinet files be included")
28.1.33 by Monty Taylor
Added -Wall
1204
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
1 by brian
clean slate
1205
#include <sys/socket.h>
1206
#include <netinet/in_systm.h>
1207
#include <netinet/in.h>
1208
#include <netinet/ip.h>
28.1.33 by Monty Taylor
Added -Wall
1209
#include <netinet/tcp.h>]], [[ printf("1\n"); ]])],[netinet_inc=yes],[netinet_inc=no])
1 by brian
clean slate
1210
if test "$netinet_inc" = "no"
1211
then
1212
  AC_DEFINE([HAVE_BROKEN_NETINET_INCLUDES], [1], [Can netinet be included])
1213
fi
1214
AC_MSG_RESULT("$netinet_inc")
1215
28.1.33 by Monty Taylor
Added -Wall
1216
AC_LANG_PUSH([C++])
1 by brian
clean slate
1217
AC_CHECK_HEADERS(cxxabi.h)
1218
AC_CACHE_CHECK([checking for abi::__cxa_demangle], mysql_cv_cxa_demangle,
28.1.33 by Monty Taylor
Added -Wall
1219
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <cxxabi.h>]], [[
1 by brian
clean slate
1220
  char *foo= 0; int bar= 0;
1221
  foo= abi::__cxa_demangle(foo, foo, 0, &bar);
28.1.33 by Monty Taylor
Added -Wall
1222
]])],[mysql_cv_cxa_demangle=yes],[mysql_cv_cxa_demangle=no])])
1223
AC_LANG_POP([])
1 by brian
clean slate
1224
1225
if test "x$mysql_cv_cxa_demangle" = xyes; then
1226
  AC_DEFINE(HAVE_ABI_CXA_DEMANGLE, 1,
1227
            [Define to 1 if you have the `abi::__cxa_demangle' function.])
1228
fi
1229
1230
#--------------------------------------------------------------------
1231
# Check for requested features
1232
#--------------------------------------------------------------------
1233
1234
MYSQL_CHECK_BIG_TABLES
1235
MYSQL_CHECK_MAX_INDEXES
1236
MYSQL_CHECK_VIO
1237
1238
#--------------------------------------------------------------------
1239
# Declare our plugin modules
1240
# Has to be done late, as the plugin may need to check for existence of
1241
# functions tested above
1242
#--------------------------------------------------------------------
1243
1244
MYSQL_CONFIGURE_PLUGINS([none])
1245
1246
AC_SUBST(mysql_plugin_dirs)
1247
AC_SUBST(mysql_plugin_libs)
1248
AC_SUBST(mysql_plugin_defs)
1249
189 by Brian Aker
Refactor of configure.ac. Added profile. One note... I believe this should
1250
AC_ARG_ENABLE([profiling],
1251
    [AS_HELP_STRING([--enable-profiling],
1252
       [Toggle profiling @<:@default=off@:>@])],
1253
    [ac_profiling="$enableval"],
1254
    [ac_profiling="no"])
1255
1256
AC_ARG_ENABLE([coverage],
1257
    [AS_HELP_STRING([--enable-coverage],
1258
       [Toggle coverage @<:@default=off@:>@])],
1259
    [ac_coverage="$enableval"],
1260
    [ac_coverage="no"])
1261
53.2.1 by Monty Taylor
Added --disable-pedantic-warnings and --enable-fail.
1262
AC_ARG_ENABLE([pedantic-warnings],
1263
    [AS_HELP_STRING([--disable-pedantic-warnings],
1264
       [Toggle pedanticness @<:@default=on@:>@])],
1265
    [ac_warn_pedantic="$enableval"],
1266
    [ac_warn_pedantic="yes"])
1267
1268
AC_ARG_ENABLE([fail],
77.1.112 by Monty Taylor
Fixed comment on --enable-fail -> --disable-fail.
1269
    [AS_HELP_STRING([--disable-fail],
1270
       [Turn warnings into failures @<:@default=on@:>@])],
53.2.1 by Monty Taylor
Added --disable-pedantic-warnings and --enable-fail.
1271
    [ac_warn_fail="$enableval"],
77.1.108 by Monty Taylor
Turn on -Werror again by default.
1272
    [ac_warn_fail="yes"])
53.2.1 by Monty Taylor
Added --disable-pedantic-warnings and --enable-fail.
1273
53.2.6 by Monty Taylor
Turned unreachable code warnings into a configure option.
1274
AC_ARG_ENABLE([unreachable],
1275
    [AS_HELP_STRING([--enable-unreachable],
1276
       [Enable warnings about unreachable code @<:@default=off@:>@])],
1277
    [ac_warn_unreachable="$enableval"],
1278
    [ac_warn_unreachable="no"])
1279
77.1.109 by Monty Taylor
Made --disable-pedantic-warnings only disable the pedantic warnings, rather than also removing the -std=gnu99 part.
1280
AC_ARG_ENABLE([longlong-warnings],
1281
    [AS_HELP_STRING([--enable-longlong-warnings],
1282
       [Enable warnings about longlong in C++ @<:@default=off@:>@])],
1283
    [ac_warn_longlong="$enableval"],
1284
    [ac_warn_longlong="no"])
1285
1286
AC_ARG_ENABLE([strict-aliasing],
1287
    [AS_HELP_STRING([--enable-strict-aliasing],
1288
       [Enable warnings about stict-aliasing @<:@default=off@:>@])],
1289
    [ac_warn_strict_aliasing="$enableval"],
1290
    [ac_warn_strict_aliasing="no"])
1291
53.2.2 by Monty Taylor
Updated everything that needs updating to compile with -std=gnu99 -pedantic
1292
53.2.1 by Monty Taylor
Added --disable-pedantic-warnings and --enable-fail.
1293
if test "$GCC" = "yes"
1294
then
53.2.2 by Monty Taylor
Updated everything that needs updating to compile with -std=gnu99 -pedantic
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
  if test "$ac_warn_longlong" = "yes"
1297
  then
1298
    W_LONGLONG="-Wlong-long"
1299
  else
1300
    W_LONGLONG="-Wno-long-long"
1301
  fi
53.2.1 by Monty Taylor
Added --disable-pedantic-warnings and --enable-fail.
1302
77.1.109 by Monty Taylor
Made --disable-pedantic-warnings only disable the pedantic warnings, rather than also removing the -std=gnu99 part.
1303
  if test "$ac_warn_strict_aliasing" = "yes"
1304
  then
1305
    W_STRICT_ALIASING="-Wstrict-aliasing"
1306
  else
77.1.110 by Monty Taylor
Fixed a typo.
1307
    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.
1308
  fi
53.2.1 by Monty Taylor
Added --disable-pedantic-warnings and --enable-fail.
1309
189 by Brian Aker
Refactor of configure.ac. Added profile. One note... I believe this should
1310
  if test "$ac_profiling" = "yes"
1311
  then
1312
    GPROF_PROFILING="-pg"
1313
  else
1314
    GPROF_PROFILING=" "
1315
  fi
1316
1317
  if test "$ac_coverage" = "yes"
1318
  then
1319
    GPROF_COVERAGE="-fprofile-arcs -ftest-coverage"
1320
  else
1321
    GPROF_COVERAGE=" "
1322
  fi
1323
53.2.1 by Monty Taylor
Added --disable-pedantic-warnings and --enable-fail.
1324
  if test "$ac_warn_pedantic" = "yes"
1325
  then
77.1.109 by Monty Taylor
Made --disable-pedantic-warnings only disable the pedantic warnings, rather than also removing the -std=gnu99 part.
1326
    GCC_PEDANTIC="-pedantic -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls ${W_STRICT_ALIASING}"
1327
    GXX_PEDANTIC="-pedantic -Wundef -Wredundant-decls ${W_LONGLONG} ${W_STRICT_ALIASING}"
53.2.1 by Monty Taylor
Added --disable-pedantic-warnings and --enable-fail.
1328
  fi
1329
53.2.6 by Monty Taylor
Turned unreachable code warnings into a configure option.
1330
  if test "$ac_warn_unreachable" = "yes"
1331
  then
77.1.109 by Monty Taylor
Made --disable-pedantic-warnings only disable the pedantic warnings, rather than also removing the -std=gnu99 part.
1332
    W_UNREACHABLE="-Wunreachable-code"
53.2.6 by Monty Taylor
Turned unreachable code warnings into a configure option.
1333
  fi
1334
53.2.1 by Monty Taylor
Added --disable-pedantic-warnings and --enable-fail.
1335
  if test "$ac_warn_fail" = "yes"
1336
  then
77.1.109 by Monty Taylor
Made --disable-pedantic-warnings only disable the pedantic warnings, rather than also removing the -std=gnu99 part.
1337
    W_FAIL="-Werror"
53.2.1 by Monty Taylor
Added --disable-pedantic-warnings and --enable-fail.
1338
  fi
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
  BASE_WARNINGS="-W -Wall -Wextra"
236.1.2 by Monty Taylor
Changed the way we work around autoconf2.59
1341
  GCC_WARNINGS="${C99_SUPPORT_HACK} ${BASE_WARNINGS} ${GCC_PEDANTIC} ${W_UNREACHABLE} ${W_FAIL} ${GPROF_PROFILING} ${GPROF_COVERAGE}"
230.3.1 by Monty Taylor
Bug 252805: ./configure not detecting missing g++
1342
  GXX_WARNINGS="${BASE_WARNINGS} ${GXX_PEDANTIC} ${W_UNREACHABLE} ${W_FAIL} ${GPROF_PROFILING} ${GPROF_COVERAGE}"
77.1.109 by Monty Taylor
Made --disable-pedantic-warnings only disable the pedantic warnings, rather than also removing the -std=gnu99 part.
1343
1344
  CXXFLAGS="$CXXFLAGS ${GXX_WARNINGS}"
1345
  CFLAGS="$CFLAGS ${GCC_WARNINGS} "
53.2.1 by Monty Taylor
Added --disable-pedantic-warnings and --enable-fail.
1346
fi
1347
212.5.43 by Monty Taylor
Removed global include dir from CPPFLAGS.
1348
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.
1349
AC_SUBST([AM_CPPFLAGS],['${GLOBAL_CPPFLAGS}'])
1350
1 by brian
clean slate
1351
# Some usefull subst
1352
AC_SUBST(CC)
1353
AC_SUBST(GXX)
1354
1355
# Set configuration options for make_binary_distribution
1356
case $SYSTEM_TYPE in
1357
  *netware*)
1358
    MAKE_BINARY_DISTRIBUTION_OPTIONS="$MAKE_BINARY_DISTRIBUTION_OPTIONS --no-strip"
1359
    ;;
1360
  *)
1361
    : # no change for other platforms yet
1362
    ;;
1363
esac
1364
AC_SUBST(MAKE_BINARY_DISTRIBUTION_OPTIONS)
1365
28.1.2 by Monty Taylor
First stab at back porting libtool convenience lib patch from telco-6.2
1366
AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile mysys/tests/Makefile dnl
212.5.4 by Monty Taylor
Renamed strings to mystrings, for include/lib naming consistency.
1367
 mystrings/Makefile mystrings/tests/Makefile storage/Makefile dnl
13 by brian
Incomming patch to clean up build.
1368
 vio/Makefile dnl
77.1.38 by Monty Taylor
Renamed more stuff to drizzle.
1369
 libdrizzle/Makefile client/Makefile dnl
214 by Brian Aker
Rename of fields (fix issue with string and decimal .h clashing).
1370
 drizzled/Makefile dnl
1371
 drizzled/field/Makefile dnl
1372
 drizzled/share/Makefile dnl
1373
 drizzled/sql_builtin.cc dnl
28.1.31 by Monty Taylor
Deleted tons of pointless garbage from scripts.
1374
 support-files/Makefile dnl
77.1.47 by Monty Taylor
Moved test to tests...
1375
 tests/Makefile tests/install_test_db dnl
212.5.36 by Monty Taylor
Moved drizzle_version.
1376
 drizzled/version.h plugin/Makefile dnl
214 by Brian Aker
Rename of fields (fix issue with string and decimal .h clashing).
1377
 drizzled/drizzled_safe support-files/libdrizzle.pc dnl
77.1.38 by Monty Taylor
Renamed more stuff to drizzle.
1378
 support-files/drizzle.server support-files/drizzle-log-rotate)
1 by brian
clean slate
1379
1380
AC_CONFIG_COMMANDS([default], , test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h)
1381
1382
# Ensure that table handlers gets all modifications to CFLAGS/CXXFLAGS
1383
AC_CONFIG_COMMANDS_POST(ac_configure_args="$ac_configure_args CFLAGS='$CFLAGS' CXXFLAGS='$CXXFLAGS'")
1384
1385
AC_OUTPUT