~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Monty Taylor
  • Date: 2009-03-04 02:48:12 UTC
  • mto: (917.1.2 mordred)
  • mto: This revision was merged to the branch mainline in revision 918.
  • Revision ID: mordred@inaugust.com-20090304024812-5wb6wpye5c1iitbq
Applied atomic patch to current tree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
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
 
 
20
4
AC_PREREQ(2.59)dnl              Minimum Autoconf version required.
21
 
dnl Version from the AC_INIT call below is overridden later
22
 
dnl So don't update it here
23
 
AC_INIT([drizzle7],[7],[http://bugs.launchpad.net/drizzle])
 
5
 
 
6
m4_include(m4/bzr_version.m4)
 
7
 
24
8
AC_CONFIG_SRCDIR([drizzled/drizzled.cc])
25
 
AC_CONFIG_AUX_DIR([config])
26
 
 
27
 
PANDORA_CANONICAL_TARGET(less-warnings, warnings-always-on, require-cxx, force-gcc42, version-from-vc, skip-visibility)
28
 
 
29
 
LIBDRIZZLE_LIBRARY_VERSION=1:0:0
30
 
#                          | | |
31
 
#                   +------+ | +---+
32
 
#                   |        |     |
33
 
#                current:revision:age
34
 
#                   |        |     |
35
 
#                   |        |     +- increment if interfaces have been added
36
 
#                   |        |        set to zero if interfaces have been
37
 
#                   |        |        removed or changed
38
 
#                   |        +- increment if source code has changed
39
 
#                   |           set to zero if current is incremented
40
 
#                   +- increment if interfaces have been added, removed or
41
 
#                      changed
42
 
AC_SUBST(LIBDRIZZLE_LIBRARY_VERSION)
 
9
AC_CONFIG_AUX_DIR(config)
 
10
AC_CONFIG_HEADERS([config.h])
 
11
AC_CONFIG_MACRO_DIR([m4])
 
12
 
 
13
# Setting CFLAGS here prevents AC_CANONICAL_TARGET from injecting them
 
14
SAVE_CFLAGS=${CFLAGS}
 
15
SAVE_CXXFLAGS=${CXXFLAGS}
 
16
CFLAGS=
 
17
CXXFLAGS=
 
18
 
 
19
AC_CANONICAL_TARGET
 
20
 
 
21
CFLAGS=${SAVE_CFLAGS}
 
22
CXXFLAGS=${SAVE_CXXFLAGS}
 
23
 
 
24
AM_INIT_AUTOMAKE(nostdinc subdir-objects -Wall -Werror)
 
25
 
 
26
if test "x${enable_dependency_tracking}" = "x"
 
27
then
 
28
  enable_dependency_tracking=yes
 
29
fi
 
30
 
 
31
gl_EARLY
 
32
 
 
33
# See the libtool docs for information on how to do shared lib versions.
 
34
SHARED_LIB_MAJOR_VERSION=1
 
35
SHARED_LIB_VERSION=$SHARED_LIB_MAJOR_VERSION:0:0
 
36
AC_SUBST(SHARED_LIB_MAJOR_VERSION)
 
37
AC_SUBST(SHARED_LIB_VERSION)
 
38
 
 
39
 
 
40
dnl Checks for programs.
 
41
AC_PROG_CXX
 
42
 
 
43
gl_USE_SYSTEM_EXTENSIONS
 
44
if test "$GCC" = "yes"
 
45
then
 
46
  AC_CACHE_CHECK([if GCC is recent enough], [drizzle_cv_gcc_recent],
 
47
    [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 
48
#if !defined(__GNUC__) || (__GNUC__ < 4)
 
49
# error GCC is Too Old!
 
50
#endif
 
51
      ]])],
 
52
      [drizzle_cv_gcc_recent=yes],
 
53
      [drizzle_cv_gcc_recent=no])])
 
54
  if test "$drizzle_cv_gcc_recent" = "no"
 
55
  then
 
56
    AC_MSG_ERROR([Your version of GCC is too old. Drizzle requires at least version 4.0.2])
 
57
  fi
 
58
fi
 
59
AC_CXX_HEADER_STDCXX_98
 
60
if test "$ac_cv_cxx_stdcxx_98" = "no"
 
61
then
 
62
  AC_MSG_ERROR([C++ Compiler required to compile Drizzle])
 
63
fi
 
64
AC_PROG_CPP
 
65
AM_PROG_CC_C_O
 
66
 
 
67
 
 
68
gl_INIT
 
69
 
 
70
AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
 
71
 
 
72
AC_PROG_GCC_TRADITIONAL
 
73
 
 
74
 
 
75
# Set all version vars based on $VERSION. How do we do this more elegant ?
 
76
# Remember that regexps needs to quote [ and ] since this is run through m4
 
77
# We take some made up examples
 
78
#
 
79
#  VERSION                  5.1.40sp1-alpha     5.0.34a
 
80
#  DRIZZLE_NO_DASH_VERSION    5.1.40sp1           5.0.34a
 
81
#  DRIZZLE_NUMERIC_VERSION    5.1.40              5.0.34
 
82
#  DRIZZLE_BASE_VERSION       5.1                 5.0
 
83
#  DRIZZLE_VERSION_ID         50140               50034
 
84
#
 
85
DRIZZLE_NO_DASH_VERSION=`echo $VERSION | sed -e "s|-.*$||"`
 
86
DRIZZLE_NUMERIC_VERSION=`echo $DRIZZLE_NO_DASH_VERSION | sed -e "s|[[a-z]][[a-z0-9]]*$||"`
 
87
DRIZZLE_BASE_VERSION=`echo $DRIZZLE_NUMERIC_VERSION | sed -e "s|\.[[^.]]*$||"`
 
88
DRIZZLE_VERSION_ID=`echo $DRIZZLE_NUMERIC_VERSION | \
 
89
    awk -F. '{printf "%d%0.2d%0.2d", $1, $2, $3}'`
 
90
AC_DEFINE_UNQUOTED(DRIZZLE_BASE_VERSION,["$DRIZZLE_BASE_VERSION"],
 
91
                   [Major and minor version])
 
92
AC_DEFINE_UNQUOTED([DRIZZLE_VERSION_ID],[$DRIZZLE_VERSION_ID],
 
93
                   [Version ID that can be easily used for numeric comparison])
 
94
 
 
95
AC_DEFINE([_BACKWARD_BACKWARD_WARNING_H],[1],[Hack to disable deprecation warning in gcc])
 
96
 
 
97
# The port should be constant for a LONG time
 
98
DRIZZLE_TCP_PORT_DEFAULT=4427
 
99
 
 
100
m4_include(m4/dtrace.m4)
 
101
 
 
102
m4_include(m4/character_sets.m4)
 
103
AC_SUBST(AVAILABLE_LANGUAGES)
 
104
 
 
105
m4_include(m4/gettext.m4)
 
106
AM_GNU_GETTEXT(external, need-formatstring-macros)
 
107
if test "x$MSGMERGE" = "x" -o "x$MSGMERGE" = "x:"
 
108
then
 
109
  AM_PATH_PROG_WITH_TEST(GMSGMERGE, gmsgmerge,
 
110
    [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
 
111
  MSGMERGE="${GMSGMERGE}"
 
112
fi
 
113
AM_CONDITIONAL([BUILD_GETTEXT],[test "x$MSGMERGE" != "x" -a "x$MSGMERGE" != "x:"])
 
114
 
 
115
 
 
116
# Set this for plugins to use
 
117
ac_build_drizzle="yes"
 
118
 
 
119
 
 
120
# Canonicalize the configuration name.
 
121
 
 
122
# Check whether --with-system-type or --without-system-type was given.
 
123
AC_ARG_WITH([system-type],
 
124
    [AS_HELP_STRING([--with-system-type],
 
125
       [Set the system type, like "sun-solaris10"])],
 
126
    [SYSTEM_TYPE="$withval"],
 
127
    [SYSTEM_TYPE="$host_vendor-$host_os"])
 
128
AC_ARG_WITH([machine-type],
 
129
    [AS_HELP_STRING([--with-machine-type],
 
130
       [Set the machine type, like "sparc"])],
 
131
    [MACHINE_TYPE="$withval"],
 
132
    [MACHINE_TYPE="$host_cpu"])
 
133
AC_SUBST(SYSTEM_TYPE)
 
134
AC_DEFINE_UNQUOTED([SYSTEM_TYPE], ["$SYSTEM_TYPE"],
 
135
                   [Name of system, eg sun-solaris])
 
136
AC_SUBST(MACHINE_TYPE)
 
137
AC_DEFINE_UNQUOTED([MACHINE_TYPE], ["$MACHINE_TYPE"],
 
138
                   [Machine type name, eg sparc])
 
139
 
 
140
# Detect intel x86 like processor
 
141
BASE_MACHINE_TYPE=$MACHINE_TYPE
 
142
case $MACHINE_TYPE in
 
143
  i?86) BASE_MACHINE_TYPE=i386 ;;
 
144
esac
 
145
 
 
146
 
 
147
case "$target_os" in
 
148
  *linux*)
 
149
  TARGET_LINUX="true"
 
150
  AC_SUBST(TARGET_LINUX)
 
151
  AC_DEFINE([TARGET_OS_LINUX], [1], [Whether we build for Linux])
 
152
    ;;
 
153
  *apple-darwin*)
 
154
    TARGET_OSX="true"
 
155
    AC_SUBST(TARGET_OSX)
 
156
    AC_DEFINE([TARGET_OS_OSX], [1], [Whether we build for OSX])
 
157
    ;;
 
158
  *solaris*)
 
159
    TARGET_SOLARIS="true"
 
160
    AC_SUBST(TARGET_SOLARIS)
 
161
    AC_DEFINE([TARGET_OS_SOLARIS], [1], [Whether we are building for Solaris])
 
162
    ;;
 
163
  *)
 
164
    ;;
 
165
esac
 
166
 
 
167
DRIZZLE_CHECK_C_VERSION
 
168
DRIZZLE_CHECK_CXX_VERSION
 
169
 
 
170
AC_SYS_LARGEFILE
 
171
 
 
172
AC_PROG_AWK
 
173
 
 
174
 
 
175
AC_PATH_PROG(GPERF, gperf)
 
176
AS_IF([test "x$GPERF" = "x"],
 
177
      AC_MSG_ERROR("Drizzle requires gperf to build. Please install it."))
 
178
 
 
179
AC_PATH_PROG(LCOV, lcov)
 
180
AC_PATH_PROG(GENHTML, genhtml)
 
181
 
 
182
AM_CONDITIONAL(HAVE_LCOV,[test "x$LCOV" != "x"])
 
183
 
 
184
dnl TODO: This needs to go away and be replaced with _ISOC99_SOURCE
 
185
if test "$ac_cv_c_compiler_gnu" = "yes" -o "$target_os" = "linux-gnu"
 
186
then
 
187
  AC_DEFINE([_GNU_SOURCE],[1],[Fix problem with S_ISLNK() on Linux])
 
188
fi
 
189
 
 
190
dnl  Solaris 9 include file <sys/feature_tests.h> refers to X/Open document
 
191
 
 
192
dnl  System Interfaces and Headers, Issue 5
 
193
 
 
194
dnl  saying we should define _XOPEN_SOURCE=500 to get POSIX.1c prototypes,
 
195
dnl  but apparently other systems (namely FreeBSD) don't agree.
 
196
 
 
197
dnl  On a newer Solaris 10, the above file recognizes also _XOPEN_SOURCE=600.
 
198
dnl  Furthermore, it tests that if a program requires older standard
 
199
dnl  (_XOPEN_SOURCE<600 or _POSIX_C_SOURCE<200112L) it cannot be
 
200
dnl  run on a new compiler (that defines _STDC_C99) and issues an #error.
 
201
dnl  It's also an #error if a program requires new standard (_XOPEN_SOURCE=600
 
202
dnl  or _POSIX_C_SOURCE=200112L) and a compiler does not define _STDC_C99.
 
203
 
 
204
dnl  To add more to this mess, Sun Studio C compiler defines _STDC_C99 while
 
205
dnl  C++ compiler does not!
 
206
 
 
207
dnl TODO: Can _ISOC99_SOURCE be defined on all platforms and remove the 
 
208
dnl       Need for all of this? 
 
209
if test "$GCC" = "yes"
 
210
then
 
211
  case "$target_os" in
 
212
    *solaris*)
 
213
    AC_DEFINE([_XOPEN_SOURCE],[600],[Turn on XOpen 6.0 Features])
 
214
    AC_DEFINE([__C99FEATURES__],[1],[Turn on C99 Features for C++])
 
215
    ;;
 
216
  esac
 
217
fi
 
218
 
 
219
AC_SUBST(NM)dnl
 
220
 
 
221
AC_PROG_INSTALL
 
222
 
 
223
# Look for "(group|user)add". 
 
224
# TODO: If the programs do not exist, inform the DBA that the user
 
225
#       was not created at the end of the install routine.
 
226
AC_CHECK_PROGS(GROUPADD, groupadd addgroup)
 
227
AC_CHECK_PROGS(USERADD, useradd adduser)
 
228
 
 
229
dnl Not critical since the generated file is distributed
 
230
AC_CHECK_PROGS(YACC, ['bison -y'])
 
231
if test -z "$YACC" && test -d ".bzr"
 
232
then
 
233
  AC_MSG_ERROR(["bison is required for Drizzle to build from a bzr branch"])
 
234
fi
 
235
 
 
236
 
 
237
# The following is required for portable results of floating point calculations
 
238
# on PowerPC. The same must also be done for IA-64, but this options is missing
 
239
# in the IA-64 gcc backend.
 
240
 
 
241
if test "$GCC" = "yes"
 
242
then
 
243
  case "$host_cpu" in
 
244
    *ppc* | *powerpc*)
 
245
      CFLAGS="$CFLAGS -mno-fused-madd"
 
246
      CXXFLAGS="$CXXFLAGS -mno-fused-madd"
 
247
    ;;
 
248
  esac
 
249
fi
 
250
# Build optimized or debug version ?
 
251
# First check for gcc and g++
 
252
if test "$GCC" = "yes"
 
253
then
 
254
  CFLAGS="${CFLAGS} -ggdb3 -std=gnu99"
 
255
  CXXFLAGS="${CXXFLAGS} -ggdb3 -std=gnu++98"
 
256
 
 
257
  DEBUG_CFLAGS="-O0"
 
258
  DEBUG_CXXFLAGS="-O0"
 
259
 
 
260
  OPTIMIZE_CFLAGS="-O3"
 
261
  OPTIMIZE_CXXFLAGS="-O3"
 
262
fi
 
263
if test "$SUNCC" = "yes"
 
264
then
 
265
  isainfo_k=`isainfo -k`
 
266
  if test "$target_cpu" = "sparc"
 
267
  then
 
268
    MEMALIGN_FLAGS="-xmemalign=8s"
 
269
    IS_64="-m64"
 
270
    LDFLAGS="${LDFLAGS} -L/usr/lib/${isainfo_k} -L/usr/local/lib/${isainfo_k}"
 
271
  else
 
272
    if test "$isainfo_k" = "amd64"
 
273
    then
 
274
      IS_64="-m64"
 
275
      LDFLAGS="${LDFLAGS} -L/usr/lib/${isainfo_k} -L/usr/local/lib/${isainfo_k}"
 
276
    fi
 
277
  fi
 
278
  CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
 
279
 
 
280
  CXXFLAGS="${CXXFLAGS} -xlang=c99 -g -mt -compat=5 -library=stlport4 -template=no%extdef ${IS_64} ${MEMALIGN_FLAGS}"
 
281
  CFLAGS="${CFLAGS} -g -mt -xc99=all ${IS_64} ${MEMALIGN_FLAGS}"
 
282
  DEBUG_CFLAGS="-xO0"
 
283
  DEBUG_CXXFLAGS="-xO0" 
 
284
 
 
285
  dnl TODO: -xO4 causes a Sun Studio failure in innodb... let's check back
 
286
  dnl       in on this one.
 
287
  OPTIMIZE_FLAGS="-xO3 -xlibmil -xdepend"
 
288
  OPTIMIZE_CFLAGS="${OPTIMIZE_FLAGS} -Xa -xstrconst"
 
289
  OPTIMIZE_CXXFLAGS="${OPTIMIZE_FLAGS}"
 
290
 
 
291
fi
 
292
 
 
293
# We use libtool
 
294
AC_PROG_LIBTOOL
 
295
 
 
296
dnl TODO: Remove this define once we are using 2.61 across the board.
 
297
# AX_HEADER_ASSERT
 
298
# ----------------
 
299
# Check whether to enable assertions.
 
300
AC_DEFUN([AX_HEADER_ASSERT],
 
301
[
 
302
  AC_MSG_CHECKING([whether to enable assertions])
 
303
  AC_ARG_ENABLE([assert],
 
304
    [AS_HELP_STRING([--disable-assert],
 
305
       [Turn off assertions])],
 
306
    [ac_cv_assert="no"],
 
307
    [ac_cv_assert="yes"])
 
308
  AC_MSG_RESULT([$ac_cv_assert])
 
309
])
 
310
 
 
311
AX_HEADER_ASSERT
 
312
 
 
313
AC_ARG_WITH([debug],
 
314
    [AS_HELP_STRING([--with-debug],
 
315
       [Add debug code/turns off optimizations (yes|no) @<:@default=no@:>@])],
 
316
    [with_debug=$withval],
 
317
    [with_debug=no])
 
318
if test "$with_debug" = "yes"
 
319
then
 
320
  # Debuging. No optimization.
 
321
  CFLAGS="${DEBUG_CFLAGS} -DDEBUG ${CFLAGS}"
 
322
  CXXFLAGS="${DEBUG_CXXFLAGS} -DDEBUG ${CXXFLAGS}"
 
323
else
 
324
  # Optimized version. No debug
 
325
  CFLAGS="${OPTIMIZE_CFLAGS} ${CFLAGS}"
 
326
  CXXFLAGS="${OPTIMIZE_CXXFLAGS} ${CXXFLAGS}"
 
327
fi
 
328
 
 
329
 
 
330
AC_CXX_STL_HASH
 
331
AC_CXX_CSTDINT
 
332
AC_CXX_CINTTYPES
 
333
AC_CXX_CMATH
 
334
 
 
335
DRIZZLE_PROG_AR
43
336
 
44
337
# libdrizzle versioning when linked with GNU ld.
45
 
AS_IF([test "$lt_cv_prog_gnu_ld" = "yes"],[
46
 
  LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_srcdir)/config/drizzle.ver"
47
 
  ])
 
338
if test "x$EGREP" != "x"
 
339
then
 
340
  if test "$lt_cv_prog_gnu_ld" = "yes" -a $LD --version 2>/dev/null|${EGREP} -q GNU
 
341
  then
 
342
    LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_srcdir)/libdrizzleclient/libdrizzleclient.ver"
 
343
  fi
 
344
fi
48
345
AC_SUBST(LD_VERSION_SCRIPT)
49
346
 
50
 
dnl Set the default datadir location to /usr/local/var/drizzle. If a
51
 
dnl localstatedir is explicitly given, just use that.
52
 
AS_IF([test "x${localstatedir}" = 'x${prefix}/var'],[
53
 
  localstatedir='${prefix}/var/drizzle'
54
 
])
55
 
 
56
 
AC_PATH_PROG(GPERF, gperf)
57
 
AS_IF([test "x$GPERF" = "x"],
58
 
      AC_MSG_ERROR("Drizzle requires gperf to build."))
59
 
 
60
 
# libexecinfo provides backtrace_symbols on FreeBSD
61
 
AC_SEARCH_LIBS(backtrace_symbols, [execinfo])
62
 
 
63
 
PANDORA_RUN_CPPLINT
64
 
 
65
 
PANDORA_REQUIRE_LIBPROTOBUF
66
 
PANDORA_PROTOBUF_REQUIRE_VERSION([2.1.0])
67
 
PANDORA_REQUIRE_PROTOC
 
347
AC_LIB_PREFIX
 
348
 
 
349
#--------------------------------------------------------------------
 
350
# Check for Google Proto Buffers
 
351
#--------------------------------------------------------------------
 
352
 
 
353
AC_LANG_PUSH([C++])
 
354
AC_LIB_HAVE_LINKFLAGS(protobuf,,
 
355
[#include <google/protobuf/descriptor.h>
 
356
],
 
357
[google::protobuf::FileDescriptor* file;])
 
358
AS_IF([test x$ac_cv_libprotobuf = xno],
 
359
      AC_MSG_ERROR([protobuf is required for Drizzle]))
 
360
 
 
361
AC_CACHE_CHECK([if protobuf is recent enough], [drizzle_cv_protobuf_recent],
 
362
  [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 
363
#include <google/protobuf/descriptor.h>
 
364
#if GOOGLE_PROTOBUF_VERSION < 2000002
 
365
# error Your version of Protobuf is too old
 
366
#endif
 
367
    ]])],
 
368
    [drizzle_cv_protobuf_recent=yes],
 
369
    [drizzle_cv_protobuf_recent=no])])
 
370
if test "$drizzle_cv_protobuf_recent" = "no"
 
371
then
 
372
  AC_MSG_ERROR([Your version of Google Protocol Buffers is too old. Drizzle requires at least version 2.0.2])
 
373
fi
 
374
 
 
375
AC_PATH_PROG([PROTOC],[protoc],[no],[$LIBPROTOBUF_PREFIX/bin:$PATH])
 
376
if test "x$PROTOC" = "xno"
 
377
then
 
378
  AC_MSG_ERROR([Couldn't find protoc. Try installing Google Protocol Buffer.])
 
379
fi
 
380
 
 
381
AC_LANG_POP()
 
382
 
 
383
#--------------------------------------------------------------------
 
384
# Check for libuuid
 
385
#--------------------------------------------------------------------
 
386
 
 
387
dnl Do this by hand. Need to check for uuid/uuid.h, but uuid may or may
 
388
dnl not be a lib is weird.
 
389
 
 
390
AC_CHECK_HEADERS(uuid/uuid.h)
 
391
if test "x$ac_cv_header_uuid_uuid_h" = "xno"
 
392
then
 
393
  AC_MSG_ERROR([Couldn't find uuid/uuid.h. Try installing libuuid development packages])
 
394
fi
 
395
AC_LIB_HAVE_LINKFLAGS(uuid,,
 
396
[
 
397
#include <uuid/uuid.h>
 
398
],
 
399
[
 
400
  uuid_t uout;
 
401
  uuid_generate(uout);
 
402
])
 
403
 
 
404
 
 
405
 
 
406
#--------------------------------------------------------------------
 
407
# Check for libpthread
 
408
#--------------------------------------------------------------------
 
409
 
 
410
ACX_PTHREAD(,AC_MSG_ERROR(could not find libpthread))
 
411
LIBS="$PTHREAD_LIBS $LIBS"
 
412
CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS}"
 
413
CC="$PTHREAD_CC"
 
414
 
 
415
#--------------------------------------------------------------------
 
416
# Check for tcmalloc/mtmalloc
 
417
#--------------------------------------------------------------------
 
418
 
 
419
AC_ARG_ENABLE([tcmalloc],
 
420
    [AS_HELP_STRING([--enable-tcmalloc],
 
421
       [Enable linking with tcmalloc @<:@default=off@:>@])],
 
422
    [ac_enable_tcmalloc="$enableval"],
 
423
    [ac_enable_tcmalloc="no"])
 
424
 
 
425
if test "x$ac_enable_tcmalloc" != "xno"
 
426
then
 
427
  AC_CHECK_LIB(tcmalloc,malloc,[],[])
 
428
fi
 
429
 
 
430
if test "x$ac_cv_lib_tcmalloc_malloc" != "xyes"
 
431
then
 
432
  AC_CHECK_LIB(mtmalloc,malloc,[],[])
 
433
fi
 
434
 
 
435
 
 
436
#--------------------------------------------------------------------
 
437
# Check for libdrizzle
 
438
#--------------------------------------------------------------------
 
439
 
 
440
AC_LIB_HAVE_LINKFLAGS(drizzle,,
 
441
[#include <libdrizzle/drizzle.h>],
 
442
[
 
443
  const char *version= drizzle_version()
 
444
])
 
445
dnl AS_IF([test x$ac_cv_libdrizzle = xno],
 
446
dnl       AC_MSG_ERROR([libdrizzle is required for Drizzle])
 
447
 
 
448
 
 
449
#--------------------------------------------------------------------
 
450
# Check for libz
 
451
#--------------------------------------------------------------------
 
452
 
 
453
AC_LIB_HAVE_LINKFLAGS(z,,
 
454
[#include <zlib.h>],
 
455
[
 
456
  crc32(0, Z_NULL, 0);
 
457
])
 
458
AS_IF([test x$ac_cv_libz = xno],
 
459
      AC_MSG_ERROR([libz is required for Drizzle]))
 
460
 
 
461
#--------------------------------------------------------------------
 
462
# Check for TBB
 
463
#--------------------------------------------------------------------
68
464
 
69
465
AC_LANG_PUSH(C++)
70
 
PANDORA_REQUIRE_PTHREAD
71
 
PANDORA_REQUIRE_LIBUUID
72
 
PANDORA_REQUIRE_LIBZ
73
 
PANDORA_REQUIRE_LIBPCRE
74
 
PANDORA_REQUIRE_LIBREADLINE
75
 
PANDORA_REQUIRE_LIBDL
76
 
AC_LANG_POP
77
 
 
78
 
DRIZZLE_STACK_DIRECTION
79
 
 
80
 
PANDORA_USE_BETTER_MALLOC
81
 
 
82
 
PANDORA_DRIZZLE_BUILD
83
 
AC_DEFINE([BUILDING_DRIZZLED],[1],
84
 
          [Define indicating we are building and not consuming drizzle.])
85
 
 
86
 
PANDORA_HAVE_LIBGTEST
87
 
PANDORA_HAVE_LIBSQLITE3
88
 
 
89
 
AC_CHECK_FUNC(inet_ntoa, [], [AC_CHECK_LIB(nsl, inet_ntoa)])
 
466
AC_LIB_HAVE_LINKFLAGS(tbb,,
 
467
[#include <tbb/atomic.h>
 
468
 #include <stdint.h>
 
469
],
 
470
[
 
471
  tbb::atomic<uint64_t> x;
 
472
  tbb::atomic<uint8_t> y;
 
473
  x=0;
 
474
  y=0;
 
475
  x++;
 
476
  y++;
 
477
])
 
478
AC_LANG_POP()
 
479
 
 
480
#--------------------------------------------------------------------
 
481
# Check for libreadline or compatible (libedit on Mac OS X)
 
482
#--------------------------------------------------------------------
 
483
 
 
484
save_LIBS="${LIBS}"
 
485
LIBS=""
 
486
VL_LIB_READLINE
 
487
AS_IF([test "x$vl_cv_lib_readline" = "xno"],
 
488
      AC_MSG_ERROR([libreadline is required for Drizzle]))
 
489
READLINE_LIBS="${LIBS}"
 
490
LIBS="${save_LIBS}"
 
491
AC_SUBST(READLINE_LIBS)
 
492
 
 
493
DRIZZLE_CHECK_NEW_RL_INTERFACE
 
494
 
 
495
#--------------------------------------------------------------------
 
496
# Check for libpcre
 
497
#--------------------------------------------------------------------
 
498
 
 
499
AC_LIB_HAVE_LINKFLAGS(pcre,, [#include <pcre.h>], [pcre *re= NULL])
 
500
AS_IF([test "x$ac_cv_libpcre" = "xno"],[
 
501
  ac_cv_libpcre=
 
502
  AC_LIB_HAVE_LINKFLAGS(pcre,, [#include <pcre/pcre.h>], [pcre *re= NULL])
 
503
    AS_IF([test "x$ac_cv_libpcre" = "xno"],
 
504
          [AC_MSG_ERROR([libpcre is required for Drizzle])]
 
505
          [AC_DEFINE(PCRE_HEADER,[<pcre/pcre.h>],[Location of pcre header])])
 
506
  ],[
 
507
    AC_DEFINE(PCRE_HEADER,[<pcre.h>],[Location of pcre header])
 
508
  ])
 
509
 
 
510
 
 
511
dnl Find paths to some shell programs
 
512
AC_PATH_PROG(LN, ln, ln)
 
513
# This must be able to take a -f flag like normal unix ln.
 
514
AC_PATH_PROG(LN_CP_F, ln, ln)
 
515
 
 
516
AC_PATH_PROG(MV, mv, mv)
 
517
AC_PATH_PROG(RM, rm, rm)
 
518
AC_PATH_PROG(CP, cp, cp)
 
519
AC_PATH_PROG(SED, sed, sed)
 
520
AC_PATH_PROG(CMP, cmp, cmp)
 
521
AC_PATH_PROG(CHMOD, chmod, chmod)
 
522
AC_PATH_PROG(HOSTNAME, hostname, hostname)
 
523
# Check for a GNU tar named 'gtar', or 'gnutar' (MacOS X) and
 
524
# fall back to 'tar' otherwise and hope that it's a GNU tar as well
 
525
AC_CHECK_PROGS(TAR, gnutar gtar tar)
 
526
 
 
527
dnl We use a path for perl so the script startup works
 
528
dnl We make sure to use perl, not perl5, in hopes that the RPMs will
 
529
dnl not depend on the perl5 binary being installed (probably a bug in RPM)
 
530
AC_PATH_PROG(PERL, perl, no)
 
531
if test "$PERL" != "no" && $PERL -e 'require 5' > /dev/null 2>&1
 
532
then
 
533
  PERL5=$PERL
 
534
else
 
535
  AC_PATH_PROG(PERL5, perl5, no)
 
536
  if test "$PERL5" != no
 
537
  then
 
538
    PERL=$PERL5
 
539
    ac_cv_path_PERL=$ac_cv_path_PERL5
 
540
  fi
 
541
fi
 
542
 
 
543
AC_SUBST(HOSTNAME)
 
544
AC_SUBST(PERL)
 
545
AC_SUBST(PERL5)
 
546
 
 
547
# icheck, used for ABI check
 
548
AC_PATH_PROG(ICHECK, icheck, no)
 
549
# "icheck" is also the name of a file system check program on Tru64.
 
550
# Verify the program found is really the interface checker.
 
551
if test "x$ICHECK" != "xno"
 
552
then
 
553
  AC_MSG_CHECKING(if $ICHECK works as expected)
 
554
  echo "int foo;" > conftest.h
 
555
  $ICHECK --canonify -o conftest.ic conftest.h 2>/dev/null
 
556
  if test -f "conftest.ic"
 
557
  then
 
558
    AC_MSG_RESULT(yes)
 
559
  else
 
560
    AC_MSG_RESULT(no)
 
561
    ICHECK=no
 
562
  fi
 
563
  rm -f conftest.ic conftest.h
 
564
fi
 
565
AC_SUBST(ICHECK)
 
566
 
 
567
# Lock for PS
 
568
AC_PATH_PROG(PS, ps, ps)
 
569
AC_MSG_CHECKING("how to check if pid exists")
 
570
PS=$ac_cv_path_PS
 
571
# Linux style
 
572
if $PS p $$ 2> /dev/null | grep `echo $0 | sed s/\-//` > /dev/null
 
573
then
 
574
  FIND_PROC="$PS p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
 
575
# Solaris
 
576
elif $PS -fp $$ 2> /dev/null | grep $0 > /dev/null
 
577
then
 
578
  FIND_PROC="$PS -p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
 
579
# BSD style
 
580
elif $PS -uaxww 2> /dev/null | grep $0 > /dev/null
 
581
then
 
582
  FIND_PROC="$PS -uaxww | grep -v grep | grep \$\$MYSQLD | grep \" \$\$PID \" > /dev/null"
 
583
# SysV style
 
584
elif $PS -ef 2> /dev/null | grep $0 > /dev/null
 
585
then
 
586
  FIND_PROC="$PS -ef | grep -v grep | grep \$\$MYSQLD | grep \" \$\$PID \" > /dev/null"
 
587
# Do anybody use this?
 
588
elif $PS $$ 2> /dev/null | grep $0 > /dev/null
 
589
then
 
590
  FIND_PROC="$PS \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
 
591
else
 
592
  case $SYSTEM_TYPE in
 
593
    *freebsd*|*dragonfly*|*cygwin*)
 
594
      FIND_PROC="$PS p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
 
595
      ;;
 
596
    *darwin*)
 
597
      FIND_PROC="$PS -uaxww | grep -v grep | grep \$\$MYSQLD | grep \" \$\$PID \" > /dev/null"
 
598
      ;;
 
599
    *)
 
600
      AC_MSG_ERROR([Could not find the right ps switches. Which OS is this ?. See the Installation chapter in the Reference Manual.])
 
601
      ;;
 
602
  esac
 
603
fi
 
604
AC_SUBST(FIND_PROC)
 
605
AC_MSG_RESULT("$FIND_PROC")
 
606
 
 
607
# Check if a pid is valid
 
608
AC_PATH_PROG(KILL, kill, kill)
 
609
AC_MSG_CHECKING("for kill switches")
 
610
if $ac_cv_path_KILL -0 $$
 
611
then
 
612
  CHECK_PID="$ac_cv_path_KILL -0 \$\$PID > /dev/null 2> /dev/null"
 
613
elif kill -s 0 $$
 
614
then
 
615
  CHECK_PID="$ac_cv_path_KILL -s 0 \$\$PID > /dev/null 2> /dev/null"
 
616
else
 
617
  AC_MSG_WARN([kill -0 to check for pid seems to fail])
 
618
    CHECK_PID="$ac_cv_path_KILL -s SIGCONT \$\$PID > /dev/null 2> /dev/null"
 
619
fi
 
620
AC_SUBST(CHECK_PID)
 
621
AC_MSG_RESULT("$CHECK_PID")
 
622
 
 
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
90
631
 
91
632
 
92
633
AC_ARG_WITH([server-suffix],
93
634
    [AS_HELP_STRING([--with-server-suffix],
94
635
      [Append value to the version string.])],
95
 
    [ DRIZZLE_SERVER_SUFFIX="$withval" ]
96
 
    [ DRIZZLE_SERVER_SUFFIX= ])
97
 
 
 
636
    [ DRIZZLE_SERVER_SUFFIX=`echo "$withval" | sed -e  's/^\(...................................\)..*$/\1/'` ],
 
637
    [ DRIZZLE_SERVER_SUFFIX= ]
 
638
    )
98
639
AC_DEFINE_UNQUOTED([DRIZZLE_SERVER_SUFFIX],[$DRIZZLE_SERVER_SUFFIX],
99
640
                   [Append value to the version string])
100
641
 
101
 
 
 
642
# Force use of a curses libs
 
643
AC_ARG_WITH([named-curses-libs],
 
644
    [AS_HELP_STRING([--with-named-curses-libs=ARG],
 
645
            [Use specified curses libraries instead of those
 
646
                automatically found by configure.])],
 
647
    [ with_named_curses=$withval ],
 
648
    [ with_named_curses=no ]
 
649
    )
 
650
 
 
651
AC_ARG_WITH([tcp-port],
 
652
    [AS_HELP_STRING([--with-tcp-port=port-number],
 
653
            [Which port to use for Drizzle services @<:@default=4427@:>@])],
 
654
    [ DRIZZLE_TCP_PORT=$withval ],
 
655
    [ DRIZZLE_TCP_PORT=$DRIZZLE_TCP_PORT_DEFAULT
 
656
      # if we actually defaulted (as opposed to the pathological case of
 
657
      # --with-tcp-port=<DRIZZLE_TCP_PORT_DEFAULT> which might in theory
 
658
      # happen if whole batch of servers was built from a script), set
 
659
      # the default to zero to indicate that; we don't lose information
 
660
      # that way, because 0 obviously indicates that we can get the
 
661
      # default value from DRIZZLE_TCP_PORT. this seems really evil, but
 
662
      # testing for DRIZZLE_TCP_PORT==DRIZZLE_TCP_PORT_DEFAULT would make a
 
663
      # a port of DRIZZLE_TCP_PORT_DEFAULT magic even if the builder did not
 
664
      # intend it to mean "use the default, in fact, look up a good default
 
665
      # from /etc/services if you can", but really, really meant 4427 when
 
666
      # they passed in 4427. When they pass in a specific value, let them
 
667
      # have it; don't second guess user and think we know better, this will
 
668
      # just make people cross.  this makes the the logic work like this
 
669
      # (which is complicated enough):
 
670
      #
 
671
      # - if a port was set during build, use that as a default.
 
672
      #
 
673
      # - otherwise, try to look up a port in /etc/services; if that fails,
 
674
      #   use DRIZZLE_TCP_PORT_DEFAULT (at the time of this writing 4427)
 
675
      #
 
676
      # - allow the DRIZZLE_TCP_PORT environment variable to override that.
 
677
      #
 
678
      # - allow command-line parameters to override all of the above.
 
679
      #
 
680
      # the top-most DRIZZLE_TCP_PORT_DEFAULT is read from win/configure.js,
 
681
      # so don't mess with that.
 
682
      DRIZZLE_TCP_PORT_DEFAULT=0 ]
 
683
    )
 
684
AC_SUBST(DRIZZLE_TCP_PORT)
 
685
# We might want to document the assigned port in the manual.
 
686
AC_SUBST(DRIZZLE_TCP_PORT_DEFAULT)
 
687
AC_DEFINE_UNQUOTED([DRIZZLE_PORT],[$DRIZZLE_TCP_PORT],
 
688
                   [Drizzle port to use])
 
689
AC_DEFINE_UNQUOTED([DRIZZLE_PORT_DEFAULT],[$DRIZZLE_TCP_PORT_DEFAULT],
 
690
                   [If we defaulted to DRIZZLE_PORT, then this will be zero])
 
691
 
 
692
# Use this to set the place used for unix socket used to local communication.
102
693
AC_ARG_WITH([drizzled-user],
103
694
    [AS_HELP_STRING([--with-drizzled-user=username],
104
695
            [What user the drizzled daemon shall be run as.
105
696
                @<:@default=drizzle@:>@])],
106
 
    [ DRIZZLED_USER="$withval" ],
107
 
    [ DRIZZLED_USER=drizzle ])
 
697
    [ DRIZZLED_USER=$withval ],
 
698
    [ DRIZZLED_USER=drizzle ]
 
699
    )
108
700
AC_SUBST(DRIZZLED_USER)
109
701
 
 
702
# If we should allow LOAD DATA LOCAL
 
703
AC_MSG_CHECKING(If we should should enable LOAD DATA LOCAL by default)
 
704
AC_ARG_ENABLE(local-infile,
 
705
    [  --enable-local-infile   Enable LOAD DATA LOCAL INFILE (default: disabled)],
 
706
    [ ENABLED_LOCAL_INFILE=$enableval ],
 
707
    [ ENABLED_LOCAL_INFILE=no ]
 
708
    )
 
709
if test "$ENABLED_LOCAL_INFILE" = "yes"
 
710
then
 
711
  AC_MSG_RESULT([yes])
 
712
  AC_DEFINE([ENABLED_LOCAL_INFILE], [1],
 
713
            [If LOAD DATA LOCAL INFILE should be enabled by default])
 
714
else
 
715
  AC_MSG_RESULT([no])
 
716
fi
 
717
 
 
718
# Types that must be checked AFTER large file support is checked
 
719
AC_TYPE_SIZE_T
 
720
 
 
721
#--------------------------------------------------------------------
 
722
# Check for system header files
 
723
#--------------------------------------------------------------------
 
724
 
 
725
AC_HEADER_DIRENT
 
726
AC_HEADER_STDC
 
727
AC_HEADER_SYS_WAIT
 
728
AC_HEADER_STDBOOL
 
729
AC_CHECK_HEADERS(fcntl.h float.h fpu_control.h ieeefp.h)
 
730
AC_CHECK_HEADERS(limits.h pwd.h select.h linux/config.h)
 
731
AC_CHECK_HEADERS(sys/fpu.h utime.h sys/utime.h )
 
732
AC_CHECK_HEADERS(synch.h sys/mman.h sys/socket.h)
 
733
AC_CHECK_HEADERS([curses.h term.h],[],[],
 
734
[[#ifdef HAVE_CURSES_H
 
735
# include <curses.h>
 
736
#endif
 
737
]])
 
738
AC_CHECK_HEADERS(termio.h termios.h sched.h alloca.h)
 
739
AC_CHECK_HEADERS(sys/prctl.h ieeefp.h)
 
740
AC_CHECK_HEADERS(execinfo.h)
 
741
 
 
742
#--------------------------------------------------------------------
 
743
# Check for system libraries. Adds the library to $LIBS
 
744
# and defines HAVE_LIBM etc
 
745
#--------------------------------------------------------------------
 
746
 
 
747
AC_CHECK_LIB(m, floor, [], AC_CHECK_LIB(m, __infinity))
 
748
 
 
749
AC_CHECK_FUNC(setsockopt, [], [AC_CHECK_LIB(socket, setsockopt)])
 
750
AC_CHECK_FUNC(yp_get_default_domain, [],
 
751
  [AC_CHECK_LIB(nsl, yp_get_default_domain)])
 
752
AC_CHECK_FUNC(p2open, [], [AC_CHECK_LIB(gen, p2open)])
 
753
# This may get things to compile even if bind-8 is installed
 
754
AC_CHECK_FUNC(bind, [], [AC_CHECK_LIB(bind, bind)])
 
755
# Check if crypt() exists in libc or libcrypt, sets LIBS if needed
 
756
AC_SEARCH_LIBS(crypt, crypt, AC_DEFINE(HAVE_CRYPT, 1, [crypt]))
 
757
 
 
758
# Check rt for aio_read
 
759
AC_CHECK_LIB(rt, aio_read)
 
760
 
 
761
# For the sched_yield() function on Solaris
 
762
AC_CHECK_FUNC(sched_yield, [],
 
763
  [AC_CHECK_LIB(posix4, [sched_yield],
 
764
    [AC_DEFINE(HAVE_SCHED_YIELD) LIBS="$LIBS -lposix4"])])
 
765
 
 
766
if test "$ac_cv_header_termio_h" = "no" -a "$ac_cv_header_termios_h" = "no"
 
767
then
 
768
  AC_CHECK_FUNC(gtty, [], [AC_CHECK_LIB(compat, gtty)])
 
769
fi
 
770
 
 
771
AC_CHECK_TYPES([fp_except], [], [], [
 
772
#include <sys/types.h>
 
773
#include <ieeefp.h>
 
774
])
 
775
 
 
776
my_save_LIBS="$LIBS"
 
777
LIBS=""
 
778
AC_CHECK_LIB(dl,dlopen)
 
779
AC_CHECK_FUNCS(dlopen)
 
780
if test "$ac_cv_func_dlopen" != "yes"
 
781
then
 
782
  AC_MSG_ERROR([Drizzle requires dlopen])
 
783
fi
 
784
LIBDL_LIBS="$LIBS"
 
785
LIBS="$my_save_LIBS"
 
786
AC_SUBST(LIBDL_LIBS)
 
787
 
 
788
 
 
789
AC_ARG_WITH([fast-mutexes],
 
790
    [AS_HELP_STRING([--with-fast-mutexes],
 
791
            [Compile with fast mutexes  @<:@default=off@:>@])],
 
792
    [with_fast_mutexes=$withval],
 
793
    [with_fast_mutexes=no])
 
794
 
 
795
if test "$with_fast_mutexes" != "no"
 
796
then
 
797
        AC_DEFINE([MY_PTHREAD_FASTMUTEX], [1], 
 
798
                        [Define to 1 if you want to use fast mutexes])
 
799
fi
 
800
 
 
801
AM_CONDITIONAL(BUILD_FAST_MUTEX,[test "$with_fast_mutexes" != "no"])
 
802
 
 
803
AC_ARG_WITH([atomic-ops],
 
804
    [AS_HELP_STRING([--with-atomic-ops=rwlocks|smp|up],
 
805
       [Implement atomic operations using pthread rwlocks or atomic CPU
 
806
        instructions for multi-processor or uniprocessor
 
807
        configuration. By default gcc built-in sync functions are used,
 
808
        if available and 'smp' configuration otherwise.])],
 
809
    [with_atomic_ops="$withval"],
 
810
    [with_atomic_ops=smp])
 
811
 
 
812
case "$with_atomic_ops" in
 
813
  "up") AC_DEFINE([MY_ATOMIC_MODE_DUMMY], [1],
 
814
                  [Assume single-CPU mode, no concurrency]) ;;
 
815
  "rwlocks") AC_DEFINE([MY_ATOMIC_MODE_RWLOCKS], [1],
 
816
                  [Use pthread rwlocks for atomic ops]) ;;
 
817
  "smp") 
 
818
    AC_CACHE_CHECK(
 
819
      [whether the compiler provides atomic builtins],
 
820
      [ac_cv_gcc_atomic_builtins],
 
821
      [AC_TRY_COMPILE([],
 
822
        [int main()
 
823
        {
 
824
          int foo= -10; int bar= 10;
 
825
          if (!__sync_fetch_and_add(&foo, bar) || foo)
 
826
            return -1;
 
827
          bar= __sync_lock_test_and_set(&foo, bar);
 
828
          if (bar || foo != 10)
 
829
            return -1;
 
830
          bar= __sync_val_compare_and_swap(&bar, foo, 15);
 
831
          if (bar)
 
832
            return -1;
 
833
          return 0;
 
834
        }],
 
835
       [ac_cv_gcc_atomic_builtins=yes],
 
836
       [ac_cv_gcc_atomic_builtins=no])])
 
837
 
 
838
    if test "x$ac_cv_gcc_atomic_builtins" = "xyes"; then
 
839
      AC_DEFINE(HAVE_GCC_ATOMIC_BUILTINS, 1,
 
840
                [Define to 1 if compiler provides atomic builtins.])
 
841
    fi
 
842
   ;;
 
843
   *) AC_MSG_ERROR(["$with_atomic_ops" is not a valid value for --with-atomic-ops]) ;;
 
844
esac
 
845
 
110
846
 
111
847
AC_ARG_WITH([comment],
112
848
    [AS_HELP_STRING([--with-comment],
113
849
            [Comment about compilation environment. @<:@default=off@:>@])],
114
850
    [with_comment=$withval],
115
851
    [with_comment=no])
116
 
AS_IF([test "$with_comment" != "no"],[
 
852
if test "$with_comment" != "no"
 
853
then
117
854
  COMPILATION_COMMENT=$with_comment
118
 
],[
119
 
  COMPILATION_COMMENT="Source distribution (${PANDORA_RELEASE_COMMENT})"
120
 
])
 
855
else
 
856
  COMPILATION_COMMENT="Source distribution"
 
857
fi
121
858
AC_DEFINE_UNQUOTED([COMPILATION_COMMENT],["$COMPILATION_COMMENT"],
122
859
                   [Comment about compilation environment])
123
860
 
 
861
dnl Checks for typedefs, structures, and compiler characteristics.
 
862
AC_C_CONST
 
863
AC_C_INLINE
 
864
AC_C_VOLATILE
 
865
AC_TYPE_OFF_T
 
866
AC_HEADER_TIME
 
867
AC_STRUCT_TM
 
868
# off_t is not a builtin type
 
869
AC_CHECK_SIZEOF(off_t, 4)
 
870
if test "$ac_cv_sizeof_off_t" -eq 0
 
871
then
 
872
  AC_MSG_ERROR("Drizzle needs a off_t type.")
 
873
fi
 
874
 
 
875
dnl
 
876
dnl check if time_t is unsigned
 
877
dnl
 
878
 
 
879
DRIZZLE_CHECK_TIME_T
 
880
 
 
881
 
 
882
# This always gives a warning. Ignore it unless you are cross compiling
 
883
AC_C_BIGENDIAN
 
884
#---START: Used in for client configure
 
885
# Check base type of last arg to accept
 
886
DRIZZLE_TYPE_ACCEPT
 
887
#---END:
 
888
# Figure out what type of struct rlimit to use with setrlimit
 
889
DRIZZLE_TYPE_STRUCT_RLIMIT
 
890
# Find where the stack goes
 
891
DRIZZLE_STACK_DIRECTION
 
892
# We want to skip alloca on irix unconditionally. It may work on some version..
 
893
DRIZZLE_FUNC_ALLOCA
 
894
# Do struct timespec have members tv_sec or ts_sec
 
895
DRIZZLE_TIMESPEC_TS
 
896
# Do we have the tzname variable
 
897
DRIZZLE_TZNAME
 
898
AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>])
 
899
AC_CHECK_TYPES([uint, ulong])
 
900
 
 
901
DRIZZLE_PTHREAD_YIELD
 
902
 
 
903
 
 
904
dnl Checks for header files.
 
905
AC_CHECK_HEADERS(malloc.h)
 
906
 
 
907
dnl Checks for library functions.
 
908
AC_FUNC_ALLOCA
 
909
AC_PROG_GCC_TRADITIONAL
 
910
AC_TYPE_SIGNAL
 
911
 
 
912
AC_CHECK_FUNCS(issetugid)
 
913
 
 
914
# from old readline settting:
 
915
 
 
916
MAKE_SHELL=/bin/sh
 
917
AC_SUBST(MAKE_SHELL)
 
918
 
 
919
# Already-done: stdlib.h string.h unistd.h termios.h
 
920
AC_CHECK_HEADERS(stdarg.h dirent.h locale.h ndir.h sys/dir.h \
 
921
 sys/ndir.h sys/select.h \
 
922
 sys/mman.h termcap.h termio.h asm/termbits.h grp.h \
 
923
 paths.h)
 
924
 
 
925
# Already-done: strcasecmp
 
926
AC_CHECK_FUNCS(lstat select)
 
927
 
 
928
AC_HEADER_STAT
 
929
DRIZZLE_SIGNAL_CHECK
 
930
DRIZZLE_CHECK_GETPW_FUNCS
 
931
DRIZZLE_HAVE_TIOCGWINSZ
 
932
DRIZZLE_HAVE_TIOCSTAT
124
933
 
125
934
#########################################################################
126
935
 
127
 
 
128
 
dnl Has to be done late, as the plugin may need to check for existence of
129
 
dnl functions tested above
130
 
PANDORA_PLUGINS([drizzled/module/load_list.h])
 
936
dnl Checks for library functions.
 
937
 
 
938
AC_FUNC_UTIME_NULL
 
939
AC_FUNC_VPRINTF
 
940
 
 
941
AC_CHECK_FUNCS(fcntl)
 
942
if test "x$ac_cv_func_fcntl" != "xyes"
 
943
then
 
944
  AC_MSG_ERROR("Drizzle requires fcntl.")
 
945
fi
 
946
 
 
947
AC_CONFIG_LIBOBJ_DIR([gnulib])
 
948
 
 
949
AC_CHECK_FUNCS( \
 
950
  cuserid fchmod \
 
951
  fdatasync fpresetsticky fpsetmask fsync \
 
952
  getpassphrase getpwnam \
 
953
  getpwuid getrlimit getrusage index initgroups isnan \
 
954
  localtime_r gethrtime gmtime_r \
 
955
  madvise \
 
956
  mkstemp mlockall poll pread pthread_attr_create mmap mmap64 \
 
957
  pthread_attr_getstacksize pthread_attr_setprio pthread_attr_setschedparam \
 
958
  pthread_attr_setstacksize pthread_condattr_create pthread_getsequence_np \
 
959
  pthread_key_delete pthread_rwlock_rdlock pthread_setprio \
 
960
  pthread_setprio_np pthread_setschedparam pthread_sigmask readlink \
 
961
  realpath rename rwlock_init setupterm \
 
962
  sigaction \
 
963
  sigthreadmask \
 
964
  snprintf strpbrk \
 
965
  tell tempnam \
 
966
  backtrace backtrace_symbols backtrace_symbols_fd)
 
967
 
 
968
AC_LANG_PUSH(C++)
 
969
# Test whether madvise() is declared in C++ code -- it is not on some
 
970
# systems, such as Solaris
 
971
AC_CHECK_DECLS([madvise], [], [], [AC_INCLUDES_DEFAULT[
 
972
#if HAVE_SYS_MMAN_H
 
973
#include <sys/types.h>
 
974
#include <sys/mman.h>
 
975
#endif
 
976
]])
 
977
AC_LANG_POP()
 
978
 
 
979
 
 
980
AM_CONDITIONAL(BUILD_THR_RWLOCK,[test "$ac_cv_func_rwlock_init" -a "$ac_cv_funn_pthread_rwlock_rdlock"])
 
981
 
 
982
 
 
983
# Sanity check: We chould not have any fseeko symbol unless
 
984
# large_file_support=yes
 
985
AC_CHECK_FUNC(fseeko,
 
986
[if test "$large_file_support" = no -a "x$TARGET_LINUX" = "xtrue";
 
987
then
 
988
  AC_MSG_ERROR("Found fseeko symbol but large_file_support is not enabled!")
 
989
fi]
 
990
)
 
991
 
 
992
# Check definition of pthread_getspecific
 
993
AC_CACHE_CHECK([args to pthread_getspecific], [mysql_cv_getspecific_args],
 
994
  [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 
995
#if !defined(_REENTRANT)
 
996
#define _REENTRANT
 
997
#endif
 
998
#ifndef _POSIX_PTHREAD_SEMANTICS 
 
999
#define _POSIX_PTHREAD_SEMANTICS 
 
1000
#endif
 
1001
#include <pthread.h> ]], [[ void *pthread_getspecific(pthread_key_t key);
 
1002
pthread_getspecific((pthread_key_t) NULL); ]])],
 
1003
    [mysql_cv_getspecific_args=POSIX],
 
1004
    [mysql_cv_getspecific_args=other])])
 
1005
  if test "$mysql_cv_getspecific_args" = "other"
 
1006
  then
 
1007
    AC_DEFINE([HAVE_NONPOSIX_PTHREAD_GETSPECIFIC], [1],
 
1008
              [For some non posix threads])
 
1009
  fi
 
1010
 
 
1011
  # Check definition of pthread_mutex_init
 
1012
  AC_CACHE_CHECK([args to pthread_mutex_init], [mysql_cv_mutex_init_args],
 
1013
    [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 
1014
#ifndef _REENTRANT
 
1015
#define _REENTRANT
 
1016
#endif
 
1017
#ifndef _POSIX_PTHREAD_SEMANTICS
 
1018
#define _POSIX_PTHREAD_SEMANTICS 
 
1019
#endif
 
1020
#include <pthread.h> ]], [[ 
 
1021
  pthread_mutexattr_t attr;
 
1022
  pthread_mutex_t mp;
 
1023
  pthread_mutex_init(&mp,&attr); ]])],
 
1024
      [mysql_cv_mutex_init_args=POSIX],
 
1025
      [mysql_cv_mutex_init_args=other])])
 
1026
  if test "$mysql_cv_mutex_init_args" = "other"
 
1027
  then
 
1028
    AC_DEFINE([HAVE_NONPOSIX_PTHREAD_MUTEX_INIT], [1],
 
1029
              [For some non posix threads])
 
1030
  fi
 
1031
#---END:
 
1032
 
 
1033
#---START: Used in for client configure
 
1034
# Check definition of readdir_r
 
1035
AC_CACHE_CHECK([args to readdir_r], [mysql_cv_readdir_r],
 
1036
  [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
 
1037
#ifndef _REENTRANT
 
1038
#define _REENTRANT
 
1039
#endif
 
1040
#ifndef _POSIX_PTHREAD_SEMANTICS 
 
1041
#define _POSIX_PTHREAD_SEMANTICS 
 
1042
#endif
 
1043
#include <pthread.h>
 
1044
#include <dirent.h>]], [[ int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result);
 
1045
readdir_r((DIR *) NULL, (struct dirent *) NULL, (struct dirent **) NULL); ]])],
 
1046
    [mysql_cv_readdir_r=POSIX],
 
1047
    [mysql_cv_readdir_r=other])])
 
1048
if test "$mysql_cv_readdir_r" = "POSIX"
 
1049
then
 
1050
  AC_DEFINE([HAVE_READDIR_R], [1], [POSIX readdir_r])
 
1051
fi
 
1052
 
 
1053
# Check definition of posix sigwait()
 
1054
AC_CACHE_CHECK([style of sigwait], [mysql_cv_sigwait],
 
1055
  [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
 
1056
#ifndef _REENTRANT
 
1057
#define _REENTRANT
 
1058
#endif
 
1059
#ifndef _POSIX_PTHREAD_SEMANTICS
 
1060
#define _POSIX_PTHREAD_SEMANTICS 
 
1061
#endif
 
1062
#include <pthread.h>
 
1063
#include <signal.h>
 
1064
      ]], [[
 
1065
#ifndef _AIX
 
1066
sigset_t set;
 
1067
int sig;
 
1068
sigwait(&set,&sig);
 
1069
#endif
 
1070
      ]])],
 
1071
    [mysql_cv_sigwait=POSIX],
 
1072
    [mysql_cv_sigwait=other])])
 
1073
if test "$mysql_cv_sigwait" = "POSIX"
 
1074
then
 
1075
  AC_DEFINE([HAVE_SIGWAIT], [1], [POSIX sigwait])
 
1076
fi
 
1077
 
 
1078
if test "$mysql_cv_sigwait" != "POSIX"
 
1079
then
 
1080
unset mysql_cv_sigwait
 
1081
# Check definition of posix sigwait()
 
1082
AC_CACHE_CHECK([style of sigwait], [mysql_cv_sigwait],
 
1083
  [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
 
1084
#ifndef _REENTRANT
 
1085
#define _REENTRANT
 
1086
#endif
 
1087
#ifndef _POSIX_PTHREAD_SEMANTICS
 
1088
#define _POSIX_PTHREAD_SEMANTICS 
 
1089
#endif
 
1090
#include <pthread.h>
 
1091
#include <signal.h>
 
1092
      ]], [[
 
1093
sigset_t set;
 
1094
int sig;
 
1095
sigwait(&set);
 
1096
      ]])],
 
1097
    [mysql_cv_sigwait=NONPOSIX],
 
1098
    [mysql_cv_sigwait=other])])
 
1099
if test "$mysql_cv_sigwait" = "NONPOSIX"
 
1100
then
 
1101
  AC_DEFINE([HAVE_NONPOSIX_SIGWAIT], [1], [sigwait with one argument])
 
1102
fi
 
1103
fi
 
1104
#---END:
 
1105
 
 
1106
# Check if pthread_attr_setscope() exists
 
1107
AC_CACHE_CHECK([for pthread_attr_setscope], [mysql_cv_pthread_attr_setscope],
 
1108
  [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
 
1109
#ifndef _REENTRANT
 
1110
#define _REENTRANT
 
1111
#endif
 
1112
#ifndef _POSIX_PTHREAD_SEMANTICS
 
1113
#define _POSIX_PTHREAD_SEMANTICS 
 
1114
#endif
 
1115
#include <pthread.h>
 
1116
      ]], [[
 
1117
pthread_attr_t thr_attr;
 
1118
pthread_attr_setscope(&thr_attr,0);
 
1119
      ]])],
 
1120
    [mysql_cv_pthread_attr_setscope=yes],
 
1121
    [mysql_cv_pthread_attr_setscope=no])])
 
1122
if test "$mysql_cv_pthread_attr_setscope" = "yes"
 
1123
then
 
1124
  AC_DEFINE([HAVE_PTHREAD_ATTR_SETSCOPE], [1], [pthread_attr_setscope])
 
1125
fi
 
1126
 
 
1127
AC_LANG_PUSH([C++])
 
1128
AC_CHECK_HEADERS(cxxabi.h)
 
1129
AC_CACHE_CHECK([checking for abi::__cxa_demangle], mysql_cv_cxa_demangle,
 
1130
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <cxxabi.h>]], [[
 
1131
  char *foo= 0; int bar= 0;
 
1132
  foo= abi::__cxa_demangle(foo, foo, 0, &bar);
 
1133
]])],[mysql_cv_cxa_demangle=yes],[mysql_cv_cxa_demangle=no])])
 
1134
AC_LANG_POP([])
 
1135
 
 
1136
if test "x$mysql_cv_cxa_demangle" = xyes; then
 
1137
  AC_DEFINE(HAVE_ABI_CXA_DEMANGLE, 1,
 
1138
            [Define to 1 if you have the `abi::__cxa_demangle' function.])
 
1139
fi
 
1140
 
 
1141
#--------------------------------------------------------------------
 
1142
# Check for requested features
 
1143
#--------------------------------------------------------------------
 
1144
 
 
1145
DRIZZLE_CHECK_MAX_INDEXES
 
1146
 
 
1147
#--------------------------------------------------------------------
 
1148
# Declare our plugin modules
 
1149
# Has to be done late, as the plugin may need to check for existence of
 
1150
# functions tested above
 
1151
#--------------------------------------------------------------------
 
1152
 
 
1153
DRIZZLE_CONFIGURE_PLUGINS([none])
 
1154
 
 
1155
AC_SUBST(mysql_plugin_dirs)
 
1156
AC_SUBST(mysql_plugin_libs)
 
1157
AC_SUBST(mysql_plugin_defs)
 
1158
AC_SUBST(DRIZZLED_PLUGIN_DEP_LIBS)
 
1159
 
 
1160
 
 
1161
AC_ARG_ENABLE([profiling],
 
1162
    [AS_HELP_STRING([--enable-profiling],
 
1163
       [Toggle profiling @<:@default=off@:>@])],
 
1164
    [ac_profiling="$enableval"],
 
1165
    [ac_profiling="no"])
 
1166
 
 
1167
AC_ARG_ENABLE([coverage],
 
1168
    [AS_HELP_STRING([--enable-coverage],
 
1169
       [Toggle coverage @<:@default=off@:>@])],
 
1170
    [ac_coverage="$enableval"],
 
1171
    [ac_coverage="no"])
 
1172
 
 
1173
AC_ARG_ENABLE([pedantic-warnings],
 
1174
    [AS_HELP_STRING([--disable-pedantic-warnings],
 
1175
       [Toggle pedanticness @<:@default=on@:>@])],
 
1176
    [ac_warn_pedantic="$enableval"],
 
1177
    [ac_warn_pedantic="yes"])
 
1178
 
 
1179
AC_ARG_ENABLE([fail],
 
1180
    [AS_HELP_STRING([--disable-fail],
 
1181
       [Turn warnings into failures @<:@default=on@:>@])],
 
1182
    [ac_warn_fail="$enableval"],
 
1183
    [ac_warn_fail="yes"])
 
1184
 
 
1185
AC_ARG_ENABLE([unreachable],
 
1186
    [AS_HELP_STRING([--enable-unreachable],
 
1187
       [Enable warnings about unreachable code @<:@default=off@:>@])],
 
1188
    [ac_warn_unreachable="$enableval"],
 
1189
    [ac_warn_unreachable="no"])
 
1190
 
 
1191
AC_ARG_ENABLE([longlong-warnings],
 
1192
    [AS_HELP_STRING([--enable-longlong-warnings],
 
1193
       [Enable warnings about longlong in C++ @<:@default=off@:>@])],
 
1194
    [ac_warn_longlong="$enableval"],
 
1195
    [ac_warn_longlong="no"])
 
1196
 
 
1197
AC_ARG_ENABLE([strict-aliasing],
 
1198
    [AS_HELP_STRING([--enable-strict-aliasing],
 
1199
       [Enable warnings about stict-aliasing @<:@default=off@:>@])],
 
1200
    [ac_warn_strict_aliasing="$enableval"],
 
1201
    [ac_warn_strict_aliasing="no"])
 
1202
 
 
1203
AC_ARG_ENABLE([cast-warnings],
 
1204
    [AS_HELP_STRING([--enable-cast-warnings],
 
1205
       [Enable warnings about use of old C-style casts @<:@default=off@:>@])],
 
1206
    [ac_warn_cast="$enableval"],
 
1207
    [ac_warn_cast="no"])
 
1208
 
 
1209
AC_ARG_ENABLE([effective-style],
 
1210
    [AS_HELP_STRING([--enable-effective-style],
 
1211
       [Enable warnings violating Effective C++ Style Guidelines @<:@default=off@:>@])],
 
1212
    [ac_warn_effc="$enableval"],
 
1213
    [ac_warn_effc="no"])
 
1214
 
 
1215
AC_ARG_ENABLE([shadow],
 
1216
    [AS_HELP_STRING([--disable-shadow],
 
1217
       [Disables warnings about scope shadowing @<:@default=on@:>@])],
 
1218
    [ac_warn_shadow="$enableval"],
 
1219
    [ac_warn_shadow="yes"])
 
1220
 
 
1221
AC_ARG_ENABLE([conversion],
 
1222
    [AS_HELP_STRING([--enable-conversion],
 
1223
       [Enables conversion warnings @<:@default=off@:>@])],
 
1224
    [ac_warn_conversion="$enableval"],
 
1225
    [ac_warn_conversion="no"])
 
1226
 
 
1227
AC_ARG_ENABLE([datarace],
 
1228
    [AS_HELP_STRING([--enable-datarace],
 
1229
       [Enables Sun Studio data race detection @<:@default=off@:>@])],
 
1230
    [ac_datarace="$enableval"],
 
1231
    [ac_datarace="no"])
 
1232
 
 
1233
AC_ARG_ENABLE([exceptions],
 
1234
    [AS_HELP_STRING([--disable-exceptions],
 
1235
        [Disables use of Exceptions in the build @<:@default=on@:>@])],
 
1236
    [ac_exceptions="$enableval"],
 
1237
    [ac_exceptions="yes"])
 
1238
 
 
1239
if test "$GCC" = "yes"
 
1240
then
 
1241
 
 
1242
  if test "$ac_warn_fail" = "yes"
 
1243
  then
 
1244
    W_FAIL="-Werror"
 
1245
  fi
 
1246
  BASE_WARNINGS="-Wall -Wextra ${W_FAIL}"
 
1247
 
 
1248
  if test "$ac_warn_longlong" = "yes"
 
1249
  then
 
1250
    W_LONGLONG="-Wlong-long"
 
1251
  else
 
1252
    W_LONGLONG="-Wno-long-long"
 
1253
  fi
 
1254
 
 
1255
  if test "$ac_warn_strict_aliasing" = "yes"
 
1256
  then
 
1257
    W_STRICT_ALIASING="-Wstrict-aliasing"
 
1258
  else
 
1259
    W_STRICT_ALIASING="-Wno-strict-aliasing"
 
1260
  fi
 
1261
 
 
1262
  if test "$ac_warn_shadow" = "yes"
 
1263
  then
 
1264
    W_SHADOW="-Wshadow"
 
1265
    NO_SHADOW="-Wno-shadow"
 
1266
  else
 
1267
    W_SHADOW="-Wno-shadow"
 
1268
    NO_SHADOW=""
 
1269
  fi
 
1270
 
 
1271
  if test "$ac_profiling" = "yes"
 
1272
  then
 
1273
    GPROF_PROFILING="-pg"
 
1274
    save_LIBS="${LIBS}"
 
1275
    LIBS=""
 
1276
    AC_CHECK_LIB(c_p, read)
 
1277
    LIBC_P="${LIBS}"
 
1278
    LIBS="${save_LIBS}"
 
1279
  else
 
1280
    GPROF_PROFILING=" "
 
1281
  fi
 
1282
 
 
1283
  if test "$ac_coverage" = "yes"
 
1284
  then
 
1285
    GPROF_COVERAGE="-fprofile-arcs -ftest-coverage"
 
1286
  else
 
1287
    GPROF_COVERAGE=" "
 
1288
  fi
 
1289
 
 
1290
  if test "$ac_warn_pedantic" = "yes"
 
1291
  then
 
1292
    save_CXXFLAGS="${CXXFLAGS}"
 
1293
    CXXFLAGS="${CXXFLAGS} ${W_FAIL} -Wredundant-decls"
 
1294
    AC_CACHE_CHECK([whether it is safe to use -Wredundant-decls],
 
1295
      [ac_cv_safe_to_use_Wredundant_decls_],
 
1296
      [AC_LANG_PUSH(C++)
 
1297
       AC_COMPILE_IFELSE(
 
1298
         [AC_LANG_PROGRAM([
 
1299
template <typename E> struct C { void foo(); };
 
1300
template <typename E> void C<E>::foo() { }
 
1301
template <> void C<int>::foo();
 
1302
            AC_INCLUDES_DEFAULT])],
 
1303
          [ac_cv_safe_to_use_Wredundant_decls_=yes],
 
1304
          [ac_cv_safe_to_use_Wredundant_decls_=no])
 
1305
        AC_LANG_POP()])
 
1306
    if test $ac_cv_safe_to_use_Wredundant_decls_ = yes
 
1307
    then
 
1308
      GXX_W_REDUNDANT_DECLS="-Wredundant-decls"
 
1309
    else
 
1310
      GXX_W_REDUNDANT_DECLS="-Wno-redundant-decls"
 
1311
    fi
 
1312
    
 
1313
    GCC_PEDANTIC="-pedantic -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls ${W_STRICT_ALIASING}"
 
1314
    GXX_PEDANTIC="-pedantic -Wundef -Woverloaded-virtual  -Wnon-virtual-dtor -Wctor-dtor-privacy ${GXX_W_REDUNDANT_DECLS} ${W_LONGLONG} ${W_STRICT_ALIASING}"
 
1315
 
 
1316
    AC_CACHE_CHECK([whether __attribute__ visibility "hidden" is supported],
 
1317
      [ac_cv_can_use_hidden_],
 
1318
      [AC_LANG_PUSH(C++)
 
1319
       AC_COMPILE_IFELSE(
 
1320
         [AC_LANG_PROGRAM([
 
1321
          AC_INCLUDES_DEFAULT
 
1322
__attribute__((visibility ("hidden")))
 
1323
void testme() {  };],[
 
1324
     testme();])],  
 
1325
         [ac_cv_can_use_hidden_=yes],
 
1326
         [ac_cv_can_use_hidden_=no])
 
1327
       AC_LANG_POP()])
 
1328
    if test "$ac_cv_can_use_hidden_" = "yes"
 
1329
    then
 
1330
      AC_DEFINE(HAVE_ATTR_HIDDEN, 1,
 
1331
                [Define to 1 if you have support for __attribute__((visibility("hidden")))])
 
1332
    fi
 
1333
 
 
1334
    CXXFLAGS="${save_CXXFLAGS}"
 
1335
  fi
 
1336
 
 
1337
  if test "$ac_warn_unreachable" = "yes"
 
1338
  then
 
1339
    W_UNREACHABLE="-Wunreachable-code"
 
1340
  fi
 
1341
 
 
1342
  if test "$ac_warn_cast" = "yes"
 
1343
  then
 
1344
    W_CAST="-Wold-style-cast"
 
1345
  fi
 
1346
 
 
1347
  if test "$ac_warn_effc" = "yes"
 
1348
  then
 
1349
    W_EFFC="-Weffc++"
 
1350
  fi
 
1351
 
 
1352
  if test "$ac_warn_conversion" = "yes"
 
1353
  then
 
1354
    W_CONVERSION="-Wconversion"
 
1355
  fi
 
1356
 
 
1357
  CC_WARNINGS="${C99_SUPPORT_HACK} ${BASE_WARNINGS} ${GCC_PEDANTIC} ${W_UNREACHABLE} ${GPROF_PROFILING} ${GPROF_COVERAGE} ${W_SHADOW} ${W_CONVERSION}"
 
1358
  CXX_WARNINGS="${BASE_WARNINGS} ${GXX_PEDANTIC} ${W_UNREACHABLE} ${GPROF_PROFILING} ${GPROF_COVERAGE} ${W_CAST} ${W_SHADOW} ${W_EFFC} ${W_CONVERSION}"
 
1359
 
 
1360
  if test "$ac_exceptions" = "no"
 
1361
  then
 
1362
    NO_EXCEPTIONS="-fno-exceptions"
 
1363
    W_EXCEPTIONS="-fexceptions"
 
1364
  fi
 
1365
  NO_REDUNDANT_DECLS="-Wno-redundant-decls"
 
1366
  # Disable exceptions as they seams to create problems with gcc and threads.
 
1367
  # drizzled doesn't use run-time-type-checking, so we disable it.
 
1368
  CXXFLAGS="${CXXFLAGS} -fno-rtti"
 
1369
  CPPFLAGS="${CPPFLAGS} -fpch-deps"
 
1370
  PROTOSKIP_WARNINGS="${NO_SHADOW}"
 
1371
fi
 
1372
if test "$SUNCC" = "yes"
 
1373
then
 
1374
  if test "$ac_datarace" = "yes"
 
1375
  then
 
1376
    CFLAGS="${CFLAGS} -xinstrument=datarace"
 
1377
    CXXFLAGS="${CXXFLAGS} -xinstrument=datarace"
 
1378
  fi
 
1379
 
 
1380
  if test "$ac_warn_fail" = "yes"
 
1381
  then
 
1382
    W_FAIL="-errwarn=%all"
 
1383
  fi
 
1384
 
 
1385
  CC_WARNINGS="-v -errtags=yes -erroff=E_ATTRIBUTE_NOT_VAR ${W_FAIL}"
 
1386
  CXX_WARNINGS="+w +w2 -xport64 -errtags=yes -erroff=attrskipunsup,doubunder,reftotemp,inllargeuse,truncwarn1,signextwarn ${W_FAIL}" 
 
1387
  PROTOSKIP_WARNINGS="-erroff=attrskipunsup,doubunder,reftotemp,wbadinitl,identexpected,inllargeuse,truncwarn1,signextwarn"
 
1388
  NO_UNREACHED="-erroff=E_STATEMENT_NOT_REACHED"
 
1389
  if test "$ac_exceptions" = "no"
 
1390
  then
 
1391
    NO_EXCEPTIONS="-features=no%except"
 
1392
    W_EXCEPTIONS="-features=except"
 
1393
  fi
 
1394
fi
 
1395
AC_SUBST(NO_EXCEPTIONS)
 
1396
AC_SUBST(W_EXCEPTIONS)
 
1397
AC_SUBST(NO_SHADOW)
 
1398
AC_SUBST(W_SHADOW)
 
1399
AC_SUBST(NO_REDUNDANT_DECLS)
 
1400
AC_SUBST(PROTOSKIP_WARNINGS)
 
1401
AC_SUBST(NO_UNREACHED)
 
1402
 
 
1403
if test "$ac_cv_func_timegm" = "no" -o "$gl_cv_func_gnu_getopt" = "no"
 
1404
then
 
1405
  CPPFLAGS="-I\$(top_srcdir)/gnulib -I\$(top_builddir)/gnulib ${CPPFLAGS}"
 
1406
fi
 
1407
CPPFLAGS="-I\$(top_srcdir) -I\$(top_builddir) ${CPPFLAGS}"
 
1408
 
 
1409
AM_CPPFLAGS="${CPPFLAGS}"
 
1410
AM_CFLAGS="${CC_WARNINGS} ${CFLAGS}"
 
1411
AM_CXXFLAGS="${CXX_WARNINGS} ${NO_EXCEPTIONS} ${CXXFLAGS}"
 
1412
 
 
1413
AC_SUBST([AM_CPPFLAGS])
 
1414
AC_SUBST([AM_CFLAGS])
 
1415
AC_SUBST([AM_CXXFLAGS])
 
1416
 
 
1417
dnl We've collected the flags in AM_*FLAGS now, so blank these.
 
1418
CFLAGS=""
 
1419
CXXFLAGS=""
 
1420
CPPFLAGS=""
 
1421
 
 
1422
AC_SUBST(pkgplugindir,"\$(pkglibdir)/plugin")
131
1423
 
132
1424
dnl GCC Precompiled Header Support
133
1425
dnl re-enable later
134
1426
dnl AM_CONDITIONAL([BUILD_GCC_PCH],[test "$GCC" = "yes"])
135
1427
AM_CONDITIONAL([BUILD_GCC_PCH],[test "no" = "yes"])
136
1428
 
137
 
AS_IF([test "$lt_cv_prog_gnu_ld" = "yes"],[
138
 
  LDFLAGS="${LDFLAGS} ${LD_VERSION_SCRIPT}"
139
 
  ])
140
 
 
141
 
WITH_VALGRIND
142
 
 
143
 
AC_CONFIG_FILES(Makefile dnl
144
 
 tests/Makefile dnl
145
 
 drizzled/plugin/version.h dnl
146
 
 support-files/libdrizzle.pc dnl
147
 
 support-files/drizzle.server support-files/drizzle-log-rotate
148
 
 support-files/smf/install.sh dnl
149
 
 support-files/drizzle.spec dnl
150
 
 support-files/smf/drizzle.xml dnl
151
 
 support-files/smf/drizzle)
 
1429
AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl
 
1430
 gnulib/Makefile dnl
 
1431
 mystrings/Makefile storage/Makefile dnl
 
1432
 po/Makefile.in dnl
 
1433
 libdrizzleclient/Makefile client/Makefile dnl
 
1434
 drizzled/Makefile dnl
 
1435
 drizzled/serialize/Makefile dnl
 
1436
 drizzled/sql_builtin.cc dnl
 
1437
 support-files/Makefile dnl
 
1438
 tests/Makefile tests/install_test_db dnl
 
1439
 plugin/Makefile dnl
 
1440
 drizzled/drizzled_safe support-files/libdrizzleclient.pc dnl
 
1441
 support-files/drizzle.server support-files/drizzle-log-rotate)
152
1442
 
153
1443
scheduling_plugins_available="
154
1444
  pool_of_threads 
165
1455
  fi
166
1456
done
167
1457
 
 
1458
AC_CONFIG_COMMANDS([timestamp-h], , test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h)
 
1459
 
 
1460
AC_CONFIG_COMMANDS([po/POTFILES.in],[
 
1461
if test "x$EGREP" != "x"
 
1462
then
 
1463
  echo "# This file is auto-generated from configure. Do not edit directly" > po/POTFILES.in.in
 
1464
  # The grep -v 'drizzle-' is to exclude any distcheck leftovers
 
1465
  for f in `find . | grep -v 'drizzle-' | ${EGREP} '\.(cc|c|h|yy)$' | cut -c3- | sort`
 
1466
  do
 
1467
    if grep gettext.h "$f" | grep include >/dev/null 2>&1
 
1468
    then
 
1469
      echo "$f" >> po/POTFILES.in.in
 
1470
    fi
 
1471
  done
 
1472
  if ! diff po/POTFILES.in.in po/POTFILES.in >/dev/null 2>&1
 
1473
  then
 
1474
    mv po/POTFILES.in.in po/POTFILES.in
 
1475
  else
 
1476
    rm po/POTFILES.in.in
 
1477
  fi
 
1478
fi
 
1479
])
 
1480
 
 
1481
# Ensure that table handlers gets all modifications to CFLAGS/CXXFLAGS
 
1482
AC_CONFIG_COMMANDS_POST(ac_configure_args="$ac_configure_args CFLAGS='$CFLAGS' CXXFLAGS='$CXXFLAGS' AM_CFLAGS='$AM_CFLAGS' AM_CXXFLAGS='$AM_CXXFLAGS'")
 
1483
 
168
1484
AC_OUTPUT
169
1485
 
170
1486
echo "---"
171
 
echo "Configuration summary for $PACKAGE_NAME version $VERSION $PANDORA_RELEASE_COMMENT"
 
1487
echo "Configuration summary for $PACKAGE_NAME version $VERSION"
172
1488
echo ""
173
1489
echo "   * Installation prefix:       $prefix"
174
 
echo "   * System type:               $host_vendor-$host_os"
175
 
echo "   * pandora-build version:     PANDORA_CANONICAL_VERSION"
 
1490
echo "   * System type:               $SYSTEM_TYPE"
176
1491
echo "   * Host CPU:                  $host_cpu"
177
1492
echo "   * C Compiler:                $CC_VERSION"
178
1493
echo "   * C++ Compiler:              $CXX_VERSION"
 
1494
echo "   * Build auth_pam:            $ac_cv_header_security_pam_appl_h"
179
1495
echo "   * Assertions enabled:        $ac_cv_assert"
180
1496
echo "   * Debug enabled:             $with_debug"
181
1497
echo "   * Profiling enabled:         $ac_profiling"
182
1498
echo "   * Coverage enabled:          $ac_coverage"
183
 
echo "   * Warnings as failure:       $ac_cv_warnings_as_errors"
 
1499
echo "   * Warnings as failure:       $ac_warn_fail"
 
1500
echo "   * Scheduling Plugins:        $scheduling_plugins"
 
1501
echo "   * C++ cstdint location:      $ac_cv_cxx_cstdint"
 
1502
echo "   * C++ hash_map location:     $ac_cv_cxx_hash_map"
 
1503
echo "   * C++ hash namespace:        $ac_cv_cxx_hash_namespace"
 
1504
echo "   * C++ cmath location:        $ac_cv_cxx_cmath"
 
1505
echo "   * C++ cmath namespace:       $ac_cv_cxx_cmath_namespace"
184
1506
echo ""
185
1507
echo "---"
186
1508
 
187
 
case "$host_os" in
188
 
  *freebsd*)
189
 
    echo "*****"
190
 
    echo "*"
191
 
    echo "*  NOTE: You are on FreeBSD. BSD make will not work."
192
 
    echo "*"
193
 
    echo "*   use 'gmake' To build Drizzle"
194
 
    echo "*"
195
 
    echo "*  And ensure that /usr/local/lib/gcc44 is in your LD_LIBRARY_PATH"
196
 
    echo "*" 
197
 
    echo "*****"
198
 
  ;;
199
 
esac
200
 
 
201
 
 
202
1509
dnl libtoolize scans configure.ac  and needs to see some text
203
1510
m4_define([LIBTOOLIZE_AC_INIT], [])