~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Stewart Smith
  • Date: 2009-06-16 06:55:11 UTC
  • mto: This revision was merged to the branch mainline in revision 1094.
  • Revision ID: stewart@flamingspork.com-20090616065511-ps3ewfxj7918lwy3
rollback.test for MyISAM temp only.
- rename to myisam_rollback to reflect what it's testing
- just use create temporary table

Show diffs side-by-side

added added

removed removed

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