~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Eric Day
  • Date: 2009-11-10 22:59:28 UTC
  • mto: This revision was merged to the branch mainline in revision 1218.
  • Revision ID: eday@oddments.org-20091110225928-hht1klldtfflwixc
Fixed header file guards and fixed test cases.

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