~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Brian Aker
  • Date: 2009-11-18 22:58:22 UTC
  • mto: (1223.1.1 push) (1226.1.2 push)
  • mto: This revision was merged to the branch mainline in revision 1224.
  • Revision ID: brian@gaz-20091118225822-4ryr9rviir23o0kr
Second pass through bugs related to CREATE TABLE LIKE

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, Inc.
 
4
dnl  Copyright (C) 2009 Sun Microsystems
5
5
dnl
6
6
dnl  This program is free software; you can redistribute it and/or modify
7
7
dnl  it under the terms of the GNU General Public License as published by
20
20
AC_PREREQ(2.59)dnl              Minimum Autoconf version required.
21
21
dnl Version from the AC_INIT call below is overridden later
22
22
dnl So don't update it here
23
 
AC_INIT([drizzle7],[7],[http://bugs.launchpad.net/drizzle])
 
23
AC_INIT([drizzle],[7],[http://bugs.launchpad.net/drizzle])
24
24
AC_CONFIG_SRCDIR([drizzled/drizzled.cc])
25
 
AC_CONFIG_AUX_DIR([config])
26
 
 
27
 
PANDORA_CANONICAL_TARGET(less-warnings, require-cxx, force-gcc42, version-from-vc) 
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
PANDORA_CANONICAL_TARGET(less-warnings, warnings-always-on, use-gnulib, require-cxx, force-gcc42)
 
30
PANDORA_VC_VERSION
 
31
 
 
32
 
 
33
# The port that was assigned by IANA.
 
34
DRIZZLE_TCP_PORT_DEFAULT=4427
 
35
 
 
36
# Set this for plugins to use
 
37
ac_build_drizzle="yes"
 
38
 
55
39
 
56
40
AC_PATH_PROG(GPERF, gperf)
57
41
AS_IF([test "x$GPERF" = "x"],
58
42
      AC_MSG_ERROR("Drizzle requires gperf to build."))
59
43
 
60
 
# libexecinfo provides backtrace_symbols on FreeBSD
61
 
AC_SEARCH_LIBS(backtrace_symbols, [execinfo])
 
44
AC_CHECK_PROGS(YACC, ['bison -y'])
 
45
AS_IF([test "x$YACC" = "x" -a "$ac_cv_building_from_bzr" = "yes"],[
 
46
  AC_MSG_ERROR(["bison is required for Drizzle to build from a bzr branch"])
 
47
])
 
48
 
 
49
 
 
50
PANDORA_WITH_GETTEXT
 
51
 
 
52
dnl We need to turn on our CXXFLAGS to make sure it shows up correctly
 
53
save_CXXFLAGS="${CXXFLAGS}"
 
54
CXXFLAGS="${CXXFLAGS} ${AM_CXXFLAGS}"
 
55
AC_CXX_STL_HASH
 
56
CXXFLAGS="${save_CXXFLAGS}"
 
57
 
 
58
AC_CXX_CSTDINT
 
59
AC_CXX_CINTTYPES
 
60
 
 
61
PANDORA_REQUIRE_PTHREAD
62
62
 
63
63
PANDORA_REQUIRE_LIBPROTOBUF
64
64
PANDORA_PROTOBUF_REQUIRE_VERSION([2.1.0])
65
65
PANDORA_REQUIRE_PROTOC
66
66
 
 
67
#--------------------------------------------------------------------
 
68
# Check for libuuid
 
69
#--------------------------------------------------------------------
 
70
 
 
71
dnl Do this by hand. Need to check for uuid/uuid.h, but uuid may or may
 
72
dnl not be a lib is weird.
 
73
 
 
74
AC_CHECK_HEADERS(uuid/uuid.h)
 
75
if test "x$ac_cv_header_uuid_uuid_h" = "xno"
 
76
then
 
77
  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.])
 
78
fi
 
79
AC_LIB_HAVE_LINKFLAGS(uuid,,
 
80
[
 
81
#include <uuid/uuid.h>
 
82
],
 
83
[
 
84
  uuid_t uout;
 
85
  uuid_generate(uout);
 
86
])
 
87
 
 
88
 
 
89
 
 
90
 
 
91
#--------------------------------------------------------------------
 
92
# Check for tcmalloc/mtmalloc
 
93
#--------------------------------------------------------------------
 
94
 
 
95
PANDORA_HAVE_BETTER_MALLOC
 
96
LIBS="${LIBS} ${BETTER_MALLOC_LIBS}"
 
97
 
 
98
#--------------------------------------------------------------------
 
99
# Check for libdrizzle
 
100
#--------------------------------------------------------------------
 
101
 
67
102
AC_LANG_PUSH(C++)
68
 
PANDORA_REQUIRE_PTHREAD
69
 
PANDORA_REQUIRE_LIBUUID
70
 
PANDORA_REQUIRE_LIBZ
71
 
PANDORA_REQUIRE_LIBPCRE
72
 
PANDORA_REQUIRE_LIBREADLINE
73
 
PANDORA_REQUIRE_LIBDL
 
103
PANDORA_REQUIRE_LIBDRIZZLE
74
104
AC_LANG_POP
75
105
 
76
 
DRIZZLE_STACK_DIRECTION
77
 
 
78
 
PANDORA_USE_BETTER_MALLOC
79
 
 
80
 
PANDORA_DRIZZLE_BUILD
81
 
AC_DEFINE([BUILDING_DRIZZLED],[1],
82
 
          [Define indicating we are building and not consuming drizzle.])
83
 
 
84
 
PANDORA_HAVE_BOOST_TEST
85
 
PANDORA_HAVE_LIBSQLITE3
86
 
 
87
 
AC_CHECK_FUNC(inet_ntoa, [], [AC_CHECK_LIB(nsl, inet_ntoa)])
 
106
 
 
107
#--------------------------------------------------------------------
 
108
# Check for libz
 
109
#--------------------------------------------------------------------
 
110
 
 
111
AC_LIB_HAVE_LINKFLAGS(z,,
 
112
[#include <zlib.h>],
 
113
[
 
114
  crc32(0, Z_NULL, 0);
 
115
])
 
116
AS_IF([test x$ac_cv_libz = xno],
 
117
      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.]))
 
118
 
 
119
#--------------------------------------------------------------------
 
120
# Check for libreadline or compatible (libedit on Mac OS X)
 
121
#--------------------------------------------------------------------
 
122
 
 
123
save_LIBS="${LIBS}"
 
124
LIBS=""
 
125
VL_LIB_READLINE
 
126
AS_IF([test "x$vl_cv_lib_readline" = "xno"],
 
127
      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.]))
 
128
READLINE_LIBS="${LIBS}"
 
129
LIBS="${save_LIBS}"
 
130
AC_SUBST(READLINE_LIBS)
 
131
 
 
132
DRIZZLE_CHECK_NEW_RL_INTERFACE
 
133
 
 
134
#--------------------------------------------------------------------
 
135
# Check for libpcre
 
136
#--------------------------------------------------------------------
 
137
 
 
138
AC_LIB_HAVE_LINKFLAGS(pcre,,
 
139
[#include <pcre.h>],
 
140
[
 
141
  pcre *re= NULL;
 
142
  pcre_version();
 
143
])
 
144
AS_IF([test "x$ac_cv_libpcre" = "xno"],
 
145
[
 
146
  unset ac_cv_libpcre
 
147
  unset HAVE_LIBPCRE
 
148
  unset LIBPCRE
 
149
  unset LIBPCRE_PREFIX
 
150
  unset LTLIBPCRE
 
151
  AC_LIB_HAVE_LINKFLAGS(pcre,,
 
152
  [#include <pcre/pcre.h>],
 
153
  [
 
154
    pcre *re= NULL;
 
155
    pcre_version();
 
156
  ])
 
157
  AS_IF([test "x$ac_cv_libpcre" = "xno"],
 
158
  [
 
159
    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.])
 
160
  ],[
 
161
    AC_DEFINE(PCRE_HEADER,[<pcre/pcre.h>],[Location of pcre header])
 
162
  ])
 
163
],[
 
164
  AC_DEFINE(PCRE_HEADER,[<pcre.h>],[Location of pcre header])
 
165
])
 
166
 
 
167
 
 
168
AC_PATH_PROG(PERL, perl, no)
88
169
 
89
170
 
90
171
AC_ARG_WITH([server-suffix],
91
172
    [AS_HELP_STRING([--with-server-suffix],
92
173
      [Append value to the version string.])],
93
 
    [ DRIZZLE_SERVER_SUFFIX="$withval" ]
94
 
    [ DRIZZLE_SERVER_SUFFIX= ])
95
 
 
 
174
    [ DRIZZLE_SERVER_SUFFIX=`echo "$withval" | sed -e  's/^\(...................................\)..*$/\1/'` ],
 
175
    [ DRIZZLE_SERVER_SUFFIX= ]
 
176
    )
96
177
AC_DEFINE_UNQUOTED([DRIZZLE_SERVER_SUFFIX],[$DRIZZLE_SERVER_SUFFIX],
97
178
                   [Append value to the version string])
98
179
 
99
 
 
 
180
# Force use of a curses libs
 
181
AC_ARG_WITH([named-curses-libs],
 
182
    [AS_HELP_STRING([--with-named-curses-libs=ARG],
 
183
            [Use specified curses libraries instead of those
 
184
                automatically found by configure.])],
 
185
    [ with_named_curses=$withval ],
 
186
    [ with_named_curses=no ]
 
187
    )
 
188
 
 
189
AC_ARG_WITH([tcp-port],
 
190
    [AS_HELP_STRING([--with-tcp-port=port-number],
 
191
            [Which port to use for Drizzle TCP services @<:@default=4427@:>@])],
 
192
    [ DRIZZLE_TCP_PORT=$withval ],
 
193
    [ DRIZZLE_TCP_PORT=$DRIZZLE_TCP_PORT_DEFAULT
 
194
      # if we actually defaulted (as opposed to the pathological case of
 
195
      # --with-tcp-port=<DRIZZLE_TCP_PORT_DEFAULT> which might in theory
 
196
      # happen if whole batch of servers was built from a script), set
 
197
      # the default to zero to indicate that; we don't lose information
 
198
      # that way, because 0 obviously indicates that we can get the
 
199
      # default value from DRIZZLE_TCP_PORT. this seems really evil, but
 
200
      # testing for DRIZZLE_TCP_PORT==DRIZZLE_TCP_PORT_DEFAULT would make a
 
201
      # a port of DRIZZLE_TCP_PORT_DEFAULT magic even if the builder did not
 
202
      # intend it to mean "use the default, in fact, look up a good default
 
203
      # from /etc/services if you can", but really, really meant 4427 when
 
204
      # they passed in 4427. When they pass in a specific value, let them
 
205
      # have it; don't second guess user and think we know better, this will
 
206
      # just make people cross.  this makes the the logic work like this
 
207
      # (which is complicated enough):
 
208
      #
 
209
      # - if a port was set during build, use that as a default.
 
210
      #
 
211
      # - otherwise, try to look up a port in /etc/services; if that fails,
 
212
      #   use DRIZZLE_TCP_PORT_DEFAULT (at the time of this writing 4427)
 
213
      #
 
214
      # - allow the DRIZZLE_TCP_PORT environment variable to override that.
 
215
      #
 
216
      # - allow command-line parameters to override all of the above.
 
217
      #
 
218
      # the top-most DRIZZLE_TCP_PORT_DEFAULT is read from win/configure.js,
 
219
      # so don't mess with that.
 
220
      DRIZZLE_TCP_PORT_DEFAULT=0 ]
 
221
    )
 
222
 
 
223
AC_SUBST(DRIZZLE_TCP_PORT)
 
224
AC_SUBST(DRIZZLE_TCP_PORT_DEFAULT)
 
225
AC_DEFINE_UNQUOTED([DRIZZLE_TCP_PORT],[$DRIZZLE_TCP_PORT],
 
226
                   [Drizzle port to use])
 
227
AC_DEFINE_UNQUOTED([DRIZZLE_TCP_PORT_DEFAULT],[$DRIZZLE_TCP_PORT_DEFAULT],
 
228
                   [If we defaulted to DRIZZLE_PORT, then this will be zero])
 
229
 
 
230
 
 
231
# Use this to set the place used for unix socket used to local communication.
100
232
AC_ARG_WITH([drizzled-user],
101
233
    [AS_HELP_STRING([--with-drizzled-user=username],
102
234
            [What user the drizzled daemon shall be run as.
103
235
                @<:@default=drizzle@:>@])],
104
 
    [ DRIZZLED_USER="$withval" ],
105
 
    [ DRIZZLED_USER=drizzle ])
 
236
    [ DRIZZLED_USER=$withval ],
 
237
    [ DRIZZLED_USER=drizzle ]
 
238
    )
106
239
AC_SUBST(DRIZZLED_USER)
107
240
 
 
241
# If we should allow LOAD DATA LOCAL
 
242
AC_MSG_CHECKING(If we should should enable LOAD DATA LOCAL by default)
 
243
AC_ARG_ENABLE(local-infile,
 
244
    [  --enable-local-infile   Enable LOAD DATA LOCAL INFILE (default: disabled)],
 
245
    [ ENABLED_LOCAL_INFILE=$enableval ],
 
246
    [ ENABLED_LOCAL_INFILE=no ]
 
247
    )
 
248
if test "$ENABLED_LOCAL_INFILE" = "yes"
 
249
then
 
250
  AC_MSG_RESULT([yes])
 
251
  AC_DEFINE([ENABLED_LOCAL_INFILE], [1],
 
252
            [If LOAD DATA LOCAL INFILE should be enabled by default])
 
253
else
 
254
  AC_MSG_RESULT([no])
 
255
fi
 
256
 
 
257
#--------------------------------------------------------------------
 
258
# Check for system header files
 
259
#--------------------------------------------------------------------
 
260
 
 
261
AC_HEADER_DIRENT
 
262
AC_HEADER_STDC
 
263
AC_HEADER_SYS_WAIT
 
264
AC_HEADER_STDBOOL
 
265
AC_CHECK_HEADERS(fcntl.h float.h fpu_control.h ieeefp.h)
 
266
AC_CHECK_HEADERS(limits.h pwd.h select.h linux/config.h)
 
267
AC_CHECK_HEADERS(sys/fpu.h utime.h sys/utime.h )
 
268
AC_CHECK_HEADERS(synch.h sys/mman.h sys/socket.h)
 
269
AC_CHECK_HEADERS([curses.h term.h],[],[],
 
270
[[#ifdef HAVE_CURSES_H
 
271
# include <curses.h>
 
272
#endif
 
273
]])
 
274
AC_CHECK_HEADERS(termio.h termios.h sched.h alloca.h)
 
275
AC_CHECK_HEADERS(sys/prctl.h ieeefp.h)
 
276
AC_CHECK_HEADERS(execinfo.h)
 
277
 
 
278
#--------------------------------------------------------------------
 
279
# Check for system libraries. Adds the library to $LIBS
 
280
# and defines HAVE_LIBM etc
 
281
#--------------------------------------------------------------------
 
282
 
 
283
AC_CHECK_LIB(m, floor, [], AC_CHECK_LIB(m, __infinity))
 
284
 
 
285
AC_CHECK_FUNC(setsockopt, [], [AC_CHECK_LIB(socket, setsockopt)])
 
286
AC_CHECK_FUNC(yp_get_default_domain, [],
 
287
  [AC_CHECK_LIB(nsl, yp_get_default_domain)])
 
288
AC_CHECK_FUNC(p2open, [], [AC_CHECK_LIB(gen, p2open)])
 
289
# This may get things to compile even if bind-8 is installed
 
290
AC_CHECK_FUNC(bind, [], [AC_CHECK_LIB(bind, bind)])
 
291
# Check if crypt() exists in libc or libcrypt, sets LIBS if needed
 
292
AC_SEARCH_LIBS(crypt, crypt, AC_DEFINE(HAVE_CRYPT, 1, [crypt]))
 
293
 
 
294
# Check rt for aio_read
 
295
AC_CHECK_LIB(rt, aio_read)
 
296
 
 
297
# For the sched_yield() function on Solaris
 
298
AC_CHECK_FUNC(sched_yield, [],
 
299
  [AC_CHECK_LIB(posix4, [sched_yield],
 
300
    [AC_DEFINE(HAVE_SCHED_YIELD, 1, [Have sched_yield function]) LIBS="$LIBS -lposix4"])])
 
301
 
 
302
if test "$ac_cv_header_termio_h" = "no" -a "$ac_cv_header_termios_h" = "no"
 
303
then
 
304
  AC_CHECK_FUNC(gtty, [], [AC_CHECK_LIB(compat, gtty)])
 
305
fi
 
306
 
 
307
AC_CHECK_TYPES([fp_except], [], [], [
 
308
#include <sys/types.h>
 
309
#include <ieeefp.h>
 
310
])
 
311
 
 
312
my_save_LIBS="$LIBS"
 
313
LIBS=""
 
314
AC_CHECK_LIB(dl,dlopen)
 
315
AC_CHECK_FUNCS(dlopen)
 
316
if test "$ac_cv_func_dlopen" != "yes"
 
317
then
 
318
  AC_MSG_ERROR([Drizzle requires dlopen])
 
319
fi
 
320
LIBDL_LIBS="$LIBS"
 
321
LIBS="$my_save_LIBS"
 
322
AC_SUBST(LIBDL_LIBS)
 
323
 
 
324
 
 
325
AC_CACHE_CHECK(
 
326
  [whether the compiler provides atomic builtins],
 
327
  [ac_cv_gcc_atomic_builtins],
 
328
  [AC_RUN_IFELSE(
 
329
    [AC_LANG_PROGRAM([],[[
 
330
      int foo= -10; int bar= 10;
 
331
      if (!__sync_fetch_and_add(&foo, bar) || foo)
 
332
        return -1;
 
333
      bar= __sync_lock_test_and_set(&foo, bar);
 
334
      if (bar || foo != 10)
 
335
        return -1;
 
336
      bar= __sync_val_compare_and_swap(&bar, foo, 15);
 
337
      if (bar)
 
338
        return -1;
 
339
      return 0;
 
340
      ]])],
 
341
    [ac_cv_gcc_atomic_builtins=yes],
 
342
    [ac_cv_gcc_atomic_builtins=no])])
 
343
 
 
344
AS_IF([test "x$ac_cv_gcc_atomic_builtins" = "xyes"],[
 
345
  AC_DEFINE(HAVE_GCC_ATOMIC_BUILTINS, 1,
 
346
            [Define to 1 if compiler provides atomic builtins.])
 
347
])
 
348
 
108
349
 
109
350
AC_ARG_WITH([comment],
110
351
    [AS_HELP_STRING([--with-comment],
111
352
            [Comment about compilation environment. @<:@default=off@:>@])],
112
353
    [with_comment=$withval],
113
354
    [with_comment=no])
114
 
AS_IF([test "$with_comment" != "no"],[
 
355
if test "$with_comment" != "no"
 
356
then
115
357
  COMPILATION_COMMENT=$with_comment
116
 
],[
 
358
else
117
359
  COMPILATION_COMMENT="Source distribution (${PANDORA_RELEASE_COMMENT})"
118
 
])
 
360
fi
119
361
AC_DEFINE_UNQUOTED([COMPILATION_COMMENT],["$COMPILATION_COMMENT"],
120
362
                   [Comment about compilation environment])
121
363
 
 
364
dnl Checks for typedefs, structures, and compiler characteristics.
 
365
 
 
366
AC_STRUCT_TM
 
367
# off_t is not a builtin type
 
368
AC_CHECK_SIZEOF(off_t, 4)
 
369
if test "$ac_cv_sizeof_off_t" -eq 0
 
370
then
 
371
  AC_MSG_ERROR("Drizzle needs a off_t type.")
 
372
fi
 
373
AC_CHECK_SIZEOF(size_t)
 
374
AC_DEFINE_UNQUOTED([SIZEOF_SIZE_T],[$ac_cv_sizeof_size_t],[Size of size_t as computed by sizeof()])
 
375
AC_CHECK_SIZEOF(long long)
 
376
AC_DEFINE_UNQUOTED(SIZEOF_LONG_LONG,[$ac_cv_sizeof_long_long],[Size of long long as computed by sizeof()])
 
377
 
 
378
dnl
 
379
dnl check if time_t is unsigned
 
380
dnl
 
381
 
 
382
DRIZZLE_CHECK_TIME_T
 
383
 
 
384
DRIZZLE_STACK_DIRECTION
 
385
 
 
386
AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>])
 
387
AC_CHECK_TYPES([uint, ulong])
 
388
 
 
389
DRIZZLE_PTHREAD_YIELD
 
390
 
 
391
 
 
392
dnl Checks for header files.
 
393
AC_CHECK_HEADERS(malloc.h)
 
394
 
 
395
dnl Checks for library functions.
 
396
AC_FUNC_ALLOCA
 
397
 
 
398
AC_CHECK_FUNCS(issetugid)
 
399
 
 
400
# Already-done: stdlib.h string.h unistd.h termios.h
 
401
AC_CHECK_HEADERS(stdarg.h dirent.h locale.h ndir.h sys/dir.h \
 
402
 sys/ndir.h sys/select.h \
 
403
 sys/mman.h termcap.h termio.h asm/termbits.h grp.h \
 
404
 paths.h)
 
405
 
 
406
# Already-done: strcasecmp
 
407
AC_CHECK_FUNCS(lstat select)
 
408
 
 
409
AC_HEADER_STAT
 
410
DRIZZLE_HAVE_TIOCGWINSZ
 
411
DRIZZLE_HAVE_TIOCSTAT
122
412
 
123
413
#########################################################################
124
414
 
 
415
dnl Checks for library functions.
 
416
 
 
417
AC_FUNC_UTIME_NULL
 
418
AC_FUNC_VPRINTF
 
419
 
 
420
AC_CHECK_FUNCS(fcntl)
 
421
if test "x$ac_cv_func_fcntl" != "xyes"
 
422
then
 
423
  AC_MSG_ERROR("Drizzle requires fcntl.")
 
424
fi
 
425
 
 
426
 
 
427
AC_CACHE_CHECK([working fdatasync],[ac_cv_func_fdatasync],[
 
428
  AC_LANG_PUSH(C++)
 
429
  AC_RUN_IFELSE([AC_LANG_PROGRAM([[
 
430
#include <unistd.h>
 
431
    ]],[[
 
432
fdatasync(4);
 
433
    ]])],
 
434
  [ac_cv_func_fdatasync=yes],
 
435
  [ac_cv_func_fdatasync=no])
 
436
  AC_LANG_POP()
 
437
])
 
438
AS_IF([test "x${ac_cv_func_fdatasync}" = "xyes"],
 
439
  [AC_DEFINE([HAVE_FDATASYNC],[1],[If the system has a working fdatasync])])
 
440
 
 
441
 
 
442
AC_CHECK_FUNCS( \
 
443
  cuserid fchmod \
 
444
  fpresetsticky fpsetmask fsync \
 
445
  getpassphrase getpwnam \
 
446
  getpwuid getrlimit getrusage index initgroups isnan \
 
447
  localtime_r log log2 gethrtime gmtime_r \
 
448
  madvise \
 
449
  mkstemp mlockall poll pread pthread_attr_create mmap mmap64 \
 
450
  readlink \
 
451
  realpath rename rwlock_init setupterm \
 
452
  sigaction \
 
453
  sigthreadmask \
 
454
  snprintf strpbrk \
 
455
  tell tempnam \
 
456
  backtrace backtrace_symbols backtrace_symbols_fd)
 
457
 
 
458
AC_LANG_PUSH(C++)
 
459
# Test whether madvise() is declared in C++ code -- it is not on some
 
460
# systems, such as Solaris
 
461
AC_CHECK_DECLS([madvise], [], [], [AC_INCLUDES_DEFAULT[
 
462
#if HAVE_SYS_MMAN_H
 
463
#include <sys/types.h>
 
464
#include <sys/mman.h>
 
465
#endif
 
466
]])
 
467
AC_LANG_POP()
 
468
 
 
469
 
 
470
AM_CONDITIONAL(BUILD_THR_RWLOCK,[test "$ac_cv_func_rwlock_init" -a "$ac_cv_funn_pthread_rwlock_rdlock"])
 
471
 
 
472
 
 
473
# Sanity check: We chould not have any fseeko symbol unless
 
474
# large_file_support=yes
 
475
AC_CHECK_FUNC(fseeko,
 
476
[if test "$large_file_support" = no -a "x$TARGET_LINUX" = "xtrue";
 
477
then
 
478
  AC_MSG_ERROR("Found fseeko symbol but large_file_support is not enabled!")
 
479
fi]
 
480
)
 
481
 
 
482
# Check definition of pthread_getspecific
 
483
AC_CACHE_CHECK([args to pthread_getspecific], [pandora_cv_getspecific_args],
 
484
  [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 
485
#if !defined(_REENTRANT)
 
486
#define _REENTRANT
 
487
#endif
 
488
#ifndef _POSIX_PTHREAD_SEMANTICS 
 
489
#define _POSIX_PTHREAD_SEMANTICS 
 
490
#endif
 
491
#include <pthread.h>
 
492
   ]], [[
 
493
void *pthread_getspecific(pthread_key_t key);
 
494
pthread_getspecific((pthread_key_t) NULL);
 
495
   ]])],
 
496
    [pandora_cv_getspecific_args=POSIX],
 
497
    [pandora_cv_getspecific_args=other])])
 
498
  if test "$pandora_cv_getspecific_args" = "other"
 
499
  then
 
500
    AC_DEFINE([HAVE_NONPOSIX_PTHREAD_GETSPECIFIC], [1],
 
501
              [For some non posix threads])
 
502
  fi
 
503
 
 
504
  # Check definition of pthread_mutex_init
 
505
  AC_CACHE_CHECK([args to pthread_mutex_init], [pandora_cv_mutex_init_args],
 
506
    [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 
507
#ifndef _REENTRANT
 
508
#define _REENTRANT
 
509
#endif
 
510
#ifndef _POSIX_PTHREAD_SEMANTICS
 
511
#define _POSIX_PTHREAD_SEMANTICS 
 
512
#endif
 
513
#include <pthread.h> ]], [[ 
 
514
  pthread_mutexattr_t attr;
 
515
  pthread_mutex_t mp;
 
516
  pthread_mutex_init(&mp,&attr); ]])],
 
517
      [pandora_cv_mutex_init_args=POSIX],
 
518
      [pandora_cv_mutex_init_args=other])])
 
519
  if test "$pandora_cv_mutex_init_args" = "other"
 
520
  then
 
521
    AC_DEFINE([HAVE_NONPOSIX_PTHREAD_MUTEX_INIT], [1],
 
522
              [For some non posix threads])
 
523
  fi
 
524
#---END:
 
525
 
 
526
#---START: Used in for client configure
 
527
# Check definition of readdir_r
 
528
AC_CACHE_CHECK([args to readdir_r], [pandora_cv_readdir_r],
 
529
  [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
 
530
#ifndef _REENTRANT
 
531
#define _REENTRANT
 
532
#endif
 
533
#ifndef _POSIX_PTHREAD_SEMANTICS 
 
534
#define _POSIX_PTHREAD_SEMANTICS 
 
535
#endif
 
536
#include <pthread.h>
 
537
#include <dirent.h>]], [[ int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result);
 
538
readdir_r((DIR *) NULL, (struct dirent *) NULL, (struct dirent **) NULL); ]])],
 
539
    [pandora_cv_readdir_r=POSIX],
 
540
    [pandora_cv_readdir_r=other])])
 
541
if test "$pandora_cv_readdir_r" = "POSIX"
 
542
then
 
543
  AC_DEFINE([HAVE_READDIR_R], [1], [POSIX readdir_r])
 
544
fi
 
545
 
 
546
# Check definition of posix sigwait()
 
547
AC_CACHE_CHECK([style of sigwait], [pandora_cv_sigwait],
 
548
  [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
 
549
#ifndef _REENTRANT
 
550
#define _REENTRANT
 
551
#endif
 
552
#ifndef _POSIX_PTHREAD_SEMANTICS
 
553
#define _POSIX_PTHREAD_SEMANTICS 
 
554
#endif
 
555
#include <pthread.h>
 
556
#include <signal.h>
 
557
      ]], [[
 
558
#ifndef _AIX
 
559
sigset_t set;
 
560
int sig;
 
561
sigwait(&set,&sig);
 
562
#endif
 
563
      ]])],
 
564
    [pandora_cv_sigwait=POSIX],
 
565
    [pandora_cv_sigwait=other])])
 
566
if test "$pandora_cv_sigwait" = "POSIX"
 
567
then
 
568
  AC_DEFINE([HAVE_SIGWAIT], [1], [POSIX sigwait])
 
569
fi
 
570
 
 
571
if test "$pandora_cv_sigwait" != "POSIX"
 
572
then
 
573
unset pandora_cv_sigwait
 
574
# Check definition of posix sigwait()
 
575
AC_CACHE_CHECK([style of sigwait], [pandora_cv_sigwait],
 
576
  [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
 
577
#ifndef _REENTRANT
 
578
#define _REENTRANT
 
579
#endif
 
580
#ifndef _POSIX_PTHREAD_SEMANTICS
 
581
#define _POSIX_PTHREAD_SEMANTICS 
 
582
#endif
 
583
#include <pthread.h>
 
584
#include <signal.h>
 
585
      ]], [[
 
586
sigset_t set;
 
587
int sig;
 
588
sigwait(&set);
 
589
      ]])],
 
590
    [pandora_cv_sigwait=NONPOSIX],
 
591
    [pandora_cv_sigwait=other])])
 
592
if test "$pandora_cv_sigwait" = "NONPOSIX"
 
593
then
 
594
  AC_DEFINE([HAVE_NONPOSIX_SIGWAIT], [1], [sigwait with one argument])
 
595
fi
 
596
fi
 
597
#---END:
 
598
 
 
599
# Check if pthread_attr_setscope() exists
 
600
AC_CACHE_CHECK([for pthread_attr_setscope], [pandora_cv_pthread_attr_setscope],
 
601
  [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
 
602
#ifndef _REENTRANT
 
603
#define _REENTRANT
 
604
#endif
 
605
#ifndef _POSIX_PTHREAD_SEMANTICS
 
606
#define _POSIX_PTHREAD_SEMANTICS 
 
607
#endif
 
608
#include <pthread.h>
 
609
      ]], [[
 
610
pthread_attr_t thr_attr;
 
611
pthread_attr_setscope(&thr_attr,0);
 
612
      ]])],
 
613
    [pandora_cv_pthread_attr_setscope=yes],
 
614
    [pandora_cv_pthread_attr_setscope=no])])
 
615
if test "$pandora_cv_pthread_attr_setscope" = "yes"
 
616
then
 
617
  AC_DEFINE([HAVE_PTHREAD_ATTR_SETSCOPE], [1], [pthread_attr_setscope])
 
618
fi
 
619
 
 
620
AC_LANG_PUSH([C++])
 
621
AC_CHECK_HEADERS(cxxabi.h)
 
622
AC_CACHE_CHECK([checking for abi::__cxa_demangle], pandora_cv_cxa_demangle,
 
623
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <cxxabi.h>]], [[
 
624
  char *foo= 0; int bar= 0;
 
625
  foo= abi::__cxa_demangle(foo, foo, 0, &bar);
 
626
]])],[pandora_cv_cxa_demangle=yes],[pandora_cv_cxa_demangle=no])])
 
627
AC_LANG_POP([])
 
628
 
 
629
if test "x$pandora_cv_cxa_demangle" = xyes; then
 
630
  AC_DEFINE(HAVE_ABI_CXA_DEMANGLE, 1,
 
631
            [Define to 1 if you have the `abi::__cxa_demangle' function.])
 
632
fi
 
633
 
 
634
#--------------------------------------------------------------------
 
635
# Check for requested features
 
636
#--------------------------------------------------------------------
 
637
 
 
638
DRIZZLE_CHECK_MAX_INDEXES
125
639
 
126
640
dnl Has to be done late, as the plugin may need to check for existence of
127
641
dnl functions tested above
128
 
PANDORA_PLUGINS([drizzled/module/load_list.h])
 
642
PANDORA_PLUGINS([drizzled/plugin/config.h])
129
643
 
130
644
dnl GCC Precompiled Header Support
131
645
dnl re-enable later
132
646
dnl AM_CONDITIONAL([BUILD_GCC_PCH],[test "$GCC" = "yes"])
133
647
AM_CONDITIONAL([BUILD_GCC_PCH],[test "no" = "yes"])
134
648
 
135
 
AS_IF([test "$lt_cv_prog_gnu_ld" = "yes"],[
136
 
  LDFLAGS="${LDFLAGS} ${LD_VERSION_SCRIPT}"
137
 
  ])
138
 
 
139
 
WITH_VALGRIND
140
 
AS_IF([test "x${ac_gcc_profile_mode}" = "xyes" -a "x${pandora_cv_boost_profile}" = "xyes"],[
141
 
    AC_DEFINE([_GLIBCXX_PROFILE],[1],[Enable GCC Profile Mode])
142
 
    ])
143
 
 
144
 
 
145
649
AC_CONFIG_FILES(Makefile dnl
146
 
 tests/Makefile dnl
147
 
 drizzled/plugin/version.h dnl
148
 
 support-files/drizzle7.pc dnl
149
 
 support-files/libdrizzle.pc dnl
 
650
 gnulib/Makefile dnl
 
651
 po/Makefile.in dnl
 
652
 drizzled/hash/Makefile dnl
 
653
 drizzled/message/Makefile dnl
 
654
 drizzled/Makefile dnl
 
655
 support-files/Makefile dnl
 
656
 tests/Makefile tests/install_test_db dnl
 
657
 support-files/drizzle.server support-files/drizzle-log-rotate
 
658
 support-files/smf/Makefile dnl
150
659
 support-files/smf/install.sh dnl
151
660
 support-files/smf/drizzle.xml dnl
152
661
 support-files/smf/drizzle)
173
682
echo ""
174
683
echo "   * Installation prefix:       $prefix"
175
684
echo "   * System type:               $host_vendor-$host_os"
176
 
echo "   * pandora-build version:     PANDORA_CANONICAL_VERSION"
177
685
echo "   * Host CPU:                  $host_cpu"
178
686
echo "   * C Compiler:                $CC_VERSION"
179
687
echo "   * C++ Compiler:              $CXX_VERSION"
 
688
echo "   * Build auth_pam:            $ac_cv_libpam"
180
689
echo "   * Assertions enabled:        $ac_cv_assert"
181
690
echo "   * Debug enabled:             $with_debug"
182
691
echo "   * Profiling enabled:         $ac_profiling"
183
692
echo "   * Coverage enabled:          $ac_coverage"
184
693
echo "   * Warnings as failure:       $ac_cv_warnings_as_errors"
 
694
echo "   * C++ cstdint location:      $ac_cv_cxx_cstdint"
 
695
echo "   * C++ hash_map location:     $ac_cv_cxx_hash_map"
 
696
echo "   * C++ hash namespace:        $ac_cv_cxx_hash_namespace"
 
697
echo "   * C++ shared_ptr namespace:  $ac_cv_shared_ptr_namespace"
185
698
echo ""
186
699
echo "---"
187
700
 
188
 
case "$host_os" in
189
 
  *freebsd*)
190
 
    echo "*****"
191
 
    echo "*"
192
 
    echo "*  NOTE: You are on FreeBSD. BSD make will not work."
193
 
    echo "*"
194
 
    echo "*   use 'gmake' To build Drizzle"
195
 
    echo "*"
196
 
    echo "*  And ensure that /usr/local/lib/gcc44 is in your LD_LIBRARY_PATH"
197
 
    echo "*" 
198
 
    echo "*****"
199
 
  ;;
200
 
esac
201
 
 
202
 
 
203
701
dnl libtoolize scans configure.ac  and needs to see some text
204
702
m4_define([LIBTOOLIZE_AC_INIT], [])