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