~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Padraig O'Sullivan
  • Date: 2009-03-21 01:02:23 UTC
  • mto: (960.2.5 mordred)
  • mto: This revision was merged to the branch mainline in revision 961.
  • Revision ID: osullivan.padraig@gmail.com-20090321010223-j8cph7eeyt1u3xol
Fixed function object to ensure it correctly returns a boolean type since
memcmp returns an integer. Added some more comments.

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