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