~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Brian Aker
  • Date: 2009-02-21 00:18:15 UTC
  • Revision ID: brian@tangent.org-20090221001815-x20e8h71e984lvs1
Completion (?) of uint conversion.

Show diffs side-by-side

added added

removed removed

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