~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Brian Aker
  • Date: 2008-09-04 19:31:00 UTC
  • Revision ID: brian@tangent.org-20080904193100-l849hgghfy4urj43
Changing default character set from this point on.

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
AC_CONFIG_SRCDIR([drizzled/drizzled.cc])
8
8
AC_CONFIG_AUX_DIR(config)
9
9
AC_CONFIG_HEADERS([config.h])
10
 
 
11
 
# Save some variables and the command line options for mysqlbug
12
 
SAVE_CC="$CC"
13
 
SAVE_CXX="$CXX"
14
 
SAVE_ASFLAGS="$ASFLAGS"
15
 
SAVE_CFLAGS="$CFLAGS"
16
 
SAVE_CXXFLAGS="$CXXFLAGS"
17
 
SAVE_LDFLAGS="$LDFLAGS"
18
 
SAVE_CXXLDFLAGS="$CXXLDFLAGS"
19
 
CONF_COMMAND="$0 $ac_configure_args"
20
 
AC_SUBST(CONF_COMMAND)
21
 
AC_SUBST(SAVE_CC)
22
 
AC_SUBST(SAVE_CXX)
23
 
AC_SUBST(SAVE_ASFLAGS)
24
 
AC_SUBST(SAVE_CFLAGS)
25
 
AC_SUBST(SAVE_CXXFLAGS)
26
 
AC_SUBST(SAVE_LDFLAGS)
27
 
AC_SUBST(SAVE_CXXLDFLAGS)
28
 
AC_SUBST(CXXLDFLAGS)
29
 
 
30
10
AC_CANONICAL_TARGET
31
 
AM_INIT_AUTOMAKE(-Wall -Wno-portability -Werror)
 
11
AM_INIT_AUTOMAKE(-Wall -Werror)
32
12
 
33
13
PROTOCOL_VERSION=10
34
14
DOT_FRM_VERSION=6
35
15
# See the libtool docs for information on how to do shared lib versions.
36
 
SHARED_LIB_MAJOR_VERSION=1
 
16
SHARED_LIB_MAJOR_VERSION=16
37
17
SHARED_LIB_VERSION=$SHARED_LIB_MAJOR_VERSION:0:0
38
18
 
39
 
##############################################################################
40
 
# The below section needs to be done before AC_PROG_CC
41
 
##############################################################################
42
 
 
43
 
if test "x${CFLAGS-}" = x ; then
44
 
  cflags_is_set=no
45
 
else
46
 
  cflags_is_set=yes
47
 
fi
48
 
 
49
 
if test "x${CPPFLAGS-}" = x ; then
50
 
  cppflags_is_set=no
51
 
else
52
 
  cppflags_is_set=yes
53
 
fi
54
 
 
55
 
if test "x${LDFLAGS-}" = x ; then
56
 
  ldflags_is_set=no
57
 
else
58
 
  ldflags_is_set=yes
59
 
fi
60
 
 
61
 
################ End of section to be done before AC_PROG_CC #################
62
 
 
63
 
dnl Checks for programs.
64
 
AC_PROG_CC
65
 
ifdef([AC_PROG_CC_C99],[
66
 
  dnl TODO: Need to fix this to use c99 instead of gnu99
67
 
  AC_PROG_CC_C99([],[AC_MSG_ERROR([C99 support required for compiling Drizzle])])
68
 
  C99_SUPPORT_HACK=""
69
 
],[C99_SUPPORT_HACK="-std=gnu99"])
70
 
 
71
 
ifdef([AC_USE_SYSTEM_EXTENSIONS],[
72
 
  AC_USE_SYSTEM_EXTENSIONS
73
 
],[
74
 
 
75
 
  AH_VERBATIM([__EXTENSIONS__],
76
 
[/* Enable extensions on Solaris.  */
77
 
#ifndef __EXTENSIONS__
78
 
# undef __EXTENSIONS__
79
 
#endif
80
 
#ifndef _POSIX_PTHREAD_SEMANTICS
81
 
# undef _POSIX_PTHREAD_SEMANTICS
82
 
#endif
83
 
#ifndef _TANDEM_SOURCE
84
 
# undef _TANDEM_SOURCE
85
 
#endif])
86
 
 
87
 
  AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
88
 
    [ac_cv_safe_to_define___extensions__],
89
 
    [AC_COMPILE_IFELSE(
90
 
       [AC_LANG_PROGRAM([
91
 
#         define __EXTENSIONS__ 1
92
 
          AC_INCLUDES_DEFAULT])],
93
 
       [ac_cv_safe_to_define___extensions__=yes],
94
 
       [ac_cv_safe_to_define___extensions__=no])])
95
 
  test $ac_cv_safe_to_define___extensions__ = yes &&
96
 
    AC_DEFINE([__EXTENSIONS__])
97
 
  AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
98
 
  AC_DEFINE([_TANDEM_SOURCE])
99
 
])
100
 
 
101
 
AC_PROG_CXX
102
 
AC_CXX_HEADER_STDCXX_98
103
 
if test "$ac_cv_cxx_stdcxx_98" = "no"
104
 
then
105
 
  AC_MSG_ERROR([C++ Compiler required to compile Drizzle])
106
 
fi
107
 
AC_PROG_CPP
108
 
AM_PROG_CC_C_O
109
 
 
110
 
AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
111
 
 
112
 
dnl AC_CANONICAL_HOST thinks it's a good idea to just set CFLAGS to 
113
 
dnl -g -O2 if you're running gcc. We would like to use something else, thanks.
114
 
if test "x${CFLAGS}" = "x-g -O2"
115
 
then
116
 
  CFLAGS=
117
 
fi
118
 
if test "x${CXXFLAGS}" = "x-g -O2"
119
 
then
120
 
  CXXFLAGS=
121
 
fi
122
19
 
123
20
 
124
21
# Set all version vars based on $VERSION. How do we do this more elegant ?
140
37
# The port should be constant for a LONG time
141
38
DRIZZLE_TCP_PORT_DEFAULT=4427
142
39
 
 
40
dnl Include m4 
 
41
sinclude(m4/alloca.m4)
 
42
sinclude(m4/check_cpu.m4)
 
43
sinclude(m4/character_sets.m4)
 
44
sinclude(m4/compiler_flag.m4)
143
45
sinclude(m4/dtrace.m4)
144
 
sinclude(m4/character_sets.m4)
 
46
sinclude(m4/plugins.m4)
 
47
sinclude(m4/large_file.m4)
 
48
sinclude(m4/misc.m4)
 
49
sinclude(m4/readline.m4)
 
50
sinclude(m4/ssl.m4)
 
51
sinclude(m4/pkg.m4)
 
52
sinclude(m4/lib-link.m4)
 
53
sinclude(m4/lib-prefix.m4)
145
54
sinclude(m4/gettext.m4)
 
55
sinclude(m4/progtest.m4)
 
56
sinclude(m4/po.m4)
 
57
sinclude(m4/nls.m4)
 
58
sinclude(m4/iconv.m4)
 
59
sinclude(m4/lib-ld.m4)
 
60
sinclude(m4/ac_cxx_header_stdcxx_98.m4)
146
61
 
147
62
AM_GNU_GETTEXT([external])
148
63
AM_GNU_GETTEXT_VERSION(0.17)
149
64
 
150
 
AM_CONDITIONAL([BUILD_GETTEXT],[test "x$MSGMERGE" != "x" -a "x$MSGMERGE" != "x:"])
 
65
AM_CONDITIONAL([BUILD_GETTEXT],[test "x$MSGMERGE" != "x"])
151
66
 
152
67
AC_SUBST(DRIZZLE_NO_DASH_VERSION)
153
 
AC_DEFINE_UNQUOTED(DRIZZLE_BASE_VERSION,["$DRIZZLE_BASE_VERSION"],
154
 
                  [Major and minor version])
 
68
AC_SUBST(DRIZZLE_BASE_VERSION)
155
69
AC_SUBST(DRIZZLE_VERSION_ID)
156
 
AC_DEFINE_UNQUOTED([DRIZZLE_VERSION_ID],[$DRIZZLE_VERSION_ID],
157
 
                   [Version ID that can be easily used for numeric comparison])
158
70
AC_SUBST(DRIZZLE_PREVIOUS_BASE_VERSION)
159
71
AC_SUBST(PROTOCOL_VERSION)
160
72
AC_DEFINE_UNQUOTED([PROTOCOL_VERSION], [$PROTOCOL_VERSION],
161
73
                   [mysql client protocol version])
162
74
AC_SUBST(DOT_FRM_VERSION)
163
 
AC_DEFINE_UNQUOTED([FRM_VER], [$DOT_FRM_VERSION],
 
75
AC_DEFINE_UNQUOTED([DOT_FRM_VERSION], [$DOT_FRM_VERSION],
164
76
                   [Version of .frm files])
165
 
AC_DEFINE_UNQUOTED([DRIZZLE_CONFIG_NAME],["drizzled"],[Name of server config section])
166
 
 
167
77
AC_SUBST(SHARED_LIB_MAJOR_VERSION)
168
78
AC_SUBST(SHARED_LIB_VERSION)
169
79
AC_SUBST(AVAILABLE_LANGUAGES)
170
80
 
171
 
dnl Ok. This is sort of lame, but we need to be nice to plugins Makefile.am's.
172
 
AM_CONDITIONAL(BUILDING_DRIZZLE,[test "x" = "x"])
173
 
 
174
 
 
175
 
# General Constants
176
 
AC_DEFINE([IO_SIZE], [4096], [Io buffer size; Must be a power of 2 and 
177
 
  a multiple of 512. May be
178
 
  smaller what the disk page size. This influences the speed of the
179
 
  isam btree library. eg to big to slow.])
180
 
AC_DEFINE([SC_MAXWIDTH],[256], [Max width of screen (for error messages)])
181
 
AC_DEFINE([FN_LEN],[256 ], [Max file name len ])
182
 
AC_DEFINE([FN_EXTLEN],[20], [Max length of extension (part of FN_LEN) ])
183
 
AC_DEFINE([FN_REFLEN],[512], [Max length of full path-name ])
184
 
AC_DEFINE([FN_EXTCHAR],['.'], [File extension character])
185
 
AC_DEFINE([FN_HOMELIB],['~'], [~/ is used as abbrev for home dir ])
186
 
AC_DEFINE([FN_CURLIB],['.'], [./ is used as abbrev for current dir ])
187
 
AC_DEFINE([FN_PARENTDIR],[".."], [Parent directory; Must be a string ])
188
 
 
189
 
AC_DEFINE([MASTER],[1],[Compile without unireg])
190
 
 
191
 
AH_VERBATIM([QUOTE_ARG],[
192
 
/* Quote argument (before cpp) */
193
 
#ifndef QUOTE_ARG
194
 
# define QUOTE_ARG(x) #x
195
 
#endif
196
 
/* Quote argument, (after cpp) */
197
 
#ifndef STRINGIFY_ARG
198
 
# define STRINGIFY_ARG(x) QUOTE_ARG(x)
199
 
#endif
200
 
])
201
 
 
202
 
AH_VERBATIM([builtin_expect],[
203
 
/*
204
 
 * The macros below are borrowed from include/linux/compiler.h in the
205
 
 * Linux kernel. Use them to indicate the likelyhood of the truthfulness
206
 
 * of a condition. This serves two purposes - newer versions of gcc will be
207
 
 * able to optimize for branch predication, which could yield siginficant
208
 
 * performance gains in frequently executed sections of the code, and the
209
 
 * other reason to use them is for documentation
210
 
 */
211
 
#if !defined(__GNUC__)
212
 
#define __builtin_expect(x, expected_value) (x)
213
 
#endif
214
 
 
215
 
#define likely(x)  __builtin_expect((x),1)
216
 
#define unlikely(x)  __builtin_expect((x),0)
217
 
])
218
 
 
219
 
dnl  InnoDB depends on some Drizzle's internals which other plugins should not
220
 
dnl  need.  This is because of InnoDB's foreign key support, "safe" binlog
221
 
dnl  truncation, and other similar legacy features.
222
 
 
223
 
dnl  We define accessors for these internals unconditionally, but do not
224
 
dnl  expose them in mysql/plugin.h.  They are declared in ha_innodb.h for
225
 
dnl  InnoDB's use.
226
 
 
227
 
AC_DEFINE([INNODB_COMPATIBILITY_HOOKS],[1],[TODO: Remove the need for this])
228
 
dnl TODO: Make a test for when this needs to be set.
229
 
AC_DEFINE([_REENTRANT],[1],[Some thread libraries require this])
230
 
 
231
 
AH_VERBATIM([posix_pthread],[
232
 
/* We want posix threads */
233
 
#ifndef _POSIX_PTHREAD_SEMANTICS
234
 
#define _POSIX_PTHREAD_SEMANTICS
235
 
#endif
236
 
])
237
 
 
238
81
 
239
82
# Canonicalize the configuration name.
240
83
 
262
105
  i?86) BASE_MACHINE_TYPE=i386 ;;
263
106
esac
264
107
 
 
108
# Save some variables and the command line options for mysqlbug
 
109
SAVE_CC="$CC"
 
110
SAVE_CXX="$CXX"
 
111
SAVE_ASFLAGS="$ASFLAGS"
 
112
SAVE_CFLAGS="$CFLAGS"
 
113
SAVE_CXXFLAGS="$CXXFLAGS"
 
114
SAVE_LDFLAGS="$LDFLAGS"
 
115
SAVE_CXXLDFLAGS="$CXXLDFLAGS"
 
116
CONF_COMMAND="$0 $ac_configure_args"
 
117
AC_SUBST(CONF_COMMAND)
 
118
AC_SUBST(SAVE_CC)
 
119
AC_SUBST(SAVE_CXX)
 
120
AC_SUBST(SAVE_ASFLAGS)
 
121
AC_SUBST(SAVE_CFLAGS)
 
122
AC_SUBST(SAVE_CXXFLAGS)
 
123
AC_SUBST(SAVE_LDFLAGS)
 
124
AC_SUBST(SAVE_CXXLDFLAGS)
 
125
AC_SUBST(CXXLDFLAGS)
 
126
 
265
127
AM_SANITY_CHECK
266
128
# This is needed is SUBDIRS is set
267
129
AC_PROG_MAKE_SET
268
130
 
269
 
 
270
 
case "$target_os" in
271
 
  *linux*)
272
 
  TARGET_LINUX="true"
273
 
  AC_SUBST(TARGET_LINUX)
274
 
  AC_DEFINE([TARGET_OS_LINUX], [1], [Whether we build for Linux])
275
 
    ;;
 
131
##############################################################################
 
132
# The below section needs to be done before AC_PROG_CC
 
133
##############################################################################
 
134
 
 
135
if test "x${CFLAGS-}" = x ; then
 
136
  cflags_is_set=no
 
137
else
 
138
  cflags_is_set=yes
 
139
fi
 
140
 
 
141
if test "x${CPPFLAGS-}" = x ; then
 
142
  cppflags_is_set=no
 
143
else
 
144
  cppflags_is_set=yes
 
145
fi
 
146
 
 
147
if test "x${LDFLAGS-}" = x ; then
 
148
  ldflags_is_set=no
 
149
else
 
150
  ldflags_is_set=yes
 
151
fi
 
152
 
 
153
################ End of section to be done before AC_PROG_CC #################
 
154
 
 
155
# The following hack should ensure that configure doesn't add optimizing
 
156
# or debugging flags to CFLAGS or CXXFLAGS
 
157
# C_EXTRA_FLAGS are flags that are automaticly added to both
 
158
# CFLAGS and CXXFLAGS
 
159
CFLAGS="$CFLAGS $C_EXTRA_FLAGS "
 
160
CXXFLAGS="$CXXFLAGS $C_EXTRA_FLAGS "
 
161
 
 
162
dnl Checks for programs.
 
163
AC_PROG_CC
 
164
ifdef([AC_PROG_CC_C99],[
 
165
  AC_PROG_CC_C99([],[AC_MSG_ERROR([C99 support required for compiling Drizzle])])
 
166
  C99_SUPPORT_HACK=""
 
167
],[C99_SUPPORT_HACK="-std=gnu99"])
 
168
AC_PROG_CXX
 
169
AC_CXX_HEADER_STDCXX_98
 
170
if test "$ac_cv_cxx_stdcxx_98" = "no"
 
171
then
 
172
  AC_MSG_ERROR([C++ Compiler required to compile Drizzle])
 
173
fi
 
174
AC_PROG_CPP
 
175
AM_PROG_CC_C_O
 
176
 
 
177
# Print version of CC and CXX compiler (if they support --version)
 
178
case $SYSTEM_TYPE in
276
179
  *apple-darwin*)
277
 
    TARGET_OSX="true"
278
 
    AC_SUBST(TARGET_OSX)
279
180
    AC_DEFINE([TARGET_OS_OSX], [1], [Whether we build for OSX])
280
181
    ;;
281
 
  *solaris*)
282
 
    TARGET_SOLARIS="true"
283
 
    AC_SUBST(TARGET_SOLARIS)
284
 
    AC_DEFINE([TARGET_OS_SOLARIS], [1], [Whether we are building for Solaris])
285
 
    ;;
286
182
  *)
 
183
CC_VERSION=`$CC --version | sed 1q`
287
184
    ;;
288
185
esac
289
 
 
290
 
dnl AC_CANONICAL_HOST thinks it's a good idea to just set CFLAGS to 
291
 
dnl -g -O2 if you're running gcc. We would like to use something else, thanks.
292
 
if test "x${CFLAGS}" = "x-g -O2"
293
 
then
294
 
  CFLAGS=
295
 
fi
296
 
if test "x${CXXFLAGS}" = "x-g -O2"
297
 
then
298
 
  CXXFLAGS=
299
 
fi
300
 
 
301
 
DRIZZLE_CHECK_C_VERSION
 
186
if test $? -eq "0"
 
187
then
 
188
  AC_MSG_CHECKING("C Compiler version")
 
189
  AC_MSG_RESULT("$CC $CC_VERSION")
 
190
else
 
191
CC_VERSION=""
 
192
fi
 
193
AC_SUBST(CC_VERSION)
302
194
DRIZZLE_CHECK_CXX_VERSION
303
195
 
304
196
AC_PROG_AWK
311
203
  AC_PATH_PROG(AS, as, as)
312
204
fi
313
205
 
314
 
dnl TODO: This needs to go away and be replaced with _ISOC99_SOURCE
315
 
if test "$ac_cv_c_compiler_gnu" = "yes" -o "$target_os" = "linux-gnu"
316
 
then
317
 
  AC_DEFINE([_GNU_SOURCE],[1],[Fix problem with S_ISLNK() on Linux])
318
 
fi
319
 
 
320
 
dnl  Solaris 9 include file <sys/feature_tests.h> refers to X/Open document
321
 
 
322
 
dnl  System Interfaces and Headers, Issue 5
323
 
 
324
 
dnl  saying we should define _XOPEN_SOURCE=500 to get POSIX.1c prototypes,
325
 
dnl  but apparently other systems (namely FreeBSD) don't agree.
326
 
 
327
 
dnl  On a newer Solaris 10, the above file recognizes also _XOPEN_SOURCE=600.
328
 
dnl  Furthermore, it tests that if a program requires older standard
329
 
dnl  (_XOPEN_SOURCE<600 or _POSIX_C_SOURCE<200112L) it cannot be
330
 
dnl  run on a new compiler (that defines _STDC_C99) and issues an #error.
331
 
dnl  It's also an #error if a program requires new standard (_XOPEN_SOURCE=600
332
 
dnl  or _POSIX_C_SOURCE=200112L) and a compiler does not define _STDC_C99.
333
 
 
334
 
dnl  To add more to this mess, Sun Studio C compiler defines _STDC_C99 while
335
 
dnl  C++ compiler does not!
336
 
 
337
 
dnl TODO: Can _ISOC99_SOURCE be defined on all platforms and remove the 
338
 
dnl       Need for all of this? 
339
 
if test "$GCC" = "yes"
340
 
then
341
 
  case "$target_os" in
342
 
    *solaris*)
343
 
    CFLAGS="${CFLAGS} -D_XOPEN_SOURCE=600"
344
 
    CXXFLAGS="${CXXFLAGS} -D__C99FEATURES__"
345
 
    ;;
346
 
  esac
347
 
fi
348
 
 
349
206
# We use libtool
350
207
#AC_LIBTOOL_WIN32_DLL
351
208
AC_PROG_LIBTOOL
361
218
test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
362
219
 
363
220
# Not critical since the generated file is distributed
364
 
AC_CHECK_PROGS(YACC, ['bison -y -p DRIZZLE'])
 
221
AC_CHECK_PROGS(YACC, ['bison -y -p MYSQL'])
365
222
if test -z "$YACC" && test -d ".bzr"
366
223
then
367
224
  AC_MSG_ERROR(["bison is required for Drizzle to build from a bzr branch"])
382
239
])
383
240
AC_MSG_RESULT($mysql_cv_sys_os)
384
241
 
 
242
# This should be rewritten to use $target_os
 
243
case "$target_os" in
 
244
  *solaris*)
 
245
    TARGET_SOLARIS="true"
 
246
    AC_DEFINE([TARGET_OS_SOLARIS], [1], [Whether we are building for Solaris])
 
247
    AC_SUBST(TARGET_SOLARIS)
 
248
  ;;
 
249
esac
385
250
 
386
251
# The following is required for portable results of floating point calculations
387
252
# on PowerPC. The same must also be done for IA-64, but this options is missing
396
261
    ;;
397
262
  esac
398
263
fi
399
 
# Build optimized or debug version ?
400
 
# First check for gcc and g++
401
 
SYMBOLS_FLAGS="-g"
402
 
DEBUG_OPTIMIZE_CC=""
403
 
OPTIMIZE_CFLAGS="-O"
404
 
DEBUG_OPTIMIZE_CXX=""
405
 
OPTIMIZE_CXXFLAGS="-O"
406
 
if test "$GCC" = "yes"
407
 
then
408
 
  SYMBOLS_FLAGS="-ggdb3"
409
 
  DEBUG_OPTIMIZE_CC="-O0"
410
 
  OPTIMIZE_CFLAGS="-O3"
411
 
  DEBUG_OPTIMIZE_CXX="-O0"
412
 
  OPTIMIZE_CXXFLAGS="-O3"
413
 
fi
414
 
if test "$SUNCC" = "yes"
415
 
then
416
 
  dnl I'm cheating here and sticking C99 support in SYMBOLS_FLAGS
417
 
  SYMBOLS_FLAGS=""
418
 
  DEBUG_OPTIMIZE_CC=""
419
 
  OPTIMIZE_CFLAGS="-xO4 -xlibmil -xdepend -Xa -mt -xstrconst -D_FORTEC_"
420
 
  DEBUG_OPTIMIZE_CXX=""
421
 
  #Put back in once isnan is figured out
422
 
  OPTIMIZE_CXXFLAGS="-xO4 -xlibmil -mt -D_FORTEC_ -xlang=c99 -compat=5 -library=stlport4"
423
 
fi
424
 
 
425
 
dnl TODO: Remove this define once we are using 2.61 across the board.
426
 
# AX_HEADER_ASSERT
427
 
# ----------------
428
 
# Check whether to enable assertions.
429
 
AC_DEFUN([AX_HEADER_ASSERT],
430
 
[
431
 
  AC_MSG_CHECKING([whether to enable assertions])
432
 
  AC_ARG_ENABLE([assert],
433
 
    [AS_HELP_STRING([--disable-assert],
434
 
       [Turn off assertions])],
435
 
    [ac_cv_assert="no"],
436
 
    [ac_cv_assert="yes"])
437
 
  AC_MSG_RESULT([$ac_cv_assert])
438
 
])
439
 
 
440
 
AX_HEADER_ASSERT
441
 
 
442
 
CFLAGS="${SYMBOLS_FLAGS} ${CFLAGS}"
443
 
CXXFLAGS="${SYMBOLS_FLAGS} ${CXXFLAGS}"
444
 
 
445
 
AC_ARG_WITH([debug],
446
 
    [AS_HELP_STRING([--with-debug],
447
 
       [Add debug code/turns off optimizations (yes|no) @<:@default=no@:>@])],
448
 
    [with_debug=$withval],
449
 
    [with_debug=no])
450
 
if test "$with_debug" = "yes"
451
 
then
452
 
  # Medium debug.
453
 
  CFLAGS="$DEBUG_OPTIMIZE_CC -DDEBUG $CFLAGS ${SAVE_CFLAGS}"
454
 
  CXXFLAGS="$DEBUG_OPTIMIZE_CXX -DDEBUG $CXXFLAGS ${SAVE_CXXFLAGS}"
455
 
else
456
 
  # Optimized version. No debug
457
 
  CFLAGS="${OPTIMIZE_CFLAGS} ${CFLAGS} ${SAVE_CFLAGS}"
458
 
  CXXFLAGS="$OPTIMIZE_CXXFLAGS $CXXFLAGS ${SAVE_CXXFLAGS}"
459
 
fi
460
264
 
461
265
AC_SUBST(CC)
462
266
AC_SUBST(CFLAGS)
469
273
 
470
274
export CC CXX CFLAGS LD LDFLAGS AR ARFLAGS
471
275
 
472
 
AC_CXX_STL_HASH
473
 
AC_CXX_CSTDINT
474
 
AC_CXX_CINTTYPES
475
 
AC_CXX_CMATH
 
276
if test "$GCC" = "yes"
 
277
then
 
278
  # Disable exceptions as they seams to create problems with gcc and threads.
 
279
  # drizzled doesn't use run-time-type-checking, so we disable it.
 
280
  AM_CXXFLAGS="${AM_CXXFLAGS} -fno-exceptions -fno-rtti"
 
281
fi
476
282
 
477
283
DRIZZLE_PROG_AR
478
284
 
479
285
# libdrizzle versioning when linked with GNU ld.
480
 
if test "$GCC" = "yes" -a $LD --version 2>/dev/null|grep -q GNU; then
 
286
if $LD --version 2>/dev/null|grep -q GNU; then
481
287
  LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_srcdir)/libdrizzle/libdrizzle.ver"
482
288
fi
483
289
AC_SUBST(LD_VERSION_SCRIPT)
486
292
# Check for Google Proto Buffers
487
293
#--------------------------------------------------------------------
488
294
 
489
 
AC_MSG_CHECKING(for Google Protocol Buffers)
490
 
AC_ARG_WITH(protobuf,
491
 
  [AS_HELP_STRING([--with-protobuf@<:@=DIR@:>@],
492
 
       [search for protobuf in DIR/include and DIR/lib])],
493
 
  [ with_protobuf=$withval ],
494
 
  [ with_protobuf=yes ])
495
 
 
496
 
save_CPPFLAGS="$CPPFLAGS"
497
 
save_LIBS="$LIBS"
498
 
 
499
 
if test "$with_protobuf" = "yes"
500
 
then
501
 
  CPPFLAGS=""
502
 
  LIBS="-lprotobuf"
503
 
  PROTO_PATH="$PATH"
504
 
else
505
 
  CPPFLAGS="-I$withval/include"
506
 
  LIBS="-L$withval/lib -lprotobuf"
507
 
  PROTO_PATH="${withval}/bin:$PATH"
508
 
fi 
509
 
 
510
 
AC_CHECK_TOOL([PROTOC],[protoc],[no],[$PROTO_PATH])
511
 
if test "x$PROTOC" = "xno"
512
 
then
513
 
  AC_MSG_ERROR([Couldn't find protoc. Try installing Google Protocol Buffer.])
514
 
fi
515
 
 
516
295
AC_LANG_PUSH([C++])
517
296
AC_CHECK_HEADERS([google/protobuf/message.h])
518
297
if test "x$ac_cv_header_google_protobuf_message_h" != "xyes"
519
298
then
520
299
  AC_MSG_ERROR([Couldn't find message.h. Try installing Google Protocol Buffer development packages])
521
300
fi
522
 
AC_MSG_RESULT("$wthval")
 
301
 
 
302
save_CFLAGS="$CFLAGS"
 
303
save_LIBS="$LIBS"
 
304
CFLAGS=""
 
305
LIBS="-lprotobuf"
523
306
 
524
307
AC_CACHE_CHECK([for Message in libprotobuf], ac_libprotobuf_works, [
525
308
  AC_TRY_LINK([
533
316
])
534
317
 
535
318
PROTOBUF_LIBS="${LIBS}"
536
 
PROTOBUF_CPPFLAGS="${CPPFLAGS}"
537
319
AC_SUBST(PROTOBUF_LIBS)
538
 
AC_SUBST(PROTOBUF_CPPFLAGS)
539
 
CPPFLAGS="$save_CPPFLAGS"
 
320
CFLAGS="$save_CFLAGS"
540
321
LIBS="$save_LIBS"
541
322
AC_LANG_POP()
542
323
 
543
324
#--------------------------------------------------------------------
544
 
# Check for libuuid
545
 
#--------------------------------------------------------------------
546
 
 
547
 
AC_CHECK_HEADERS(uuid/uuid.h)
548
 
if test "x$ac_cv_header_uuid_uuid_h" = "xno"
549
 
then
550
 
  AC_MSG_ERROR([Couldn't find uuid/uuid.h. Try installing libuuid development packages])
551
 
fi
552
 
AC_CHECK_LIB(uuid, uuid_generate)
553
 
 
554
 
#--------------------------------------------------------------------
555
325
# Check for libevent
556
326
#--------------------------------------------------------------------
557
327
 
558
328
AC_MSG_CHECKING(for libevent)
559
329
AC_ARG_WITH(libevent,
560
 
  [AS_HELP_STRING([--with-libevent@<:@=DIR@:>@],
561
 
       [Use libevent in DIR])],
 
330
  [AS_HELP_STRING([--with-libevent],
 
331
       [Use libevent build directory])],
562
332
  [ with_libevent=$withval ],
563
333
  [ with_libevent=yes ])
564
334
 
574
344
    AC_CHECK_LIB(event, event_loop, [], [AC_MSG_ERROR(could not find libevent)])
575
345
    LIBEVENT_LIBS="${LIBS}"
576
346
    LIBS="${my_save_LIBS}"
577
 
    LIBEVENT_CPPFLAGS=""
 
347
    LIBEVENT_CFLAGS=""
578
348
else
579
349
    AC_MSG_RESULT($withval)
580
350
    if test -f $withval/event.h -a -f $withval/libevent.a; then
581
351
       owd=`pwd`
582
352
       if cd $withval; then withval=`pwd`; cd $owd; fi
583
 
       LIBEVENT_CPPFLAGS="-I$withval"
 
353
       LIBEVENT_CFLAGS="-I$withval"
584
354
       LIBEVENT_LIBS="-L$withval -levent"
585
355
    elif test -f $withval/include/event.h -a -f $withval/lib/libevent.a; then
586
356
       owd=`pwd`
587
357
       if cd $withval; then withval=`pwd`; cd $owd; fi
588
 
       LIBEVENT_CPPFLAGS="-I$withval/include"
 
358
       LIBEVENT_CFLAGS="-I$withval/include"
589
359
       LIBEVENT_LIBS="-L$withval/lib -levent"
590
360
    else
591
361
       AC_MSG_ERROR([event.h or libevent.a not found in $withval])
592
362
    fi
593
363
fi
594
364
 
595
 
AC_SUBST(LIBEVENT_CPPFLAGS)
 
365
AC_SUBST(LIBEVENT_CFLAGS)
596
366
AC_SUBST(LIBEVENT_LIBS)
597
367
 
598
368
AC_CACHE_CHECK([for bufferevent in libevent], ac_libevent_works, [
599
 
  save_CPPFLAGS="$CPPFLAGS"
 
369
  save_CFLAGS="$CFLAGS"
600
370
  save_LIBS="$LIBS"
601
 
  CPPFLAGS="$LIBEVENT_CPPFLAGS"
 
371
  CFLAGS="$LIBEVENT_CFLAGS"
602
372
  LIBS="$LIBEVENT_LIBS"
603
373
  AC_TRY_LINK([
604
374
#include <sys/types.h>
612
382
        check http://www.monkey.org/~provos/libevent/])
613
383
  ])
614
384
 
615
 
  CPPFLAGS="$save_CPPFLAGS"
 
385
  CFLAGS="$save_CFLAGS"
616
386
  LIBS="$save_LIBS"
617
387
])
618
388
 
814
584
  FIND_PROC="$PS \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
815
585
else
816
586
  case $SYSTEM_TYPE in
817
 
    *freebsd*|*dragonfly*|*cygwin*)
 
587
    *freebsd*|*dragonfly*)
818
588
      FIND_PROC="$PS p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
819
589
      ;;
820
590
    *darwin*)
866
636
    [ DRIZZLE_SERVER_SUFFIX=`echo "$withval" | sed -e  's/^\(...................................\)..*$/\1/'` ],
867
637
    [ DRIZZLE_SERVER_SUFFIX= ]
868
638
    )
869
 
AC_DEFINE_UNQUOTED([DRIZZLE_SERVER_SUFFIX],[$DRIZZLE_SERVER_SUFFIX],
870
 
                   [Append value to the version string])
 
639
AC_SUBST(DRIZZLE_SERVER_SUFFIX)
871
640
 
872
641
# Force use of a curses libs
873
642
AC_ARG_WITH([named-curses-libs],
914
683
AC_SUBST(DRIZZLE_TCP_PORT)
915
684
# We might want to document the assigned port in the manual.
916
685
AC_SUBST(DRIZZLE_TCP_PORT_DEFAULT)
917
 
AC_DEFINE_UNQUOTED([DRIZZLE_PORT],[$DRIZZLE_TCP_PORT],
918
 
                   [Drizzle port to use])
919
 
AC_DEFINE_UNQUOTED([DRIZZLE_PORT_DEFAULT],[$DRIZZLE_TCP_PORT_DEFAULT],
920
 
                   [If we defaulted to DRIZZLE_PORT, then this will be zero])
921
686
 
922
687
# Use this to set the place used for unix socket used to local communication.
923
 
AC_ARG_WITH([drizzled-user],
924
 
    [AS_HELP_STRING([--with-drizzled-user=username],
925
 
            [What user the drizzled daemon shall be run as.
926
 
                @<:@default=drizzle@:>@])],
927
 
    [ DRIZZLED_USER=$withval ],
928
 
    [ DRIZZLED_USER=drizzle ]
 
688
AC_ARG_WITH([mysqld-user],
 
689
    [AS_HELP_STRING([--with-mysqld-user=username],
 
690
            [What user the mysqld daemon shall be run as.
 
691
                @<:@default=mysql@:>@])],
 
692
    [ MYSQLD_USER=$withval ],
 
693
    [ MYSQLD_USER=mysql ]
929
694
    )
930
 
AC_SUBST(DRIZZLED_USER)
 
695
AC_SUBST(MYSQLD_USER)
931
696
 
932
697
# If we should allow LOAD DATA LOCAL
933
698
AC_MSG_CHECKING(If we should should enable LOAD DATA LOCAL by default)
945
710
  AC_MSG_RESULT([no])
946
711
fi
947
712
 
948
 
AC_SYS_LARGEFILE
949
 
AC_FUNC_FSEEKO
 
713
DRIZZLE_SYS_LARGEFILE
950
714
 
951
715
# Types that must be checked AFTER large file support is checked
952
716
AC_TYPE_SIZE_T
962
726
AC_CHECK_HEADERS(fcntl.h float.h fpu_control.h ieeefp.h)
963
727
AC_CHECK_HEADERS(limits.h pwd.h select.h linux/config.h)
964
728
AC_CHECK_HEADERS(sys/fpu.h utime.h sys/utime.h )
965
 
AC_CHECK_HEADERS(synch.h sys/mman.h sys/socket.h)
966
 
AC_CHECK_HEADERS([curses.h term.h],[],[],
967
 
[[#ifdef HAVE_CURSES_H
968
 
# include <curses.h>
969
 
#endif
970
 
]])
 
729
AC_CHECK_HEADERS(synch.h sys/mman.h sys/socket.h netinet/in.h arpa/inet.h)
 
730
AC_CHECK_HEADERS(sys/timeb.h sys/vadvise.h sys/wait.h term.h)
971
731
AC_CHECK_HEADERS(termio.h termios.h sched.h alloca.h)
972
 
AC_CHECK_HEADERS(sys/prctl.h ieeefp.h)
 
732
AC_CHECK_HEADERS(sys/ioctl.h malloc.h sys/malloc.h sys/ipc.h sys/shm.h)
 
733
AC_CHECK_HEADERS(sys/prctl.h sys/resource.h sys/param.h port.h ieeefp.h)
973
734
AC_CHECK_HEADERS(execinfo.h)
974
735
 
 
736
AC_CHECK_HEADERS([xfs/xfs.h])
 
737
 
975
738
#--------------------------------------------------------------------
976
739
# Check for system libraries. Adds the library to $LIBS
977
740
# and defines HAVE_LIBM etc
978
741
#--------------------------------------------------------------------
979
742
 
980
743
AC_CHECK_LIB(m, floor, [], AC_CHECK_LIB(m, __infinity))
 
744
AC_CHECK_FUNCS(log2)
981
745
 
982
746
AC_CHECK_FUNC(setsockopt, [], [AC_CHECK_LIB(socket, setsockopt)])
983
747
AC_CHECK_FUNC(yp_get_default_domain, [],
1001
765
  AC_CHECK_FUNC(gtty, [], [AC_CHECK_LIB(compat, gtty)])
1002
766
fi
1003
767
 
 
768
AC_CHECK_TYPES([int8, uint8, int16, uint16, int32, uint32, int64, uint64,
 
769
                uchar, uint, ulong],[],[], [
 
770
#include <sys/types.h>
 
771
])
1004
772
AC_CHECK_TYPES([fp_except], [], [], [
1005
773
#include <sys/types.h>
1006
774
#include <ieeefp.h>
1009
777
my_save_LIBS="$LIBS"
1010
778
LIBS=""
1011
779
AC_CHECK_LIB(dl,dlopen)
1012
 
AC_CHECK_FUNCS(dlopen)
 
780
AC_CHECK_FUNCS(dlopen dlerror)
1013
781
if test "$ac_cv_func_dlopen" != "yes"
1014
782
then
1015
783
  AC_MSG_ERROR([Drizzle requires dlopen])
1020
788
 
1021
789
AC_CHECK_FUNCS(strtok_r)
1022
790
 
 
791
# Build optimized or debug version ?
 
792
# First check for gcc and g++
 
793
if test "$ac_cv_c_compiler_gnu" = "yes"
 
794
then
 
795
  SYMBOLS_CFLAGS="-ggdb3"
 
796
  DEBUG_OPTIMIZE_CC="-O0"
 
797
  OPTIMIZE_CFLAGS="-O3"
 
798
else
 
799
  SYMBOLS_CFLAGS="-g"
 
800
  DEBUG_OPTIMIZE_CC=""
 
801
  OPTIMIZE_CFLAGS="-O"
 
802
fi
 
803
if test "$ac_cv_prog_cxx_g" = "yes"
 
804
then
 
805
  SYMBOLS_CXXFLAGS="-ggdb3"
 
806
  DEBUG_OPTIMIZE_CXX="-O0"
 
807
  OPTIMIZE_CXXFLAGS="-O3"
 
808
else
 
809
  SYMBOLS_CXXFLAGS="-g"
 
810
  DEBUG_OPTIMIZE_CXX=""
 
811
  OPTIMIZE_CXXFLAGS="-O"
 
812
fi
 
813
 
 
814
# If the user specified CFLAGS, we won't add any optimizations
 
815
if test -n "$SAVE_CFLAGS"
 
816
then
 
817
  OPTIMIZE_CFLAGS=""
 
818
  DEBUG_OPTIMIZE_CC=""
 
819
fi
 
820
# Ditto for CXXFLAGS
 
821
if test -n "$SAVE_CXXFLAGS"
 
822
then
 
823
  OPTIMIZE_CXXFLAGS=""
 
824
  DEBUG_OPTIMIZE_CXX=""
 
825
fi
 
826
 
 
827
dnl TODO: Remove this define once we are using 2.61 across the board.
 
828
# AC_HEADER_ASSERT
 
829
# ----------------
 
830
# Check whether to enable assertions.
 
831
ifdef([AC_HEADER_ASSERT], [], [AC_DEFUN([AC_HEADER_ASSERT],
 
832
[
 
833
  AC_MSG_CHECKING([whether to enable assertions])
 
834
  AC_ARG_ENABLE([assert],
 
835
    [  --disable-assert        turn off assertions],
 
836
    [AC_MSG_RESULT([no])
 
837
     AC_DEFINE(NDEBUG, 1, [Define to 1 if assertions should be disabled.])],
 
838
    [AC_MSG_RESULT(yes)])
 
839
])])
 
840
 
 
841
AC_HEADER_ASSERT
 
842
 
 
843
CFLAGS="${SYMBOLS_CFLAGS} ${CFLAGS}"
 
844
CXXFLAGS="${SYMBOLS_CXXFLAGS} ${CXXFLAGS}"
 
845
 
 
846
AC_ARG_WITH([debug],
 
847
    [AS_HELP_STRING([--with-debug],
 
848
       [Add debug code/turns off optimizations (yes|no) @<:@default=no@:>@])],
 
849
    [with_debug=$withval],
 
850
    [with_debug=no])
 
851
if test "$with_debug" = "yes"
 
852
then
 
853
  # Medium debug.
 
854
  CFLAGS="$DEBUG_OPTIMIZE_CC $CFLAGS"
 
855
  CXXFLAGS="$DEBUG_OPTIMIZE_CXX $CXXFLAGS"
 
856
else
 
857
  # Optimized version. No debug
 
858
  CFLAGS="$OPTIMIZE_CFLAGS $CFLAGS"
 
859
  CXXFLAGS="$OPTIMIZE_CXXFLAGS $CXXFLAGS"
 
860
fi
1023
861
 
1024
862
 
1025
863
AC_ARG_WITH([fast-mutexes],
1047
885
else
1048
886
  COMPILATION_COMMENT="Source distribution"
1049
887
fi
1050
 
AC_DEFINE_UNQUOTED([COMPILATION_COMMENT],["$COMPILATION_COMMENT"],
1051
 
                   [Comment about compilation environment])
 
888
AC_SUBST(COMPILATION_COMMENT)
 
889
 
 
890
if expr "$target_os" : "[[Ll]]inux.*" > /dev/null
 
891
then
 
892
  TARGET_LINUX="true"
 
893
  AC_DEFINE([TARGET_OS_LINUX], [1], [Whether we build for Linux])
 
894
else
 
895
  TARGET_LINUX="false"
 
896
fi
1052
897
 
1053
898
dnl Checks for typedefs, structures, and compiler characteristics.
1054
899
AC_C_CONST
1056
901
AC_TYPE_OFF_T
1057
902
AC_HEADER_TIME
1058
903
AC_STRUCT_TM
 
904
# AC_CHECK_SIZEOF return 0 when it does not find the size of a
 
905
# type. We want a error instead.
 
906
AC_CHECK_SIZEOF(char, 1)
 
907
if test "$ac_cv_sizeof_char" -eq 0
 
908
then
 
909
  AC_MSG_ERROR([No size for char type.])
 
910
fi
 
911
AC_CHECK_SIZEOF(char*, 4)
 
912
AC_CHECK_SIZEOF(short, 2)
 
913
AC_CHECK_SIZEOF(int, 4)
 
914
if test "$ac_cv_sizeof_int" -eq 0
 
915
then
 
916
  AC_MSG_ERROR("No size for int type.")
 
917
fi
 
918
AC_CHECK_SIZEOF(long, 4)
 
919
if test "$ac_cv_sizeof_long" -eq 0
 
920
then
 
921
  AC_MSG_ERROR("No size for long type.")
 
922
fi
 
923
AC_CHECK_SIZEOF(long long, 8)
 
924
if test "$ac_cv_sizeof_long_long" -eq 0
 
925
then
 
926
  AC_MSG_ERROR("Drizzle needs a long long type.")
 
927
fi
1059
928
# off_t is not a builtin type
1060
929
AC_CHECK_SIZEOF(off_t, 4)
1061
930
if test "$ac_cv_sizeof_off_t" -eq 0
1070
939
DRIZZLE_CHECK_TIME_T
1071
940
 
1072
941
 
 
942
# do we need #pragma interface/#pragma implementation ?
 
943
# yes if it's gcc 2.x, and not icc pretending to be gcc, and not cygwin
 
944
AC_MSG_CHECKING(the need for @%:@pragma interface/implementation)
 
945
# instead of trying to match SYSTEM_TYPE and CC_VERSION (that doesn't
 
946
# follow any standard), we'll use well-defined preprocessor macros:
 
947
AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
 
948
#if !defined(__CYGWIN__) && !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ < 3)
 
949
#error USE_PRAGMA_IMPLEMENTATION
 
950
#endif
 
951
]])],[AC_MSG_RESULT(no) ],[AC_MSG_RESULT(yes) ; CXXFLAGS="$CXXFLAGS -DUSE_PRAGMA_IMPLEMENTATION"])
 
952
 
1073
953
# This always gives a warning. Ignore it unless you are cross compiling
1074
954
AC_C_BIGENDIAN
1075
955
#---START: Used in for client configure
1086
966
DRIZZLE_TIMESPEC_TS
1087
967
# Do we have the tzname variable
1088
968
DRIZZLE_TZNAME
 
969
# Do the c++ compiler have a bool type
 
970
DRIZZLE_CXX_BOOL
1089
971
AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>])
1090
 
AC_CHECK_TYPES([uint, ulong])
 
972
AC_CHECK_TYPES([size_t], [], [], [#include <stdio.h>])
 
973
AC_CHECK_TYPES([u_int32_t])
1091
974
 
1092
975
DRIZZLE_PTHREAD_YIELD
1093
976
 
1094
977
 
1095
978
dnl Checks for header files.
1096
 
AC_CHECK_HEADERS(malloc.h)
 
979
AC_CHECK_HEADERS(malloc.h sys/cdefs.h)
1097
980
 
1098
981
dnl Checks for library functions.
1099
982
AC_FUNC_ALLOCA
1100
983
AC_PROG_GCC_TRADITIONAL
1101
984
AC_TYPE_SIGNAL
1102
 
 
 
985
AC_CHECK_FUNCS(re_comp regcomp strdup)
 
986
 
 
987
dnl Sun compilers have their own vis.h that is about something
 
988
dnl totally different. So, not to change the libedit source, we
 
989
dnl do some additional checks before we define HAVE_VIS_H.
 
990
AC_CHECK_HEADER(vis.h,
 
991
  [AC_CHECK_FUNC(strvis,
 
992
    [AC_DEFINE([HAVE_VIS_H], [1],[Found vis.h and the strvis() function])])])
 
993
 
 
994
AC_CHECK_FUNCS(strlcat strlcpy)
1103
995
AC_CHECK_FUNCS(issetugid)
 
996
AC_CHECK_FUNCS(getline flockfile)
1104
997
 
1105
998
# from old readline settting:
1106
999
 
1108
1001
AC_SUBST(MAKE_SHELL)
1109
1002
 
1110
1003
# Already-done: stdlib.h string.h unistd.h termios.h
1111
 
AC_CHECK_HEADERS(stdarg.h dirent.h locale.h ndir.h sys/dir.h \
1112
 
 sys/ndir.h sys/select.h \
1113
 
 sys/mman.h termcap.h termio.h asm/termbits.h grp.h \
1114
 
 paths.h)
 
1004
AC_CHECK_HEADERS(varargs.h stdarg.h dirent.h locale.h ndir.h sys/dir.h \
 
1005
 sys/file.h sys/ndir.h sys/ptem.h sys/pte.h sys/select.h sys/stream.h \
 
1006
 sys/mman.h curses.h termcap.h termio.h termbits.h asm/termbits.h grp.h \
 
1007
paths.h semaphore.h)
1115
1008
 
1116
1009
# Already-done: strcasecmp
1117
 
AC_CHECK_FUNCS(lstat select)
 
1010
AC_CHECK_FUNCS(lstat putenv select setenv setlocale strcoll tcgetattr)
1118
1011
 
1119
1012
AC_HEADER_STAT
1120
1013
DRIZZLE_SIGNAL_CHECK
1121
1014
DRIZZLE_CHECK_GETPW_FUNCS
1122
1015
DRIZZLE_HAVE_TIOCGWINSZ
 
1016
DRIZZLE_HAVE_FIONREAD
1123
1017
DRIZZLE_HAVE_TIOCSTAT
 
1018
DRIZZLE_STRUCT_DIRENT_D_INO
 
1019
DRIZZLE_STRUCT_DIRENT_D_NAMLEN
1124
1020
DRIZZLE_TYPE_SIGHANDLER
 
1021
DRIZZLE_CHECK_MULTIBYTE
1125
1022
if test "$with_named_curses" = "no"
1126
1023
then
1127
1024
  DRIZZLE_CHECK_LIB_TERMCAP
1130
1027
fi
1131
1028
AC_SUBST(TERMCAP_LIBS)
1132
1029
 
 
1030
# Check if the termcap function 'tgoto' is already declared in
 
1031
# system header files or if it need to be declared locally
 
1032
AC_CHECK_DECLS(tgoto,,,[
 
1033
#ifdef HAVE_CURSES_H
 
1034
# include <curses.h>
 
1035
#elif HAVE_NCURSES_H
 
1036
# include <ncurses.h>
 
1037
#endif
 
1038
#ifdef HAVE_TERM_H
 
1039
# include <term.h>
 
1040
#endif
 
1041
])
 
1042
 
1133
1043
# End of readline/libedit stuff
1134
1044
#########################################################################
1135
1045
 
1158
1068
fi
1159
1069
 
1160
1070
AC_CONFIG_LIBOBJ_DIR([mystrings])
 
1071
AC_REPLACE_FUNCS([stpcpy stpncpy])
1161
1072
 
1162
 
AC_CHECK_FUNCS( \
 
1073
AC_CHECK_FUNCS(bsearch \
1163
1074
  cuserid fchmod \
1164
 
  fdatasync fpresetsticky fpsetmask fsync \
1165
 
  getcwd getpassphrase getpwnam \
 
1075
  fdatasync finite fpresetsticky fpsetmask fsync ftruncate \
 
1076
  getcwd getpass getpassphrase getpwnam \
1166
1077
  getpwuid getrlimit getrusage getwd index initgroups isnan \
1167
1078
  localtime_r gethrtime gmtime_r \
1168
 
  madvise \
1169
 
  mkstemp mlockall poll pread pthread_attr_create mmap mmap64 \
 
1079
  locking longjmp lrand48 madvise mallinfo \
 
1080
  memmove \
 
1081
  mkstemp mlockall perror poll pread pthread_attr_create mmap mmap64 \
1170
1082
  pthread_attr_getstacksize pthread_attr_setprio pthread_attr_setschedparam \
1171
1083
  pthread_attr_setstacksize pthread_condattr_create pthread_getsequence_np \
1172
1084
  pthread_key_delete pthread_rwlock_rdlock pthread_setprio \
1173
1085
  pthread_setprio_np pthread_setschedparam pthread_sigmask readlink \
1174
 
  realpath rename rwlock_init setupterm \
1175
 
  sigaction \
1176
 
  sigthreadmask \
1177
 
  snprintf strpbrk \
1178
 
  tell tempnam \
1179
 
  backtrace backtrace_symbols backtrace_symbols_fd)
 
1086
  realpath rename rint rwlock_init setupterm \
 
1087
  shmget shmat shmdt shmctl sigaction sigemptyset sigaddset \
 
1088
  sighold sigset sigthreadmask port_create sleep \
 
1089
  snprintf socket strcasecmp strerror strsignal strpbrk \
 
1090
  tell tempnam vidattr \
 
1091
  posix_fallocate backtrace backtrace_symbols backtrace_symbols_fd)
1180
1092
 
1181
1093
AC_LANG_PUSH(C++)
1182
1094
# Test whether madvise() is declared in C++ code -- it is not on some
1183
1095
# systems, such as Solaris
1184
 
AC_CHECK_DECLS([madvise], [], [], [AC_INCLUDES_DEFAULT[
1185
 
#if HAVE_SYS_MMAN_H
 
1096
AC_CHECK_DECLS(madvise, [], [], [#if HAVE_SYS_MMAN_H
1186
1097
#include <sys/types.h>
1187
1098
#include <sys/mman.h>
1188
 
#endif
1189
 
]])
 
1099
#endif])
1190
1100
AC_LANG_POP()
1191
1101
 
1192
1102
 
1193
1103
AM_CONDITIONAL(BUILD_THR_RWLOCK,[test "$ac_cv_func_rwlock_init" -a "$ac_cv_funn_pthread_rwlock_rdlock"])
1194
1104
 
 
1105
# Check that isinf() is available in math.h and can be used in both C and C++
 
1106
# code
 
1107
AC_MSG_CHECKING(for isinf in math.h)
 
1108
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]], [[
 
1109
    float f = 0.0; 
 
1110
    int r = isinf(f); 
 
1111
    return r;
 
1112
  ]])],[
 
1113
    AC_MSG_RESULT(yes)
 
1114
    AC_MSG_CHECKING(whether isinf() can be used in C++ code)
 
1115
    AC_LANG_PUSH([C++])
 
1116
    AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]], [[
 
1117
      float f = 0.0;
 
1118
      int r = isinf(f);
 
1119
      return r;
 
1120
    ]])],[
 
1121
      AC_MSG_RESULT(yes)
 
1122
      AC_DEFINE(HAVE_ISINF, [1], [isinf() macro or function])
 
1123
    ],[
 
1124
      AC_MSG_RESULT(no)
 
1125
    ])
 
1126
    AC_LANG_POP([])
 
1127
  ],[
 
1128
  AC_MSG_RESULT(no)])
 
1129
 
1195
1130
 
1196
1131
CFLAGS="$ORG_CFLAGS"
1197
1132
 
1198
1133
# Sanity check: We chould not have any fseeko symbol unless
1199
1134
# large_file_support=yes
1200
1135
AC_CHECK_FUNC(fseeko,
1201
 
[if test "$large_file_support" = no -a "x$TARGET_LINUX" = "xtrue";
 
1136
[if test "$large_file_support" = no -a "$TARGET_LINUX" = "true";
1202
1137
then
1203
1138
  AC_MSG_ERROR("Found fseeko symbol but large_file_support is not enabled!")
1204
1139
fi]
1314
1249
  AC_DEFINE([HAVE_PTHREAD_ATTR_SETSCOPE], [1], [pthread_attr_setscope])
1315
1250
fi
1316
1251
 
 
1252
# Check for bad includes
 
1253
AC_MSG_CHECKING("can netinet files be included")
 
1254
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
 
1255
#include <sys/socket.h>
 
1256
#include <netinet/in_systm.h>
 
1257
#include <netinet/in.h>
 
1258
#include <netinet/ip.h>
 
1259
#include <netinet/tcp.h>]], [[ printf("1\n"); ]])],[netinet_inc=yes],[netinet_inc=no])
 
1260
if test "$netinet_inc" = "no"
 
1261
then
 
1262
  AC_DEFINE([HAVE_BROKEN_NETINET_INCLUDES], [1], [Can netinet be included])
 
1263
fi
 
1264
AC_MSG_RESULT("$netinet_inc")
 
1265
 
1317
1266
AC_LANG_PUSH([C++])
1318
1267
AC_CHECK_HEADERS(cxxabi.h)
1319
1268
AC_CACHE_CHECK([checking for abi::__cxa_demangle], mysql_cv_cxa_demangle,
1332
1281
# Check for requested features
1333
1282
#--------------------------------------------------------------------
1334
1283
 
 
1284
DRIZZLE_CHECK_BIG_TABLES
1335
1285
DRIZZLE_CHECK_MAX_INDEXES
1336
1286
DRIZZLE_CHECK_VIO
1337
1287
 
1347
1297
AC_SUBST(mysql_plugin_libs)
1348
1298
AC_SUBST(mysql_plugin_defs)
1349
1299
 
1350
 
 
1351
1300
AC_ARG_ENABLE([profiling],
1352
1301
    [AS_HELP_STRING([--enable-profiling],
1353
1302
       [Toggle profiling @<:@default=off@:>@])],
1390
1339
    [ac_warn_strict_aliasing="$enableval"],
1391
1340
    [ac_warn_strict_aliasing="no"])
1392
1341
 
1393
 
AC_ARG_ENABLE([cast-warnings],
1394
 
    [AS_HELP_STRING([--enable-cast-warnings],
1395
 
       [Enable warnings about use of old C-style casts @<:@default=off@:>@])],
1396
 
    [ac_warn_cast="$enableval"],
1397
 
    [ac_warn_cast="no"])
1398
 
 
1399
 
AC_ARG_ENABLE([effective-style],
1400
 
    [AS_HELP_STRING([--enable-effective-style],
1401
 
       [Enable warnings violating Effective C++ Style Guidelines @<:@default=off@:>@])],
1402
 
    [ac_warn_effc="$enableval"],
1403
 
    [ac_warn_effc="no"])
1404
 
 
1405
 
AC_ARG_ENABLE([go-crazy],
1406
 
    [AS_HELP_STRING([--enable-go-crazy],
1407
 
       [Enables extra little warnings that might be too much @<:@default=off@:>@])],
1408
 
    [ac_warn_go_crazy="$enableval"],
1409
 
    [ac_warn_go_crazy="no"])
1410
 
 
1411
1342
 
1412
1343
if test "$GCC" = "yes"
1413
1344
then
1414
1345
 
1415
 
 
1416
 
  if test "$ac_warn_fail" = "yes"
1417
 
  then
1418
 
    W_FAIL="-Werror"
1419
 
  fi
1420
 
  BASE_WARNINGS="-W -Wall -Wextra -Wunused-macros ${W_FAIL}"
1421
 
 
1422
1346
  if test "$ac_warn_longlong" = "yes"
1423
1347
  then
1424
1348
    W_LONGLONG="-Wlong-long"
1449
1373
 
1450
1374
  if test "$ac_warn_pedantic" = "yes"
1451
1375
  then
1452
 
    save_CXXFLAGS="${CXXFLAGS}"
1453
 
    CXXFLAGS="${CXXFLAGS} ${W_FAIL} -Wredundant-decls"
1454
 
    AC_CACHE_CHECK([whether it is safe to use -Wredundant-decls],
1455
 
      [ac_cv_safe_to_use_Wredundant_decls_],
1456
 
      [AC_LANG_PUSH(C++)
1457
 
       AC_COMPILE_IFELSE(
1458
 
         [AC_LANG_PROGRAM([
1459
 
template <typename E> struct C { void foo(); };
1460
 
template <typename E> void C<E>::foo() { }
1461
 
template <> void C<int>::foo();
1462
 
            AC_INCLUDES_DEFAULT])],
1463
 
          [ac_cv_safe_to_use_Wredundant_decls_=yes],
1464
 
          [ac_cv_safe_to_use_Wredundant_decls_=no])
1465
 
        AC_LANG_POP()])
1466
 
    if test $ac_cv_safe_to_use_Wredundant_decls_ = yes
1467
 
    then
1468
 
      GXX_W_REDUNDANT_DECLS="-Wredundant-decls"
1469
 
    else
1470
 
      GXX_W_REDUNDANT_DECLS="-Wno-redundant-decls"
1471
 
    fi
1472
 
    
1473
1376
    GCC_PEDANTIC="-pedantic -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls ${W_STRICT_ALIASING}"
1474
 
    GXX_PEDANTIC="-pedantic -Wundef ${GXX_W_REDUNDANT_DECLS} ${W_LONGLONG} ${W_STRICT_ALIASING}"
1475
 
 
1476
 
    AC_CACHE_CHECK([whether __attribute__ visibility "hidden" is supported],
1477
 
      [ac_cv_can_use_hidden_],
1478
 
      [AC_LANG_PUSH(C++)
1479
 
       AC_COMPILE_IFELSE(
1480
 
         [AC_LANG_PROGRAM([
1481
 
          AC_INCLUDES_DEFAULT
1482
 
__attribute__((visibility ("hidden")))
1483
 
void testme() {  };],[
1484
 
     testme();])],  
1485
 
         [ac_cv_can_use_hidden_=yes],
1486
 
         [ac_cv_can_use_hidden_=no])
1487
 
       AC_LANG_POP()])
1488
 
    if test "$ac_cv_can_use_hidden_" = "yes"
1489
 
    then
1490
 
      AC_DEFINE(HAVE_ATTR_HIDDEN, 1,
1491
 
                [Define to 1 if you have support for __attribute__((visibility("hidden")))])
1492
 
    fi
1493
 
 
1494
 
    CXXFLAGS="${save_CXXFLAGS}"
 
1377
    GXX_PEDANTIC="-pedantic -Wundef -Wredundant-decls ${W_LONGLONG} ${W_STRICT_ALIASING}"
1495
1378
  fi
1496
1379
 
1497
1380
  if test "$ac_warn_unreachable" = "yes"
1498
1381
  then
1499
1382
    W_UNREACHABLE="-Wunreachable-code"
1500
1383
  fi
1501
 
  if test "$ac_warn_cast" = "yes"
1502
 
  then
1503
 
    W_CAST="-Wold-style-cast"
1504
 
  fi
1505
 
 
1506
 
  if test "$ac_warn_effc" = "yes"
1507
 
  then
1508
 
    W_EFFC="-Weffc++"
1509
 
  fi
1510
 
 
1511
 
  if test "$ac_warn_gocrazy" = "yes"
1512
 
  then
1513
 
    W_CRAZY="-Wshadow -Wconversion -Winvalid-pch"
1514
 
  fi
1515
 
 
1516
 
  CC_WARNINGS="${C99_SUPPORT_HACK} ${BASE_WARNINGS} ${GCC_PEDANTIC} ${W_UNREACHABLE} ${GPROF_PROFILING} ${GPROF_COVERAGE} ${W_CRAZY}"
1517
 
  CXX_WARNINGS="${BASE_WARNINGS} ${GXX_PEDANTIC} ${W_UNREACHABLE} ${GPROF_PROFILING} ${GPROF_COVERAGE} ${W_CAST} ${W_EFFC} ${W_CRAZY}"
1518
 
 
1519
 
  NO_EXCEPTIONS="-fno-exceptions"
1520
 
  W_EXCEPTIONS="-fexceptions"
1521
 
  NO_UNUSED_MACROS="-Wno-unused-macros"
1522
 
  NO_REDUNDANT_DECLS="-Wno-redundant-decls"
1523
 
  # Disable exceptions as they seams to create problems with gcc and threads.
1524
 
  # drizzled doesn't use run-time-type-checking, so we disable it.
1525
 
  AM_CXXFLAGS="${AM_CXXFLAGS} -fno-rtti"
1526
 
fi
1527
 
if test "$SUNCC" = "yes"
1528
 
then
1529
 
  CC_WARNINGS="-v -xc99=all -errtags=yes"
1530
 
  CXX_WARNINGS="+w +w2 -xport64 -errtags=yes -erroff=attrskipunsup -compat=5"
1531
 
  NO_EXCEPTIONS="-features=no%except"
1532
 
  W_EXCEPTIONS="-features=except"
1533
 
fi
1534
 
AM_CXXFLAGS="${CXX_WARNINGS} ${NO_EXCEPTIONS}  ${AM_CXXFLAGS}"
1535
 
AM_CFLAGS="${CC_WARNINGS} ${AM_CFLAGS}"
1536
 
 
1537
 
AC_SUBST(NO_EXCEPTIONS)
1538
 
AC_SUBST(W_EXCEPTIONS)
1539
 
AC_SUBST(NO_UNUSED_MACROS)
1540
 
AC_SUBST(NO_REDUNDANT_DECLS)
 
1384
 
 
1385
  if test "$ac_warn_fail" = "yes"
 
1386
  then
 
1387
    W_FAIL="-Werror"
 
1388
  fi
 
1389
 
 
1390
  BASE_WARNINGS="-W -Wall -Wextra"
 
1391
  GCC_WARNINGS="${C99_SUPPORT_HACK} ${BASE_WARNINGS} ${GCC_PEDANTIC} ${W_UNREACHABLE} ${W_FAIL} ${GPROF_PROFILING} ${GPROF_COVERAGE}"
 
1392
  GXX_WARNINGS="${BASE_WARNINGS} ${GXX_PEDANTIC} ${W_UNREACHABLE} ${W_FAIL} ${GPROF_PROFILING} ${GPROF_COVERAGE}"
 
1393
 
 
1394
  AM_CXXFLAGS="${GXX_WARNINGS} ${AM_CXXFLAGS}"
 
1395
  AM_CFLAGS="${GCC_WARNINGS} ${AM_CFLAGS}"
 
1396
fi
1541
1397
 
1542
1398
AC_SUBST([GLOBAL_CPPFLAGS],['-I$(top_srcdir) -I$(top_builddir)'])
1543
1399
AC_SUBST([AM_CPPFLAGS],['${GLOBAL_CPPFLAGS}'])
1559
1415
esac
1560
1416
AC_SUBST(MAKE_BINARY_DISTRIBUTION_OPTIONS)
1561
1417
 
1562
 
dnl GCC Precompiled Header Support
1563
 
AM_CONDITIONAL([GCC_PCH],[test "$GCC" = "yes"])
1564
 
 
1565
1418
AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl
1566
1419
 mystrings/Makefile storage/Makefile dnl
1567
1420
 vio/Makefile po/Makefile.in dnl
1569
1422
 drizzled/Makefile dnl
1570
1423
 drizzled/field/Makefile dnl
1571
1424
 drizzled/serialize/Makefile dnl
1572
 
 drizzled/functions/Makefile dnl
1573
 
 drizzled/util/Makefile dnl
1574
1425
 drizzled/sql_builtin.cc dnl
 
1426
 drizzled/share/Makefile dnl
1575
1427
 support-files/Makefile dnl
1576
1428
 tests/Makefile tests/install_test_db dnl
1577
 
 plugin/Makefile dnl
 
1429
 drizzled/version.h plugin/Makefile dnl
1578
1430
 drizzled/drizzled_safe support-files/libdrizzle.pc dnl
1579
1431
 support-files/drizzle.server support-files/drizzle-log-rotate)
1580
1432
 
1584
1436
AC_CONFIG_COMMANDS_POST(ac_configure_args="$ac_configure_args CFLAGS='$CFLAGS' CXXFLAGS='$CXXFLAGS' AM_CFLAGS='$AM_CFLAGS' AM_CXXFLAGS='$AM_CXXFLAGS'")
1585
1437
 
1586
1438
AC_OUTPUT
1587
 
 
1588
 
echo "---"
1589
 
echo "Configuration summary for $PACKAGE_NAME version $VERSION"
1590
 
echo ""
1591
 
echo "   * Installation prefix:       $prefix"
1592
 
echo "   * System type:               $SYSTEM_TYPE"
1593
 
echo "   * Host CPU:                  $host_cpu"
1594
 
echo "   * C Compiler:                $CC_VERSION"
1595
 
echo "   * C++ Compiler:              $CXX"
1596
 
echo "   * Build auth_pam:            $ac_cv_header_security_pam_appl_h"
1597
 
echo "   * Assertions enabled:        $ac_cv_assert"
1598
 
echo "   * Debug enabled:             $with_debug"
1599
 
echo "   * Profiling enabled:         $ac_profiling"
1600
 
echo "   * Coverage enabled:          $ac_coverage"
1601
 
echo "   * Warnings as failure:       $ac_warn_fail"
1602
 
echo "   * C++ cstdint location:      $ac_cv_cxx_cstdint"
1603
 
echo "   * C++ hash_map location:     $ac_cv_cxx_hash_map"
1604
 
echo "   * C++ hash namespace:        $ac_cv_cxx_hash_namespace"
1605
 
echo "   * C++ cmath location:        $ac_cv_cxx_cmath"
1606
 
echo "   * C++ cmath namespace:       $ac_cv_cxx_cmath_namespace"
1607
 
echo ""
1608
 
echo "---"