~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Brian Aker
  • Date: 2008-10-06 06:47:29 UTC
  • Revision ID: brian@tangent.org-20081006064729-2i9mhjkzyvow9xsm
RemoveĀ uint.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
dnl -*- bash -*-
 
1
dnl -*- ksh -*-
2
2
dnl Process this file with autoconf to produce a configure script.
3
3
 
4
 
dnl  Copyright (C) 2009 Sun Microsystems
5
 
dnl
6
 
dnl  This program is free software; you can redistribute it and/or modify
7
 
dnl  it under the terms of the GNU General Public License as published by
8
 
dnl  the Free Software Foundation; version 2 of the License.
9
 
dnl
10
 
dnl  This program is distributed in the hope that it will be useful,
11
 
dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
dnl  GNU General Public License for more details.
14
 
dnl
15
 
dnl  You should have received a copy of the GNU General Public License
16
 
dnl  along with this program; if not, write to the Free Software
17
 
dnl  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
 
 
19
 
 
20
4
AC_PREREQ(2.59)dnl              Minimum Autoconf version required.
21
 
dnl Version from the AC_INIT call below is overridden later
22
 
dnl So don't update it here
23
 
AC_INIT([drizzle],[7],[http://bugs.launchpad.net/drizzle])
 
5
 
 
6
AC_INIT(drizzle, [7.0.0], [http://bugs.launchpad.net/drizzle])
24
7
AC_CONFIG_SRCDIR([drizzled/drizzled.cc])
25
 
AC_CONFIG_AUX_DIR([config])
26
 
 
27
 
PANDORA_CANONICAL_TARGET(less-warnings, warnings-always-on, require-cxx, force-gcc42, skip-visibility, version-from-vc)
28
 
 
29
 
dnl Set the default datadir location to /usr/local/var/drizzle. If a
30
 
dnl localstatedir is explicitly given, just use that.
31
 
AS_IF([test "x${localstatedir}" = 'x${prefix}/var'],[
32
 
  localstatedir='${prefix}/var/drizzle'
33
 
])
34
 
 
35
 
AC_PATH_PROG(GPERF, gperf)
36
 
AS_IF([test "x$GPERF" = "x"],
37
 
      AC_MSG_ERROR("Drizzle requires gperf to build."))
38
 
 
39
 
AC_CHECK_PROGS(YACC, ['bison -y'])
40
 
AS_IF([test "x$YACC" = "x" -a "$pandora_building_from_bzr" = "yes"],[
 
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
 
 
30
AC_CANONICAL_TARGET
 
31
AM_INIT_AUTOMAKE(-Wall -Werror)
 
32
 
 
33
PROTOCOL_VERSION=10
 
34
DOT_FRM_VERSION=6
 
35
# See the libtool docs for information on how to do shared lib versions.
 
36
SHARED_LIB_MAJOR_VERSION=1
 
37
SHARED_LIB_VERSION=$SHARED_LIB_MAJOR_VERSION:0:0
 
38
 
 
39
 
 
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
 
 
52
# Set all version vars based on $VERSION. How do we do this more elegant ?
 
53
# Remember that regexps needs to quote [ and ] since this is run through m4
 
54
# We take some made up examples
 
55
#
 
56
#  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
 
61
#
 
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 | \
 
66
    awk -F. '{printf "%d%0.2d%0.2d", $1, $2, $3}'`
 
67
 
 
68
# 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)
 
83
AC_SUBST(PROTOCOL_VERSION)
 
84
AC_DEFINE_UNQUOTED([PROTOCOL_VERSION], [$PROTOCOL_VERSION],
 
85
                   [mysql client protocol version])
 
86
AC_SUBST(DOT_FRM_VERSION)
 
87
AC_DEFINE_UNQUOTED([DOT_FRM_VERSION], [$DOT_FRM_VERSION],
 
88
                   [Version of .frm files])
 
89
AC_SUBST(SHARED_LIB_MAJOR_VERSION)
 
90
AC_SUBST(SHARED_LIB_VERSION)
 
91
AC_SUBST(AVAILABLE_LANGUAGES)
 
92
 
 
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
 
 
158
# Canonicalize the configuration name.
 
159
 
 
160
# Check whether --with-system-type or --without-system-type was given.
 
161
AC_ARG_WITH([system-type],
 
162
    [AS_HELP_STRING([--with-system-type],
 
163
       [Set the system type, like "sun-solaris10"])],
 
164
    [SYSTEM_TYPE="$withval"],
 
165
    [SYSTEM_TYPE="$host_vendor-$host_os"])
 
166
AC_ARG_WITH([machine-type],
 
167
    [AS_HELP_STRING([--with-machine-type],
 
168
       [Set the machine type, like "powerpc"])],
 
169
    [MACHINE_TYPE="$withval"],
 
170
    [MACHINE_TYPE="$host_cpu"])
 
171
AC_SUBST(SYSTEM_TYPE)
 
172
AC_DEFINE_UNQUOTED([SYSTEM_TYPE], ["$SYSTEM_TYPE"],
 
173
                   [Name of system, eg sun-solaris])
 
174
AC_SUBST(MACHINE_TYPE)
 
175
AC_DEFINE_UNQUOTED([MACHINE_TYPE], ["$MACHINE_TYPE"],
 
176
                   [Machine type name, eg sparc])
 
177
 
 
178
# Detect intel x86 like processor
 
179
BASE_MACHINE_TYPE=$MACHINE_TYPE
 
180
case $MACHINE_TYPE in
 
181
  i?86) BASE_MACHINE_TYPE=i386 ;;
 
182
esac
 
183
 
 
184
AM_SANITY_CHECK
 
185
# This is needed is SUBDIRS is set
 
186
AC_PROG_MAKE_SET
 
187
 
 
188
##############################################################################
 
189
# The below section needs to be done before AC_PROG_CC
 
190
##############################################################################
 
191
 
 
192
if test "x${CFLAGS-}" = x ; then
 
193
  cflags_is_set=no
 
194
else
 
195
  cflags_is_set=yes
 
196
fi
 
197
 
 
198
if test "x${CPPFLAGS-}" = x ; then
 
199
  cppflags_is_set=no
 
200
else
 
201
  cppflags_is_set=yes
 
202
fi
 
203
 
 
204
if test "x${LDFLAGS-}" = x ; then
 
205
  ldflags_is_set=no
 
206
else
 
207
  ldflags_is_set=yes
 
208
fi
 
209
 
 
210
################ End of section to be done before AC_PROG_CC #################
 
211
 
 
212
dnl Checks for programs.
 
213
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
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
AC_PROG_CPP
 
226
AM_PROG_CC_C_O
 
227
 
 
228
# Print version of CC and CXX compiler (if they support --version)
 
229
case $SYSTEM_TYPE in
 
230
  *apple-darwin*)
 
231
    AC_DEFINE([TARGET_OS_OSX], [1], [Whether we build for OSX])
 
232
    ;;
 
233
  *)
 
234
CC_VERSION=`$CC --version | sed 1q`
 
235
    ;;
 
236
esac
 
237
if test $? -eq "0"
 
238
then
 
239
  AC_MSG_CHECKING("C Compiler version")
 
240
  AC_MSG_RESULT("$CC $CC_VERSION")
 
241
else
 
242
CC_VERSION=""
 
243
fi
 
244
AC_SUBST(CC_VERSION)
 
245
 
 
246
dnl AC_CANONICAL_HOST thinks it's a good idea to just set CFLAGS to 
 
247
dnl -g -O2 if you're running gcc. We would like to use something else, thanks.
 
248
if test "x${CFLAGS}" = "x-g -O2"
 
249
then
 
250
  CFLAGS=
 
251
fi
 
252
if test "x${CXXFLAGS}" = "x-g -O2"
 
253
then
 
254
  CXXFLAGS=
 
255
fi
 
256
 
 
257
DRIZZLE_CHECK_CXX_VERSION
 
258
 
 
259
AC_PROG_AWK
 
260
 
 
261
if test "$ac_cv_c_compiler_gnu" = "yes"
 
262
then
 
263
  AS="$CC -c"
 
264
  AC_SUBST(AS)
 
265
else
 
266
  AC_PATH_PROG(AS, as, as)
 
267
fi
 
268
 
 
269
dnl TODO: This needs to go away and be replaced with _ISOC99_SOURCE
 
270
if test "$ac_cv_compiler_gnu" = "yes" -o "$target_os" = "linux-gnu"
 
271
then
 
272
  AC_DEFINE([_GNU_SOURCE],[1],[Fix problem with S_ISLNK() on Linux])
 
273
fi
 
274
 
 
275
dnl  Solaris 9 include file <sys/feature_tests.h> refers to X/Open document
 
276
 
 
277
dnl  System Interfaces and Headers, Issue 5
 
278
 
 
279
dnl  saying we should define _XOPEN_SOURCE=500 to get POSIX.1c prototypes,
 
280
dnl  but apparently other systems (namely FreeBSD) don't agree.
 
281
 
 
282
dnl  On a newer Solaris 10, the above file recognizes also _XOPEN_SOURCE=600.
 
283
dnl  Furthermore, it tests that if a program requires older standard
 
284
dnl  (_XOPEN_SOURCE<600 or _POSIX_C_SOURCE<200112L) it cannot be
 
285
dnl  run on a new compiler (that defines _STDC_C99) and issues an #error.
 
286
dnl  It's also an #error if a program requires new standard (_XOPEN_SOURCE=600
 
287
dnl  or _POSIX_C_SOURCE=200112L) and a compiler does not define _STDC_C99.
 
288
 
 
289
dnl  To add more to this mess, Sun Studio C compiler defines _STDC_C99 while
 
290
dnl  C++ compiler does not!
 
291
 
 
292
dnl TODO: Can _ISOC99_SOURCE be defined on all platforms and remove the 
 
293
dnl       Need for all of this? 
 
294
if test "${build_vendor}" = "sun"
 
295
then
 
296
  dnl Do we need both of these? 
 
297
  dnl This is for C++
 
298
  AC_DEFINE([__C99FEATURES__],[1],[C99 Features])
 
299
  dnl This is for C
 
300
  AC_DEFINE([_XOPEN_SOURCE],[600],[X/Open Level])
 
301
fi
 
302
 
 
303
# We use libtool
 
304
#AC_LIBTOOL_WIN32_DLL
 
305
AC_PROG_LIBTOOL
 
306
 
 
307
# Ensure that we have --preserve-dup-deps defines, otherwise we get link
 
308
# problems of 'mysql' with CXX=g++
 
309
LIBTOOL="$LIBTOOL --preserve-dup-deps"
 
310
AC_SUBST(LIBTOOL)dnl
 
311
 
 
312
AC_SUBST(NM)dnl
 
313
 
 
314
AC_PROG_INSTALL
 
315
test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
 
316
 
 
317
# Not critical since the generated file is distributed
 
318
AC_CHECK_PROGS(YACC, ['bison -y -p MYSQL'])
 
319
if test -z "$YACC" && test -d ".bzr"
 
320
then
41
321
  AC_MSG_ERROR(["bison is required for Drizzle to build from a bzr branch"])
42
 
])
43
 
 
44
 
 
45
 
PANDORA_RUN_CPPLINT
46
 
 
47
 
PANDORA_REQUIRE_LIBPROTOBUF
48
 
PANDORA_PROTOBUF_REQUIRE_VERSION([2.1.0])
49
 
PANDORA_REQUIRE_PROTOC
50
 
 
51
 
AC_LANG_PUSH(C++)
52
 
PANDORA_REQUIRE_PTHREAD
53
 
PANDORA_REQUIRE_LIBUUID
54
 
PANDORA_REQUIRE_LIBDRIZZLE
55
 
PANDORA_REQUIRE_LIBZ
56
 
PANDORA_REQUIRE_LIBPCRE
57
 
PANDORA_REQUIRE_LIBREADLINE
58
 
PANDORA_REQUIRE_LIBDL
59
 
AC_LANG_POP
60
 
 
61
 
PANDORA_USE_BETTER_MALLOC
62
 
 
63
 
PANDORA_DRIZZLE_BUILD
64
 
AC_DEFINE([BUILDING_DRIZZLE],[1],
65
 
          [Define indicating we are building and not consuming drizzle.])
 
322
fi
 
323
 
 
324
AC_PATH_PROG(uname_prog, uname, no)
 
325
 
 
326
# We should go through this and put all the explictly system dependent
 
327
# stuff in one place
 
328
AC_MSG_CHECKING(operating system)
 
329
AC_CACHE_VAL(mysql_cv_sys_os,
 
330
[
 
331
if test "$uname_prog" != "no"; then
 
332
  mysql_cv_sys_os="`uname`"
 
333
else
 
334
  mysql_cv_sys_os="Not Solaris"
 
335
fi
 
336
])
 
337
AC_MSG_RESULT($mysql_cv_sys_os)
 
338
 
 
339
# This should be rewritten to use $target_os
 
340
case "$target_os" in
 
341
  *solaris*)
 
342
    TARGET_SOLARIS="true"
 
343
    AC_DEFINE([TARGET_OS_SOLARIS], [1], [Whether we are building for Solaris])
 
344
    AC_SUBST(TARGET_SOLARIS)
 
345
  ;;
 
346
esac
 
347
 
 
348
# The following is required for portable results of floating point calculations
 
349
# on PowerPC. The same must also be done for IA-64, but this options is missing
 
350
# in the IA-64 gcc backend.
 
351
 
 
352
if test "$GCC" = "yes"
 
353
then
 
354
  case "$host_cpu" in
 
355
    *ppc* | *powerpc*)
 
356
      AM_CFLAGS="$CFLAGS -mno-fused-madd"
 
357
      AM_CXXFLAGS="$CXXFLAGS -mno-fused-madd"
 
358
    ;;
 
359
  esac
 
360
fi
 
361
 
 
362
AC_SUBST(CC)
 
363
AC_SUBST(CFLAGS)
 
364
AC_SUBST(CXX)
 
365
AC_SUBST(CXXFLAGS)
 
366
AC_SUBST(ASFLAGS)
 
367
AC_SUBST(LD)
 
368
AC_SUBST(INSTALL_SCRIPT)
 
369
 
 
370
 
 
371
export CC CXX CFLAGS LD LDFLAGS AR ARFLAGS
 
372
 
 
373
if test "$GCC" = "yes"
 
374
then
 
375
  # Disable exceptions as they seams to create problems with gcc and threads.
 
376
  # drizzled doesn't use run-time-type-checking, so we disable it.
 
377
  AM_CXXFLAGS="${AM_CXXFLAGS} -fno-exceptions"
 
378
fi
 
379
 
 
380
DRIZZLE_PROG_AR
 
381
 
 
382
# libdrizzle versioning when linked with GNU ld.
 
383
if $LD --version 2>/dev/null|grep -q GNU; then
 
384
  LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_srcdir)/libdrizzle/libdrizzle.ver"
 
385
fi
 
386
AC_SUBST(LD_VERSION_SCRIPT)
 
387
 
 
388
#--------------------------------------------------------------------
 
389
# Check for Google Proto Buffers
 
390
#--------------------------------------------------------------------
 
391
 
 
392
AC_LANG_PUSH([C++])
 
393
AC_CHECK_HEADERS([google/protobuf/message.h])
 
394
if test "x$ac_cv_header_google_protobuf_message_h" != "xyes"
 
395
then
 
396
  AC_MSG_ERROR([Couldn't find message.h. Try installing Google Protocol Buffer development packages])
 
397
fi
 
398
 
 
399
save_CFLAGS="$CFLAGS"
 
400
save_LIBS="$LIBS"
 
401
CFLAGS=""
 
402
LIBS="-lprotobuf"
 
403
 
 
404
AC_CACHE_CHECK([for Message in libprotobuf], ac_libprotobuf_works, [
 
405
  AC_TRY_LINK([
 
406
#include <google/protobuf/descriptor.pb.h>
 
407
  ],[
 
408
    google::protobuf::FileDescriptorProto testFdp;
 
409
  ], ac_libprotobuf_works=yes, [
 
410
        AC_ERROR([could not find Google's libprotobuf])
 
411
  ])
 
412
 
 
413
])
 
414
 
 
415
PROTOBUF_LIBS="${LIBS}"
 
416
AC_SUBST(PROTOBUF_LIBS)
 
417
CFLAGS="$save_CFLAGS"
 
418
LIBS="$save_LIBS"
 
419
AC_LANG_POP()
 
420
 
 
421
#--------------------------------------------------------------------
 
422
# Check for libevent
 
423
#--------------------------------------------------------------------
 
424
 
 
425
AC_MSG_CHECKING(for libevent)
 
426
AC_ARG_WITH(libevent,
 
427
  [AS_HELP_STRING([--with-libevent],
 
428
       [Use libevent build directory])],
 
429
  [ with_libevent=$withval ],
 
430
  [ with_libevent=yes ])
 
431
 
 
432
if test "$with_libevent" = "yes"
 
433
then
 
434
    AC_CHECK_HEADERS(event.h)
 
435
    if test "x$ac_cv_header_event_h" != "xyes"
 
436
    then
 
437
      AC_MSG_ERROR([Couldn't find event.h. Try installing libevent development packages])
 
438
    fi
 
439
    my_save_LIBS="$LIBS"
 
440
    LIBS=""
 
441
    AC_CHECK_LIB(event, event_loop, [], [AC_MSG_ERROR(could not find libevent)])
 
442
    LIBEVENT_LIBS="${LIBS}"
 
443
    LIBS="${my_save_LIBS}"
 
444
    LIBEVENT_CFLAGS=""
 
445
else
 
446
    AC_MSG_RESULT($withval)
 
447
    if test -f $withval/event.h -a -f $withval/libevent.a; then
 
448
       owd=`pwd`
 
449
       if cd $withval; then withval=`pwd`; cd $owd; fi
 
450
       LIBEVENT_CFLAGS="-I$withval"
 
451
       LIBEVENT_LIBS="-L$withval -levent"
 
452
    elif test -f $withval/include/event.h -a -f $withval/lib/libevent.a; then
 
453
       owd=`pwd`
 
454
       if cd $withval; then withval=`pwd`; cd $owd; fi
 
455
       LIBEVENT_CFLAGS="-I$withval/include"
 
456
       LIBEVENT_LIBS="-L$withval/lib -levent"
 
457
    else
 
458
       AC_MSG_ERROR([event.h or libevent.a not found in $withval])
 
459
    fi
 
460
fi
 
461
 
 
462
AC_SUBST(LIBEVENT_CFLAGS)
 
463
AC_SUBST(LIBEVENT_LIBS)
 
464
 
 
465
AC_CACHE_CHECK([for bufferevent in libevent], ac_libevent_works, [
 
466
  save_CFLAGS="$CFLAGS"
 
467
  save_LIBS="$LIBS"
 
468
  CFLAGS="$LIBEVENT_CFLAGS"
 
469
  LIBS="$LIBEVENT_LIBS"
 
470
  AC_TRY_LINK([
 
471
#include <sys/types.h>
 
472
#include <sys/time.h>
 
473
#include <stdlib.h>
 
474
#include <event.h>],[
 
475
        struct bufferevent bev;
 
476
        bufferevent_settimeout(&bev, 1, 1);
 
477
  ], ac_libevent_works=yes, [
 
478
        AC_ERROR([you need to install a more recent version of libevent,
 
479
        check http://www.monkey.org/~provos/libevent/])
 
480
  ])
 
481
 
 
482
  CFLAGS="$save_CFLAGS"
 
483
  LIBS="$save_LIBS"
 
484
])
 
485
 
 
486
 
 
487
#--------------------------------------------------------------------
 
488
# Check for libpthread
 
489
#--------------------------------------------------------------------
 
490
 
 
491
AC_CHECK_HEADERS(pthread.h)
 
492
if test "x$ac_cv_header_pthread_h" != "xyes"
 
493
then
 
494
  AC_MSG_ERROR([Couldn't find pthread.h.])
 
495
fi
 
496
AC_CHECK_LIB(pthread, pthread_create, [], [AC_MSG_ERROR(could not find libpthread)])
 
497
 
 
498
#--------------------------------------------------------------------
 
499
# Check for tcmalloc
 
500
#--------------------------------------------------------------------
 
501
 
 
502
AC_ARG_ENABLE([tcmalloc],
 
503
    [AS_HELP_STRING([--enable-tcmalloc],
 
504
       [Enable linking with tcmalloc @<:@default=off@:>@])],
 
505
    [ac_enable_tcmalloc="$enableval"],
 
506
    [ac_enable_tcmalloc="no"])
 
507
 
 
508
if test "x$ac_enable_tcmalloc" = "xyes"
 
509
then
 
510
  AC_CHECK_LIB(tcmalloc,malloc,[],[])
 
511
fi
 
512
 
 
513
#--------------------------------------------------------------------
 
514
# Check for libz
 
515
#--------------------------------------------------------------------
 
516
 
 
517
my_save_LIBS="$LIBS"
 
518
LIBS=""
 
519
AC_CHECK_HEADERS(zlib.h)
 
520
if test "x$ac_cv_header_zlib_h" != "xyes"
 
521
then
 
522
  AC_MSG_ERROR([Couldn't find zlib.h. Try installing zlib development packages])
 
523
fi
 
524
AC_CHECK_LIB(z, crc32, [], [AC_MSG_ERROR(could not find libz)])
 
525
ZLIB_LIBS="$LIBS"
 
526
LIBS="$my_save_LIBS"
 
527
AC_SUBST(ZLIB_LIBS)
 
528
 
 
529
 
 
530
#--------------------------------------------------------------------
 
531
# Check for libreadline or compatible (libedit on Mac OS X)
 
532
#--------------------------------------------------------------------
 
533
 
 
534
AC_CHECK_HEADERS(readline/history.h readline/readline.h)
 
535
if test "x$ac_cv_header_readline_readline_h" != "xyes"
 
536
then
 
537
  AC_MSG_ERROR([Couldn't find readline/readline.h. Try installing readline development packages.])
 
538
fi
 
539
AC_CHECK_TYPES([HIST_ENTRY], [], [], [AC_INCLUDES_DEFAULT[
 
540
#ifdef HAVE_READLINE_HISTORY_H
 
541
#include <readline/history.h>
 
542
#endif
 
543
#include <readline/readline.h>
 
544
]])
 
545
AC_CHECK_DECLS([completion_matches], [], [], [AC_INCLUDES_DEFAULT[
 
546
#ifdef HAVE_READLINE_HISTORY_H
 
547
#include <readline/history.h>
 
548
#endif
 
549
#include <readline/readline.h>
 
550
]])
 
551
 
 
552
DRIZZLE_CHECK_NEW_RL_INTERFACE
 
553
 
 
554
my_save_LIBS="$LIBS"
 
555
LIBS=""
 
556
AC_CHECK_LIB(readline, rl_initialize, [],
 
557
  [AC_CHECK_LIB(ncurses, tgetent, [], [AC_MSG_ERROR(Couldn't find ncurses)]) 
 
558
   AC_SEARCH_LIBS(rl_initialize, readline, [],
 
559
    [AC_MSG_ERROR(Couldn't find libreadline.)])])
 
560
READLINE_LIBS="$LIBS"
 
561
LIBS="$my_save_LIBS"
 
562
AC_SUBST(READLINE_LIBS)
 
563
 
 
564
 
 
565
#--------------------------------------------------------------------
 
566
# Check for libpcre
 
567
#--------------------------------------------------------------------
 
568
 
 
569
AC_LANG_PUSH([C++])
 
570
AC_PATH_PROG(PKG_CONFIG, pkg-config, AC_MSG_ERROR([pkg-config wasn't found.]))
 
571
PKG_CHECK_MODULES(PCRE, [libpcrecpp >= 3], [found_pcre="yes"],[found_pcre="no"])
 
572
 
 
573
if test "$found_pcre" = "no"
 
574
then
 
575
  dnl Only check the header here, because autoconf can't handle
 
576
  dnl checking for C++ methods without C linkages
 
577
  AC_CHECK_HEADERS(pcrecpp.h)
 
578
  if test "x$ac_cv_header_pcrecpp_h" != "xyes" 
 
579
  then
 
580
    AC_MSG_ERROR([Couldn't find pcrecpp.h. Try installing the development package associated with libpcre on your system.])
 
581
  else
 
582
    # Found headers, now see if we can link
 
583
    AC_MSG_CHECKING(for libpcrecpp)
 
584
    save_LDFLAGS="$LDFLAGS"
 
585
    LDFLAGS="-lpcrecpp -lpcre"
 
586
    AC_TRY_LINK([
 
587
#include <pcrecpp.h>
 
588
    ],
 
589
    [pcrecpp::RE_Options opt;],
 
590
    [found_pcre="yes"],
 
591
    [AC_MSG_ERROR([Couldn't link libpcrecpp])])
 
592
 
 
593
    PCRE_LIBS="$LDFLAGS"
 
594
    LDFLAGS="$save_LDFLAGS"
 
595
    AC_MSG_RESULT([yes])
 
596
  fi
 
597
fi
 
598
AC_LANG_POP([])
 
599
AC_SUBST(PCRE_LIBS)
 
600
AC_SUBST(PCRE_CFLAGS)
 
601
 
 
602
dnl Find paths to some shell programs
 
603
AC_PATH_PROG(LN, ln, ln)
 
604
# This must be able to take a -f flag like normal unix ln.
 
605
AC_PATH_PROG(LN_CP_F, ln, ln)
 
606
 
 
607
AC_PATH_PROG(MV, mv, mv)
 
608
AC_PATH_PROG(RM, rm, rm)
 
609
AC_PATH_PROG(CP, cp, cp)
 
610
AC_PATH_PROG(SED, sed, sed)
 
611
AC_PATH_PROG(CMP, cmp, cmp)
 
612
AC_PATH_PROG(CHMOD, chmod, chmod)
 
613
AC_PATH_PROG(HOSTNAME, hostname, hostname)
 
614
# Check for a GNU tar named 'gtar', or 'gnutar' (MacOS X) and
 
615
# fall back to 'tar' otherwise and hope that it's a GNU tar as well
 
616
AC_CHECK_PROGS(TAR, gnutar gtar tar)
 
617
 
 
618
dnl We use a path for perl so the script startup works
 
619
dnl We make sure to use perl, not perl5, in hopes that the RPMs will
 
620
dnl not depend on the perl5 binary being installed (probably a bug in RPM)
 
621
AC_PATH_PROG(PERL, perl, no)
 
622
if test "$PERL" != "no" && $PERL -e 'require 5' > /dev/null 2>&1
 
623
then
 
624
  PERL5=$PERL
 
625
else
 
626
  AC_PATH_PROG(PERL5, perl5, no)
 
627
  if test "$PERL5" != no
 
628
  then
 
629
    PERL=$PERL5
 
630
    ac_cv_path_PERL=$ac_cv_path_PERL5
 
631
  fi
 
632
fi
 
633
 
 
634
AC_SUBST(HOSTNAME)
 
635
AC_SUBST(PERL)
 
636
AC_SUBST(PERL5)
 
637
 
 
638
# icheck, used for ABI check
 
639
AC_PATH_PROG(ICHECK, icheck, no)
 
640
# "icheck" is also the name of a file system check program on Tru64.
 
641
# Verify the program found is really the interface checker.
 
642
if test "x$ICHECK" != "xno"
 
643
then
 
644
  AC_MSG_CHECKING(if $ICHECK works as expected)
 
645
  echo "int foo;" > conftest.h
 
646
  $ICHECK --canonify -o conftest.ic conftest.h 2>/dev/null
 
647
  if test -f "conftest.ic"
 
648
  then
 
649
    AC_MSG_RESULT(yes)
 
650
  else
 
651
    AC_MSG_RESULT(no)
 
652
    ICHECK=no
 
653
  fi
 
654
  rm -f conftest.ic conftest.h
 
655
fi
 
656
AC_SUBST(ICHECK)
 
657
 
 
658
# Lock for PS
 
659
AC_PATH_PROG(PS, ps, ps)
 
660
AC_MSG_CHECKING("how to check if pid exists")
 
661
PS=$ac_cv_path_PS
 
662
# Linux style
 
663
if $PS p $$ 2> /dev/null | grep `echo $0 | sed s/\-//` > /dev/null
 
664
then
 
665
  FIND_PROC="$PS p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
 
666
# Solaris
 
667
elif $PS -fp $$ 2> /dev/null | grep $0 > /dev/null
 
668
then
 
669
  FIND_PROC="$PS -p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
 
670
# BSD style
 
671
elif $PS -uaxww 2> /dev/null | grep $0 > /dev/null
 
672
then
 
673
  FIND_PROC="$PS -uaxww | grep -v grep | grep \$\$MYSQLD | grep \" \$\$PID \" > /dev/null"
 
674
# SysV style
 
675
elif $PS -ef 2> /dev/null | grep $0 > /dev/null
 
676
then
 
677
  FIND_PROC="$PS -ef | grep -v grep | grep \$\$MYSQLD | grep \" \$\$PID \" > /dev/null"
 
678
# Do anybody use this?
 
679
elif $PS $$ 2> /dev/null | grep $0 > /dev/null
 
680
then
 
681
  FIND_PROC="$PS \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
 
682
else
 
683
  case $SYSTEM_TYPE in
 
684
    *freebsd*|*dragonfly*|*cygwin*)
 
685
      FIND_PROC="$PS p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
 
686
      ;;
 
687
    *darwin*)
 
688
      FIND_PROC="$PS -uaxww | grep -v grep | grep \$\$MYSQLD | grep \" \$\$PID \" > /dev/null"
 
689
      ;;
 
690
    *)
 
691
      AC_MSG_ERROR([Could not find the right ps switches. Which OS is this ?. See the Installation chapter in the Reference Manual.])
 
692
      ;;
 
693
  esac
 
694
fi
 
695
AC_SUBST(FIND_PROC)
 
696
AC_MSG_RESULT("$FIND_PROC")
 
697
 
 
698
# Check if a pid is valid
 
699
AC_PATH_PROG(KILL, kill, kill)
 
700
AC_MSG_CHECKING("for kill switches")
 
701
if $ac_cv_path_KILL -0 $$
 
702
then
 
703
  CHECK_PID="$ac_cv_path_KILL -0 \$\$PID > /dev/null 2> /dev/null"
 
704
elif kill -s 0 $$
 
705
then
 
706
  CHECK_PID="$ac_cv_path_KILL -s 0 \$\$PID > /dev/null 2> /dev/null"
 
707
else
 
708
  AC_MSG_WARN([kill -0 to check for pid seems to fail])
 
709
    CHECK_PID="$ac_cv_path_KILL -s SIGCONT \$\$PID > /dev/null 2> /dev/null"
 
710
fi
 
711
AC_SUBST(CHECK_PID)
 
712
AC_MSG_RESULT("$CHECK_PID")
 
713
 
 
714
# We need an ANSI C compiler
 
715
AM_PROG_CC_STDC
 
716
 
 
717
# We need an assembler, too
 
718
AM_PROG_AS
 
719
CCASFLAGS="$CCASFLAGS $ASFLAGS"
 
720
 
 
721
# Check if we need noexec stack for assembler
 
722
AC_CHECK_NOEXECSTACK
 
723
 
 
724
if test "$am_cv_prog_cc_stdc" = "no"
 
725
then
 
726
  AC_MSG_ERROR([Drizzle requires an ANSI C compiler (and a C++ compiler). Try gcc. See the Installation chapter in the Reference Manual.])
 
727
fi
66
728
 
67
729
 
68
730
AC_ARG_WITH([server-suffix],
69
731
    [AS_HELP_STRING([--with-server-suffix],
70
732
      [Append value to the version string.])],
71
 
    [ DRIZZLE_SERVER_SUFFIX="$withval" ]
72
 
    [ DRIZZLE_SERVER_SUFFIX= ])
73
 
 
74
 
AC_DEFINE_UNQUOTED([DRIZZLE_SERVER_SUFFIX],[$DRIZZLE_SERVER_SUFFIX],
75
 
                   [Append value to the version string])
76
 
 
77
 
 
78
 
AC_ARG_WITH([drizzled-user],
79
 
    [AS_HELP_STRING([--with-drizzled-user=username],
80
 
            [What user the drizzled daemon shall be run as.
81
 
                @<:@default=drizzle@:>@])],
82
 
    [ DRIZZLED_USER="$withval" ],
83
 
    [ DRIZZLED_USER=drizzle ])
84
 
AC_SUBST(DRIZZLED_USER)
85
 
 
 
733
    [ DRIZZLE_SERVER_SUFFIX=`echo "$withval" | sed -e  's/^\(...................................\)..*$/\1/'` ],
 
734
    [ DRIZZLE_SERVER_SUFFIX= ]
 
735
    )
 
736
AC_SUBST(DRIZZLE_SERVER_SUFFIX)
 
737
 
 
738
# Force use of a curses libs
 
739
AC_ARG_WITH([named-curses-libs],
 
740
    [AS_HELP_STRING([--with-named-curses-libs=ARG],
 
741
            [Use specified curses libraries instead of those
 
742
                automatically found by configure.])],
 
743
    [ with_named_curses=$withval ],
 
744
    [ with_named_curses=no ]
 
745
    )
 
746
 
 
747
AC_ARG_WITH([tcp-port],
 
748
    [AS_HELP_STRING([--with-tcp-port=port-number],
 
749
            [Which port to use for Drizzle services @<:@default=4427@:>@])],
 
750
    [ DRIZZLE_TCP_PORT=$withval ],
 
751
    [ DRIZZLE_TCP_PORT=$DRIZZLE_TCP_PORT_DEFAULT
 
752
      # if we actually defaulted (as opposed to the pathological case of
 
753
      # --with-tcp-port=<DRIZZLE_TCP_PORT_DEFAULT> which might in theory
 
754
      # happen if whole batch of servers was built from a script), set
 
755
      # the default to zero to indicate that; we don't lose information
 
756
      # that way, because 0 obviously indicates that we can get the
 
757
      # default value from DRIZZLE_TCP_PORT. this seems really evil, but
 
758
      # testing for DRIZZLE_TCP_PORT==DRIZZLE_TCP_PORT_DEFAULT would make a
 
759
      # a port of DRIZZLE_TCP_PORT_DEFAULT magic even if the builder did not
 
760
      # intend it to mean "use the default, in fact, look up a good default
 
761
      # from /etc/services if you can", but really, really meant 4427 when
 
762
      # they passed in 4427. When they pass in a specific value, let them
 
763
      # have it; don't second guess user and think we know better, this will
 
764
      # just make people cross.  this makes the the logic work like this
 
765
      # (which is complicated enough):
 
766
      #
 
767
      # - if a port was set during build, use that as a default.
 
768
      #
 
769
      # - otherwise, try to look up a port in /etc/services; if that fails,
 
770
      #   use DRIZZLE_TCP_PORT_DEFAULT (at the time of this writing 4427)
 
771
      #
 
772
      # - allow the DRIZZLE_TCP_PORT environment variable to override that.
 
773
      #
 
774
      # - allow command-line parameters to override all of the above.
 
775
      #
 
776
      # the top-most DRIZZLE_TCP_PORT_DEFAULT is read from win/configure.js,
 
777
      # so don't mess with that.
 
778
      DRIZZLE_TCP_PORT_DEFAULT=0 ]
 
779
    )
 
780
AC_SUBST(DRIZZLE_TCP_PORT)
 
781
# We might want to document the assigned port in the manual.
 
782
AC_SUBST(DRIZZLE_TCP_PORT_DEFAULT)
 
783
 
 
784
# Use this to set the place used for unix socket used to local communication.
 
785
AC_ARG_WITH([mysqld-user],
 
786
    [AS_HELP_STRING([--with-mysqld-user=username],
 
787
            [What user the mysqld daemon shall be run as.
 
788
                @<:@default=mysql@:>@])],
 
789
    [ MYSQLD_USER=$withval ],
 
790
    [ MYSQLD_USER=mysql ]
 
791
    )
 
792
AC_SUBST(MYSQLD_USER)
 
793
 
 
794
# If we should allow LOAD DATA LOCAL
 
795
AC_MSG_CHECKING(If we should should enable LOAD DATA LOCAL by default)
 
796
AC_ARG_ENABLE(local-infile,
 
797
    [  --enable-local-infile   Enable LOAD DATA LOCAL INFILE (default: disabled)],
 
798
    [ ENABLED_LOCAL_INFILE=$enableval ],
 
799
    [ ENABLED_LOCAL_INFILE=no ]
 
800
    )
 
801
if test "$ENABLED_LOCAL_INFILE" = "yes"
 
802
then
 
803
  AC_MSG_RESULT([yes])
 
804
  AC_DEFINE([ENABLED_LOCAL_INFILE], [1],
 
805
            [If LOAD DATA LOCAL INFILE should be enabled by default])
 
806
else
 
807
  AC_MSG_RESULT([no])
 
808
fi
 
809
 
 
810
DRIZZLE_SYS_LARGEFILE
 
811
 
 
812
# Types that must be checked AFTER large file support is checked
 
813
AC_TYPE_SIZE_T
 
814
 
 
815
#--------------------------------------------------------------------
 
816
# Check for system header files
 
817
#--------------------------------------------------------------------
 
818
 
 
819
AC_HEADER_DIRENT
 
820
AC_HEADER_STDC
 
821
AC_HEADER_SYS_WAIT
 
822
AC_HEADER_STDBOOL
 
823
AC_CHECK_HEADERS(fcntl.h float.h fpu_control.h ieeefp.h)
 
824
AC_CHECK_HEADERS(limits.h pwd.h select.h linux/config.h)
 
825
AC_CHECK_HEADERS(sys/fpu.h utime.h sys/utime.h )
 
826
AC_CHECK_HEADERS(synch.h sys/mman.h sys/socket.h netinet/in.h arpa/inet.h)
 
827
AC_CHECK_HEADERS(sys/timeb.h sys/vadvise.h sys/wait.h term.h)
 
828
AC_CHECK_HEADERS(termio.h termios.h sched.h alloca.h)
 
829
AC_CHECK_HEADERS(sys/ioctl.h malloc.h sys/malloc.h sys/ipc.h sys/shm.h)
 
830
AC_CHECK_HEADERS(sys/prctl.h sys/resource.h sys/param.h port.h ieeefp.h)
 
831
AC_CHECK_HEADERS(execinfo.h)
 
832
 
 
833
AC_CHECK_HEADERS([xfs/xfs.h])
 
834
 
 
835
#--------------------------------------------------------------------
 
836
# Check for system libraries. Adds the library to $LIBS
 
837
# and defines HAVE_LIBM etc
 
838
#--------------------------------------------------------------------
 
839
 
 
840
AC_CHECK_LIB(m, floor, [], AC_CHECK_LIB(m, __infinity))
 
841
AC_CHECK_FUNCS(log2)
 
842
 
 
843
AC_CHECK_FUNC(setsockopt, [], [AC_CHECK_LIB(socket, setsockopt)])
 
844
AC_CHECK_FUNC(yp_get_default_domain, [],
 
845
  [AC_CHECK_LIB(nsl, yp_get_default_domain)])
 
846
AC_CHECK_FUNC(p2open, [], [AC_CHECK_LIB(gen, p2open)])
 
847
# This may get things to compile even if bind-8 is installed
 
848
AC_CHECK_FUNC(bind, [], [AC_CHECK_LIB(bind, bind)])
 
849
# Check if crypt() exists in libc or libcrypt, sets LIBS if needed
 
850
AC_SEARCH_LIBS(crypt, crypt, AC_DEFINE(HAVE_CRYPT, 1, [crypt]))
 
851
 
 
852
# Check rt for aio_read
 
853
AC_CHECK_LIB(rt, aio_read)
 
854
 
 
855
# For the sched_yield() function on Solaris
 
856
AC_CHECK_FUNC(sched_yield, [],
 
857
  [AC_CHECK_LIB(posix4, [sched_yield],
 
858
    [AC_DEFINE(HAVE_SCHED_YIELD) LIBS="$LIBS -lposix4"])])
 
859
 
 
860
if test "$ac_cv_header_termio_h" = "no" -a "$ac_cv_header_termios_h" = "no"
 
861
then
 
862
  AC_CHECK_FUNC(gtty, [], [AC_CHECK_LIB(compat, gtty)])
 
863
fi
 
864
 
 
865
AC_CHECK_TYPES([int8, uint8, int16, uint16, int32, uint32, int64, uint64,
 
866
                uchar, uint, ulong],[],[], [
 
867
#include <sys/types.h>
 
868
])
 
869
AC_CHECK_TYPES([fp_except], [], [], [
 
870
#include <sys/types.h>
 
871
#include <ieeefp.h>
 
872
])
 
873
 
 
874
my_save_LIBS="$LIBS"
 
875
LIBS=""
 
876
AC_CHECK_LIB(dl,dlopen)
 
877
AC_CHECK_FUNCS(dlopen dlerror)
 
878
if test "$ac_cv_func_dlopen" != "yes"
 
879
then
 
880
  AC_MSG_ERROR([Drizzle requires dlopen])
 
881
fi
 
882
LIBDL_LIBS="$LIBS"
 
883
LIBS="$my_save_LIBS"
 
884
AC_SUBST(LIBDL_LIBS)
 
885
 
 
886
AC_CHECK_FUNCS(strtok_r)
 
887
 
 
888
 
 
889
 
 
890
AC_ARG_WITH([fast-mutexes],
 
891
    [AS_HELP_STRING([--with-fast-mutexes],
 
892
            [Compile with fast mutexes  @<:@default=off@:>@])],
 
893
    [with_fast_mutexes=$withval],
 
894
    [with_fast_mutexes=no])
 
895
 
 
896
if test "$with_fast_mutexes" != "no"
 
897
then
 
898
        AC_DEFINE([MY_PTHREAD_FASTMUTEX], [1], 
 
899
                        [Define to 1 if you want to use fast mutexes])
 
900
fi
 
901
 
 
902
AM_CONDITIONAL(BUILD_FAST_MUTEX,[test "$with_fast_mutexes" != "no"])
86
903
 
87
904
AC_ARG_WITH([comment],
88
905
    [AS_HELP_STRING([--with-comment],
89
906
            [Comment about compilation environment. @<:@default=off@:>@])],
90
907
    [with_comment=$withval],
91
908
    [with_comment=no])
92
 
AS_IF([test "$with_comment" != "no"],[
 
909
if test "$with_comment" != "no"
 
910
then
93
911
  COMPILATION_COMMENT=$with_comment
 
912
else
 
913
  COMPILATION_COMMENT="Source distribution"
 
914
fi
 
915
AC_SUBST(COMPILATION_COMMENT)
 
916
 
 
917
if expr "$target_os" : "[[Ll]]inux.*" > /dev/null
 
918
then
 
919
  TARGET_LINUX="true"
 
920
  AC_DEFINE([TARGET_OS_LINUX], [1], [Whether we build for Linux])
 
921
else
 
922
  TARGET_LINUX="false"
 
923
fi
 
924
 
 
925
dnl Checks for typedefs, structures, and compiler characteristics.
 
926
AC_C_CONST
 
927
AC_C_INLINE
 
928
AC_TYPE_OFF_T
 
929
AC_HEADER_TIME
 
930
AC_STRUCT_TM
 
931
# AC_CHECK_SIZEOF return 0 when it does not find the size of a
 
932
# type. We want a error instead.
 
933
AC_CHECK_SIZEOF(char, 1)
 
934
if test "$ac_cv_sizeof_char" -eq 0
 
935
then
 
936
  AC_MSG_ERROR([No size for char type.])
 
937
fi
 
938
AC_CHECK_SIZEOF(char*, 4)
 
939
AC_CHECK_SIZEOF(short, 2)
 
940
AC_CHECK_SIZEOF(int, 4)
 
941
if test "$ac_cv_sizeof_int" -eq 0
 
942
then
 
943
  AC_MSG_ERROR("No size for int type.")
 
944
fi
 
945
AC_CHECK_SIZEOF(long, 4)
 
946
if test "$ac_cv_sizeof_long" -eq 0
 
947
then
 
948
  AC_MSG_ERROR("No size for long type.")
 
949
fi
 
950
AC_CHECK_SIZEOF(long long, 8)
 
951
if test "$ac_cv_sizeof_long_long" -eq 0
 
952
then
 
953
  AC_MSG_ERROR("Drizzle needs a long long type.")
 
954
fi
 
955
# off_t is not a builtin type
 
956
AC_CHECK_SIZEOF(off_t, 4)
 
957
if test "$ac_cv_sizeof_off_t" -eq 0
 
958
then
 
959
  AC_MSG_ERROR("Drizzle needs a off_t type.")
 
960
fi
 
961
 
 
962
dnl
 
963
dnl check if time_t is unsigned
 
964
dnl
 
965
 
 
966
DRIZZLE_CHECK_TIME_T
 
967
 
 
968
 
 
969
# do we need #pragma interface/#pragma implementation ?
 
970
# yes if it's gcc 2.x, and not icc pretending to be gcc, and not cygwin
 
971
AC_MSG_CHECKING(the need for @%:@pragma interface/implementation)
 
972
# instead of trying to match SYSTEM_TYPE and CC_VERSION (that doesn't
 
973
# follow any standard), we'll use well-defined preprocessor macros:
 
974
AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
 
975
#if !defined(__CYGWIN__) && !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ < 3)
 
976
#error USE_PRAGMA_IMPLEMENTATION
 
977
#endif
 
978
]])],[
 
979
  AC_MSG_RESULT(no)
94
980
],[
95
 
  COMPILATION_COMMENT="Source distribution (${PANDORA_RELEASE_COMMENT})"
96
 
])
97
 
AC_DEFINE_UNQUOTED([COMPILATION_COMMENT],["$COMPILATION_COMMENT"],
98
 
                   [Comment about compilation environment])
99
 
 
100
 
 
 
981
  AC_MSG_RESULT(yes)
 
982
  AC_DEFINE(USE_PRAGMA_IMPLEMENTATION,[1],[pragma implementation is a good idea])
 
983
  AC_DEFINE(USE_PRAGMA_INTERFACE,[1],[pragma interface is a good idea])
 
984
])
 
985
 
 
986
# This always gives a warning. Ignore it unless you are cross compiling
 
987
AC_C_BIGENDIAN
 
988
#---START: Used in for client configure
 
989
# Check base type of last arg to accept
 
990
DRIZZLE_TYPE_ACCEPT
 
991
#---END:
 
992
# Figure out what type of struct rlimit to use with setrlimit
 
993
DRIZZLE_TYPE_STRUCT_RLIMIT
 
994
# Find where the stack goes
 
995
DRIZZLE_STACK_DIRECTION
 
996
# We want to skip alloca on irix unconditionally. It may work on some version..
 
997
DRIZZLE_FUNC_ALLOCA
 
998
# Do struct timespec have members tv_sec or ts_sec
 
999
DRIZZLE_TIMESPEC_TS
 
1000
# Do we have the tzname variable
 
1001
DRIZZLE_TZNAME
 
1002
# Do the c++ compiler have a bool type
 
1003
DRIZZLE_CXX_BOOL
 
1004
AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>])
 
1005
AC_CHECK_TYPES([size_t], [], [], [#include <stdio.h>])
 
1006
AC_CHECK_TYPES([u_int32_t])
 
1007
 
 
1008
DRIZZLE_PTHREAD_YIELD
 
1009
 
 
1010
 
 
1011
dnl Checks for header files.
 
1012
AC_CHECK_HEADERS(malloc.h sys/cdefs.h)
 
1013
 
 
1014
dnl Checks for library functions.
 
1015
AC_FUNC_ALLOCA
 
1016
AC_PROG_GCC_TRADITIONAL
 
1017
AC_TYPE_SIGNAL
 
1018
AC_CHECK_FUNCS(re_comp regcomp strdup)
 
1019
 
 
1020
dnl Sun compilers have their own vis.h that is about something
 
1021
dnl totally different. So, not to change the libedit source, we
 
1022
dnl do some additional checks before we define HAVE_VIS_H.
 
1023
AC_CHECK_HEADER(vis.h,
 
1024
  [AC_CHECK_FUNC(strvis,
 
1025
    [AC_DEFINE([HAVE_VIS_H], [1],[Found vis.h and the strvis() function])])])
 
1026
 
 
1027
AC_CHECK_FUNCS(strlcat strlcpy)
 
1028
AC_CHECK_FUNCS(issetugid)
 
1029
AC_CHECK_FUNCS(getline flockfile)
 
1030
 
 
1031
# from old readline settting:
 
1032
 
 
1033
MAKE_SHELL=/bin/sh
 
1034
AC_SUBST(MAKE_SHELL)
 
1035
 
 
1036
# Already-done: stdlib.h string.h unistd.h termios.h
 
1037
AC_CHECK_HEADERS(stdarg.h dirent.h locale.h ndir.h sys/dir.h \
 
1038
 sys/file.h sys/ndir.h sys/ptem.h sys/pte.h sys/select.h sys/stream.h \
 
1039
 sys/mman.h curses.h termcap.h termio.h termbits.h asm/termbits.h grp.h \
 
1040
paths.h semaphore.h)
 
1041
 
 
1042
# Already-done: strcasecmp
 
1043
AC_CHECK_FUNCS(lstat putenv select setenv setlocale strcoll tcgetattr)
 
1044
 
 
1045
AC_HEADER_STAT
 
1046
DRIZZLE_SIGNAL_CHECK
 
1047
DRIZZLE_CHECK_GETPW_FUNCS
 
1048
DRIZZLE_HAVE_TIOCGWINSZ
 
1049
DRIZZLE_HAVE_FIONREAD
 
1050
DRIZZLE_HAVE_TIOCSTAT
 
1051
DRIZZLE_STRUCT_DIRENT_D_INO
 
1052
DRIZZLE_STRUCT_DIRENT_D_NAMLEN
 
1053
DRIZZLE_TYPE_SIGHANDLER
 
1054
DRIZZLE_CHECK_MULTIBYTE
 
1055
if test "$with_named_curses" = "no"
 
1056
then
 
1057
  DRIZZLE_CHECK_LIB_TERMCAP
 
1058
else
 
1059
  TERMCAP_LIBS="$with_named_curses"
 
1060
fi
 
1061
AC_SUBST(TERMCAP_LIBS)
 
1062
 
 
1063
# Check if the termcap function 'tgoto' is already declared in
 
1064
# system header files or if it need to be declared locally
 
1065
AC_CHECK_DECLS(tgoto,,,[
 
1066
#ifdef HAVE_CURSES_H
 
1067
# include <curses.h>
 
1068
#elif HAVE_NCURSES_H
 
1069
# include <ncurses.h>
 
1070
#endif
 
1071
#ifdef HAVE_TERM_H
 
1072
# include <term.h>
 
1073
#endif
 
1074
])
 
1075
 
 
1076
# End of readline/libedit stuff
101
1077
#########################################################################
102
1078
 
103
 
 
104
 
dnl Has to be done late, as the plugin may need to check for existence of
105
 
dnl functions tested above
106
 
PANDORA_PLUGINS([drizzled/plugin/load_list.h])
107
 
 
108
 
dnl GCC Precompiled Header Support
109
 
dnl re-enable later
110
 
dnl AM_CONDITIONAL([BUILD_GCC_PCH],[test "$GCC" = "yes"])
111
 
AM_CONDITIONAL([BUILD_GCC_PCH],[test "no" = "yes"])
112
 
 
113
 
AC_CONFIG_FILES(Makefile dnl
114
 
 gnulib/Makefile dnl
115
 
 po/Makefile.in dnl
116
 
 tests/Makefile dnl
117
 
 drizzled/plugin/version.h dnl
118
 
 support-files/drizzle.server support-files/drizzle-log-rotate
119
 
 support-files/smf/install.sh dnl
120
 
 support-files/drizzle.spec dnl
121
 
 support-files/smf/drizzle.xml dnl
122
 
 support-files/smf/drizzle)
123
 
 
124
 
scheduling_plugins_available="
125
 
  pool_of_threads 
126
 
  single_thread
127
 
"
128
 
 
129
 
for sched_plugin in $scheduling_plugins_available
130
 
do
131
 
  varname="\${with_plugin_${sched_plugin}}"
132
 
  result=`eval "echo $varname"`
133
 
  if test "x$result" = "xyes"
134
 
  then
135
 
    scheduling_plugins="$sched_plugin $scheduling_plugins"
136
 
  fi
137
 
done
 
1079
dnl Checks for library functions.
 
1080
 
 
1081
#
 
1082
# The following code disables intrinsic function support while we test for
 
1083
# library functions.  This is to avoid configure problems with Intel ecc
 
1084
# compiler
 
1085
 
 
1086
ORG_CFLAGS="$CFLAGS"
 
1087
if test "$GCC" != "yes"; then
 
1088
  AC_SYS_COMPILER_FLAG(-nolib_inline,nolib_inline,CFLAGS,[],[])
 
1089
fi
 
1090
 
 
1091
#AC_FUNC_MMAP
 
1092
AC_TYPE_SIGNAL
 
1093
DRIZZLE_TYPE_QSORT
 
1094
AC_FUNC_UTIME_NULL
 
1095
AC_FUNC_VPRINTF
 
1096
 
 
1097
AC_CHECK_FUNCS(fcntl)
 
1098
if test "x$ac_cv_func_fcntl" != "xyes"
 
1099
then
 
1100
  AC_MSG_ERROR("Drizzle requires fcntl.")
 
1101
fi
 
1102
 
 
1103
AC_CONFIG_LIBOBJ_DIR([mystrings])
 
1104
 
 
1105
AC_CHECK_FUNCS(bsearch \
 
1106
  cuserid fchmod \
 
1107
  fdatasync finite fpresetsticky fpsetmask fsync ftruncate \
 
1108
  getcwd getpassphrase getpwnam \
 
1109
  getpwuid getrlimit getrusage getwd index initgroups isnan \
 
1110
  localtime_r gethrtime gmtime_r \
 
1111
  locking longjmp lrand48 madvise mallinfo \
 
1112
  memmove \
 
1113
  mkstemp mlockall perror poll pread pthread_attr_create mmap mmap64 \
 
1114
  pthread_attr_getstacksize pthread_attr_setprio pthread_attr_setschedparam \
 
1115
  pthread_attr_setstacksize pthread_condattr_create pthread_getsequence_np \
 
1116
  pthread_key_delete pthread_rwlock_rdlock pthread_setprio \
 
1117
  pthread_setprio_np pthread_setschedparam pthread_sigmask readlink \
 
1118
  realpath rename rwlock_init setupterm \
 
1119
  shmget shmat shmdt shmctl sigaction sigemptyset sigaddset \
 
1120
  sighold sigset sigthreadmask port_create sleep \
 
1121
  snprintf socket strcasecmp strerror strsignal strpbrk \
 
1122
  tell tempnam vidattr \
 
1123
  posix_fallocate backtrace backtrace_symbols backtrace_symbols_fd)
 
1124
 
 
1125
AC_LANG_PUSH(C++)
 
1126
# Test whether madvise() is declared in C++ code -- it is not on some
 
1127
# systems, such as Solaris
 
1128
AC_CHECK_DECLS([madvise], [], [], [AC_INCLUDES_DEFAULT[
 
1129
#if HAVE_SYS_MMAN_H
 
1130
#include <sys/types.h>
 
1131
#include <sys/mman.h>
 
1132
#endif
 
1133
]])
 
1134
AC_LANG_POP()
 
1135
 
 
1136
 
 
1137
AM_CONDITIONAL(BUILD_THR_RWLOCK,[test "$ac_cv_func_rwlock_init" -a "$ac_cv_funn_pthread_rwlock_rdlock"])
 
1138
 
 
1139
# Check that isinf() is available in math.h and can be used in both C and C++
 
1140
# code
 
1141
AC_MSG_CHECKING(for isinf in math.h)
 
1142
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]], [[
 
1143
    float f = 0.0; 
 
1144
    int r = isinf(f); 
 
1145
    return r;
 
1146
  ]])],[
 
1147
    AC_MSG_RESULT(yes)
 
1148
    AC_MSG_CHECKING(whether isinf() can be used in C++ code)
 
1149
    AC_LANG_PUSH([C++])
 
1150
    AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]], [[
 
1151
      float f = 0.0;
 
1152
      int r = isinf(f);
 
1153
      return r;
 
1154
    ]])],[
 
1155
      AC_MSG_RESULT(yes)
 
1156
      AC_DEFINE(HAVE_ISINF, [1], [isinf() macro or function])
 
1157
    ],[
 
1158
      AC_MSG_RESULT(no)
 
1159
    ])
 
1160
    AC_LANG_POP([])
 
1161
  ],[
 
1162
  AC_MSG_RESULT(no)])
 
1163
 
 
1164
 
 
1165
CFLAGS="$ORG_CFLAGS"
 
1166
 
 
1167
# Sanity check: We chould not have any fseeko symbol unless
 
1168
# large_file_support=yes
 
1169
AC_CHECK_FUNC(fseeko,
 
1170
[if test "$large_file_support" = no -a "$TARGET_LINUX" = "true";
 
1171
then
 
1172
  AC_MSG_ERROR("Found fseeko symbol but large_file_support is not enabled!")
 
1173
fi]
 
1174
)
 
1175
 
 
1176
# Check definition of pthread_getspecific
 
1177
AC_CACHE_CHECK([args to pthread_getspecific], [mysql_cv_getspecific_args],
 
1178
  [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if !defined(_REENTRANT)
 
1179
#define _REENTRANT
 
1180
#endif
 
1181
#define _POSIX_PTHREAD_SEMANTICS 
 
1182
#include <pthread.h> ]], [[ void *pthread_getspecific(pthread_key_t key);
 
1183
pthread_getspecific((pthread_key_t) NULL); ]])],
 
1184
    [mysql_cv_getspecific_args=POSIX],
 
1185
    [mysql_cv_getspecific_args=other])])
 
1186
  if test "$mysql_cv_getspecific_args" = "other"
 
1187
  then
 
1188
    AC_DEFINE([HAVE_NONPOSIX_PTHREAD_GETSPECIFIC], [1],
 
1189
              [For some non posix threads])
 
1190
  fi
 
1191
 
 
1192
  # Check definition of pthread_mutex_init
 
1193
  AC_CACHE_CHECK([args to pthread_mutex_init], [mysql_cv_mutex_init_args],
 
1194
    [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#define _REENTRANT
 
1195
#define _POSIX_PTHREAD_SEMANTICS 
 
1196
#include <pthread.h> ]], [[ 
 
1197
  pthread_mutexattr_t attr;
 
1198
  pthread_mutex_t mp;
 
1199
  pthread_mutex_init(&mp,&attr); ]])],
 
1200
      [mysql_cv_mutex_init_args=POSIX],
 
1201
      [mysql_cv_mutex_init_args=other])])
 
1202
  if test "$mysql_cv_mutex_init_args" = "other"
 
1203
  then
 
1204
    AC_DEFINE([HAVE_NONPOSIX_PTHREAD_MUTEX_INIT], [1],
 
1205
              [For some non posix threads])
 
1206
  fi
 
1207
#---END:
 
1208
 
 
1209
#---START: Used in for client configure
 
1210
# Check definition of readdir_r
 
1211
AC_CACHE_CHECK([args to readdir_r], [mysql_cv_readdir_r],
 
1212
  [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define _REENTRANT
 
1213
#define _POSIX_PTHREAD_SEMANTICS 
 
1214
#include <pthread.h>
 
1215
#include <dirent.h>]], [[ int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result);
 
1216
readdir_r((DIR *) NULL, (struct dirent *) NULL, (struct dirent **) NULL); ]])],
 
1217
    [mysql_cv_readdir_r=POSIX],
 
1218
    [mysql_cv_readdir_r=other])])
 
1219
if test "$mysql_cv_readdir_r" = "POSIX"
 
1220
then
 
1221
  AC_DEFINE([HAVE_READDIR_R], [1], [POSIX readdir_r])
 
1222
fi
 
1223
 
 
1224
# Check definition of posix sigwait()
 
1225
AC_CACHE_CHECK([style of sigwait], [mysql_cv_sigwait],
 
1226
  [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
 
1227
#define _REENTRANT
 
1228
#define _POSIX_PTHREAD_SEMANTICS 
 
1229
#include <pthread.h>
 
1230
#include <signal.h>
 
1231
      ]], [[
 
1232
#ifndef _AIX
 
1233
sigset_t set;
 
1234
int sig;
 
1235
sigwait(&set,&sig);
 
1236
#endif
 
1237
      ]])],
 
1238
    [mysql_cv_sigwait=POSIX],
 
1239
    [mysql_cv_sigwait=other])])
 
1240
if test "$mysql_cv_sigwait" = "POSIX"
 
1241
then
 
1242
  AC_DEFINE([HAVE_SIGWAIT], [1], [POSIX sigwait])
 
1243
fi
 
1244
 
 
1245
if test "$mysql_cv_sigwait" != "POSIX"
 
1246
then
 
1247
unset mysql_cv_sigwait
 
1248
# Check definition of posix sigwait()
 
1249
AC_CACHE_CHECK([style of sigwait], [mysql_cv_sigwait],
 
1250
  [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
 
1251
#define _REENTRANT
 
1252
#define _POSIX_PTHREAD_SEMANTICS 
 
1253
#include <pthread.h>
 
1254
#include <signal.h>
 
1255
      ]], [[
 
1256
sigset_t set;
 
1257
int sig;
 
1258
sigwait(&set);
 
1259
      ]])],
 
1260
    [mysql_cv_sigwait=NONPOSIX],
 
1261
    [mysql_cv_sigwait=other])])
 
1262
if test "$mysql_cv_sigwait" = "NONPOSIX"
 
1263
then
 
1264
  AC_DEFINE([HAVE_NONPOSIX_SIGWAIT], [1], [sigwait with one argument])
 
1265
fi
 
1266
fi
 
1267
#---END:
 
1268
 
 
1269
# Check if pthread_attr_setscope() exists
 
1270
AC_CACHE_CHECK([for pthread_attr_setscope], [mysql_cv_pthread_attr_setscope],
 
1271
  [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
 
1272
#define _REENTRANT
 
1273
#define _POSIX_PTHREAD_SEMANTICS 
 
1274
#include <pthread.h>
 
1275
      ]], [[
 
1276
pthread_attr_t thr_attr;
 
1277
pthread_attr_setscope(&thr_attr,0);
 
1278
      ]])],
 
1279
    [mysql_cv_pthread_attr_setscope=yes],
 
1280
    [mysql_cv_pthread_attr_setscope=no])])
 
1281
if test "$mysql_cv_pthread_attr_setscope" = "yes"
 
1282
then
 
1283
  AC_DEFINE([HAVE_PTHREAD_ATTR_SETSCOPE], [1], [pthread_attr_setscope])
 
1284
fi
 
1285
 
 
1286
# Check for bad includes
 
1287
AC_MSG_CHECKING("can netinet files be included")
 
1288
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
 
1289
#include <sys/socket.h>
 
1290
#include <netinet/in_systm.h>
 
1291
#include <netinet/in.h>
 
1292
#include <netinet/ip.h>
 
1293
#include <netinet/tcp.h>]], [[ printf("1\n"); ]])],[netinet_inc=yes],[netinet_inc=no])
 
1294
if test "$netinet_inc" = "no"
 
1295
then
 
1296
  AC_DEFINE([HAVE_BROKEN_NETINET_INCLUDES], [1], [Can netinet be included])
 
1297
fi
 
1298
AC_MSG_RESULT("$netinet_inc")
 
1299
 
 
1300
AC_LANG_PUSH([C++])
 
1301
AC_CHECK_HEADERS(cxxabi.h)
 
1302
AC_CACHE_CHECK([checking for abi::__cxa_demangle], mysql_cv_cxa_demangle,
 
1303
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <cxxabi.h>]], [[
 
1304
  char *foo= 0; int bar= 0;
 
1305
  foo= abi::__cxa_demangle(foo, foo, 0, &bar);
 
1306
]])],[mysql_cv_cxa_demangle=yes],[mysql_cv_cxa_demangle=no])])
 
1307
AC_LANG_POP([])
 
1308
 
 
1309
if test "x$mysql_cv_cxa_demangle" = xyes; then
 
1310
  AC_DEFINE(HAVE_ABI_CXA_DEMANGLE, 1,
 
1311
            [Define to 1 if you have the `abi::__cxa_demangle' function.])
 
1312
fi
 
1313
 
 
1314
#--------------------------------------------------------------------
 
1315
# Check for requested features
 
1316
#--------------------------------------------------------------------
 
1317
 
 
1318
DRIZZLE_CHECK_BIG_TABLES
 
1319
DRIZZLE_CHECK_MAX_INDEXES
 
1320
DRIZZLE_CHECK_VIO
 
1321
 
 
1322
#--------------------------------------------------------------------
 
1323
# Declare our plugin modules
 
1324
# Has to be done late, as the plugin may need to check for existence of
 
1325
# functions tested above
 
1326
#--------------------------------------------------------------------
 
1327
 
 
1328
DRIZZLE_CONFIGURE_PLUGINS([none])
 
1329
 
 
1330
AC_SUBST(mysql_plugin_dirs)
 
1331
AC_SUBST(mysql_plugin_libs)
 
1332
AC_SUBST(mysql_plugin_defs)
 
1333
 
 
1334
# Build optimized or debug version ?
 
1335
# First check for gcc and g++
 
1336
if test "$ac_cv_c_compiler_gnu" = "yes"
 
1337
then
 
1338
  SYMBOLS_CFLAGS="-ggdb3"
 
1339
  DEBUG_OPTIMIZE_CC="-O0"
 
1340
  OPTIMIZE_CFLAGS="-O3"
 
1341
else
 
1342
  SYMBOLS_CFLAGS="-g"
 
1343
  DEBUG_OPTIMIZE_CC=""
 
1344
  OPTIMIZE_CFLAGS="-O"
 
1345
fi
 
1346
if test "$ac_cv_prog_cxx_g" = "yes"
 
1347
then
 
1348
  SYMBOLS_CXXFLAGS="-ggdb3"
 
1349
  DEBUG_OPTIMIZE_CXX="-O0"
 
1350
  OPTIMIZE_CXXFLAGS="-O3"
 
1351
else
 
1352
  SYMBOLS_CXXFLAGS="-g"
 
1353
  DEBUG_OPTIMIZE_CXX=""
 
1354
  OPTIMIZE_CXXFLAGS="-O"
 
1355
fi
 
1356
 
 
1357
dnl TODO: Remove this define once we are using 2.61 across the board.
 
1358
# AC_HEADER_ASSERT
 
1359
# ----------------
 
1360
# Check whether to enable assertions.
 
1361
ifdef([AC_HEADER_ASSERT], [], [AC_DEFUN([AC_HEADER_ASSERT],
 
1362
[
 
1363
  AC_MSG_CHECKING([whether to enable assertions])
 
1364
  AC_ARG_ENABLE([assert],
 
1365
    [  --disable-assert        turn off assertions],
 
1366
    [AC_MSG_RESULT([no])
 
1367
     AC_DEFINE(NDEBUG, 1, [Define to 1 if assertions should be disabled.])],
 
1368
    [AC_MSG_RESULT(yes)])
 
1369
])])
 
1370
 
 
1371
AC_HEADER_ASSERT
 
1372
 
 
1373
CFLAGS="${SYMBOLS_CFLAGS} ${CFLAGS}"
 
1374
CXXFLAGS="${SYMBOLS_CXXFLAGS} ${CXXFLAGS}  -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
 
1375
 
 
1376
AC_ARG_WITH([debug],
 
1377
    [AS_HELP_STRING([--with-debug],
 
1378
       [Add debug code/turns off optimizations (yes|no) @<:@default=no@:>@])],
 
1379
    [with_debug=$withval],
 
1380
    [with_debug=no])
 
1381
if test "$with_debug" = "yes"
 
1382
then
 
1383
  # Medium debug.
 
1384
  CFLAGS="$DEBUG_OPTIMIZE_CC $CFLAGS ${SAVE_CFLAGS}"
 
1385
  CXXFLAGS="$DEBUG_OPTIMIZE_CXX $CXXFLAGS ${SAVE_CXXFLAGS}"
 
1386
else
 
1387
  # Optimized version. No debug
 
1388
  CFLAGS="${OPTIMIZE_CFLAGS} ${CFLAGS} ${SAVE_CFLAGS}"
 
1389
  CXXFLAGS="$OPTIMIZE_CXXFLAGS $CXXFLAGS ${SAVE_CXXFLAGS}"
 
1390
fi
 
1391
 
 
1392
AC_ARG_ENABLE([profiling],
 
1393
    [AS_HELP_STRING([--enable-profiling],
 
1394
       [Toggle profiling @<:@default=off@:>@])],
 
1395
    [ac_profiling="$enableval"],
 
1396
    [ac_profiling="no"])
 
1397
 
 
1398
AC_ARG_ENABLE([coverage],
 
1399
    [AS_HELP_STRING([--enable-coverage],
 
1400
       [Toggle coverage @<:@default=off@:>@])],
 
1401
    [ac_coverage="$enableval"],
 
1402
    [ac_coverage="no"])
 
1403
 
 
1404
AC_ARG_ENABLE([pedantic-warnings],
 
1405
    [AS_HELP_STRING([--disable-pedantic-warnings],
 
1406
       [Toggle pedanticness @<:@default=on@:>@])],
 
1407
    [ac_warn_pedantic="$enableval"],
 
1408
    [ac_warn_pedantic="yes"])
 
1409
 
 
1410
AC_ARG_ENABLE([fail],
 
1411
    [AS_HELP_STRING([--disable-fail],
 
1412
       [Turn warnings into failures @<:@default=on@:>@])],
 
1413
    [ac_warn_fail="$enableval"],
 
1414
    [ac_warn_fail="yes"])
 
1415
 
 
1416
AC_ARG_ENABLE([unreachable],
 
1417
    [AS_HELP_STRING([--enable-unreachable],
 
1418
       [Enable warnings about unreachable code @<:@default=off@:>@])],
 
1419
    [ac_warn_unreachable="$enableval"],
 
1420
    [ac_warn_unreachable="no"])
 
1421
 
 
1422
AC_ARG_ENABLE([longlong-warnings],
 
1423
    [AS_HELP_STRING([--enable-longlong-warnings],
 
1424
       [Enable warnings about longlong in C++ @<:@default=off@:>@])],
 
1425
    [ac_warn_longlong="$enableval"],
 
1426
    [ac_warn_longlong="no"])
 
1427
 
 
1428
AC_ARG_ENABLE([strict-aliasing],
 
1429
    [AS_HELP_STRING([--enable-strict-aliasing],
 
1430
       [Enable warnings about stict-aliasing @<:@default=off@:>@])],
 
1431
    [ac_warn_strict_aliasing="$enableval"],
 
1432
    [ac_warn_strict_aliasing="no"])
 
1433
 
 
1434
 
 
1435
if test "$GCC" = "yes"
 
1436
then
 
1437
 
 
1438
  if test "$ac_warn_longlong" = "yes"
 
1439
  then
 
1440
    W_LONGLONG="-Wlong-long"
 
1441
  else
 
1442
    W_LONGLONG="-Wno-long-long"
 
1443
  fi
 
1444
 
 
1445
  if test "$ac_warn_strict_aliasing" = "yes"
 
1446
  then
 
1447
    W_STRICT_ALIASING="-Wstrict-aliasing"
 
1448
  else
 
1449
    W_STRICT_ALIASING="-Wno-strict-aliasing"
 
1450
  fi
 
1451
 
 
1452
  if test "$ac_profiling" = "yes"
 
1453
  then
 
1454
    GPROF_PROFILING="-pg"
 
1455
  else
 
1456
    GPROF_PROFILING=" "
 
1457
  fi
 
1458
 
 
1459
  if test "$ac_coverage" = "yes"
 
1460
  then
 
1461
    GPROF_COVERAGE="-fprofile-arcs -ftest-coverage"
 
1462
  else
 
1463
    GPROF_COVERAGE=" "
 
1464
  fi
 
1465
 
 
1466
  if test "$ac_warn_pedantic" = "yes"
 
1467
  then
 
1468
    GCC_PEDANTIC="-pedantic -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls ${W_STRICT_ALIASING}"
 
1469
    GXX_PEDANTIC="-pedantic -Wundef -Wredundant-decls ${W_LONGLONG} ${W_STRICT_ALIASING}"
 
1470
  fi
 
1471
 
 
1472
  if test "$ac_warn_unreachable" = "yes"
 
1473
  then
 
1474
    W_UNREACHABLE="-Wunreachable-code"
 
1475
  fi
 
1476
 
 
1477
  if test "$ac_warn_fail" = "yes"
 
1478
  then
 
1479
    W_FAIL="-Werror"
 
1480
  fi
 
1481
 
 
1482
  BASE_WARNINGS="-W -Wall -Wextra"
 
1483
  GCC_WARNINGS="${C99_SUPPORT_HACK} ${BASE_WARNINGS} ${GCC_PEDANTIC} ${W_UNREACHABLE} ${W_FAIL} ${GPROF_PROFILING} ${GPROF_COVERAGE}"
 
1484
  GXX_WARNINGS="${BASE_WARNINGS} ${GXX_PEDANTIC} ${W_UNREACHABLE} ${W_FAIL} ${GPROF_PROFILING} ${GPROF_COVERAGE}"
 
1485
 
 
1486
  AM_CXXFLAGS="${GXX_WARNINGS} ${AM_CXXFLAGS}"
 
1487
  AM_CFLAGS="${GCC_WARNINGS} ${AM_CFLAGS}"
 
1488
fi
 
1489
 
 
1490
AC_SUBST([GLOBAL_CPPFLAGS],['-I$(top_srcdir) -I$(top_builddir)'])
 
1491
AC_SUBST([AM_CPPFLAGS],['${GLOBAL_CPPFLAGS}'])
 
1492
AC_SUBST([AM_CFLAGS])
 
1493
AC_SUBST([AM_CXXFLAGS])
 
1494
 
 
1495
# Some usefull subst
 
1496
AC_SUBST(CC)
 
1497
AC_SUBST(GXX)
 
1498
 
 
1499
# Set configuration options for make_binary_distribution
 
1500
case $SYSTEM_TYPE in
 
1501
  *netware*)
 
1502
    MAKE_BINARY_DISTRIBUTION_OPTIONS="$MAKE_BINARY_DISTRIBUTION_OPTIONS --no-strip"
 
1503
    ;;
 
1504
  *)
 
1505
    : # no change for other platforms yet
 
1506
    ;;
 
1507
esac
 
1508
AC_SUBST(MAKE_BINARY_DISTRIBUTION_OPTIONS)
 
1509
 
 
1510
AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl
 
1511
 mystrings/Makefile storage/Makefile dnl
 
1512
 vio/Makefile po/Makefile.in dnl
 
1513
 libdrizzle/Makefile client/Makefile dnl
 
1514
 drizzled/Makefile dnl
 
1515
 drizzled/field/Makefile dnl
 
1516
 drizzled/serialize/Makefile dnl
 
1517
 drizzled/sql_builtin.cc dnl
 
1518
 support-files/Makefile dnl
 
1519
 tests/Makefile tests/install_test_db dnl
 
1520
 drizzled/version.h plugin/Makefile dnl
 
1521
 drizzled/drizzled_safe support-files/libdrizzle.pc dnl
 
1522
 support-files/drizzle.server support-files/drizzle-log-rotate)
 
1523
 
 
1524
AC_CONFIG_COMMANDS([default], , test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h)
 
1525
 
 
1526
# 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'")
138
1528
 
139
1529
AC_OUTPUT
140
 
 
141
 
echo "---"
142
 
echo "Configuration summary for $PACKAGE_NAME version $VERSION $PANDORA_RELEASE_COMMENT"
143
 
echo ""
144
 
echo "   * Installation prefix:       $prefix"
145
 
echo "   * System type:               $host_vendor-$host_os"
146
 
echo "   * Host CPU:                  $host_cpu"
147
 
echo "   * C Compiler:                $CC_VERSION"
148
 
echo "   * C++ Compiler:              $CXX_VERSION"
149
 
echo "   * Build auth_pam:            $ac_cv_libpam"
150
 
echo "   * Assertions enabled:        $ac_cv_assert"
151
 
echo "   * Debug enabled:             $with_debug"
152
 
echo "   * Profiling enabled:         $ac_profiling"
153
 
echo "   * Coverage enabled:          $ac_coverage"
154
 
echo "   * Warnings as failure:       $ac_cv_warnings_as_errors"
155
 
echo "   * C++ cstdint location:      $ac_cv_cxx_cstdint"
156
 
echo "   * C++ hash_map location:     $ac_cv_cxx_hash_map"
157
 
echo "   * C++ hash namespace:        $ac_cv_cxx_hash_namespace"
158
 
echo "   * C++ shared_ptr namespace:  $ac_cv_shared_ptr_namespace"
159
 
echo ""
160
 
echo "---"
161
 
 
162
 
dnl libtoolize scans configure.ac  and needs to see some text
163
 
m4_define([LIBTOOLIZE_AC_INIT], [])