~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to configure.ac

Renamed namespace slot to namespace service.

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