~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Monty Taylor
  • Date: 2009-09-23 17:40:57 UTC
  • mfrom: (1099.4.60)
  • mto: This revision was merged to the branch mainline in revision 1141.
  • Revision ID: mordred@inaugust.com-20090923174057-wuvqhk19h43no9wz
Merged translations from launchpad.

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
 
 
 
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_PATH_PROG(LCOV, lcov)
 
47
AC_PATH_PROG(GENHTML, genhtml)
 
48
 
 
49
AM_CONDITIONAL(HAVE_LCOV,[test "x$LCOV" != "x"])
 
50
 
 
51
AC_CHECK_PROGS(YACC, ['bison -y'])
 
52
AS_IF([test "x$YACC" = "x" -a "$building_from_bzr" = "yes"],[
 
53
  AC_MSG_ERROR(["bison is required for Drizzle to build from a bzr branch"])
 
54
])
 
55
 
 
56
 
 
57
AM_GNU_GETTEXT(external, need-formatstring-macros)
 
58
if test "x$MSGMERGE" = "x" -o "x$MSGMERGE" = "x:"
 
59
then
 
60
  AM_PATH_PROG_WITH_TEST(GMSGMERGE, gmsgmerge,
 
61
    [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
 
62
  MSGMERGE="${GMSGMERGE}"
 
63
fi
65
64
AM_CONDITIONAL([BUILD_GETTEXT],[test "x$MSGMERGE" != "x" -a "x$MSGMERGE" != "x:"])
66
65
 
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
224
 
  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
 
66
 
 
67
AC_CXX_STL_HASH
 
68
AC_CXX_CSTDINT
 
69
AC_CXX_CINTTYPES
 
70
 
 
71
PANDORA_REQUIRE_PTHREAD
 
72
 
 
73
PANDORA_REQUIRE_LIBPROTOBUF
 
74
PANDORA_PROTOBUF_REQUIRE_VERSION([2.0.3])
 
75
PANDORA_REQUIRE_PROTOC
 
76
 
 
77
#--------------------------------------------------------------------
 
78
# Check for libuuid
 
79
#--------------------------------------------------------------------
 
80
 
 
81
dnl Do this by hand. Need to check for uuid/uuid.h, but uuid may or may
 
82
dnl not be a lib is weird.
 
83
 
 
84
AC_CHECK_HEADERS(uuid/uuid.h)
 
85
if test "x$ac_cv_header_uuid_uuid_h" = "xno"
 
86
then
 
87
  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.])
 
88
fi
 
89
AC_LIB_HAVE_LINKFLAGS(uuid,,
 
90
[
 
91
#include <uuid/uuid.h>
 
92
],
 
93
[
 
94
  uuid_t uout;
 
95
  uuid_generate(uout);
 
96
])
 
97
 
 
98
 
 
99
 
 
100
 
 
101
#--------------------------------------------------------------------
 
102
# Check for tcmalloc/mtmalloc
 
103
#--------------------------------------------------------------------
 
104
 
 
105
PANDORA_HAVE_BETTER_MALLOC
 
106
LIBS="${LIBS} ${BETTER_MALLOC_LIBS}"
 
107
 
 
108
#--------------------------------------------------------------------
 
109
# Check for libdrizzle
 
110
#--------------------------------------------------------------------
 
111
 
 
112
AC_LANG_PUSH(C++)
 
113
PANDORA_REQUIRE_LIBDRIZZLE
 
114
AC_LANG_POP
 
115
 
415
116
 
416
117
#--------------------------------------------------------------------
417
118
# Check for libz
418
119
#--------------------------------------------------------------------
419
120
 
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
 
 
 
121
AC_LIB_HAVE_LINKFLAGS(z,,
 
122
[#include <zlib.h>],
 
123
[
 
124
  crc32(0, Z_NULL, 0);
 
125
])
 
126
AS_IF([test x$ac_cv_libz = xno],
 
127
      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
128
 
433
129
#--------------------------------------------------------------------
434
130
# Check for libreadline or compatible (libedit on Mac OS X)
435
131
#--------------------------------------------------------------------
436
132
 
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
 
]])
 
133
save_LIBS="${LIBS}"
 
134
LIBS=""
 
135
VL_LIB_READLINE
 
136
AS_IF([test "x$vl_cv_lib_readline" = "xno"],
 
137
      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.]))
 
138
READLINE_LIBS="${LIBS}"
 
139
LIBS="${save_LIBS}"
 
140
AC_SUBST(READLINE_LIBS)
454
141
 
455
142
DRIZZLE_CHECK_NEW_RL_INTERFACE
456
143
 
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
144
#--------------------------------------------------------------------
469
145
# Check for libpcre
470
146
#--------------------------------------------------------------------
471
147
 
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)
 
148
AC_LIB_HAVE_LINKFLAGS(pcre,,
 
149
[#include <pcre.h>],
 
150
[
 
151
  pcre *re= NULL;
 
152
  pcre_version();
 
153
])
 
154
AS_IF([test "x$ac_cv_libpcre" = "xno"],
 
155
[
 
156
  unset ac_cv_libpcre
 
157
  unset HAVE_LIBPCRE
 
158
  unset LIBPCRE
 
159
  unset LIBPCRE_PREFIX
 
160
  unset LTLIBPCRE
 
161
  AC_LIB_HAVE_LINKFLAGS(pcre,,
 
162
  [#include <pcre/pcre.h>],
 
163
  [
 
164
    pcre *re= NULL;
 
165
    pcre_version();
 
166
  ])
 
167
  AS_IF([test "x$ac_cv_libpcre" = "xno"],
 
168
  [
 
169
    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.])
 
170
  ],[
 
171
    AC_DEFINE(PCRE_HEADER,[<pcre/pcre.h>],[Location of pcre header])
 
172
  ])
 
173
],[
 
174
  AC_DEFINE(PCRE_HEADER,[<pcre.h>],[Location of pcre header])
 
175
])
 
176
 
 
177
 
524
178
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
179
 
632
180
 
633
181
AC_ARG_WITH([server-suffix],
636
184
    [ DRIZZLE_SERVER_SUFFIX=`echo "$withval" | sed -e  's/^\(...................................\)..*$/\1/'` ],
637
185
    [ DRIZZLE_SERVER_SUFFIX= ]
638
186
    )
639
 
AC_SUBST(DRIZZLE_SERVER_SUFFIX)
 
187
AC_DEFINE_UNQUOTED([DRIZZLE_SERVER_SUFFIX],[$DRIZZLE_SERVER_SUFFIX],
 
188
                   [Append value to the version string])
640
189
 
641
190
# Force use of a curses libs
642
191
AC_ARG_WITH([named-curses-libs],
649
198
 
650
199
AC_ARG_WITH([tcp-port],
651
200
    [AS_HELP_STRING([--with-tcp-port=port-number],
652
 
            [Which port to use for Drizzle services @<:@default=4427@:>@])],
 
201
            [Which port to use for Drizzle TCP services @<:@default=4427@:>@])],
653
202
    [ DRIZZLE_TCP_PORT=$withval ],
654
203
    [ DRIZZLE_TCP_PORT=$DRIZZLE_TCP_PORT_DEFAULT
655
204
      # if we actually defaulted (as opposed to the pathological case of
680
229
      # so don't mess with that.
681
230
      DRIZZLE_TCP_PORT_DEFAULT=0 ]
682
231
    )
 
232
 
683
233
AC_SUBST(DRIZZLE_TCP_PORT)
684
 
# We might want to document the assigned port in the manual.
685
234
AC_SUBST(DRIZZLE_TCP_PORT_DEFAULT)
 
235
AC_DEFINE_UNQUOTED([DRIZZLE_TCP_PORT],[$DRIZZLE_TCP_PORT],
 
236
                   [Drizzle port to use])
 
237
AC_DEFINE_UNQUOTED([DRIZZLE_TCP_PORT_DEFAULT],[$DRIZZLE_TCP_PORT_DEFAULT],
 
238
                   [If we defaulted to DRIZZLE_PORT, then this will be zero])
 
239
 
686
240
 
687
241
# 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 ]
 
242
AC_ARG_WITH([drizzled-user],
 
243
    [AS_HELP_STRING([--with-drizzled-user=username],
 
244
            [What user the drizzled daemon shall be run as.
 
245
                @<:@default=drizzle@:>@])],
 
246
    [ DRIZZLED_USER=$withval ],
 
247
    [ DRIZZLED_USER=drizzle ]
694
248
    )
695
 
AC_SUBST(MYSQLD_USER)
 
249
AC_SUBST(DRIZZLED_USER)
696
250
 
697
251
# If we should allow LOAD DATA LOCAL
698
252
AC_MSG_CHECKING(If we should should enable LOAD DATA LOCAL by default)
710
264
  AC_MSG_RESULT([no])
711
265
fi
712
266
 
713
 
DRIZZLE_SYS_LARGEFILE
714
 
 
715
 
# Types that must be checked AFTER large file support is checked
716
 
AC_TYPE_SIZE_T
717
 
 
718
267
#--------------------------------------------------------------------
719
268
# Check for system header files
720
269
#--------------------------------------------------------------------
726
275
AC_CHECK_HEADERS(fcntl.h float.h fpu_control.h ieeefp.h)
727
276
AC_CHECK_HEADERS(limits.h pwd.h select.h linux/config.h)
728
277
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)
 
278
AC_CHECK_HEADERS(synch.h sys/mman.h sys/socket.h)
 
279
AC_CHECK_HEADERS([curses.h term.h],[],[],
 
280
[[#ifdef HAVE_CURSES_H
 
281
# include <curses.h>
 
282
#endif
 
283
]])
731
284
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)
 
285
AC_CHECK_HEADERS(sys/prctl.h ieeefp.h)
734
286
AC_CHECK_HEADERS(execinfo.h)
735
287
 
736
 
AC_CHECK_HEADERS([xfs/xfs.h])
737
 
 
738
288
#--------------------------------------------------------------------
739
289
# Check for system libraries. Adds the library to $LIBS
740
290
# and defines HAVE_LIBM etc
741
291
#--------------------------------------------------------------------
742
292
 
743
293
AC_CHECK_LIB(m, floor, [], AC_CHECK_LIB(m, __infinity))
744
 
AC_CHECK_FUNCS(log2)
745
294
 
746
295
AC_CHECK_FUNC(setsockopt, [], [AC_CHECK_LIB(socket, setsockopt)])
747
296
AC_CHECK_FUNC(yp_get_default_domain, [],
758
307
# For the sched_yield() function on Solaris
759
308
AC_CHECK_FUNC(sched_yield, [],
760
309
  [AC_CHECK_LIB(posix4, [sched_yield],
761
 
    [AC_DEFINE(HAVE_SCHED_YIELD) LIBS="$LIBS -lposix4"])])
 
310
    [AC_DEFINE(HAVE_SCHED_YIELD, 1, [Have sched_yield function]) LIBS="$LIBS -lposix4"])])
762
311
 
763
312
if test "$ac_cv_header_termio_h" = "no" -a "$ac_cv_header_termios_h" = "no"
764
313
then
765
314
  AC_CHECK_FUNC(gtty, [], [AC_CHECK_LIB(compat, gtty)])
766
315
fi
767
316
 
768
 
AC_CHECK_TYPES([int8, uint8, int16, uint16, int32, uint32, int64, uint64,
769
 
                uchar, uint, ulong],[],[], [
770
 
#include <sys/types.h>
771
 
])
772
317
AC_CHECK_TYPES([fp_except], [], [], [
773
318
#include <sys/types.h>
774
319
#include <ieeefp.h>
777
322
my_save_LIBS="$LIBS"
778
323
LIBS=""
779
324
AC_CHECK_LIB(dl,dlopen)
780
 
AC_CHECK_FUNCS(dlopen dlerror)
 
325
AC_CHECK_FUNCS(dlopen)
781
326
if test "$ac_cv_func_dlopen" != "yes"
782
327
then
783
328
  AC_MSG_ERROR([Drizzle requires dlopen])
786
331
LIBS="$my_save_LIBS"
787
332
AC_SUBST(LIBDL_LIBS)
788
333
 
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="-O3"
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="-O3"
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"])
 
334
 
 
335
AC_ARG_WITH([atomic-ops],
 
336
    [AS_HELP_STRING([--with-atomic-ops=rwlocks|smp|up],
 
337
       [Implement atomic operations using pthread rwlocks or atomic CPU
 
338
        instructions for multi-processor or uniprocessor
 
339
        configuration. By default gcc built-in sync functions are used,
 
340
        if available and 'smp' configuration otherwise.])],
 
341
    [with_atomic_ops="$withval"],
 
342
    [with_atomic_ops=smp])
 
343
 
 
344
case "$with_atomic_ops" in
 
345
  "up") AC_DEFINE([MY_ATOMIC_MODE_DUMMY], [1],
 
346
                  [Assume single-CPU mode, no concurrency]) ;;
 
347
  "rwlocks") AC_DEFINE([MY_ATOMIC_MODE_RWLOCKS], [1],
 
348
                  [Use pthread rwlocks for atomic ops]) ;;
 
349
  "smp") 
 
350
    AC_CACHE_CHECK(
 
351
      [whether the compiler provides atomic builtins],
 
352
      [ac_cv_gcc_atomic_builtins],
 
353
      [AC_RUN_IFELSE(
 
354
        [AC_LANG_PROGRAM([],[[
 
355
          int foo= -10; int bar= 10;
 
356
          if (!__sync_fetch_and_add(&foo, bar) || foo)
 
357
            return -1;
 
358
          bar= __sync_lock_test_and_set(&foo, bar);
 
359
          if (bar || foo != 10)
 
360
            return -1;
 
361
          bar= __sync_val_compare_and_swap(&bar, foo, 15);
 
362
          if (bar)
 
363
            return -1;
 
364
          return 0;
 
365
        ]])],
 
366
       [ac_cv_gcc_atomic_builtins=yes],
 
367
       [ac_cv_gcc_atomic_builtins=no])])
 
368
 
 
369
    if test "x$ac_cv_gcc_atomic_builtins" = "xyes"; then
 
370
      AC_DEFINE(HAVE_GCC_ATOMIC_BUILTINS, 1,
 
371
                [Define to 1 if compiler provides atomic builtins.])
 
372
    fi
 
373
   ;;
 
374
   *) AC_MSG_ERROR(["$with_atomic_ops" is not a valid value for --with-atomic-ops]) ;;
 
375
esac
 
376
 
876
377
 
877
378
AC_ARG_WITH([comment],
878
379
    [AS_HELP_STRING([--with-comment],
883
384
then
884
385
  COMPILATION_COMMENT=$with_comment
885
386
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
 
387
  COMPILATION_COMMENT="Source distribution (RELEASE_COMMENT)"
 
388
fi
 
389
AC_DEFINE_UNQUOTED([COMPILATION_COMMENT],["$COMPILATION_COMMENT"],
 
390
                   [Comment about compilation environment])
897
391
 
898
392
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
 
393
 
903
394
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
395
# off_t is not a builtin type
929
396
AC_CHECK_SIZEOF(off_t, 4)
930
397
if test "$ac_cv_sizeof_off_t" -eq 0
931
398
then
932
399
  AC_MSG_ERROR("Drizzle needs a off_t type.")
933
400
fi
 
401
AC_CHECK_SIZEOF(size_t)
 
402
AC_DEFINE_UNQUOTED([SIZEOF_SIZE_T],[$ac_cv_sizeof_size_t],[Size of size_t as computed by sizeof()])
 
403
AC_CHECK_SIZEOF(long long)
 
404
AC_DEFINE_UNQUOTED(SIZEOF_LONG_LONG,[$ac_cv_sizeof_long_long],[Size of long long as computed by sizeof()])
934
405
 
935
406
dnl
936
407
dnl check if time_t is unsigned
938
409
 
939
410
DRIZZLE_CHECK_TIME_T
940
411
 
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
412
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
 
413
 
971
414
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])
 
415
AC_CHECK_TYPES([uint, ulong])
974
416
 
975
417
DRIZZLE_PTHREAD_YIELD
976
418
 
977
419
 
978
420
dnl Checks for header files.
979
 
AC_CHECK_HEADERS(malloc.h sys/cdefs.h)
 
421
AC_CHECK_HEADERS(malloc.h)
980
422
 
981
423
dnl Checks for library functions.
982
424
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)
 
425
 
995
426
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
427
 
1003
428
# 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)
 
429
AC_CHECK_HEADERS(stdarg.h dirent.h locale.h ndir.h sys/dir.h \
 
430
 sys/ndir.h sys/select.h \
 
431
 sys/mman.h termcap.h termio.h asm/termbits.h grp.h \
 
432
 paths.h)
1008
433
 
1009
434
# Already-done: strcasecmp
1010
 
AC_CHECK_FUNCS(lstat putenv select setenv setlocale strcoll tcgetattr)
 
435
AC_CHECK_FUNCS(lstat select)
1011
436
 
1012
437
AC_HEADER_STAT
1013
 
DRIZZLE_SIGNAL_CHECK
1014
 
DRIZZLE_CHECK_GETPW_FUNCS
1015
438
DRIZZLE_HAVE_TIOCGWINSZ
1016
 
DRIZZLE_HAVE_FIONREAD
1017
439
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
 
440
 
1044
441
#########################################################################
1045
442
 
1046
443
dnl Checks for library functions.
1047
444
 
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
445
AC_FUNC_UTIME_NULL
1062
446
AC_FUNC_VPRINTF
1063
447
 
1067
451
  AC_MSG_ERROR("Drizzle requires fcntl.")
1068
452
fi
1069
453
 
1070
 
AC_CONFIG_LIBOBJ_DIR([mystrings])
1071
 
AC_REPLACE_FUNCS([stpcpy stpncpy])
1072
 
 
1073
 
AC_CHECK_FUNCS(bsearch \
 
454
 
 
455
AC_CACHE_CHECK([working fdatasync],[ac_cv_func_fdatasync],[
 
456
  AC_LANG_PUSH(C++)
 
457
  AC_RUN_IFELSE([AC_LANG_PROGRAM([[
 
458
#include <unistd.h>
 
459
    ]],[[
 
460
fdatasync(4);
 
461
    ]])],
 
462
  [ac_cv_func_fdatasync=yes],
 
463
  [ac_cv_func_fdatasync=no])
 
464
  AC_LANG_POP()
 
465
])
 
466
AS_IF([test "x${ac_cv_func_fdatasync}" = "xyes"],
 
467
  [AC_DEFINE([HAVE_FDATASYNC],[1],[If the system has a working fdatasync])])
 
468
 
 
469
 
 
470
AC_CHECK_FUNCS( \
1074
471
  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 \
 
472
  fpresetsticky fpsetmask fsync \
 
473
  getpassphrase getpwnam \
 
474
  getpwuid getrlimit getrusage index initgroups isnan \
 
475
  localtime_r log log2 gethrtime gmtime_r \
 
476
  madvise \
 
477
  mkstemp mlockall poll pread pthread_attr_create mmap mmap64 \
1082
478
  pthread_attr_getstacksize pthread_attr_setprio pthread_attr_setschedparam \
1083
479
  pthread_attr_setstacksize pthread_condattr_create pthread_getsequence_np \
1084
480
  pthread_key_delete pthread_rwlock_rdlock pthread_setprio \
1085
481
  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)
 
482
  realpath rename rwlock_init setupterm \
 
483
  sigaction \
 
484
  sigthreadmask \
 
485
  snprintf strpbrk \
 
486
  tell tempnam \
 
487
  backtrace backtrace_symbols backtrace_symbols_fd)
1092
488
 
1093
489
AC_LANG_PUSH(C++)
1094
490
# Test whether madvise() is declared in C++ code -- it is not on some
1104
500
 
1105
501
AM_CONDITIONAL(BUILD_THR_RWLOCK,[test "$ac_cv_func_rwlock_init" -a "$ac_cv_funn_pthread_rwlock_rdlock"])
1106
502
 
1107
 
# Check that isinf() is available in math.h and can be used in both C and C++
1108
 
# code
1109
 
AC_MSG_CHECKING(for isinf in math.h)
1110
 
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]], [[
1111
 
    float f = 0.0; 
1112
 
    int r = isinf(f); 
1113
 
    return r;
1114
 
  ]])],[
1115
 
    AC_MSG_RESULT(yes)
1116
 
    AC_MSG_CHECKING(whether isinf() can be used in C++ code)
1117
 
    AC_LANG_PUSH([C++])
1118
 
    AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]], [[
1119
 
      float f = 0.0;
1120
 
      int r = isinf(f);
1121
 
      return r;
1122
 
    ]])],[
1123
 
      AC_MSG_RESULT(yes)
1124
 
      AC_DEFINE(HAVE_ISINF, [1], [isinf() macro or function])
1125
 
    ],[
1126
 
      AC_MSG_RESULT(no)
1127
 
    ])
1128
 
    AC_LANG_POP([])
1129
 
  ],[
1130
 
  AC_MSG_RESULT(no)])
1131
 
 
1132
 
 
1133
 
CFLAGS="$ORG_CFLAGS"
1134
503
 
1135
504
# Sanity check: We chould not have any fseeko symbol unless
1136
505
# large_file_support=yes
1137
506
AC_CHECK_FUNC(fseeko,
1138
 
[if test "$large_file_support" = no -a "$TARGET_LINUX" = "true";
 
507
[if test "$large_file_support" = no -a "x$TARGET_LINUX" = "xtrue";
1139
508
then
1140
509
  AC_MSG_ERROR("Found fseeko symbol but large_file_support is not enabled!")
1141
510
fi]
1143
512
 
1144
513
# Check definition of pthread_getspecific
1145
514
AC_CACHE_CHECK([args to pthread_getspecific], [mysql_cv_getspecific_args],
1146
 
  [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if !defined(_REENTRANT)
 
515
  [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 
516
#if !defined(_REENTRANT)
1147
517
#define _REENTRANT
1148
518
#endif
 
519
#ifndef _POSIX_PTHREAD_SEMANTICS 
1149
520
#define _POSIX_PTHREAD_SEMANTICS 
1150
 
#include <pthread.h> ]], [[ void *pthread_getspecific(pthread_key_t key);
1151
 
pthread_getspecific((pthread_key_t) NULL); ]])],
 
521
#endif
 
522
#include <pthread.h>
 
523
   ]], [[
 
524
void *pthread_getspecific(pthread_key_t key);
 
525
pthread_getspecific((pthread_key_t) NULL);
 
526
   ]])],
1152
527
    [mysql_cv_getspecific_args=POSIX],
1153
528
    [mysql_cv_getspecific_args=other])])
1154
529
  if test "$mysql_cv_getspecific_args" = "other"
1159
534
 
1160
535
  # Check definition of pthread_mutex_init
1161
536
  AC_CACHE_CHECK([args to pthread_mutex_init], [mysql_cv_mutex_init_args],
1162
 
    [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#define _REENTRANT
 
537
    [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 
538
#ifndef _REENTRANT
 
539
#define _REENTRANT
 
540
#endif
 
541
#ifndef _POSIX_PTHREAD_SEMANTICS
1163
542
#define _POSIX_PTHREAD_SEMANTICS 
 
543
#endif
1164
544
#include <pthread.h> ]], [[ 
1165
545
  pthread_mutexattr_t attr;
1166
546
  pthread_mutex_t mp;
1177
557
#---START: Used in for client configure
1178
558
# Check definition of readdir_r
1179
559
AC_CACHE_CHECK([args to readdir_r], [mysql_cv_readdir_r],
1180
 
  [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define _REENTRANT
 
560
  [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
 
561
#ifndef _REENTRANT
 
562
#define _REENTRANT
 
563
#endif
 
564
#ifndef _POSIX_PTHREAD_SEMANTICS 
1181
565
#define _POSIX_PTHREAD_SEMANTICS 
 
566
#endif
1182
567
#include <pthread.h>
1183
568
#include <dirent.h>]], [[ int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result);
1184
569
readdir_r((DIR *) NULL, (struct dirent *) NULL, (struct dirent **) NULL); ]])],
1192
577
# Check definition of posix sigwait()
1193
578
AC_CACHE_CHECK([style of sigwait], [mysql_cv_sigwait],
1194
579
  [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
 
580
#ifndef _REENTRANT
1195
581
#define _REENTRANT
 
582
#endif
 
583
#ifndef _POSIX_PTHREAD_SEMANTICS
1196
584
#define _POSIX_PTHREAD_SEMANTICS 
 
585
#endif
1197
586
#include <pthread.h>
1198
587
#include <signal.h>
1199
588
      ]], [[
1216
605
# Check definition of posix sigwait()
1217
606
AC_CACHE_CHECK([style of sigwait], [mysql_cv_sigwait],
1218
607
  [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
 
608
#ifndef _REENTRANT
1219
609
#define _REENTRANT
 
610
#endif
 
611
#ifndef _POSIX_PTHREAD_SEMANTICS
1220
612
#define _POSIX_PTHREAD_SEMANTICS 
 
613
#endif
1221
614
#include <pthread.h>
1222
615
#include <signal.h>
1223
616
      ]], [[
1237
630
# Check if pthread_attr_setscope() exists
1238
631
AC_CACHE_CHECK([for pthread_attr_setscope], [mysql_cv_pthread_attr_setscope],
1239
632
  [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
 
633
#ifndef _REENTRANT
1240
634
#define _REENTRANT
 
635
#endif
 
636
#ifndef _POSIX_PTHREAD_SEMANTICS
1241
637
#define _POSIX_PTHREAD_SEMANTICS 
 
638
#endif
1242
639
#include <pthread.h>
1243
640
      ]], [[
1244
641
pthread_attr_t thr_attr;
1251
648
  AC_DEFINE([HAVE_PTHREAD_ATTR_SETSCOPE], [1], [pthread_attr_setscope])
1252
649
fi
1253
650
 
1254
 
# Check for bad includes
1255
 
AC_MSG_CHECKING("can netinet files be included")
1256
 
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
1257
 
#include <sys/socket.h>
1258
 
#include <netinet/in_systm.h>
1259
 
#include <netinet/in.h>
1260
 
#include <netinet/ip.h>
1261
 
#include <netinet/tcp.h>]], [[ printf("1\n"); ]])],[netinet_inc=yes],[netinet_inc=no])
1262
 
if test "$netinet_inc" = "no"
1263
 
then
1264
 
  AC_DEFINE([HAVE_BROKEN_NETINET_INCLUDES], [1], [Can netinet be included])
1265
 
fi
1266
 
AC_MSG_RESULT("$netinet_inc")
1267
 
 
1268
651
AC_LANG_PUSH([C++])
1269
652
AC_CHECK_HEADERS(cxxabi.h)
1270
653
AC_CACHE_CHECK([checking for abi::__cxa_demangle], mysql_cv_cxa_demangle,
1283
666
# Check for requested features
1284
667
#--------------------------------------------------------------------
1285
668
 
1286
 
DRIZZLE_CHECK_BIG_TABLES
1287
669
DRIZZLE_CHECK_MAX_INDEXES
1288
 
DRIZZLE_CHECK_VIO
1289
 
 
1290
 
#--------------------------------------------------------------------
1291
 
# Declare our plugin modules
1292
 
# Has to be done late, as the plugin may need to check for existence of
1293
 
# functions tested above
1294
 
#--------------------------------------------------------------------
1295
 
 
1296
 
DRIZZLE_CONFIGURE_PLUGINS([none])
1297
 
 
1298
 
AC_SUBST(mysql_plugin_dirs)
1299
 
AC_SUBST(mysql_plugin_libs)
1300
 
AC_SUBST(mysql_plugin_defs)
1301
 
 
1302
 
AC_ARG_ENABLE([profiling],
1303
 
    [AS_HELP_STRING([--enable-profiling],
1304
 
       [Toggle profiling @<:@default=off@:>@])],
1305
 
    [ac_profiling="$enableval"],
1306
 
    [ac_profiling="no"])
1307
 
 
1308
 
AC_ARG_ENABLE([coverage],
1309
 
    [AS_HELP_STRING([--enable-coverage],
1310
 
       [Toggle coverage @<:@default=off@:>@])],
1311
 
    [ac_coverage="$enableval"],
1312
 
    [ac_coverage="no"])
1313
 
 
1314
 
AC_ARG_ENABLE([pedantic-warnings],
1315
 
    [AS_HELP_STRING([--disable-pedantic-warnings],
1316
 
       [Toggle pedanticness @<:@default=on@:>@])],
1317
 
    [ac_warn_pedantic="$enableval"],
1318
 
    [ac_warn_pedantic="yes"])
1319
 
 
1320
 
AC_ARG_ENABLE([fail],
1321
 
    [AS_HELP_STRING([--disable-fail],
1322
 
       [Turn warnings into failures @<:@default=on@:>@])],
1323
 
    [ac_warn_fail="$enableval"],
1324
 
    [ac_warn_fail="yes"])
1325
 
 
1326
 
AC_ARG_ENABLE([unreachable],
1327
 
    [AS_HELP_STRING([--enable-unreachable],
1328
 
       [Enable warnings about unreachable code @<:@default=off@:>@])],
1329
 
    [ac_warn_unreachable="$enableval"],
1330
 
    [ac_warn_unreachable="no"])
1331
 
 
1332
 
AC_ARG_ENABLE([longlong-warnings],
1333
 
    [AS_HELP_STRING([--enable-longlong-warnings],
1334
 
       [Enable warnings about longlong in C++ @<:@default=off@:>@])],
1335
 
    [ac_warn_longlong="$enableval"],
1336
 
    [ac_warn_longlong="no"])
1337
 
 
1338
 
AC_ARG_ENABLE([strict-aliasing],
1339
 
    [AS_HELP_STRING([--enable-strict-aliasing],
1340
 
       [Enable warnings about stict-aliasing @<:@default=off@:>@])],
1341
 
    [ac_warn_strict_aliasing="$enableval"],
1342
 
    [ac_warn_strict_aliasing="no"])
1343
 
 
1344
 
 
1345
 
if test "$GCC" = "yes"
1346
 
then
1347
 
 
1348
 
  if test "$ac_warn_longlong" = "yes"
1349
 
  then
1350
 
    W_LONGLONG="-Wlong-long"
1351
 
  else
1352
 
    W_LONGLONG="-Wno-long-long"
1353
 
  fi
1354
 
 
1355
 
  if test "$ac_warn_strict_aliasing" = "yes"
1356
 
  then
1357
 
    W_STRICT_ALIASING="-Wstrict-aliasing"
1358
 
  else
1359
 
    W_STRICT_ALIASING="-Wno-strict-aliasing"
1360
 
  fi
1361
 
 
1362
 
  if test "$ac_profiling" = "yes"
1363
 
  then
1364
 
    GPROF_PROFILING="-pg"
1365
 
  else
1366
 
    GPROF_PROFILING=" "
1367
 
  fi
1368
 
 
1369
 
  if test "$ac_coverage" = "yes"
1370
 
  then
1371
 
    GPROF_COVERAGE="-fprofile-arcs -ftest-coverage"
1372
 
  else
1373
 
    GPROF_COVERAGE=" "
1374
 
  fi
1375
 
 
1376
 
  if test "$ac_warn_pedantic" = "yes"
1377
 
  then
1378
 
    GCC_PEDANTIC="-pedantic -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls ${W_STRICT_ALIASING}"
1379
 
    GXX_PEDANTIC="-pedantic -Wundef -Wredundant-decls ${W_LONGLONG} ${W_STRICT_ALIASING}"
1380
 
  fi
1381
 
 
1382
 
  if test "$ac_warn_unreachable" = "yes"
1383
 
  then
1384
 
    W_UNREACHABLE="-Wunreachable-code"
1385
 
  fi
1386
 
 
1387
 
  if test "$ac_warn_fail" = "yes"
1388
 
  then
1389
 
    W_FAIL="-Werror"
1390
 
  fi
1391
 
 
1392
 
  BASE_WARNINGS="-W -Wall -Wextra"
1393
 
  GCC_WARNINGS="${C99_SUPPORT_HACK} ${BASE_WARNINGS} ${GCC_PEDANTIC} ${W_UNREACHABLE} ${W_FAIL} ${GPROF_PROFILING} ${GPROF_COVERAGE}"
1394
 
  GXX_WARNINGS="${BASE_WARNINGS} ${GXX_PEDANTIC} ${W_UNREACHABLE} ${W_FAIL} ${GPROF_PROFILING} ${GPROF_COVERAGE}"
1395
 
 
1396
 
  AM_CXXFLAGS="${GXX_WARNINGS} ${AM_CXXFLAGS}"
1397
 
  AM_CFLAGS="${GCC_WARNINGS} ${AM_CFLAGS}"
1398
 
fi
1399
 
 
1400
 
AC_SUBST([GLOBAL_CPPFLAGS],['-I$(top_srcdir) -I$(top_builddir)'])
1401
 
AC_SUBST([AM_CPPFLAGS],['${GLOBAL_CPPFLAGS}'])
1402
 
AC_SUBST([AM_CFLAGS])
1403
 
AC_SUBST([AM_CXXFLAGS])
1404
 
 
1405
 
# Some usefull subst
1406
 
AC_SUBST(CC)
1407
 
AC_SUBST(GXX)
1408
 
 
1409
 
# Set configuration options for make_binary_distribution
1410
 
case $SYSTEM_TYPE in
1411
 
  *netware*)
1412
 
    MAKE_BINARY_DISTRIBUTION_OPTIONS="$MAKE_BINARY_DISTRIBUTION_OPTIONS --no-strip"
1413
 
    ;;
1414
 
  *)
1415
 
    : # no change for other platforms yet
1416
 
    ;;
1417
 
esac
1418
 
AC_SUBST(MAKE_BINARY_DISTRIBUTION_OPTIONS)
1419
 
 
1420
 
AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl
1421
 
 mystrings/Makefile storage/Makefile dnl
1422
 
 vio/Makefile po/Makefile.in dnl
1423
 
 libdrizzle/Makefile client/Makefile dnl
 
670
 
 
671
dnl Has to be done late, as the plugin may need to check for existence of
 
672
dnl functions tested above
 
673
PANDORA_PLUGINS([drizzled/plugin/config.h])
 
674
 
 
675
dnl GCC Precompiled Header Support
 
676
dnl re-enable later
 
677
dnl AM_CONDITIONAL([BUILD_GCC_PCH],[test "$GCC" = "yes"])
 
678
AM_CONDITIONAL([BUILD_GCC_PCH],[test "no" = "yes"])
 
679
 
 
680
AC_CONFIG_FILES(Makefile dnl
 
681
 gnulib/Makefile dnl
 
682
 po/Makefile.in dnl
 
683
 drizzled/message/Makefile dnl
1424
684
 drizzled/Makefile dnl
1425
 
 drizzled/field/Makefile dnl
1426
 
 drizzled/serialize/Makefile dnl
1427
 
 drizzled/sql_builtin.cc dnl
1428
685
 support-files/Makefile dnl
1429
686
 tests/Makefile tests/install_test_db dnl
1430
 
 drizzled/version.h plugin/Makefile dnl
1431
 
 drizzled/drizzled_safe support-files/libdrizzle.pc dnl
1432
 
 support-files/drizzle.server support-files/drizzle-log-rotate)
1433
 
 
1434
 
AC_CONFIG_COMMANDS([default], , test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h)
1435
 
 
1436
 
# Ensure that table handlers gets all modifications to CFLAGS/CXXFLAGS
1437
 
AC_CONFIG_COMMANDS_POST(ac_configure_args="$ac_configure_args CFLAGS='$CFLAGS' CXXFLAGS='$CXXFLAGS' AM_CFLAGS='$AM_CFLAGS' AM_CXXFLAGS='$AM_CXXFLAGS'")
 
687
 support-files/drizzle.server support-files/drizzle-log-rotate
 
688
 support-files/smf/Makefile dnl
 
689
 support-files/smf/install.sh dnl
 
690
 support-files/smf/drizzle.xml dnl
 
691
 support-files/smf/drizzle)
 
692
 
 
693
scheduling_plugins_available="
 
694
  pool_of_threads 
 
695
  single_thread
 
696
"
 
697
 
 
698
for sched_plugin in $scheduling_plugins_available
 
699
do
 
700
  varname="\${with_plugin_${sched_plugin}}"
 
701
  result=`eval "echo $varname"`
 
702
  if test "x$result" = "xyes"
 
703
  then
 
704
    scheduling_plugins="$sched_plugin $scheduling_plugins"
 
705
  fi
 
706
done
1438
707
 
1439
708
AC_OUTPUT
 
709
 
 
710
echo "---"
 
711
echo "Configuration summary for $PACKAGE_NAME version $VERSION RELEASE_COMMENT"
 
712
echo ""
 
713
echo "   * Installation prefix:       $prefix"
 
714
echo "   * System type:               $host_vendor-$host_os"
 
715
echo "   * Host CPU:                  $host_cpu"
 
716
echo "   * C Compiler:                $CC_VERSION"
 
717
echo "   * C++ Compiler:              $CXX_VERSION"
 
718
echo "   * Build auth_pam:            $ac_cv_libpam"
 
719
echo "   * Assertions enabled:        $ac_cv_assert"
 
720
echo "   * Debug enabled:             $with_debug"
 
721
echo "   * Profiling enabled:         $ac_profiling"
 
722
echo "   * Coverage enabled:          $ac_coverage"
 
723
echo "   * Warnings as failure:       $ac_cv_warnings_as_errors"
 
724
echo "   * C++ cstdint location:      $ac_cv_cxx_cstdint"
 
725
echo "   * C++ hash_map location:     $ac_cv_cxx_hash_map"
 
726
echo "   * C++ hash namespace:        $ac_cv_cxx_hash_namespace"
 
727
echo "   * C++ shared_ptr namespace:  $ac_cv_shared_ptr_namespace"
 
728
echo ""
 
729
echo "---"
 
730
 
 
731
dnl libtoolize scans configure.ac  and needs to see some text
 
732
m4_define([LIBTOOLIZE_AC_INIT], [])