~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Brian Aker
  • Date: 2008-07-14 03:04:13 UTC
  • mfrom: (77.1.90 codestyle)
  • Revision ID: brian@tangent.org-20080714030413-dpv6opb0eoy1rd3f
Merging Monty's code, I did remove error on compile though (since it does
not currently work because of sql_plugin.cc)

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 
4
4
AC_PREREQ(2.59)dnl              Minimum Autoconf version required.
5
5
 
6
 
AC_INIT(drizzle, [7.0.0], [http://bugs.launchpad.net/drizzle])
7
 
AC_CONFIG_SRCDIR([drizzled/drizzled.cc])
 
6
AC_INIT
 
7
AC_CONFIG_SRCDIR([server/drizzled.cc])
8
8
AC_CONFIG_AUX_DIR(config)
9
 
AC_CONFIG_HEADERS([config.h])
10
 
 
11
 
# Save some variables and the command line options for mysqlbug
12
 
SAVE_CC="$CC"
13
 
SAVE_CXX="$CXX"
14
 
SAVE_ASFLAGS="$ASFLAGS"
15
 
SAVE_CFLAGS="$CFLAGS"
16
 
SAVE_CXXFLAGS="$CXXFLAGS"
17
 
SAVE_LDFLAGS="$LDFLAGS"
18
 
SAVE_CXXLDFLAGS="$CXXLDFLAGS"
19
 
CONF_COMMAND="$0 $ac_configure_args"
20
 
AC_SUBST(CONF_COMMAND)
21
 
AC_SUBST(SAVE_CC)
22
 
AC_SUBST(SAVE_CXX)
23
 
AC_SUBST(SAVE_ASFLAGS)
24
 
AC_SUBST(SAVE_CFLAGS)
25
 
AC_SUBST(SAVE_CXXFLAGS)
26
 
AC_SUBST(SAVE_LDFLAGS)
27
 
AC_SUBST(SAVE_CXXLDFLAGS)
28
 
AC_SUBST(CXXLDFLAGS)
29
 
 
 
9
AC_CONFIG_HEADERS([include/config.h:config.h.in])
30
10
AC_CANONICAL_TARGET
31
 
AM_INIT_AUTOMAKE(-Wall -Wno-portability -Werror)
 
11
AM_INIT_AUTOMAKE(drizzle, 7.0.0, no-define)
32
12
 
33
13
PROTOCOL_VERSION=10
34
14
DOT_FRM_VERSION=6
35
15
# See the libtool docs for information on how to do shared lib versions.
36
 
SHARED_LIB_MAJOR_VERSION=1
 
16
SHARED_LIB_MAJOR_VERSION=16
37
17
SHARED_LIB_VERSION=$SHARED_LIB_MAJOR_VERSION:0:0
38
18
 
39
19
 
40
 
dnl AC_CANONICAL_HOST thinks it's a good idea to just set CFLAGS to 
41
 
dnl -g -O2 if you're running gcc. We would like to use something else, thanks.
42
 
if test "x${CFLAGS}" = "x-g -O2"
43
 
then
44
 
  CFLAGS=
45
 
fi
46
 
if test "x${CXXFLAGS}" = "x-g -O2"
47
 
then
48
 
  CXXFLAGS=
49
 
fi
50
 
 
51
20
 
52
21
# Set all version vars based on $VERSION. How do we do this more elegant ?
53
22
# Remember that regexps needs to quote [ and ] since this is run through m4
54
23
# We take some made up examples
55
24
#
56
25
#  VERSION                  5.1.40sp1-alpha     5.0.34a
57
 
#  DRIZZLE_NO_DASH_VERSION    5.1.40sp1           5.0.34a
58
 
#  DRIZZLE_NUMERIC_VERSION    5.1.40              5.0.34
59
 
#  DRIZZLE_BASE_VERSION       5.1                 5.0
60
 
#  DRIZZLE_VERSION_ID         50140               50034
 
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
61
30
#
62
 
DRIZZLE_NO_DASH_VERSION=`echo $VERSION | sed -e "s|-.*$||"`
63
 
DRIZZLE_NUMERIC_VERSION=`echo $DRIZZLE_NO_DASH_VERSION | sed -e "s|[[a-z]][[a-z0-9]]*$||"`
64
 
DRIZZLE_BASE_VERSION=`echo $DRIZZLE_NUMERIC_VERSION | sed -e "s|\.[[^.]]*$||"`
65
 
DRIZZLE_VERSION_ID=`echo $DRIZZLE_NUMERIC_VERSION | \
 
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 | \
66
35
    awk -F. '{printf "%d%0.2d%0.2d", $1, $2, $3}'`
67
36
 
68
37
# The port should be constant for a LONG time
69
 
DRIZZLE_TCP_PORT_DEFAULT=4427
70
 
 
71
 
sinclude(m4/dtrace.m4)
72
 
sinclude(m4/character_sets.m4)
73
 
 
74
 
AM_GNU_GETTEXT([external])
75
 
AM_GNU_GETTEXT_VERSION(0.17)
76
 
 
77
 
AM_CONDITIONAL([BUILD_GETTEXT],[test "x$MSGMERGE" != "x" -a "x$MSGMERGE" != "x:"])
78
 
 
79
 
AC_SUBST(DRIZZLE_NO_DASH_VERSION)
80
 
AC_SUBST(DRIZZLE_BASE_VERSION)
81
 
AC_SUBST(DRIZZLE_VERSION_ID)
82
 
AC_SUBST(DRIZZLE_PREVIOUS_BASE_VERSION)
 
38
MYSQL_TCP_PORT_DEFAULT=3306
 
39
 
 
40
dnl Include m4 
 
41
sinclude(config/ac-macros/alloca.m4)
 
42
sinclude(config/ac-macros/check_cpu.m4)
 
43
sinclude(config/ac-macros/character_sets.m4)
 
44
sinclude(config/ac-macros/compiler_flag.m4)
 
45
sinclude(config/ac-macros/dtrace.m4)
 
46
sinclude(config/ac-macros/plugins.m4)
 
47
sinclude(config/ac-macros/large_file.m4)
 
48
sinclude(config/ac-macros/misc.m4)
 
49
sinclude(config/ac-macros/readline.m4)
 
50
sinclude(config/ac-macros/ssl.m4)
 
51
sinclude(config/ac-macros/pkg.m4)
 
52
 
 
53
# Remember to add a directory server/share/LANGUAGE
 
54
AVAILABLE_LANGUAGES="\
 
55
czech danish dutch english estonian french german greek hungarian \
 
56
italian japanese korean norwegian norwegian-ny polish portuguese \
 
57
romanian russian serbian slovak spanish swedish ukrainian"
 
58
 
 
59
#####
 
60
#####
 
61
 
 
62
AC_SUBST(MYSQL_NO_DASH_VERSION)
 
63
AC_SUBST(MYSQL_BASE_VERSION)
 
64
AC_SUBST(MYSQL_VERSION_ID)
 
65
AC_SUBST(MYSQL_PREVIOUS_BASE_VERSION)
83
66
AC_SUBST(PROTOCOL_VERSION)
84
67
AC_DEFINE_UNQUOTED([PROTOCOL_VERSION], [$PROTOCOL_VERSION],
85
68
                   [mysql client protocol version])
90
73
AC_SUBST(SHARED_LIB_VERSION)
91
74
AC_SUBST(AVAILABLE_LANGUAGES)
92
75
 
93
 
# General Constants
94
 
AC_DEFINE([IO_SIZE], [4096], [Io buffer size; Must be a power of 2 and 
95
 
  a multiple of 512. May be
96
 
  smaller what the disk page size. This influences the speed of the
97
 
  isam btree library. eg to big to slow.])
98
 
AC_DEFINE([SC_MAXWIDTH],[256], [Max width of screen (for error messages)])
99
 
AC_DEFINE([FN_LEN],[256 ], [Max file name len ])
100
 
AC_DEFINE([FN_HEADLEN],[253], [Max length of filepart of file name ])
101
 
AC_DEFINE([FN_EXTLEN],[20], [Max length of extension (part of FN_LEN) ])
102
 
AC_DEFINE([FN_REFLEN],[512], [Max length of full path-name ])
103
 
AC_DEFINE([FN_EXTCHAR],['.'], [File extension character])
104
 
AC_DEFINE([FN_HOMELIB],['~'], [~/ is used as abbrev for home dir ])
105
 
AC_DEFINE([FN_CURLIB],['.'], [./ is used as abbrev for current dir ])
106
 
AC_DEFINE([FN_PARENTDIR],[".."], [Parent directory; Must be a string ])
107
 
 
108
 
AC_DEFINE([MASTER],[1],[Compile without unireg])
109
 
 
110
 
AH_VERBATIM([QUOTE_ARG],[
111
 
/* Quote argument (before cpp) */
112
 
#ifndef QUOTE_ARG
113
 
# define QUOTE_ARG(x) #x
114
 
#endif
115
 
/* Quote argument, (after cpp) */
116
 
#ifndef STRINGIFY_ARG
117
 
# define STRINGIFY_ARG(x) QUOTE_ARG(x)
118
 
#endif
119
 
])
120
 
 
121
 
AH_VERBATIM([builtin_expect],[
122
 
/*
123
 
 * The macros below are borrowed from include/linux/compiler.h in the
124
 
 * Linux kernel. Use them to indicate the likelyhood of the truthfulness
125
 
 * of a condition. This serves two purposes - newer versions of gcc will be
126
 
 * able to optimize for branch predication, which could yield siginficant
127
 
 * performance gains in frequently executed sections of the code, and the
128
 
 * other reason to use them is for documentation
129
 
 */
130
 
#if !defined(__GNUC__)
131
 
#define __builtin_expect(x, expected_value) (x)
132
 
#endif
133
 
 
134
 
#define likely(x)  __builtin_expect((x),1)
135
 
#define unlikely(x)  __builtin_expect((x),0)
136
 
])
137
 
 
138
 
dnl  InnoDB depends on some Drizzle's internals which other plugins should not
139
 
dnl  need.  This is because of InnoDB's foreign key support, "safe" binlog
140
 
dnl  truncation, and other similar legacy features.
141
 
 
142
 
dnl  We define accessors for these internals unconditionally, but do not
143
 
dnl  expose them in mysql/plugin.h.  They are declared in ha_innodb.h for
144
 
dnl  InnoDB's use.
145
 
 
146
 
AC_DEFINE([INNODB_COMPATIBILITY_HOOKS],[1],[TODO: Remove the need for this])
147
 
dnl TODO: Make a test for when this needs to be set.
148
 
AC_DEFINE([_REENTRANT],[1],[Some thread libraries require this])
149
 
 
150
 
AH_VERBATIM([posix_pthread],[
151
 
/* We want posix threads */
152
 
#ifndef _POSIX_PTHREAD_SEMANTICS
153
 
#define _POSIX_PTHREAD_SEMANTICS
154
 
#endif
155
 
])
156
 
 
157
76
 
158
77
# Canonicalize the configuration name.
159
78
 
181
100
  i?86) BASE_MACHINE_TYPE=i386 ;;
182
101
esac
183
102
 
 
103
# Save some variables and the command line options for mysqlbug
 
104
SAVE_CC="$CC"
 
105
SAVE_CXX="$CXX"
 
106
SAVE_ASFLAGS="$ASFLAGS"
 
107
SAVE_CFLAGS="$CFLAGS"
 
108
SAVE_CXXFLAGS="$CXXFLAGS"
 
109
SAVE_LDFLAGS="$LDFLAGS"
 
110
SAVE_CXXLDFLAGS="$CXXLDFLAGS"
 
111
CONF_COMMAND="$0 $ac_configure_args"
 
112
AC_SUBST(CONF_COMMAND)
 
113
AC_SUBST(SAVE_CC)
 
114
AC_SUBST(SAVE_CXX)
 
115
AC_SUBST(SAVE_ASFLAGS)
 
116
AC_SUBST(SAVE_CFLAGS)
 
117
AC_SUBST(SAVE_CXXFLAGS)
 
118
AC_SUBST(SAVE_LDFLAGS)
 
119
AC_SUBST(SAVE_CXXLDFLAGS)
 
120
AC_SUBST(CXXLDFLAGS)
 
121
 
184
122
AM_SANITY_CHECK
185
123
# This is needed is SUBDIRS is set
186
124
AC_PROG_MAKE_SET
209
147
 
210
148
################ End of section to be done before AC_PROG_CC #################
211
149
 
 
150
# The following hack should ensure that configure doesn't add optimizing
 
151
# or debugging flags to CFLAGS or CXXFLAGS
 
152
# C_EXTRA_FLAGS are flags that are automaticly added to both
 
153
# CFLAGS and CXXFLAGS
 
154
CFLAGS="$CFLAGS $C_EXTRA_FLAGS "
 
155
CXXFLAGS="$CXXFLAGS $C_EXTRA_FLAGS "
 
156
 
212
157
dnl Checks for programs.
 
158
AC_PROG_AWK
213
159
AC_PROG_CC
214
 
ifdef([AC_PROG_CC_C99],[
215
 
  dnl TODO: Need to fix this to use c99 instead of gnu99
216
 
  AC_PROG_CC_C99([],[AC_MSG_ERROR([C99 support required for compiling Drizzle])])
217
 
  C99_SUPPORT_HACK=""
218
 
],[C99_SUPPORT_HACK="-std=gnu99"])
219
160
AC_PROG_CXX
220
 
AC_CXX_HEADER_STDCXX_98
221
 
if test "$ac_cv_cxx_stdcxx_98" = "no"
222
 
then
223
 
  AC_MSG_ERROR([C++ Compiler required to compile Drizzle])
224
 
fi
225
161
AC_PROG_CPP
226
162
AM_PROG_CC_C_O
227
163
 
228
 
AC_CXX_STL_HASH
229
 
AC_CXX_CSTDINT
230
 
AC_CXX_CINTTYPES
231
 
AC_CXX_CMATH
232
 
 
233
164
# Print version of CC and CXX compiler (if they support --version)
234
165
case $SYSTEM_TYPE in
235
 
  *apple-darwin*)
236
 
    AC_DEFINE([TARGET_OS_OSX], [1], [Whether we build for OSX])
 
166
  *netware*)
 
167
CC_VERSION=`$CC -version | grep -i version`
237
168
    ;;
238
169
  *)
239
170
CC_VERSION=`$CC --version | sed 1q`
247
178
CC_VERSION=""
248
179
fi
249
180
AC_SUBST(CC_VERSION)
250
 
 
251
 
dnl AC_CANONICAL_HOST thinks it's a good idea to just set CFLAGS to 
252
 
dnl -g -O2 if you're running gcc. We would like to use something else, thanks.
253
 
if test "x${CFLAGS}" = "x-g -O2"
254
 
then
255
 
  CFLAGS=
256
 
fi
257
 
if test "x${CXXFLAGS}" = "x-g -O2"
258
 
then
259
 
  CXXFLAGS=
260
 
fi
261
 
 
262
 
DRIZZLE_CHECK_CXX_VERSION
263
 
 
264
 
AC_PROG_AWK
 
181
MYSQL_CHECK_CXX_VERSION
265
182
 
266
183
if test "$ac_cv_c_compiler_gnu" = "yes"
267
184
then
271
188
  AC_PATH_PROG(AS, as, as)
272
189
fi
273
190
 
274
 
dnl TODO: This needs to go away and be replaced with _ISOC99_SOURCE
275
 
if test "$ac_cv_compiler_gnu" = "yes" -o "$target_os" = "linux-gnu"
276
 
then
277
 
  AC_DEFINE([_GNU_SOURCE],[1],[Fix problem with S_ISLNK() on Linux])
278
 
fi
279
 
 
280
 
dnl  Solaris 9 include file <sys/feature_tests.h> refers to X/Open document
281
 
 
282
 
dnl  System Interfaces and Headers, Issue 5
283
 
 
284
 
dnl  saying we should define _XOPEN_SOURCE=500 to get POSIX.1c prototypes,
285
 
dnl  but apparently other systems (namely FreeBSD) don't agree.
286
 
 
287
 
dnl  On a newer Solaris 10, the above file recognizes also _XOPEN_SOURCE=600.
288
 
dnl  Furthermore, it tests that if a program requires older standard
289
 
dnl  (_XOPEN_SOURCE<600 or _POSIX_C_SOURCE<200112L) it cannot be
290
 
dnl  run on a new compiler (that defines _STDC_C99) and issues an #error.
291
 
dnl  It's also an #error if a program requires new standard (_XOPEN_SOURCE=600
292
 
dnl  or _POSIX_C_SOURCE=200112L) and a compiler does not define _STDC_C99.
293
 
 
294
 
dnl  To add more to this mess, Sun Studio C compiler defines _STDC_C99 while
295
 
dnl  C++ compiler does not!
296
 
 
297
 
dnl TODO: Can _ISOC99_SOURCE be defined on all platforms and remove the 
298
 
dnl       Need for all of this? 
299
 
case "$target_os" in
300
 
  *solaris*)
301
 
  dnl Do we need both of these? 
302
 
  CXXFLAGS="${CXXFLAGS} -D__C99FEATURES__"
303
 
  CFLAGS="${CFLAGS} -D_XOPEN_SOURCE=600"
304
 
  AC_DEFINE([__EXTENSIONS__],[1],[Turn on needed extensions on Solaris])
305
 
  ;;
306
 
esac
307
 
 
308
 
 
 
191
# Still need ranlib for readline; local static use only so no libtool.
 
192
AC_PROG_RANLIB
309
193
# We use libtool
310
194
#AC_LIBTOOL_WIN32_DLL
311
195
AC_PROG_LIBTOOL
359
243
then
360
244
  case "$host_cpu" in
361
245
    *ppc* | *powerpc*)
362
 
      AM_CFLAGS="$CFLAGS -mno-fused-madd"
363
 
      AM_CXXFLAGS="$CXXFLAGS -mno-fused-madd"
 
246
      CFLAGS="$CFLAGS -mno-fused-madd"
 
247
      CXXFLAGS="$CXXFLAGS -mno-fused-madd"
364
248
    ;;
365
249
  esac
366
250
fi
378
262
 
379
263
if test "$GCC" = "yes"
380
264
then
 
265
  # mysqld requires -fno-implicit-templates.
381
266
  # Disable exceptions as they seams to create problems with gcc and threads.
382
 
  # drizzled doesn't use run-time-type-checking, so we disable it.
383
 
  AM_CXXFLAGS="${AM_CXXFLAGS} -fno-exceptions"
 
267
  # mysqld doesn't use run-time-type-checking, so we disable it.
 
268
  # We should use -Wno-invalid-offsetof flag to disable some warnings from gcc
 
269
  # regarding offset() usage in C++ which are done in a safe manner in the
 
270
  # server
 
271
  CXXFLAGS="$CXXFLAGS -fno-implicit-templates -fno-exceptions -fno-rtti"
 
272
  AC_DEFINE([HAVE_EXPLICIT_TEMPLATE_INSTANTIATION],
 
273
    [1], [Defined by configure. Use explicit template instantiation.])
384
274
fi
385
275
 
386
 
DRIZZLE_PROG_AR
 
276
MYSQL_PROG_AR
387
277
 
388
 
# libdrizzle versioning when linked with GNU ld.
 
278
# libmysqlclient versioning when linked with GNU ld.
389
279
if $LD --version 2>/dev/null|grep -q GNU; then
390
 
  LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_srcdir)/libdrizzle/libdrizzle.ver"
 
280
  LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_builddir)/libdrizzle/libdrizzle.ver"
 
281
  AC_CONFIG_FILES(libdrizzle/libdrizzle.ver)
391
282
fi
392
283
AC_SUBST(LD_VERSION_SCRIPT)
393
284
 
394
285
#--------------------------------------------------------------------
395
 
# Check for Google Proto Buffers
396
 
#--------------------------------------------------------------------
397
 
 
398
 
AC_LANG_PUSH([C++])
399
 
AC_CHECK_HEADERS([google/protobuf/message.h])
400
 
if test "x$ac_cv_header_google_protobuf_message_h" != "xyes"
401
 
then
402
 
  AC_MSG_ERROR([Couldn't find message.h. Try installing Google Protocol Buffer development packages])
403
 
fi
404
 
 
405
 
save_CFLAGS="$CFLAGS"
406
 
save_LIBS="$LIBS"
407
 
CFLAGS=""
408
 
LIBS="-lprotobuf"
409
 
 
410
 
AC_CACHE_CHECK([for Message in libprotobuf], ac_libprotobuf_works, [
411
 
  AC_TRY_LINK([
412
 
#include <google/protobuf/descriptor.pb.h>
413
 
  ],[
414
 
    google::protobuf::FileDescriptorProto testFdp;
415
 
  ], ac_libprotobuf_works=yes, [
416
 
        AC_ERROR([could not find Google's libprotobuf])
417
 
  ])
418
 
 
419
 
])
420
 
 
421
 
PROTOBUF_LIBS="${LIBS}"
422
 
AC_SUBST(PROTOBUF_LIBS)
423
 
CFLAGS="$save_CFLAGS"
424
 
LIBS="$save_LIBS"
425
 
AC_LANG_POP()
426
 
 
427
 
#--------------------------------------------------------------------
428
286
# Check for libevent
429
287
#--------------------------------------------------------------------
430
288
 
431
 
AC_MSG_CHECKING(for libevent)
432
 
AC_ARG_WITH(libevent,
433
 
  [AS_HELP_STRING([--with-libevent],
434
 
       [Use libevent build directory])],
435
 
  [ with_libevent=$withval ],
436
 
  [ with_libevent=yes ])
437
 
 
438
 
if test "$with_libevent" = "yes"
 
289
AC_CHECK_HEADERS(event.h)
 
290
if test "x$ac_cv_header_event_h" != "xyes"
439
291
then
440
 
    AC_CHECK_HEADERS(event.h)
441
 
    if test "x$ac_cv_header_event_h" != "xyes"
442
 
    then
443
 
      AC_MSG_ERROR([Couldn't find event.h. Try installing libevent development packages])
444
 
    fi
445
 
    my_save_LIBS="$LIBS"
446
 
    LIBS=""
447
 
    AC_CHECK_LIB(event, event_loop, [], [AC_MSG_ERROR(could not find libevent)])
448
 
    LIBEVENT_LIBS="${LIBS}"
449
 
    LIBS="${my_save_LIBS}"
450
 
    LIBEVENT_CFLAGS=""
451
 
else
452
 
    AC_MSG_RESULT($withval)
453
 
    if test -f $withval/event.h -a -f $withval/libevent.a; then
454
 
       owd=`pwd`
455
 
       if cd $withval; then withval=`pwd`; cd $owd; fi
456
 
       LIBEVENT_CFLAGS="-I$withval"
457
 
       LIBEVENT_LIBS="-L$withval -levent"
458
 
    elif test -f $withval/include/event.h -a -f $withval/lib/libevent.a; then
459
 
       owd=`pwd`
460
 
       if cd $withval; then withval=`pwd`; cd $owd; fi
461
 
       LIBEVENT_CFLAGS="-I$withval/include"
462
 
       LIBEVENT_LIBS="-L$withval/lib -levent"
463
 
    else
464
 
       AC_MSG_ERROR([event.h or libevent.a not found in $withval])
465
 
    fi
 
292
  AC_MSG_ERROR([Couldn't find event.h. Try installing libevent development packages])
466
293
fi
467
 
 
468
 
AC_SUBST(LIBEVENT_CFLAGS)
469
 
AC_SUBST(LIBEVENT_LIBS)
470
 
 
471
 
AC_CACHE_CHECK([for bufferevent in libevent], ac_libevent_works, [
472
 
  save_CFLAGS="$CFLAGS"
473
 
  save_LIBS="$LIBS"
474
 
  CFLAGS="$LIBEVENT_CFLAGS"
475
 
  LIBS="$LIBEVENT_LIBS"
476
 
  AC_TRY_LINK([
477
 
#include <sys/types.h>
478
 
#include <sys/time.h>
479
 
#include <stdlib.h>
480
 
#include <event.h>],[
481
 
        struct bufferevent bev;
482
 
        bufferevent_settimeout(&bev, 1, 1);
483
 
  ], ac_libevent_works=yes, [
484
 
        AC_ERROR([you need to install a more recent version of libevent,
485
 
        check http://www.monkey.org/~provos/libevent/])
486
 
  ])
487
 
 
488
 
  CFLAGS="$save_CFLAGS"
489
 
  LIBS="$save_LIBS"
490
 
])
491
 
 
 
294
AC_CHECK_LIB(event, event_loop, [], [AC_MSG_ERROR(could not find libevent)])
492
295
 
493
296
#--------------------------------------------------------------------
494
297
# Check for libpthread
502
305
AC_CHECK_LIB(pthread, pthread_create, [], [AC_MSG_ERROR(could not find libpthread)])
503
306
 
504
307
#--------------------------------------------------------------------
505
 
# Check for tcmalloc
506
 
#--------------------------------------------------------------------
507
 
 
508
 
AC_ARG_ENABLE([tcmalloc],
509
 
    [AS_HELP_STRING([--enable-tcmalloc],
510
 
       [Enable linking with tcmalloc @<:@default=off@:>@])],
511
 
    [ac_enable_tcmalloc="$enableval"],
512
 
    [ac_enable_tcmalloc="no"])
513
 
 
514
 
if test "x$ac_enable_tcmalloc" = "xyes"
515
 
then
516
 
  AC_CHECK_LIB(tcmalloc,malloc,[],[])
517
 
fi
518
 
 
519
 
#--------------------------------------------------------------------
520
308
# Check for libz
521
309
#--------------------------------------------------------------------
522
310
 
523
 
my_save_LIBS="$LIBS"
524
 
LIBS=""
525
311
AC_CHECK_HEADERS(zlib.h)
526
312
if test "x$ac_cv_header_zlib_h" != "xyes"
527
313
then
528
314
  AC_MSG_ERROR([Couldn't find zlib.h. Try installing zlib development packages])
529
315
fi
530
316
AC_CHECK_LIB(z, crc32, [], [AC_MSG_ERROR(could not find libz)])
531
 
ZLIB_LIBS="$LIBS"
532
 
LIBS="$my_save_LIBS"
533
 
AC_SUBST(ZLIB_LIBS)
534
 
 
535
 
 
536
 
#--------------------------------------------------------------------
537
 
# Check for libreadline or compatible (libedit on Mac OS X)
538
 
#--------------------------------------------------------------------
539
 
 
540
 
AC_CHECK_HEADERS(readline/history.h readline/readline.h)
 
317
 
 
318
 
 
319
AC_CHECK_HEADERS([readline/readline.h])
541
320
if test "x$ac_cv_header_readline_readline_h" != "xyes"
542
321
then
543
322
  AC_MSG_ERROR([Couldn't find readline/readline.h. Try installing readline development packages.])
544
323
fi
545
 
AC_CHECK_TYPES([HIST_ENTRY], [], [], [AC_INCLUDES_DEFAULT[
546
 
#ifdef HAVE_READLINE_HISTORY_H
547
 
#include <readline/history.h>
548
 
#endif
549
 
#include <readline/readline.h>
550
 
]])
551
 
AC_CHECK_DECLS([completion_matches], [], [], [AC_INCLUDES_DEFAULT[
552
 
#ifdef HAVE_READLINE_HISTORY_H
553
 
#include <readline/history.h>
554
 
#endif
555
 
#include <readline/readline.h>
556
 
]])
557
 
 
558
 
DRIZZLE_CHECK_NEW_RL_INTERFACE
559
 
 
560
 
my_save_LIBS="$LIBS"
561
 
LIBS=""
562
 
AC_CHECK_LIB(readline, rl_initialize, [],
563
 
  [AC_CHECK_LIB(ncurses, tgetent, [], [AC_MSG_ERROR(Couldn't find ncurses)]) 
564
 
   AC_SEARCH_LIBS(rl_initialize, readline, [],
565
 
    [AC_MSG_ERROR(Couldn't find libreadline.)])])
566
 
READLINE_LIBS="$LIBS"
567
 
LIBS="$my_save_LIBS"
568
 
AC_SUBST(READLINE_LIBS)
569
 
 
570
324
 
571
325
#--------------------------------------------------------------------
572
326
# Check for libpcre
574
328
 
575
329
AC_LANG_PUSH([C++])
576
330
AC_PATH_PROG(PKG_CONFIG, pkg-config, AC_MSG_ERROR([pkg-config wasn't found.]))
577
 
PKG_CHECK_MODULES(PCRE, [libpcrecpp >= 3], [found_pcre="yes"],[found_pcre="no"])
578
 
 
579
 
if test "$found_pcre" = "no"
580
 
then
 
331
PKG_CHECK_MODULES(PCRE, [libpcrecpp >= 3], [found_pcre="yes"],[
581
332
  dnl Only check the header here, because autoconf can't handle
582
333
  dnl checking for C++ methods without C linkages
583
334
  AC_CHECK_HEADERS(pcrecpp.h)
584
 
  if test "x$ac_cv_header_pcrecpp_h" != "xyes" 
 
335
  if test "x$ac_cv_header_prcecpp_h" = "xno" 
585
336
  then
 
337
    found_pcre="no"
 
338
  else
 
339
    found_pcre="yes"
 
340
    # We can't search for these well, but we sure do need them!
 
341
    PCRE_LIBS="-lpcrecpp -lpcre"
 
342
  fi
 
343
  ])
 
344
if test "x$found_pcre" != "xyes"
 
345
then
586
346
    AC_MSG_ERROR([Couldn't find pcrecpp.h. Try installing the development package associated with libpcre on your system.])
587
 
  else
588
 
    # Found headers, now see if we can link
589
 
    AC_MSG_CHECKING(for libpcrecpp)
590
 
    save_LDFLAGS="$LDFLAGS"
591
 
    LDFLAGS="-lpcrecpp -lpcre"
592
 
    AC_TRY_LINK([
593
 
#include <pcrecpp.h>
594
 
    ],
595
 
    [pcrecpp::RE_Options opt;],
596
 
    [found_pcre="yes"],
597
 
    [AC_MSG_ERROR([Couldn't link libpcrecpp])])
598
 
 
599
 
    PCRE_LIBS="$LDFLAGS"
600
 
    LDFLAGS="$save_LDFLAGS"
601
 
    AC_MSG_RESULT([yes])
602
 
  fi
603
347
fi
604
348
AC_LANG_POP([])
605
349
AC_SUBST(PCRE_LIBS)
606
350
AC_SUBST(PCRE_CFLAGS)
607
351
 
 
352
 
 
353
# Avoid bug in fcntl on some versions of linux
 
354
AC_MSG_CHECKING([if we should use 'skip-external-locking' as default for $target_os])
 
355
# Any variation of Linux
 
356
if expr "$target_os" : "[[Ll]]inux.*" > /dev/null
 
357
then
 
358
  MYSQLD_DEFAULT_SWITCHES="--skip-external-locking"
 
359
  TARGET_LINUX="true"
 
360
  AC_MSG_RESULT([yes])
 
361
  AC_DEFINE([TARGET_OS_LINUX], [1], [Whether we build for Linux])
 
362
else
 
363
  MYSQLD_DEFAULT_SWITCHES=""
 
364
  TARGET_LINUX="false"
 
365
  AC_MSG_RESULT([no])
 
366
fi
 
367
AC_SUBST(MYSQLD_DEFAULT_SWITCHES)
 
368
AC_SUBST(TARGET_LINUX)
 
369
 
608
370
dnl Find paths to some shell programs
609
371
AC_PATH_PROG(LN, ln, ln)
610
372
# This must be able to take a -f flag like normal unix ln.
687
449
  FIND_PROC="$PS \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
688
450
else
689
451
  case $SYSTEM_TYPE in
690
 
    *freebsd*|*dragonfly*|*cygwin*)
 
452
    *freebsd*|*dragonfly*)
691
453
      FIND_PROC="$PS p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
692
454
      ;;
693
455
    *darwin*)
695
457
      ;;
696
458
    *)
697
459
      AC_MSG_ERROR([Could not find the right ps switches. Which OS is this ?. See the Installation chapter in the Reference Manual.])
698
 
      ;;
699
460
  esac
700
461
fi
701
462
AC_SUBST(FIND_PROC)
736
497
AC_ARG_WITH([server-suffix],
737
498
    [AS_HELP_STRING([--with-server-suffix],
738
499
      [Append value to the version string.])],
739
 
    [ DRIZZLE_SERVER_SUFFIX=`echo "$withval" | sed -e  's/^\(...................................\)..*$/\1/'` ],
740
 
    [ DRIZZLE_SERVER_SUFFIX= ]
 
500
    [ MYSQL_SERVER_SUFFIX=`echo "$withval" | sed -e  's/^\(...................................\)..*$/\1/'` ],
 
501
    [ MYSQL_SERVER_SUFFIX= ]
741
502
    )
742
 
AC_SUBST(DRIZZLE_SERVER_SUFFIX)
 
503
AC_SUBST(MYSQL_SERVER_SUFFIX)
743
504
 
744
505
# Force use of a curses libs
745
506
AC_ARG_WITH([named-curses-libs],
750
511
    [ with_named_curses=no ]
751
512
    )
752
513
 
 
514
# compile with strings functions in assembler
 
515
AC_ARG_ENABLE([assembler],
 
516
    [AS_HELP_STRING([--enable-assembler],
 
517
            [Use assembler versions of some string functions if available.])],
 
518
    [ ENABLE_ASSEMBLER=$enableval ],
 
519
    [ ENABLE_ASSEMBLER=no ]
 
520
    )
 
521
 
 
522
AC_MSG_CHECKING(if we should use assembler functions)
 
523
# For now we only support assembler on i386 and sparc systems
 
524
AM_CONDITIONAL(ASSEMBLER_x86, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "i386" && $AS strings/strings-x86.s -o checkassembler >/dev/null 2>&1 && test -f checkassembler && (rm -f checkassembler; exit 0;))
 
525
AM_CONDITIONAL(ASSEMBLER_sparc32, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "sparc")
 
526
AM_CONDITIONAL(ASSEMBLER_sparc64, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "sparcv9")
 
527
AM_CONDITIONAL(ASSEMBLER, test "$ASSEMBLER_x86_TRUE" = "" -o "$ASSEMBLER_sparc32_TRUE" = "")
 
528
 
 
529
if test "$ASSEMBLER_TRUE" = ""
 
530
then
 
531
  AC_MSG_RESULT([yes])
 
532
else
 
533
  AC_MSG_RESULT([no])
 
534
fi
 
535
 
 
536
# Add query profiler
 
537
AC_MSG_CHECKING(if SHOW PROFILE should be enabled.)
 
538
AC_ARG_ENABLE([profiling],
 
539
    [AS_HELP_STRING([--enable-profiling], 
 
540
            [Build a version with query profiling code])],
 
541
    [ ENABLED_PROFILING=$enableval ],
 
542
    [ ENABLED_PROFILING=no ])
 
543
 
 
544
if test "$ENABLED_PROFILING" = "yes"
 
545
then
 
546
  AC_DEFINE([ENABLED_PROFILING], [1],
 
547
            [If SHOW PROFILE should be enabled])
 
548
  AC_MSG_RESULT([yes]) 
 
549
else
 
550
  AC_MSG_RESULT([no])
 
551
fi
 
552
 
753
553
AC_ARG_WITH([tcp-port],
754
554
    [AS_HELP_STRING([--with-tcp-port=port-number],
755
 
            [Which port to use for Drizzle services @<:@default=4427@:>@])],
756
 
    [ DRIZZLE_TCP_PORT=$withval ],
757
 
    [ DRIZZLE_TCP_PORT=$DRIZZLE_TCP_PORT_DEFAULT
 
555
            [Which port to use for Drizzle services @<:@default=3306@:>@])],
 
556
    [ MYSQL_TCP_PORT=$withval ],
 
557
    [ MYSQL_TCP_PORT=$MYSQL_TCP_PORT_DEFAULT
758
558
      # if we actually defaulted (as opposed to the pathological case of
759
 
      # --with-tcp-port=<DRIZZLE_TCP_PORT_DEFAULT> which might in theory
 
559
      # --with-tcp-port=<MYSQL_TCP_PORT_DEFAULT> which might in theory
760
560
      # happen if whole batch of servers was built from a script), set
761
561
      # the default to zero to indicate that; we don't lose information
762
562
      # that way, because 0 obviously indicates that we can get the
763
 
      # default value from DRIZZLE_TCP_PORT. this seems really evil, but
764
 
      # testing for DRIZZLE_TCP_PORT==DRIZZLE_TCP_PORT_DEFAULT would make a
765
 
      # a port of DRIZZLE_TCP_PORT_DEFAULT magic even if the builder did not
 
563
      # default value from MYSQL_TCP_PORT. this seems really evil, but
 
564
      # testing for MYSQL_TCP_PORT==MYSQL_TCP_PORT_DEFAULT would make a
 
565
      # a port of MYSQL_TCP_PORT_DEFAULT magic even if the builder did not
766
566
      # intend it to mean "use the default, in fact, look up a good default
767
 
      # from /etc/services if you can", but really, really meant 4427 when
768
 
      # they passed in 4427. When they pass in a specific value, let them
 
567
      # from /etc/services if you can", but really, really meant 3306 when
 
568
      # they passed in 3306. When they pass in a specific value, let them
769
569
      # have it; don't second guess user and think we know better, this will
770
570
      # just make people cross.  this makes the the logic work like this
771
571
      # (which is complicated enough):
773
573
      # - if a port was set during build, use that as a default.
774
574
      #
775
575
      # - otherwise, try to look up a port in /etc/services; if that fails,
776
 
      #   use DRIZZLE_TCP_PORT_DEFAULT (at the time of this writing 4427)
 
576
      #   use MYSQL_TCP_PORT_DEFAULT (at the time of this writing 3306)
777
577
      #
778
 
      # - allow the DRIZZLE_TCP_PORT environment variable to override that.
 
578
      # - allow the MYSQL_TCP_PORT environment variable to override that.
779
579
      #
780
580
      # - allow command-line parameters to override all of the above.
781
581
      #
782
 
      # the top-most DRIZZLE_TCP_PORT_DEFAULT is read from win/configure.js,
 
582
      # the top-most MYSQL_TCP_PORT_DEFAULT is read from win/configure.js,
783
583
      # so don't mess with that.
784
 
      DRIZZLE_TCP_PORT_DEFAULT=0 ]
 
584
      MYSQL_TCP_PORT_DEFAULT=0 ]
785
585
    )
786
 
AC_SUBST(DRIZZLE_TCP_PORT)
 
586
AC_SUBST(MYSQL_TCP_PORT)
787
587
# We might want to document the assigned port in the manual.
788
 
AC_SUBST(DRIZZLE_TCP_PORT_DEFAULT)
 
588
AC_SUBST(MYSQL_TCP_PORT_DEFAULT)
789
589
 
790
590
# Use this to set the place used for unix socket used to local communication.
791
591
AC_ARG_WITH([mysqld-user],
813
613
  AC_MSG_RESULT([no])
814
614
fi
815
615
 
816
 
AC_SYS_LARGEFILE
817
 
AC_FUNC_FSEEKO
 
616
MYSQL_SYS_LARGEFILE
818
617
 
819
618
# Types that must be checked AFTER large file support is checked
820
619
AC_TYPE_SIZE_T
832
631
AC_CHECK_HEADERS(sys/fpu.h utime.h sys/utime.h )
833
632
AC_CHECK_HEADERS(synch.h sys/mman.h sys/socket.h netinet/in.h arpa/inet.h)
834
633
AC_CHECK_HEADERS(sys/timeb.h sys/vadvise.h sys/wait.h term.h)
835
 
AC_CHECK_HEADERS(termio.h termios.h sched.h alloca.h)
 
634
AC_CHECK_HEADERS(termio.h termios.h sched.h crypt.h alloca.h)
836
635
AC_CHECK_HEADERS(sys/ioctl.h malloc.h sys/malloc.h sys/ipc.h sys/shm.h)
837
636
AC_CHECK_HEADERS(sys/prctl.h sys/resource.h sys/param.h port.h ieeefp.h)
838
637
AC_CHECK_HEADERS(execinfo.h)
845
644
#--------------------------------------------------------------------
846
645
 
847
646
AC_CHECK_LIB(m, floor, [], AC_CHECK_LIB(m, __infinity))
 
647
AC_CHECK_FUNCS(log2)
848
648
 
849
 
AC_CHECK_FUNC(setsockopt, [], [AC_CHECK_LIB(socket, setsockopt)])
850
 
AC_CHECK_FUNC(yp_get_default_domain, [],
851
 
  [AC_CHECK_LIB(nsl, yp_get_default_domain)])
852
 
AC_CHECK_FUNC(p2open, [], [AC_CHECK_LIB(gen, p2open)])
 
649
AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
 
650
AC_CHECK_FUNC(yp_get_default_domain, ,
 
651
  AC_CHECK_LIB(nsl, yp_get_default_domain))
 
652
AC_CHECK_FUNC(p2open, , AC_CHECK_LIB(gen, p2open))
853
653
# This may get things to compile even if bind-8 is installed
854
 
AC_CHECK_FUNC(bind, [], [AC_CHECK_LIB(bind, bind)])
 
654
AC_CHECK_FUNC(bind, , AC_CHECK_LIB(bind, bind))
855
655
# Check if crypt() exists in libc or libcrypt, sets LIBS if needed
856
656
AC_SEARCH_LIBS(crypt, crypt, AC_DEFINE(HAVE_CRYPT, 1, [crypt]))
857
657
 
859
659
AC_CHECK_LIB(rt, aio_read)
860
660
 
861
661
# For the sched_yield() function on Solaris
862
 
AC_CHECK_FUNC(sched_yield, [],
863
 
  [AC_CHECK_LIB(posix4, [sched_yield],
864
 
    [AC_DEFINE(HAVE_SCHED_YIELD) LIBS="$LIBS -lposix4"])])
 
662
AC_CHECK_FUNC(sched_yield, , AC_CHECK_LIB(posix4, sched_yield,
 
663
[AC_DEFINE(HAVE_SCHED_YIELD) LIBS="$LIBS -lposix4"]))
865
664
 
866
665
if test "$ac_cv_header_termio_h" = "no" -a "$ac_cv_header_termios_h" = "no"
867
666
then
868
 
  AC_CHECK_FUNC(gtty, [], [AC_CHECK_LIB(compat, gtty)])
 
667
  AC_CHECK_FUNC(gtty, , AC_CHECK_LIB(compat, gtty))
869
668
fi
870
669
 
 
670
AC_CHECK_TYPES([int8, uint8, int16, uint16, int32, uint32, int64, uint64,
 
671
                uchar, uint, ulong],[],[], [
 
672
#include <sys/types.h>
 
673
])
871
674
AC_CHECK_TYPES([fp_except], [], [], [
872
675
#include <sys/types.h>
873
676
#include <ieeefp.h>
874
677
])
875
678
 
 
679
 
876
680
my_save_LIBS="$LIBS"
877
681
LIBS=""
878
682
AC_CHECK_LIB(dl,dlopen)
 
683
LIBDL=$LIBS
 
684
LIBS="$my_save_LIBS"
 
685
AC_SUBST(LIBDL)
 
686
 
 
687
my_save_LIBS="$LIBS"
 
688
LIBS="$LIBS $LIBDL"
879
689
AC_CHECK_FUNCS(dlopen dlerror)
880
 
if test "$ac_cv_func_dlopen" != "yes"
881
 
then
882
 
  AC_MSG_ERROR([Drizzle requires dlopen])
883
 
fi
884
 
LIBDL_LIBS="$LIBS"
885
690
LIBS="$my_save_LIBS"
886
 
AC_SUBST(LIBDL_LIBS)
887
691
 
888
692
AC_CHECK_FUNCS(strtok_r)
889
693
 
890
 
 
 
694
# Build optimized or debug version ?
 
695
# First check for gcc and g++
 
696
if test "$ac_cv_c_compiler_gnu" = "yes"
 
697
then
 
698
  SYMBOLS_CFLAGS="-ggdb3"
 
699
  DEBUG_OPTIMIZE_CC="-O0"
 
700
  OPTIMIZE_CFLAGS="-O2"
 
701
else
 
702
  SYMBOLS_CFLAGS="-g"
 
703
  DEBUG_OPTIMIZE_CC=""
 
704
  OPTIMIZE_CFLAGS="-O"
 
705
fi
 
706
if test "$ac_cv_prog_cxx_g" = "yes"
 
707
then
 
708
  SYMBOLS_CXXFLAGS="-ggdb3"
 
709
  DEBUG_OPTIMIZE_CXX="-O0"
 
710
  OPTIMIZE_CXXFLAGS="-O2"
 
711
else
 
712
  SYMBOLS_CXXFLAGS="-g"
 
713
  DEBUG_OPTIMIZE_CXX=""
 
714
  OPTIMIZE_CXXFLAGS="-O"
 
715
fi
 
716
 
 
717
# If the user specified CFLAGS, we won't add any optimizations
 
718
if test -n "$SAVE_CFLAGS"
 
719
then
 
720
  OPTIMIZE_CFLAGS=""
 
721
  DEBUG_OPTIMIZE_CC=""
 
722
fi
 
723
# Ditto for CXXFLAGS
 
724
if test -n "$SAVE_CXXFLAGS"
 
725
then
 
726
  OPTIMIZE_CXXFLAGS=""
 
727
  DEBUG_OPTIMIZE_CXX=""
 
728
fi
 
729
 
 
730
CFLAGS="${SYMBOLS_CFLAGS} ${CFLAGS}"
 
731
CXXFLAGS="${SYMBOLS_CXXFLAGS} ${CXXFLAGS}"
 
732
 
 
733
AC_ARG_WITH([debug],
 
734
    [AS_HELP_STRING([--with-debug],
 
735
            [Add debug code (yes|no|full) @<:@default=no@:>@ 
 
736
            Full adds memory checked, very slow.])],
 
737
    [with_debug=$withval],
 
738
    [with_debug=no])
 
739
AM_CONDITIONAL(BUILD_DBUG, test "$with_debug" != "no")
 
740
if test "$with_debug" = "yes"
 
741
then
 
742
  # Medium debug.
 
743
  AC_DEFINE([DBUG_ON], [1], [Use libdbug])
 
744
  CFLAGS="$DEBUG_OPTIMIZE_CC $CFLAGS"
 
745
  CXXFLAGS="$DEBUG_OPTIMIZE_CXX $CXXFLAGS"
 
746
else
 
747
  # Optimized version. No debug
 
748
  AC_DEFINE([DBUG_OFF], [1], [Dont use libdbug])
 
749
  CFLAGS="$OPTIMIZE_CFLAGS $CFLAGS"
 
750
  CXXFLAGS="$OPTIMIZE_CXXFLAGS $CXXFLAGS"
 
751
fi
 
752
 
 
753
# If we should allow error injection tests
 
754
AC_ARG_WITH([error-inject],
 
755
    [AS_HELP_STRING([--with-error-inject],
 
756
            [Enable error injection in Drizzle Server @<:@default=off@:>@])],
 
757
    [ with_error_inject=$withval ],
 
758
    [ with_error_inject=no ])
 
759
 
 
760
if test $with_debug != "no"
 
761
then
 
762
  if test "$with_error_inject" = "yes"
 
763
  then
 
764
    AC_DEFINE([ERROR_INJECT_SUPPORT], [1],
 
765
              [Enable error injection in Drizzle Server])
 
766
  fi
 
767
fi
891
768
 
892
769
AC_ARG_WITH([fast-mutexes],
893
770
    [AS_HELP_STRING([--with-fast-mutexes],
897
774
 
898
775
if test "$with_fast_mutexes" != "no"
899
776
then
900
 
        AC_DEFINE([MY_PTHREAD_FASTMUTEX], [1], 
901
 
                        [Define to 1 if you want to use fast mutexes])
 
777
  if test "$with_debug" != "no"
 
778
  then
 
779
    AC_MSG_WARN(['--with-fast-mutexes' ignored when '--with-debug' is given])
 
780
  else
 
781
    AC_DEFINE([MY_PTHREAD_FASTMUTEX], [1], 
 
782
              [Define to 1 if you want to use fast mutexes])
 
783
  fi
902
784
fi
903
785
 
904
 
AM_CONDITIONAL(BUILD_FAST_MUTEX,[test "$with_fast_mutexes" != "no"])
905
 
 
906
786
AC_ARG_WITH([comment],
907
787
    [AS_HELP_STRING([--with-comment],
908
788
            [Comment about compilation environment. @<:@default=off@:>@])],
916
796
fi
917
797
AC_SUBST(COMPILATION_COMMENT)
918
798
 
919
 
if expr "$target_os" : "[[Ll]]inux.*" > /dev/null
 
799
AC_MSG_CHECKING("need of special linking flags")
 
800
if test "$TARGET_LINUX" = "true" -a "$ac_cv_c_compiler_gnu" = "yes" -a "$all_is_static" != "yes"
920
801
then
921
 
  TARGET_LINUX="true"
922
 
  AC_DEFINE([TARGET_OS_LINUX], [1], [Whether we build for Linux])
 
802
  LDFLAGS="$LDFLAGS -rdynamic"
 
803
  AC_MSG_RESULT("-rdynamic")
923
804
else
924
 
  TARGET_LINUX="false"
 
805
  case "$SYSTEM_TYPE$with_mysqld_ldflags " in
 
806
  *freebsd*"-all-static "*|*dragonfly*"-all-static "*)
 
807
    AC_MSG_RESULT("none")
 
808
    ;;
 
809
  *freebsd*|*dragonfly*)
 
810
    MYSQLD_EXTRA_LDFLAGS="$MYSQLD_EXTRA_LDFLAGS -export-dynamic"
 
811
    AC_MSG_RESULT("-export-dynamic")
 
812
    ;;
 
813
  *)
 
814
    AC_MSG_RESULT("none")
 
815
    ;;
 
816
  esac
925
817
fi
926
818
 
927
819
dnl Checks for typedefs, structures, and compiler characteristics.
930
822
AC_TYPE_OFF_T
931
823
AC_HEADER_TIME
932
824
AC_STRUCT_TM
 
825
MYSQL_NEEDS_MYSYS_NEW
 
826
# AC_CHECK_SIZEOF return 0 when it does not find the size of a
 
827
# type. We want a error instead.
 
828
AC_CHECK_SIZEOF(char, 1)
 
829
if test "$ac_cv_sizeof_char" -eq 0
 
830
then
 
831
  AC_MSG_ERROR([No size for char type.])
 
832
fi
 
833
AC_CHECK_SIZEOF(char*, 4)
 
834
AC_CHECK_SIZEOF(short, 2)
 
835
AC_CHECK_SIZEOF(int, 4)
 
836
if test "$ac_cv_sizeof_int" -eq 0
 
837
then
 
838
  AC_MSG_ERROR("No size for int type.")
 
839
fi
 
840
AC_CHECK_SIZEOF(long, 4)
 
841
if test "$ac_cv_sizeof_long" -eq 0
 
842
then
 
843
  AC_MSG_ERROR("No size for long type.")
 
844
fi
 
845
AC_CHECK_SIZEOF(long long, 8)
 
846
if test "$ac_cv_sizeof_long_long" -eq 0
 
847
then
 
848
  AC_MSG_ERROR("Drizzle needs a long long type.")
 
849
fi
933
850
# off_t is not a builtin type
934
851
AC_CHECK_SIZEOF(off_t, 4)
935
852
if test "$ac_cv_sizeof_off_t" -eq 0
941
858
dnl check if time_t is unsigned
942
859
dnl
943
860
 
944
 
DRIZZLE_CHECK_TIME_T
945
 
 
 
861
MYSQL_CHECK_TIME_T
 
862
 
 
863
 
 
864
# do we need #pragma interface/#pragma implementation ?
 
865
# yes if it's gcc 2.x, and not icc pretending to be gcc, and not cygwin
 
866
AC_MSG_CHECKING(the need for @%:@pragma interface/implementation)
 
867
# instead of trying to match SYSTEM_TYPE and CC_VERSION (that doesn't
 
868
# follow any standard), we'll use well-defined preprocessor macros:
 
869
AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
 
870
#if !defined(__CYGWIN__) && !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ < 3)
 
871
#error USE_PRAGMA_IMPLEMENTATION
 
872
#endif
 
873
]])],[AC_MSG_RESULT(no) ],[AC_MSG_RESULT(yes) ; CXXFLAGS="$CXXFLAGS -DUSE_PRAGMA_IMPLEMENTATION"])
946
874
 
947
875
# This always gives a warning. Ignore it unless you are cross compiling
948
876
AC_C_BIGENDIAN
949
877
#---START: Used in for client configure
950
878
# Check base type of last arg to accept
951
 
DRIZZLE_TYPE_ACCEPT
 
879
MYSQL_TYPE_ACCEPT
952
880
#---END:
953
881
# Figure out what type of struct rlimit to use with setrlimit
954
 
DRIZZLE_TYPE_STRUCT_RLIMIT
 
882
MYSQL_TYPE_STRUCT_RLIMIT
955
883
# Find where the stack goes
956
 
DRIZZLE_STACK_DIRECTION
 
884
MYSQL_STACK_DIRECTION
957
885
# We want to skip alloca on irix unconditionally. It may work on some version..
958
 
DRIZZLE_FUNC_ALLOCA
 
886
MYSQL_FUNC_ALLOCA
959
887
# Do struct timespec have members tv_sec or ts_sec
960
 
DRIZZLE_TIMESPEC_TS
 
888
MYSQL_TIMESPEC_TS
961
889
# Do we have the tzname variable
962
 
DRIZZLE_TZNAME
 
890
MYSQL_TZNAME
963
891
# Do the c++ compiler have a bool type
964
 
DRIZZLE_CXX_BOOL
 
892
MYSQL_CXX_BOOL
965
893
AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>])
966
894
AC_CHECK_TYPES([size_t], [], [], [#include <stdio.h>])
967
 
 
968
 
DRIZZLE_PTHREAD_YIELD
969
 
 
 
895
AC_CHECK_TYPES([u_int32_t])
 
896
 
 
897
MYSQL_PTHREAD_YIELD
 
898
 
 
899
######################################################################
 
900
# For readline/libedit (We simply move the mimimum amount of stuff from
 
901
# the readline/libedit configure.in here)
970
902
 
971
903
dnl Checks for header files.
972
904
AC_CHECK_HEADERS(malloc.h sys/cdefs.h)
994
926
AC_SUBST(MAKE_SHELL)
995
927
 
996
928
# Already-done: stdlib.h string.h unistd.h termios.h
997
 
AC_CHECK_HEADERS(stdarg.h dirent.h locale.h ndir.h sys/dir.h \
 
929
AC_CHECK_HEADERS(varargs.h stdarg.h dirent.h locale.h ndir.h sys/dir.h \
998
930
 sys/file.h sys/ndir.h sys/ptem.h sys/pte.h sys/select.h sys/stream.h \
999
931
 sys/mman.h curses.h termcap.h termio.h termbits.h asm/termbits.h grp.h \
1000
932
paths.h semaphore.h)
1003
935
AC_CHECK_FUNCS(lstat putenv select setenv setlocale strcoll tcgetattr)
1004
936
 
1005
937
AC_HEADER_STAT
1006
 
DRIZZLE_SIGNAL_CHECK
1007
 
DRIZZLE_CHECK_GETPW_FUNCS
1008
 
DRIZZLE_HAVE_TIOCGWINSZ
1009
 
DRIZZLE_HAVE_FIONREAD
1010
 
DRIZZLE_HAVE_TIOCSTAT
1011
 
DRIZZLE_STRUCT_DIRENT_D_INO
1012
 
DRIZZLE_STRUCT_DIRENT_D_NAMLEN
1013
 
DRIZZLE_TYPE_SIGHANDLER
1014
 
DRIZZLE_CHECK_MULTIBYTE
 
938
MYSQL_SIGNAL_CHECK
 
939
MYSQL_CHECK_GETPW_FUNCS
 
940
MYSQL_HAVE_TIOCGWINSZ
 
941
MYSQL_HAVE_FIONREAD
 
942
MYSQL_HAVE_TIOCSTAT
 
943
MYSQL_STRUCT_DIRENT_D_INO
 
944
MYSQL_STRUCT_DIRENT_D_NAMLEN
 
945
MYSQL_TYPE_SIGHANDLER
 
946
MYSQL_CHECK_MULTIBYTE
1015
947
if test "$with_named_curses" = "no"
1016
948
then
1017
 
  DRIZZLE_CHECK_LIB_TERMCAP
 
949
  MYSQL_CHECK_LIB_TERMCAP
1018
950
else
1019
 
  TERMCAP_LIBS="$with_named_curses"
 
951
  TERMCAP_LIB="$with_named_curses"
1020
952
fi
1021
 
AC_SUBST(TERMCAP_LIBS)
 
953
AC_SUBST(TERMCAP_LIB)
1022
954
 
1023
955
# Check if the termcap function 'tgoto' is already declared in
1024
956
# system header files or if it need to be declared locally
1050
982
 
1051
983
#AC_FUNC_MMAP
1052
984
AC_TYPE_SIGNAL
1053
 
DRIZZLE_TYPE_QSORT
 
985
MYSQL_TYPE_QSORT
1054
986
AC_FUNC_UTIME_NULL
1055
987
AC_FUNC_VPRINTF
1056
988
 
1060
992
  AC_MSG_ERROR("Drizzle requires fcntl.")
1061
993
fi
1062
994
 
1063
 
AC_CONFIG_LIBOBJ_DIR([mystrings])
1064
 
 
1065
 
AC_CHECK_FUNCS(bsearch \
 
995
AC_CHECK_FUNCS(bcmp bfill bmove bsearch bzero \
1066
996
  cuserid fchmod \
1067
997
  fdatasync finite fpresetsticky fpsetmask fsync ftruncate \
1068
 
  getcwd getpassphrase getpwnam \
 
998
  getcwd getpass getpassphrase getpwnam \
1069
999
  getpwuid getrlimit getrusage getwd index initgroups isnan \
1070
1000
  localtime_r gethrtime gmtime_r \
1071
 
  locking longjmp lrand48 madvise mallinfo \
1072
 
  memmove \
1073
 
  mkstemp mlockall perror poll pread pthread_attr_create mmap mmap64 \
 
1001
  locking longjmp lrand48 madvise mallinfo memcpy memmove \
 
1002
  mkstemp mlockall perror poll pread pthread_attr_create mmap mmap64 getpagesize \
1074
1003
  pthread_attr_getstacksize pthread_attr_setprio pthread_attr_setschedparam \
1075
1004
  pthread_attr_setstacksize pthread_condattr_create pthread_getsequence_np \
1076
1005
  pthread_key_delete pthread_rwlock_rdlock pthread_setprio \
1077
1006
  pthread_setprio_np pthread_setschedparam pthread_sigmask readlink \
1078
 
  realpath rename rwlock_init setupterm \
 
1007
  realpath rename rint rwlock_init setupterm \
1079
1008
  shmget shmat shmdt shmctl sigaction sigemptyset sigaddset \
1080
1009
  sighold sigset sigthreadmask port_create sleep \
1081
 
  snprintf socket strcasecmp strerror strsignal strpbrk \
1082
 
  tell tempnam vidattr \
 
1010
  snprintf socket stpcpy strcasecmp strerror strsignal strnlen strpbrk strstr \
 
1011
  strtol strtoll strtoul strtoull tell tempnam vidattr \
1083
1012
  posix_fallocate backtrace backtrace_symbols backtrace_symbols_fd)
1084
1013
 
1085
 
AC_LANG_PUSH(C++)
1086
 
# Test whether madvise() is declared in C++ code -- it is not on some
1087
 
# systems, such as Solaris
1088
 
AC_CHECK_DECLS([madvise], [], [], [AC_INCLUDES_DEFAULT[
1089
 
#if HAVE_SYS_MMAN_H
1090
 
#include <sys/types.h>
1091
 
#include <sys/mman.h>
1092
 
#endif
1093
 
]])
1094
 
AC_LANG_POP()
1095
 
 
1096
 
 
1097
 
AM_CONDITIONAL(BUILD_THR_RWLOCK,[test "$ac_cv_func_rwlock_init" -a "$ac_cv_funn_pthread_rwlock_rdlock"])
1098
 
 
1099
1014
# Check that isinf() is available in math.h and can be used in both C and C++
1100
1015
# code
1101
1016
AC_MSG_CHECKING(for isinf in math.h)
1134
1049
)
1135
1050
 
1136
1051
# Check definition of pthread_getspecific
1137
 
AC_CACHE_CHECK([args to pthread_getspecific], [mysql_cv_getspecific_args],
1138
 
  [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if !defined(_REENTRANT)
 
1052
AC_CACHE_CHECK("args to pthread_getspecific", mysql_cv_getspecific_args,
 
1053
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if !defined(_REENTRANT)
1139
1054
#define _REENTRANT
1140
1055
#endif
1141
1056
#define _POSIX_PTHREAD_SEMANTICS 
1142
1057
#include <pthread.h> ]], [[ void *pthread_getspecific(pthread_key_t key);
1143
 
pthread_getspecific((pthread_key_t) NULL); ]])],
1144
 
    [mysql_cv_getspecific_args=POSIX],
1145
 
    [mysql_cv_getspecific_args=other])])
 
1058
pthread_getspecific((pthread_key_t) NULL); ]])],[mysql_cv_getspecific_args=POSIX],[mysql_cv_getspecific_args=other]))
1146
1059
  if test "$mysql_cv_getspecific_args" = "other"
1147
1060
  then
1148
1061
    AC_DEFINE([HAVE_NONPOSIX_PTHREAD_GETSPECIFIC], [1],
1150
1063
  fi
1151
1064
 
1152
1065
  # Check definition of pthread_mutex_init
1153
 
  AC_CACHE_CHECK([args to pthread_mutex_init], [mysql_cv_mutex_init_args],
1154
 
    [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#define _REENTRANT
 
1066
  AC_CACHE_CHECK("args to pthread_mutex_init", mysql_cv_mutex_init_args,
 
1067
  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#define _REENTRANT
1155
1068
#define _POSIX_PTHREAD_SEMANTICS 
1156
1069
#include <pthread.h> ]], [[ 
1157
1070
  pthread_mutexattr_t attr;
1158
1071
  pthread_mutex_t mp;
1159
 
  pthread_mutex_init(&mp,&attr); ]])],
1160
 
      [mysql_cv_mutex_init_args=POSIX],
1161
 
      [mysql_cv_mutex_init_args=other])])
 
1072
  pthread_mutex_init(&mp,&attr); ]])],[mysql_cv_mutex_init_args=POSIX],[mysql_cv_mutex_init_args=other]))
1162
1073
  if test "$mysql_cv_mutex_init_args" = "other"
1163
1074
  then
1164
1075
    AC_DEFINE([HAVE_NONPOSIX_PTHREAD_MUTEX_INIT], [1],
1168
1079
 
1169
1080
#---START: Used in for client configure
1170
1081
# Check definition of readdir_r
1171
 
AC_CACHE_CHECK([args to readdir_r], [mysql_cv_readdir_r],
1172
 
  [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define _REENTRANT
 
1082
AC_CACHE_CHECK("args to readdir_r", mysql_cv_readdir_r,
 
1083
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define _REENTRANT
1173
1084
#define _POSIX_PTHREAD_SEMANTICS 
1174
1085
#include <pthread.h>
1175
1086
#include <dirent.h>]], [[ int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result);
1176
 
readdir_r((DIR *) NULL, (struct dirent *) NULL, (struct dirent **) NULL); ]])],
1177
 
    [mysql_cv_readdir_r=POSIX],
1178
 
    [mysql_cv_readdir_r=other])])
 
1087
readdir_r((DIR *) NULL, (struct dirent *) NULL, (struct dirent **) NULL); ]])],[mysql_cv_readdir_r=POSIX],[mysql_cv_readdir_r=other]))
1179
1088
if test "$mysql_cv_readdir_r" = "POSIX"
1180
1089
then
1181
1090
  AC_DEFINE([HAVE_READDIR_R], [1], [POSIX readdir_r])
1182
1091
fi
1183
1092
 
1184
1093
# Check definition of posix sigwait()
1185
 
AC_CACHE_CHECK([style of sigwait], [mysql_cv_sigwait],
1186
 
  [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1187
 
#define _REENTRANT
 
1094
AC_CACHE_CHECK("style of sigwait", mysql_cv_sigwait,
 
1095
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define _REENTRANT
1188
1096
#define _POSIX_PTHREAD_SEMANTICS 
1189
1097
#include <pthread.h>
1190
 
#include <signal.h>
1191
 
      ]], [[
1192
 
#ifndef _AIX
 
1098
#include <signal.h>]], [[#ifndef _AIX
1193
1099
sigset_t set;
1194
1100
int sig;
1195
1101
sigwait(&set,&sig);
1196
 
#endif
1197
 
      ]])],
1198
 
    [mysql_cv_sigwait=POSIX],
1199
 
    [mysql_cv_sigwait=other])])
 
1102
#endif]])],[mysql_cv_sigwait=POSIX],[mysql_cv_sigwait=other]))
1200
1103
if test "$mysql_cv_sigwait" = "POSIX"
1201
1104
then
1202
1105
  AC_DEFINE([HAVE_SIGWAIT], [1], [POSIX sigwait])
1206
1109
then
1207
1110
unset mysql_cv_sigwait
1208
1111
# Check definition of posix sigwait()
1209
 
AC_CACHE_CHECK([style of sigwait], [mysql_cv_sigwait],
1210
 
  [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1211
 
#define _REENTRANT
 
1112
AC_CACHE_CHECK("style of sigwait", mysql_cv_sigwait,
 
1113
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define _REENTRANT
1212
1114
#define _POSIX_PTHREAD_SEMANTICS 
1213
1115
#include <pthread.h>
1214
 
#include <signal.h>
1215
 
      ]], [[
1216
 
sigset_t set;
 
1116
#include <signal.h>]], [[sigset_t set;
1217
1117
int sig;
1218
 
sigwait(&set);
1219
 
      ]])],
1220
 
    [mysql_cv_sigwait=NONPOSIX],
1221
 
    [mysql_cv_sigwait=other])])
 
1118
sigwait(&set);]])],[mysql_cv_sigwait=NONPOSIX],[mysql_cv_sigwait=other]))
1222
1119
if test "$mysql_cv_sigwait" = "NONPOSIX"
1223
1120
then
1224
1121
  AC_DEFINE([HAVE_NONPOSIX_SIGWAIT], [1], [sigwait with one argument])
1227
1124
#---END:
1228
1125
 
1229
1126
# Check if pthread_attr_setscope() exists
1230
 
AC_CACHE_CHECK([for pthread_attr_setscope], [mysql_cv_pthread_attr_setscope],
1231
 
  [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1232
 
#define _REENTRANT
 
1127
AC_CACHE_CHECK("for pthread_attr_setscope", mysql_cv_pthread_attr_setscope,
 
1128
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define _REENTRANT
1233
1129
#define _POSIX_PTHREAD_SEMANTICS 
1234
 
#include <pthread.h>
1235
 
      ]], [[
1236
 
pthread_attr_t thr_attr;
1237
 
pthread_attr_setscope(&thr_attr,0);
1238
 
      ]])],
1239
 
    [mysql_cv_pthread_attr_setscope=yes],
1240
 
    [mysql_cv_pthread_attr_setscope=no])])
 
1130
#include <pthread.h>]], [[pthread_attr_t thr_attr;
 
1131
pthread_attr_setscope(&thr_attr,0);]])],[mysql_cv_pthread_attr_setscope=yes],[mysql_cv_pthread_attr_setscope=no]))
1241
1132
if test "$mysql_cv_pthread_attr_setscope" = "yes"
1242
1133
then
1243
1134
  AC_DEFINE([HAVE_PTHREAD_ATTR_SETSCOPE], [1], [pthread_attr_setscope])
1275
1166
# Check for requested features
1276
1167
#--------------------------------------------------------------------
1277
1168
 
1278
 
DRIZZLE_CHECK_BIG_TABLES
1279
 
DRIZZLE_CHECK_MAX_INDEXES
1280
 
DRIZZLE_CHECK_VIO
 
1169
MYSQL_CHECK_BIG_TABLES
 
1170
MYSQL_CHECK_MAX_INDEXES
 
1171
MYSQL_CHECK_VIO
1281
1172
 
1282
1173
#--------------------------------------------------------------------
1283
1174
# Declare our plugin modules
1285
1176
# functions tested above
1286
1177
#--------------------------------------------------------------------
1287
1178
 
1288
 
DRIZZLE_CONFIGURE_PLUGINS([none])
 
1179
MYSQL_CONFIGURE_PLUGINS([none])
1289
1180
 
1290
1181
AC_SUBST(mysql_plugin_dirs)
1291
1182
AC_SUBST(mysql_plugin_libs)
1292
1183
AC_SUBST(mysql_plugin_defs)
1293
1184
 
1294
 
# Build optimized or debug version ?
1295
 
# First check for gcc and g++
1296
 
if test "$ac_cv_c_compiler_gnu" = "yes"
1297
 
then
1298
 
  SYMBOLS_CFLAGS="-ggdb3"
1299
 
  DEBUG_OPTIMIZE_CC="-O0"
1300
 
  OPTIMIZE_CFLAGS="-O3"
1301
 
else
1302
 
  SYMBOLS_CFLAGS="-g"
1303
 
  DEBUG_OPTIMIZE_CC=""
1304
 
  OPTIMIZE_CFLAGS="-O"
1305
 
fi
1306
 
if test "$ac_cv_prog_cxx_g" = "yes"
1307
 
then
1308
 
  SYMBOLS_CXXFLAGS="-ggdb3"
1309
 
  DEBUG_OPTIMIZE_CXX="-O0"
1310
 
  OPTIMIZE_CXXFLAGS="-O3"
1311
 
else
1312
 
  SYMBOLS_CXXFLAGS="-g"
1313
 
  DEBUG_OPTIMIZE_CXX=""
1314
 
  OPTIMIZE_CXXFLAGS="-O"
1315
 
fi
1316
 
 
1317
 
dnl TODO: Remove this define once we are using 2.61 across the board.
1318
 
# AX_HEADER_ASSERT
1319
 
# ----------------
1320
 
# Check whether to enable assertions.
1321
 
AC_DEFUN([AX_HEADER_ASSERT],
1322
 
[
1323
 
  AC_MSG_CHECKING([whether to enable assertions])
1324
 
  AC_ARG_ENABLE([assert],
1325
 
    [AS_HELP_STRING([--disable-assert],
1326
 
       [Turn off assertions])],
1327
 
    [ac_cv_assert="no"],
1328
 
    [ac_cv_assert="yes"])
1329
 
  AC_MSG_RESULT([$ac_cv_assert])
1330
 
])
1331
 
 
1332
 
AX_HEADER_ASSERT
1333
 
 
1334
 
CFLAGS="${SYMBOLS_CFLAGS} ${CFLAGS}"
1335
 
CXXFLAGS="${SYMBOLS_CXXFLAGS} ${CXXFLAGS}"
1336
 
#CXXFLAGS="${SYMBOLS_CXXFLAGS} ${CXXFLAGS}  -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
1337
 
 
1338
 
AC_ARG_WITH([debug],
1339
 
    [AS_HELP_STRING([--with-debug],
1340
 
       [Add debug code/turns off optimizations (yes|no) @<:@default=no@:>@])],
1341
 
    [with_debug=$withval],
1342
 
    [with_debug=no])
1343
 
if test "$with_debug" = "yes"
1344
 
then
1345
 
  # Medium debug.
1346
 
  CFLAGS="$DEBUG_OPTIMIZE_CC -DDEBUG $CFLAGS ${SAVE_CFLAGS}"
1347
 
  CXXFLAGS="$DEBUG_OPTIMIZE_CXX -DDEBUG $CXXFLAGS ${SAVE_CXXFLAGS}"
1348
 
else
1349
 
  # Optimized version. No debug
1350
 
  CFLAGS="${OPTIMIZE_CFLAGS} ${CFLAGS} ${SAVE_CFLAGS}"
1351
 
  CXXFLAGS="$OPTIMIZE_CXXFLAGS $CXXFLAGS ${SAVE_CXXFLAGS}"
1352
 
fi
1353
 
 
1354
 
AC_ARG_ENABLE([profiling],
1355
 
    [AS_HELP_STRING([--enable-profiling],
1356
 
       [Toggle profiling @<:@default=off@:>@])],
1357
 
    [ac_profiling="$enableval"],
1358
 
    [ac_profiling="no"])
1359
 
 
1360
 
AC_ARG_ENABLE([coverage],
1361
 
    [AS_HELP_STRING([--enable-coverage],
1362
 
       [Toggle coverage @<:@default=off@:>@])],
1363
 
    [ac_coverage="$enableval"],
1364
 
    [ac_coverage="no"])
1365
 
 
1366
1185
AC_ARG_ENABLE([pedantic-warnings],
1367
1186
    [AS_HELP_STRING([--disable-pedantic-warnings],
1368
1187
       [Toggle pedanticness @<:@default=on@:>@])],
1370
1189
    [ac_warn_pedantic="yes"])
1371
1190
 
1372
1191
AC_ARG_ENABLE([fail],
1373
 
    [AS_HELP_STRING([--disable-fail],
1374
 
       [Turn warnings into failures @<:@default=on@:>@])],
 
1192
    [AS_HELP_STRING([--enable-fail],
 
1193
       [Turn warnings into failures @<:@default=off@:>@])],
1375
1194
    [ac_warn_fail="$enableval"],
1376
 
    [ac_warn_fail="yes"])
 
1195
    [ac_warn_fail="no"])
1377
1196
 
1378
1197
AC_ARG_ENABLE([unreachable],
1379
1198
    [AS_HELP_STRING([--enable-unreachable],
1381
1200
    [ac_warn_unreachable="$enableval"],
1382
1201
    [ac_warn_unreachable="no"])
1383
1202
 
1384
 
AC_ARG_ENABLE([longlong-warnings],
1385
 
    [AS_HELP_STRING([--enable-longlong-warnings],
1386
 
       [Enable warnings about longlong in C++ @<:@default=off@:>@])],
1387
 
    [ac_warn_longlong="$enableval"],
1388
 
    [ac_warn_longlong="no"])
1389
 
 
1390
 
AC_ARG_ENABLE([strict-aliasing],
1391
 
    [AS_HELP_STRING([--enable-strict-aliasing],
1392
 
       [Enable warnings about stict-aliasing @<:@default=off@:>@])],
1393
 
    [ac_warn_strict_aliasing="$enableval"],
1394
 
    [ac_warn_strict_aliasing="no"])
1395
 
 
1396
 
AC_ARG_ENABLE([cast-warnings],
1397
 
    [AS_HELP_STRING([--enable-cast-warnings],
1398
 
       [Enable warnings about use of old C-style casts @<:@default=off@:>@])],
1399
 
    [ac_warn_cast="$enableval"],
1400
 
    [ac_warn_cast="no"])
1401
 
 
1402
 
AC_ARG_ENABLE([effective-style],
1403
 
    [AS_HELP_STRING([--enable-effective-style],
1404
 
       [Enable warnings violating Effective C++ Style Guidelines @<:@default=off@:>@])],
1405
 
    [ac_warn_effc="$enableval"],
1406
 
    [ac_warn_effc="no"])
1407
 
 
1408
 
AC_ARG_ENABLE([go-crazy],
1409
 
    [AS_HELP_STRING([--enable-go-crazy],
1410
 
       [Enables extra little warnings that might be too much @<:@default=off@:>@])],
1411
 
    [ac_warn_go_crazy="$enableval"],
1412
 
    [ac_warn_go_crazy="no"])
1413
 
 
1414
1203
 
1415
1204
if test "$GCC" = "yes"
1416
1205
then
1417
1206
 
1418
 
  if test "$ac_warn_longlong" = "yes"
1419
 
  then
1420
 
    W_LONGLONG="-Wlong-long"
1421
 
  else
1422
 
    W_LONGLONG="-Wno-long-long"
1423
 
  fi
1424
 
 
1425
 
  if test "$ac_warn_strict_aliasing" = "yes"
1426
 
  then
1427
 
    W_STRICT_ALIASING="-Wstrict-aliasing"
1428
 
  else
1429
 
    W_STRICT_ALIASING="-Wno-strict-aliasing"
1430
 
  fi
1431
 
 
1432
 
  if test "$ac_profiling" = "yes"
1433
 
  then
1434
 
    GPROF_PROFILING="-pg"
1435
 
  else
1436
 
    GPROF_PROFILING=" "
1437
 
  fi
1438
 
 
1439
 
  if test "$ac_coverage" = "yes"
1440
 
  then
1441
 
    GPROF_COVERAGE="-fprofile-arcs -ftest-coverage"
1442
 
  else
1443
 
    GPROF_COVERAGE=" "
1444
 
  fi
 
1207
  GCC_WARNINGS="-W -Wall -Wextra"
 
1208
  GXX_WARNINGS="${GCC_WARNINGS}"
 
1209
 
1445
1210
 
1446
1211
  if test "$ac_warn_pedantic" = "yes"
1447
1212
  then
1448
 
    GCC_PEDANTIC="-pedantic -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls ${W_STRICT_ALIASING}"
1449
 
    GXX_PEDANTIC="-pedantic -Wundef -Wredundant-decls ${W_LONGLONG} ${W_STRICT_ALIASING}"
 
1213
    GCC_WARNINGS="${GCC_WARNINGS}  -std=gnu99 -pedantic -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wno-strict-aliasing "
 
1214
    GXX_WARNINGS="${GXX_WARNINGS}  -std=gnu++98 -pedantic -Wundef -Wredundant-decls -Wno-long-long -Wno-strict-aliasing"
1450
1215
  fi
1451
1216
 
1452
1217
  if test "$ac_warn_unreachable" = "yes"
1453
1218
  then
1454
 
    W_UNREACHABLE="-Wunreachable-code"
 
1219
    GCC_WARNINGS="${GCC_WARNINGS} -Wunreachable-code"
 
1220
    GXX_WARNINGS="${GXX_WARNINGS} -Wunreachable-code"
1455
1221
  fi
1456
1222
 
1457
1223
  if test "$ac_warn_fail" = "yes"
1458
1224
  then
1459
 
    W_FAIL="-Werror"
1460
 
  fi
1461
 
 
1462
 
  if test "$ac_warn_cast" = "yes"
1463
 
  then
1464
 
    W_CAST="-Wold-style-cast"
1465
 
  fi
1466
 
 
1467
 
  if test "$ac_warn_effc" = "yes"
1468
 
  then
1469
 
    W_EFFC="-Weffc++"
1470
 
  fi
1471
 
 
1472
 
  if test "$ac_warn_gocrazy" = "yes"
1473
 
  then
1474
 
    W_CRAZY="-Wshadow -Wconversion -Winvalid-pch"
1475
 
  fi
1476
 
 
1477
 
  BASE_WARNINGS="-W -Wall -Wextra -Wunused-macros"
1478
 
  GCC_WARNINGS="${C99_SUPPORT_HACK} ${BASE_WARNINGS} ${GCC_PEDANTIC} ${W_UNREACHABLE} ${W_FAIL} ${GPROF_PROFILING} ${GPROF_COVERAGE} ${W_CRAZY}"
1479
 
  GXX_WARNINGS="${BASE_WARNINGS} ${GXX_PEDANTIC} ${W_UNREACHABLE} ${W_FAIL} ${GPROF_PROFILING} ${GPROF_COVERAGE} ${W_CAST} ${W_EFFC} ${W_CRAZY}"
1480
 
 
1481
 
  AM_CXXFLAGS="${GXX_WARNINGS} ${AM_CXXFLAGS}"
1482
 
  AM_CFLAGS="${GCC_WARNINGS} ${AM_CFLAGS}"
 
1225
    GCC_WARNINGS="${GCC_WARNINGS} -Werror"
 
1226
    GXX_WARNINGS="${GXX_WARNINGS} -Werror"
 
1227
  fi
 
1228
 
 
1229
    CXXFLAGS="$CXXFLAGS ${GXX_WARNINGS}"
 
1230
    CFLAGS="$CFLAGS ${GCC_WARNINGS} "
1483
1231
fi
1484
1232
 
1485
 
AC_SUBST([GLOBAL_CPPFLAGS],['-I$(top_srcdir) -I$(top_builddir)'])
1486
 
AC_SUBST([AM_CPPFLAGS],['${GLOBAL_CPPFLAGS}'])
1487
 
AC_SUBST([AM_CFLAGS])
1488
 
AC_SUBST([AM_CXXFLAGS])
1489
 
 
1490
1233
# Some usefull subst
1491
1234
AC_SUBST(CC)
1492
1235
AC_SUBST(GXX)
1502
1245
esac
1503
1246
AC_SUBST(MAKE_BINARY_DISTRIBUTION_OPTIONS)
1504
1247
 
1505
 
dnl GCC Precompiled Header Support
1506
 
AM_CONDITIONAL([GCC_PCH],[test "x$GCC" = "xyes"])
1507
 
 
1508
 
AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl
1509
 
 mystrings/Makefile storage/Makefile dnl
1510
 
 vio/Makefile po/Makefile.in dnl
 
1248
AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile mysys/tests/Makefile dnl
 
1249
 strings/Makefile strings/tests/Makefile storage/Makefile dnl
 
1250
 vio/Makefile dnl
1511
1251
 libdrizzle/Makefile client/Makefile dnl
1512
 
 drizzled/Makefile dnl
1513
 
 drizzled/field/Makefile dnl
1514
 
 drizzled/serialize/Makefile dnl
1515
 
 drizzled/functions/Makefile dnl
1516
 
 drizzled/util/Makefile dnl
1517
 
 drizzled/sql_builtin.cc dnl
 
1252
 server/Makefile server/share/Makefile dnl
 
1253
 server/sql_builtin.cc dnl
 
1254
 dbug/Makefile include/Makefile dnl
1518
1255
 support-files/Makefile dnl
1519
1256
 tests/Makefile tests/install_test_db dnl
1520
 
 drizzled/version.h plugin/Makefile dnl
1521
 
 drizzled/drizzled_safe support-files/libdrizzle.pc dnl
 
1257
 include/drizzle_version.h plugin/Makefile dnl
 
1258
 server/drizzled_safe support-files/libdrizzle.pc dnl
1522
1259
 support-files/drizzle.server support-files/drizzle-log-rotate)
1523
1260
 
1524
1261
AC_CONFIG_COMMANDS([default], , test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h)
1525
1262
 
1526
1263
# Ensure that table handlers gets all modifications to CFLAGS/CXXFLAGS
1527
 
AC_CONFIG_COMMANDS_POST(ac_configure_args="$ac_configure_args CFLAGS='$CFLAGS' CXXFLAGS='$CXXFLAGS' AM_CFLAGS='$AM_CFLAGS' AM_CXXFLAGS='$AM_CXXFLAGS'")
 
1264
AC_CONFIG_COMMANDS_POST(ac_configure_args="$ac_configure_args CFLAGS='$CFLAGS' CXXFLAGS='$CXXFLAGS'")
1528
1265
 
1529
1266
AC_OUTPUT
1530
 
 
1531
 
echo "---"
1532
 
echo "Configuration summary for $PACKAGE_NAME version $VERSION"
1533
 
echo ""
1534
 
echo "   * Installation prefix:       $prefix"
1535
 
echo "   * System type:               $SYSTEM_TYPE"
1536
 
echo "   * Host CPU:                  $host_cpu"
1537
 
echo "   * C Compiler:                $CC_VERSION"
1538
 
echo "   * C++ Compiler:              $CXX"
1539
 
echo "   * Build auth_pam:            $ac_cv_header_security_pam_appl_h"
1540
 
echo "   * Assertions enabled:        $ac_cv_assert"
1541
 
echo "   * Debug enabled:             $with_debug"
1542
 
echo "   * Profiling enabled:         $ac_profiling"
1543
 
echo "   * Coverage enabled:          $ac_coverage"
1544
 
echo "   * Warnings as failure:       $ac_warn_fail"
1545
 
echo "   * C++ cstdint location:      $ac_cv_cxx_cstdint"
1546
 
echo "   * C++ hash_map location:     $ac_cv_cxx_hash_map"
1547
 
echo "   * C++ hash namespace:        $ac_cv_cxx_hash_namespace"
1548
 
echo "   * C++ cmath location:        $ac_cv_cxx_cmath"
1549
 
echo "   * C++ cmath namespace:       $ac_cv_cxx_cmath_namespace"
1550
 
echo ""
1551
 
echo "---"