~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Brian Aker
  • Date: 2009-10-01 22:56:26 UTC
  • mto: (1154.1.1 staging)
  • mto: This revision was merged to the branch mainline in revision 1155.
  • Revision ID: brian@gaz-20091001225626-sb1pdykpxlnkheaj
Remove Factory/make scheduler work like everything else.

Show diffs side-by-side

added added

removed removed

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