~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Monty Taylor
  • Date: 2008-08-04 19:37:18 UTC
  • mto: (261.2.2 codestyle)
  • mto: This revision was merged to the branch mainline in revision 262.
  • Revision ID: monty@inaugust.com-20080804193718-f0rz13uli4429ozb
Changed gettext_noop() to N_()

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
dnl -*- bash -*-
 
1
dnl -*- ksh -*-
2
2
dnl Process this file with autoconf to produce a configure script.
3
3
 
4
4
AC_PREREQ(2.59)dnl              Minimum Autoconf version required.
5
5
 
6
 
AC_INIT(drizzle, [7.0.0], [http://bugs.launchpad.net/drizzle])
 
6
AC_INIT
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(drizzle, 7.0.0, no-define)
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 ?
126
23
# We take some made up examples
127
24
#
128
25
#  VERSION                  5.1.40sp1-alpha     5.0.34a
129
 
#  DRIZZLE_NO_DASH_VERSION    5.1.40sp1           5.0.34a
130
 
#  DRIZZLE_NUMERIC_VERSION    5.1.40              5.0.34
131
 
#  DRIZZLE_BASE_VERSION       5.1                 5.0
132
 
#  DRIZZLE_VERSION_ID         50140               50034
 
26
#  MYSQL_NO_DASH_VERSION    5.1.40sp1           5.0.34a
 
27
#  MYSQL_NUMERIC_VERSION    5.1.40              5.0.34
 
28
#  MYSQL_BASE_VERSION       5.1                 5.0
 
29
#  MYSQL_VERSION_ID         50140               50034
133
30
#
134
 
DRIZZLE_NO_DASH_VERSION=`echo $VERSION | sed -e "s|-.*$||"`
135
 
DRIZZLE_NUMERIC_VERSION=`echo $DRIZZLE_NO_DASH_VERSION | sed -e "s|[[a-z]][[a-z0-9]]*$||"`
136
 
DRIZZLE_BASE_VERSION=`echo $DRIZZLE_NUMERIC_VERSION | sed -e "s|\.[[^.]]*$||"`
137
 
DRIZZLE_VERSION_ID=`echo $DRIZZLE_NUMERIC_VERSION | \
 
31
MYSQL_NO_DASH_VERSION=`echo $VERSION | sed -e "s|-.*$||"`
 
32
MYSQL_NUMERIC_VERSION=`echo $MYSQL_NO_DASH_VERSION | sed -e "s|[[a-z]][[a-z0-9]]*$||"`
 
33
MYSQL_BASE_VERSION=`echo $MYSQL_NUMERIC_VERSION | sed -e "s|\.[[^.]]*$||"`
 
34
MYSQL_VERSION_ID=`echo $MYSQL_NUMERIC_VERSION | \
138
35
    awk -F. '{printf "%d%0.2d%0.2d", $1, $2, $3}'`
139
36
 
140
37
# The port should be constant for a LONG time
141
 
DRIZZLE_TCP_PORT_DEFAULT=4427
 
38
MYSQL_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
 
AM_GNU_GETTEXT_VERSION(0.17)
149
 
 
150
 
AM_CONDITIONAL([BUILD_GETTEXT],[test "x$MSGMERGE" != "x" -a "x$MSGMERGE" != "x:"])
151
 
 
152
 
AC_SUBST(DRIZZLE_NO_DASH_VERSION)
153
 
AC_DEFINE_UNQUOTED(DRIZZLE_BASE_VERSION,["$DRIZZLE_BASE_VERSION"],
154
 
                  [Major and minor version])
155
 
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
 
AC_SUBST(DRIZZLE_PREVIOUS_BASE_VERSION)
 
63
 
 
64
AC_SUBST(MYSQL_NO_DASH_VERSION)
 
65
AC_SUBST(MYSQL_BASE_VERSION)
 
66
AC_SUBST(MYSQL_VERSION_ID)
 
67
AC_SUBST(MYSQL_PREVIOUS_BASE_VERSION)
159
68
AC_SUBST(PROTOCOL_VERSION)
160
69
AC_DEFINE_UNQUOTED([PROTOCOL_VERSION], [$PROTOCOL_VERSION],
161
70
                   [mysql client protocol version])
162
71
AC_SUBST(DOT_FRM_VERSION)
163
 
AC_DEFINE_UNQUOTED([FRM_VER], [$DOT_FRM_VERSION],
 
72
AC_DEFINE_UNQUOTED([DOT_FRM_VERSION], [$DOT_FRM_VERSION],
164
73
                   [Version of .frm files])
165
 
AC_DEFINE_UNQUOTED([DRIZZLE_CONFIG_NAME],["drizzled"],[Name of server config section])
166
 
 
167
74
AC_SUBST(SHARED_LIB_MAJOR_VERSION)
168
75
AC_SUBST(SHARED_LIB_VERSION)
169
76
AC_SUBST(AVAILABLE_LANGUAGES)
170
77
 
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
78
 
239
79
# Canonicalize the configuration name.
240
80
 
262
102
  i?86) BASE_MACHINE_TYPE=i386 ;;
263
103
esac
264
104
 
 
105
# Save some variables and the command line options for mysqlbug
 
106
SAVE_CC="$CC"
 
107
SAVE_CXX="$CXX"
 
108
SAVE_ASFLAGS="$ASFLAGS"
 
109
SAVE_CFLAGS="$CFLAGS"
 
110
SAVE_CXXFLAGS="$CXXFLAGS"
 
111
SAVE_LDFLAGS="$LDFLAGS"
 
112
SAVE_CXXLDFLAGS="$CXXLDFLAGS"
 
113
CONF_COMMAND="$0 $ac_configure_args"
 
114
AC_SUBST(CONF_COMMAND)
 
115
AC_SUBST(SAVE_CC)
 
116
AC_SUBST(SAVE_CXX)
 
117
AC_SUBST(SAVE_ASFLAGS)
 
118
AC_SUBST(SAVE_CFLAGS)
 
119
AC_SUBST(SAVE_CXXFLAGS)
 
120
AC_SUBST(SAVE_LDFLAGS)
 
121
AC_SUBST(SAVE_CXXLDFLAGS)
 
122
AC_SUBST(CXXLDFLAGS)
 
123
 
265
124
AM_SANITY_CHECK
266
125
# This is needed is SUBDIRS is set
267
126
AC_PROG_MAKE_SET
268
127
 
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
 
    ;;
276
 
  *apple-darwin*)
277
 
    TARGET_OSX="true"
278
 
    AC_SUBST(TARGET_OSX)
279
 
    AC_DEFINE([TARGET_OS_OSX], [1], [Whether we build for OSX])
280
 
    ;;
281
 
  *solaris*)
282
 
    TARGET_SOLARIS="true"
283
 
    AC_SUBST(TARGET_SOLARIS)
284
 
    AC_DEFINE([TARGET_OS_SOLARIS], [1], [Whether we are building for Solaris])
 
128
##############################################################################
 
129
# The below section needs to be done before AC_PROG_CC
 
130
##############################################################################
 
131
 
 
132
if test "x${CFLAGS-}" = x ; then
 
133
  cflags_is_set=no
 
134
else
 
135
  cflags_is_set=yes
 
136
fi
 
137
 
 
138
if test "x${CPPFLAGS-}" = x ; then
 
139
  cppflags_is_set=no
 
140
else
 
141
  cppflags_is_set=yes
 
142
fi
 
143
 
 
144
if test "x${LDFLAGS-}" = x ; then
 
145
  ldflags_is_set=no
 
146
else
 
147
  ldflags_is_set=yes
 
148
fi
 
149
 
 
150
################ End of section to be done before AC_PROG_CC #################
 
151
 
 
152
# The following hack should ensure that configure doesn't add optimizing
 
153
# or debugging flags to CFLAGS or CXXFLAGS
 
154
# C_EXTRA_FLAGS are flags that are automaticly added to both
 
155
# CFLAGS and CXXFLAGS
 
156
CFLAGS="$CFLAGS $C_EXTRA_FLAGS "
 
157
CXXFLAGS="$CXXFLAGS $C_EXTRA_FLAGS "
 
158
 
 
159
dnl Checks for programs.
 
160
AC_PROG_CC
 
161
ifdef([AC_PROG_CC_C99],[
 
162
  AC_PROG_CC_C99([],[AC_MSG_ERROR([C99 support required for compiling Drizzle])])
 
163
  C99_SUPPORT_HACK=""
 
164
],[C99_SUPPORT_HACK="-std=gnu99"])
 
165
AC_PROG_CXX
 
166
AC_CXX_HEADER_STDCXX_98
 
167
if test "$ac_cv_cxx_stdcxx_98" = "no"
 
168
then
 
169
  AC_MSG_ERROR([C++ Compiler required to compile Drizzle])
 
170
fi
 
171
AC_PROG_CPP
 
172
AM_PROG_CC_C_O
 
173
 
 
174
# Print version of CC and CXX compiler (if they support --version)
 
175
case $SYSTEM_TYPE in
 
176
  *netware*)
 
177
CC_VERSION=`$CC -version | grep -i version`
285
178
    ;;
286
179
  *)
 
180
CC_VERSION=`$CC --version | sed 1q`
287
181
    ;;
288
182
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
302
 
DRIZZLE_CHECK_CXX_VERSION
303
 
 
304
 
AH_TOP([
305
 
#ifdef _FILE_OFFSET_BITS
306
 
# undef _FILE_OFFSET_BITS
307
 
#endif
308
 
])
309
 
AC_SYS_LARGEFILE
 
183
if test $? -eq "0"
 
184
then
 
185
  AC_MSG_CHECKING("C Compiler version")
 
186
  AC_MSG_RESULT("$CC $CC_VERSION")
 
187
else
 
188
CC_VERSION=""
 
189
fi
 
190
AC_SUBST(CC_VERSION)
 
191
MYSQL_CHECK_CXX_VERSION
310
192
 
311
193
AC_PROG_AWK
312
194
 
318
200
  AC_PATH_PROG(AS, as, as)
319
201
fi
320
202
 
321
 
dnl TODO: This needs to go away and be replaced with _ISOC99_SOURCE
322
 
if test "$ac_cv_c_compiler_gnu" = "yes" -o "$target_os" = "linux-gnu"
323
 
then
324
 
  AC_DEFINE([_GNU_SOURCE],[1],[Fix problem with S_ISLNK() on Linux])
325
 
fi
326
 
 
327
 
dnl  Solaris 9 include file <sys/feature_tests.h> refers to X/Open document
328
 
 
329
 
dnl  System Interfaces and Headers, Issue 5
330
 
 
331
 
dnl  saying we should define _XOPEN_SOURCE=500 to get POSIX.1c prototypes,
332
 
dnl  but apparently other systems (namely FreeBSD) don't agree.
333
 
 
334
 
dnl  On a newer Solaris 10, the above file recognizes also _XOPEN_SOURCE=600.
335
 
dnl  Furthermore, it tests that if a program requires older standard
336
 
dnl  (_XOPEN_SOURCE<600 or _POSIX_C_SOURCE<200112L) it cannot be
337
 
dnl  run on a new compiler (that defines _STDC_C99) and issues an #error.
338
 
dnl  It's also an #error if a program requires new standard (_XOPEN_SOURCE=600
339
 
dnl  or _POSIX_C_SOURCE=200112L) and a compiler does not define _STDC_C99.
340
 
 
341
 
dnl  To add more to this mess, Sun Studio C compiler defines _STDC_C99 while
342
 
dnl  C++ compiler does not!
343
 
 
344
 
dnl TODO: Can _ISOC99_SOURCE be defined on all platforms and remove the 
345
 
dnl       Need for all of this? 
346
 
if test "$GCC" = "yes"
347
 
then
348
 
  case "$target_os" in
349
 
    *solaris*)
350
 
    CFLAGS="${CFLAGS} -D_XOPEN_SOURCE=600"
351
 
    CXXFLAGS="${CXXFLAGS} -D__C99FEATURES__"
352
 
    ;;
353
 
  esac
354
 
fi
355
 
 
356
203
# We use libtool
 
204
#AC_LIBTOOL_WIN32_DLL
357
205
AC_PROG_LIBTOOL
358
206
 
359
207
# Ensure that we have --preserve-dup-deps defines, otherwise we get link
366
214
AC_PROG_INSTALL
367
215
test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
368
216
 
369
 
# Look for "(group|user)add". 
370
 
# TODO: If the programs do not exist, inform the DBA that the user
371
 
#       was not created at the end of the install routine.
372
 
AC_CHECK_PROGS(GROUPADD, groupadd addgroup)
373
 
AC_CHECK_PROGS(USERADD, useradd adduser)
374
 
 
375
 
dnl Needed for ltmain
376
 
AC_PROG_RANLIB
377
 
 
378
 
dnl Not critical since the generated file is distributed
379
 
AC_PROG_YACC
 
217
# Not critical since the generated file is distributed
 
218
AC_CHECK_PROGS(YACC, ['bison -y -p MYSQL'])
380
219
if test -z "$YACC" && test -d ".bzr"
381
220
then
382
221
  AC_MSG_ERROR(["bison is required for Drizzle to build from a bzr branch"])
397
236
])
398
237
AC_MSG_RESULT($mysql_cv_sys_os)
399
238
 
 
239
# This should be rewritten to use $target_os
 
240
case "$target_os" in
 
241
  *solaris*)
 
242
    TARGET_SOLARIS="true"
 
243
    AC_DEFINE([TARGET_OS_SOLARIS], [1], [Whether we are building for Solaris])
 
244
    AC_SUBST(TARGET_SOLARIS)
 
245
  ;;
 
246
esac
400
247
 
401
248
# The following is required for portable results of floating point calculations
402
249
# on PowerPC. The same must also be done for IA-64, but this options is missing
406
253
then
407
254
  case "$host_cpu" in
408
255
    *ppc* | *powerpc*)
409
 
      AM_CFLAGS="$CFLAGS -mno-fused-madd"
410
 
      AM_CXXFLAGS="$CXXFLAGS -mno-fused-madd"
 
256
      CFLAGS="$CFLAGS -mno-fused-madd"
 
257
      CXXFLAGS="$CXXFLAGS -mno-fused-madd"
411
258
    ;;
412
259
  esac
413
260
fi
414
 
# Build optimized or debug version ?
415
 
# First check for gcc and g++
416
 
SYMBOLS_FLAGS="-g"
417
 
DEBUG_OPTIMIZE_CC=""
418
 
OPTIMIZE_CFLAGS="-O"
419
 
DEBUG_OPTIMIZE_CXX=""
420
 
OPTIMIZE_CXXFLAGS="-O"
421
 
if test "$GCC" = "yes"
422
 
then
423
 
  SYMBOLS_FLAGS="-ggdb3"
424
 
  DEBUG_OPTIMIZE_CC="-O0"
425
 
  OPTIMIZE_CFLAGS="-O3"
426
 
  DEBUG_OPTIMIZE_CXX="-O0"
427
 
  OPTIMIZE_CXXFLAGS="-O3"
428
 
fi
429
 
if test "$SUNCC" = "yes"
430
 
then
431
 
  dnl I'm cheating here and sticking C99 support in SYMBOLS_FLAGS
432
 
  SYMBOLS_FLAGS=""
433
 
  DEBUG_OPTIMIZE_CC=""
434
 
  OPTIMIZE_CFLAGS="-xO4 -xlibmil -xdepend -Xa -mt -xstrconst -D_FORTEC_"
435
 
  DEBUG_OPTIMIZE_CXX=""
436
 
  #Put back in once isnan is figured out
437
 
  OPTIMIZE_CXXFLAGS="-xO4 -xlibmil -mt -D_FORTEC_ -xlang=c99 -compat=5 -library=stlport4"
438
 
fi
439
 
 
440
 
dnl TODO: Remove this define once we are using 2.61 across the board.
441
 
# AX_HEADER_ASSERT
442
 
# ----------------
443
 
# Check whether to enable assertions.
444
 
AC_DEFUN([AX_HEADER_ASSERT],
445
 
[
446
 
  AC_MSG_CHECKING([whether to enable assertions])
447
 
  AC_ARG_ENABLE([assert],
448
 
    [AS_HELP_STRING([--disable-assert],
449
 
       [Turn off assertions])],
450
 
    [ac_cv_assert="no"],
451
 
    [ac_cv_assert="yes"])
452
 
  AC_MSG_RESULT([$ac_cv_assert])
453
 
])
454
 
 
455
 
AX_HEADER_ASSERT
456
 
 
457
 
CFLAGS="${SYMBOLS_FLAGS} ${CFLAGS}"
458
 
CXXFLAGS="${SYMBOLS_FLAGS} ${CXXFLAGS}"
459
 
 
460
 
AC_ARG_WITH([debug],
461
 
    [AS_HELP_STRING([--with-debug],
462
 
       [Add debug code/turns off optimizations (yes|no) @<:@default=no@:>@])],
463
 
    [with_debug=$withval],
464
 
    [with_debug=no])
465
 
if test "$with_debug" = "yes"
466
 
then
467
 
  # Medium debug.
468
 
  CFLAGS="$DEBUG_OPTIMIZE_CC -DDEBUG $CFLAGS ${SAVE_CFLAGS}"
469
 
  CXXFLAGS="$DEBUG_OPTIMIZE_CXX -DDEBUG $CXXFLAGS ${SAVE_CXXFLAGS}"
470
 
else
471
 
  # Optimized version. No debug
472
 
  CFLAGS="${OPTIMIZE_CFLAGS} ${CFLAGS} ${SAVE_CFLAGS}"
473
 
  CXXFLAGS="$OPTIMIZE_CXXFLAGS $CXXFLAGS ${SAVE_CXXFLAGS}"
474
 
fi
475
261
 
476
262
AC_SUBST(CC)
477
263
AC_SUBST(CFLAGS)
484
270
 
485
271
export CC CXX CFLAGS LD LDFLAGS AR ARFLAGS
486
272
 
487
 
AC_CXX_STL_HASH
488
 
AC_CXX_CSTDINT
489
 
AC_CXX_CINTTYPES
490
 
AC_CXX_CMATH
491
 
 
492
 
DRIZZLE_PROG_AR
493
 
 
494
 
# libdrizzle versioning when linked with GNU ld.
495
 
if test "$lt_cv_prog_gnu_ld" = "yes" -a $LD --version 2>/dev/null|grep -q GNU; then
496
 
  LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_srcdir)/libdrizzle/libdrizzle.ver"
 
273
if test "$GCC" = "yes"
 
274
then
 
275
  # mysqld requires -fno-implicit-templates.
 
276
  # Disable exceptions as they seams to create problems with gcc and threads.
 
277
  # mysqld doesn't use run-time-type-checking, so we disable it.
 
278
  # We should use -Wno-invalid-offsetof flag to disable some warnings from gcc
 
279
  # regarding offset() usage in C++ which are done in a safe manner in the
 
280
  # server
 
281
  CXXFLAGS="$CXXFLAGS -fno-implicit-templates -fno-exceptions -fno-rtti"
 
282
  AC_DEFINE([HAVE_EXPLICIT_TEMPLATE_INSTANTIATION],
 
283
    [1], [Defined by configure. Use explicit template instantiation.])
 
284
fi
 
285
 
 
286
MYSQL_PROG_AR
 
287
 
 
288
# libmysqlclient versioning when linked with GNU ld.
 
289
if $LD --version 2>/dev/null|grep -q GNU; then
 
290
  LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_builddir)/libdrizzle/libdrizzle.ver"
 
291
  AC_CONFIG_FILES(libdrizzle/libdrizzle.ver)
497
292
fi
498
293
AC_SUBST(LD_VERSION_SCRIPT)
499
294
 
500
 
#--------------------------------------------------------------------
501
 
# Check for Google Proto Buffers
502
 
#--------------------------------------------------------------------
503
 
 
504
 
AC_MSG_CHECKING(for Google Protocol Buffers)
505
 
AC_ARG_WITH(protobuf,
506
 
  [AS_HELP_STRING([--with-protobuf@<:@=DIR@:>@],
507
 
       [search for protobuf in DIR/include and DIR/lib])],
508
 
  [ with_protobuf=$withval ],
509
 
  [ with_protobuf=yes ])
510
 
 
511
 
save_CPPFLAGS="$CPPFLAGS"
512
 
save_LIBS="$LIBS"
513
 
 
514
 
if test "$with_protobuf" = "yes"
515
 
then
516
 
  CPPFLAGS=""
517
 
  LIBS="-lprotobuf"
518
 
  PROTO_PATH="$PATH"
519
 
else
520
 
  CPPFLAGS="-I$withval/include"
521
 
  LIBS="-L$withval/lib -lprotobuf"
522
 
  PROTO_PATH="${withval}/bin:$PATH"
523
 
fi 
524
 
 
525
 
AC_CHECK_TOOL([PROTOC],[protoc],[no],[$PROTO_PATH])
526
 
if test "x$PROTOC" = "xno"
527
 
then
528
 
  AC_MSG_ERROR([Couldn't find protoc. Try installing Google Protocol Buffer.])
529
 
fi
530
 
 
531
 
AC_LANG_PUSH([C++])
532
 
AC_CHECK_HEADERS([google/protobuf/message.h])
533
 
if test "x$ac_cv_header_google_protobuf_message_h" != "xyes"
534
 
then
535
 
  AC_MSG_ERROR([Couldn't find message.h. Try installing Google Protocol Buffer development packages])
536
 
fi
537
 
AC_MSG_RESULT("$wthval")
538
 
 
539
 
AC_CACHE_CHECK([for Message in libprotobuf], ac_cv_libprotobuf_works, [
540
 
  AC_TRY_LINK([
541
 
#include <google/protobuf/descriptor.pb.h>
542
 
  ],[
543
 
    google::protobuf::FileDescriptorProto testFdp;
544
 
  ], ac_cv_libprotobuf_works=yes, [
545
 
        AC_MSG_ERROR([could not find Google's libprotobuf])
546
 
  ])
547
 
 
548
 
])
549
 
 
550
 
PROTOBUF_LIBS="${LIBS}"
551
 
PROTOBUF_CPPFLAGS="${CPPFLAGS}"
552
 
AC_SUBST(PROTOBUF_LIBS)
553
 
AC_SUBST(PROTOBUF_CPPFLAGS)
554
 
CPPFLAGS="$save_CPPFLAGS"
555
 
LIBS="$save_LIBS"
556
 
AC_LANG_POP()
557
 
 
558
 
#--------------------------------------------------------------------
559
 
# Check for libuuid
560
 
#--------------------------------------------------------------------
561
 
 
562
 
dnl Do this by hand instead of with SEARCH_FOR_LIB, because uuid is weird.
563
 
AC_CHECK_HEADERS(uuid/uuid.h)
564
 
if test "x$ac_cv_header_uuid_uuid_h" = "xno"
565
 
then
566
 
  AC_MSG_ERROR([Couldn't find uuid/uuid.h. Try installing libuuid development packages])
567
 
fi
568
 
AC_CHECK_LIB(uuid, uuid_generate)
569
295
 
570
296
#--------------------------------------------------------------------
571
297
# Check for libevent
572
298
#--------------------------------------------------------------------
573
299
 
574
 
SEARCH_FOR_LIB(event, event_loop, event.h, 
575
 
               AC_MSG_ERROR([libevent is required for Drizzle]))
576
 
 
577
 
 
578
 
AC_CACHE_CHECK([for bufferevent in libevent], ac_cv_libevent_works, [
579
 
  save_CPPFLAGS="$CPPFLAGS"
 
300
AC_MSG_CHECKING(for libevent)
 
301
AC_ARG_WITH(libevent,
 
302
  [AS_HELP_STRING([--with-libevent],
 
303
       [Use libevent build directory])],
 
304
  [ with_libevent=$withval ],
 
305
  [ with_libevent=yes ])
 
306
 
 
307
if test "$with_libevent" = "yes"
 
308
then
 
309
    AC_CHECK_HEADERS(event.h)
 
310
    if test "x$ac_cv_header_event_h" != "xyes"
 
311
    then
 
312
      AC_MSG_ERROR([Couldn't find event.h. Try installing libevent development packages])
 
313
    fi
 
314
    my_save_LIBS="$LIBS"
 
315
    LIBS=""
 
316
    AC_CHECK_LIB(event, event_loop, [], [AC_MSG_ERROR(could not find libevent)])
 
317
    LIBEVENT_LIBS="${LIBS}"
 
318
    LIBS="${my_save_LIBS}"
 
319
    LIBEVENT_CFLAGS=""
 
320
else
 
321
    AC_MSG_RESULT($withval)
 
322
    if test -f $withval/event.h -a -f $withval/libevent.a; then
 
323
       owd=`pwd`
 
324
       if cd $withval; then withval=`pwd`; cd $owd; fi
 
325
       LIBEVENT_CFLAGS="-I$withval"
 
326
       LIBEVENT_LIBS="-L$withval -levent"
 
327
    elif test -f $withval/include/event.h -a -f $withval/lib/libevent.a; then
 
328
       owd=`pwd`
 
329
       if cd $withval; then withval=`pwd`; cd $owd; fi
 
330
       LIBEVENT_CFLAGS="-I$withval/include"
 
331
       LIBEVENT_LIBS="-L$withval/lib -levent"
 
332
    else
 
333
       AC_MSG_ERROR([event.h or libevent.a not found in $withval])
 
334
    fi
 
335
fi
 
336
 
 
337
AC_SUBST(LIBEVENT_CFLAGS)
 
338
AC_SUBST(LIBEVENT_LIBS)
 
339
 
 
340
AC_CACHE_CHECK([for bufferevent in libevent], ac_libevent_works, [
 
341
  save_CFLAGS="$CFLAGS"
580
342
  save_LIBS="$LIBS"
581
 
  CPPFLAGS="$EVENT_CPPFLAGS"
582
 
  LIBS="$EVENT_LIBS"
 
343
  CFLAGS="$LIBEVENT_CFLAGS"
 
344
  LIBS="$LIBEVENT_LIBS"
583
345
  AC_TRY_LINK([
584
346
#include <sys/types.h>
585
347
#include <sys/time.h>
587
349
#include <event.h>],[
588
350
        struct bufferevent bev;
589
351
        bufferevent_settimeout(&bev, 1, 1);
590
 
  ], ac_cv_libevent_works=yes, [
591
 
        AC_MSG_ERROR([you need to install a more recent version of libevent,
 
352
  ], ac_libevent_works=yes, [
 
353
        AC_ERROR([you need to install a more recent version of libevent,
592
354
        check http://www.monkey.org/~provos/libevent/])
593
355
  ])
594
356
 
595
 
  CPPFLAGS="$save_CPPFLAGS"
 
357
  CFLAGS="$save_CFLAGS"
596
358
  LIBS="$save_LIBS"
597
359
])
598
360
 
627
389
# Check for libz
628
390
#--------------------------------------------------------------------
629
391
 
630
 
SEARCH_FOR_LIB(z, crc32, zlib.h, 
631
 
               AC_MSG_ERROR([libz is required for Drizzle]))
 
392
my_save_LIBS="$LIBS"
 
393
LIBS=""
 
394
AC_CHECK_HEADERS(zlib.h)
 
395
if test "x$ac_cv_header_zlib_h" != "xyes"
 
396
then
 
397
  AC_MSG_ERROR([Couldn't find zlib.h. Try installing zlib development packages])
 
398
fi
 
399
AC_CHECK_LIB(z, crc32, [], [AC_MSG_ERROR(could not find libz)])
 
400
ZLIB_LIBS="$LIBS"
 
401
LIBS="$my_save_LIBS"
 
402
AC_SUBST(ZLIB_LIBS)
632
403
 
633
404
 
634
405
#--------------------------------------------------------------------
653
424
#include <readline/readline.h>
654
425
]])
655
426
 
656
 
DRIZZLE_CHECK_NEW_RL_INTERFACE
 
427
MYSQL_CHECK_NEW_RL_INTERFACE
657
428
 
658
429
my_save_LIBS="$LIBS"
659
430
LIBS=""
665
436
LIBS="$my_save_LIBS"
666
437
AC_SUBST(READLINE_LIBS)
667
438
 
668
 
 
669
439
#--------------------------------------------------------------------
670
440
# Check for libpcre
671
441
#--------------------------------------------------------------------
785
555
  FIND_PROC="$PS \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
786
556
else
787
557
  case $SYSTEM_TYPE in
788
 
    *freebsd*|*dragonfly*|*cygwin*)
 
558
    *freebsd*|*dragonfly*)
789
559
      FIND_PROC="$PS p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
790
560
      ;;
791
561
    *darwin*)
834
604
AC_ARG_WITH([server-suffix],
835
605
    [AS_HELP_STRING([--with-server-suffix],
836
606
      [Append value to the version string.])],
837
 
    [ DRIZZLE_SERVER_SUFFIX=`echo "$withval" | sed -e  's/^\(...................................\)..*$/\1/'` ],
838
 
    [ DRIZZLE_SERVER_SUFFIX= ]
 
607
    [ MYSQL_SERVER_SUFFIX=`echo "$withval" | sed -e  's/^\(...................................\)..*$/\1/'` ],
 
608
    [ MYSQL_SERVER_SUFFIX= ]
839
609
    )
840
 
AC_DEFINE_UNQUOTED([DRIZZLE_SERVER_SUFFIX],[$DRIZZLE_SERVER_SUFFIX],
841
 
                   [Append value to the version string])
 
610
AC_SUBST(MYSQL_SERVER_SUFFIX)
842
611
 
843
612
# Force use of a curses libs
844
613
AC_ARG_WITH([named-curses-libs],
849
618
    [ with_named_curses=no ]
850
619
    )
851
620
 
 
621
# compile with strings functions in assembler
 
622
AC_ARG_ENABLE([assembler],
 
623
    [AS_HELP_STRING([--enable-assembler],
 
624
            [Use assembler versions of some string functions if available.])],
 
625
    [ ENABLE_ASSEMBLER=$enableval ],
 
626
    [ ENABLE_ASSEMBLER=no ]
 
627
    )
 
628
 
 
629
AC_MSG_CHECKING(if we should use assembler functions)
 
630
# For now we only support assembler on i386 and sparc systems
 
631
AM_CONDITIONAL(ASSEMBLER_x86, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "i386" && $AS mystrings/strings-x86.s -o checkassembler >/dev/null 2>&1 && test -f checkassembler && (rm -f checkassembler; exit 0;))
 
632
AM_CONDITIONAL(ASSEMBLER_sparc32, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "sparc")
 
633
AM_CONDITIONAL(ASSEMBLER_sparc64, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "sparcv9")
 
634
AM_CONDITIONAL(ASSEMBLER, test "$ASSEMBLER_x86_TRUE" = "" -o "$ASSEMBLER_sparc32_TRUE" = "")
 
635
 
 
636
if test "$ASSEMBLER_TRUE" = ""
 
637
then
 
638
  AC_MSG_RESULT([yes])
 
639
else
 
640
  AC_MSG_RESULT([no])
 
641
fi
 
642
 
852
643
AC_ARG_WITH([tcp-port],
853
644
    [AS_HELP_STRING([--with-tcp-port=port-number],
854
645
            [Which port to use for Drizzle services @<:@default=4427@:>@])],
855
 
    [ DRIZZLE_TCP_PORT=$withval ],
856
 
    [ DRIZZLE_TCP_PORT=$DRIZZLE_TCP_PORT_DEFAULT
 
646
    [ MYSQL_TCP_PORT=$withval ],
 
647
    [ MYSQL_TCP_PORT=$MYSQL_TCP_PORT_DEFAULT
857
648
      # if we actually defaulted (as opposed to the pathological case of
858
 
      # --with-tcp-port=<DRIZZLE_TCP_PORT_DEFAULT> which might in theory
 
649
      # --with-tcp-port=<MYSQL_TCP_PORT_DEFAULT> which might in theory
859
650
      # happen if whole batch of servers was built from a script), set
860
651
      # the default to zero to indicate that; we don't lose information
861
652
      # that way, because 0 obviously indicates that we can get the
862
 
      # default value from DRIZZLE_TCP_PORT. this seems really evil, but
863
 
      # testing for DRIZZLE_TCP_PORT==DRIZZLE_TCP_PORT_DEFAULT would make a
864
 
      # a port of DRIZZLE_TCP_PORT_DEFAULT magic even if the builder did not
 
653
      # default value from MYSQL_TCP_PORT. this seems really evil, but
 
654
      # testing for MYSQL_TCP_PORT==MYSQL_TCP_PORT_DEFAULT would make a
 
655
      # a port of MYSQL_TCP_PORT_DEFAULT magic even if the builder did not
865
656
      # intend it to mean "use the default, in fact, look up a good default
866
657
      # from /etc/services if you can", but really, really meant 4427 when
867
658
      # they passed in 4427. When they pass in a specific value, let them
872
663
      # - if a port was set during build, use that as a default.
873
664
      #
874
665
      # - otherwise, try to look up a port in /etc/services; if that fails,
875
 
      #   use DRIZZLE_TCP_PORT_DEFAULT (at the time of this writing 4427)
 
666
      #   use MYSQL_TCP_PORT_DEFAULT (at the time of this writing 4427)
876
667
      #
877
 
      # - allow the DRIZZLE_TCP_PORT environment variable to override that.
 
668
      # - allow the MYSQL_TCP_PORT environment variable to override that.
878
669
      #
879
670
      # - allow command-line parameters to override all of the above.
880
671
      #
881
 
      # the top-most DRIZZLE_TCP_PORT_DEFAULT is read from win/configure.js,
 
672
      # the top-most MYSQL_TCP_PORT_DEFAULT is read from win/configure.js,
882
673
      # so don't mess with that.
883
 
      DRIZZLE_TCP_PORT_DEFAULT=0 ]
 
674
      MYSQL_TCP_PORT_DEFAULT=0 ]
884
675
    )
885
 
AC_SUBST(DRIZZLE_TCP_PORT)
 
676
AC_SUBST(MYSQL_TCP_PORT)
886
677
# We might want to document the assigned port in the manual.
887
 
AC_SUBST(DRIZZLE_TCP_PORT_DEFAULT)
888
 
AC_DEFINE_UNQUOTED([DRIZZLE_PORT],[$DRIZZLE_TCP_PORT],
889
 
                   [Drizzle port to use])
890
 
AC_DEFINE_UNQUOTED([DRIZZLE_PORT_DEFAULT],[$DRIZZLE_TCP_PORT_DEFAULT],
891
 
                   [If we defaulted to DRIZZLE_PORT, then this will be zero])
 
678
AC_SUBST(MYSQL_TCP_PORT_DEFAULT)
892
679
 
893
680
# Use this to set the place used for unix socket used to local communication.
894
 
AC_ARG_WITH([drizzled-user],
895
 
    [AS_HELP_STRING([--with-drizzled-user=username],
896
 
            [What user the drizzled daemon shall be run as.
897
 
                @<:@default=drizzle@:>@])],
898
 
    [ DRIZZLED_USER=$withval ],
899
 
    [ DRIZZLED_USER=drizzle ]
 
681
AC_ARG_WITH([mysqld-user],
 
682
    [AS_HELP_STRING([--with-mysqld-user=username],
 
683
            [What user the mysqld daemon shall be run as.
 
684
                @<:@default=mysql@:>@])],
 
685
    [ MYSQLD_USER=$withval ],
 
686
    [ MYSQLD_USER=mysql ]
900
687
    )
901
 
AC_SUBST(DRIZZLED_USER)
 
688
AC_SUBST(MYSQLD_USER)
902
689
 
903
690
# If we should allow LOAD DATA LOCAL
904
691
AC_MSG_CHECKING(If we should should enable LOAD DATA LOCAL by default)
916
703
  AC_MSG_RESULT([no])
917
704
fi
918
705
 
 
706
MYSQL_SYS_LARGEFILE
 
707
 
919
708
# Types that must be checked AFTER large file support is checked
920
709
AC_TYPE_SIZE_T
921
710
 
930
719
AC_CHECK_HEADERS(fcntl.h float.h fpu_control.h ieeefp.h)
931
720
AC_CHECK_HEADERS(limits.h pwd.h select.h linux/config.h)
932
721
AC_CHECK_HEADERS(sys/fpu.h utime.h sys/utime.h )
933
 
AC_CHECK_HEADERS(synch.h sys/mman.h sys/socket.h)
934
 
AC_CHECK_HEADERS([curses.h term.h],[],[],
935
 
[[#ifdef HAVE_CURSES_H
936
 
# include <curses.h>
937
 
#endif
938
 
]])
 
722
AC_CHECK_HEADERS(synch.h sys/mman.h sys/socket.h netinet/in.h arpa/inet.h)
 
723
AC_CHECK_HEADERS(sys/timeb.h sys/vadvise.h sys/wait.h term.h)
939
724
AC_CHECK_HEADERS(termio.h termios.h sched.h alloca.h)
940
 
AC_CHECK_HEADERS(sys/prctl.h ieeefp.h)
 
725
AC_CHECK_HEADERS(sys/ioctl.h malloc.h sys/malloc.h sys/ipc.h sys/shm.h)
 
726
AC_CHECK_HEADERS(sys/prctl.h sys/resource.h sys/param.h port.h ieeefp.h)
941
727
AC_CHECK_HEADERS(execinfo.h)
942
728
 
 
729
AC_CHECK_HEADERS([xfs/xfs.h])
 
730
 
943
731
#--------------------------------------------------------------------
944
732
# Check for system libraries. Adds the library to $LIBS
945
733
# and defines HAVE_LIBM etc
946
734
#--------------------------------------------------------------------
947
735
 
948
736
AC_CHECK_LIB(m, floor, [], AC_CHECK_LIB(m, __infinity))
 
737
AC_CHECK_FUNCS(log2)
949
738
 
950
739
AC_CHECK_FUNC(setsockopt, [], [AC_CHECK_LIB(socket, setsockopt)])
951
740
AC_CHECK_FUNC(yp_get_default_domain, [],
969
758
  AC_CHECK_FUNC(gtty, [], [AC_CHECK_LIB(compat, gtty)])
970
759
fi
971
760
 
 
761
AC_CHECK_TYPES([int8, uint8, int16, uint16, int32, uint32, int64, uint64,
 
762
                uchar, uint, ulong],[],[], [
 
763
#include <sys/types.h>
 
764
])
972
765
AC_CHECK_TYPES([fp_except], [], [], [
973
766
#include <sys/types.h>
974
767
#include <ieeefp.h>
977
770
my_save_LIBS="$LIBS"
978
771
LIBS=""
979
772
AC_CHECK_LIB(dl,dlopen)
980
 
AC_CHECK_FUNCS(dlopen)
 
773
AC_CHECK_FUNCS(dlopen dlerror)
981
774
if test "$ac_cv_func_dlopen" != "yes"
982
775
then
983
776
  AC_MSG_ERROR([Drizzle requires dlopen])
988
781
 
989
782
AC_CHECK_FUNCS(strtok_r)
990
783
 
 
784
# Build optimized or debug version ?
 
785
# First check for gcc and g++
 
786
if test "$ac_cv_c_compiler_gnu" = "yes"
 
787
then
 
788
  SYMBOLS_CFLAGS="-ggdb3"
 
789
  DEBUG_OPTIMIZE_CC="-O0"
 
790
  OPTIMIZE_CFLAGS="-O2"
 
791
else
 
792
  SYMBOLS_CFLAGS="-g"
 
793
  DEBUG_OPTIMIZE_CC=""
 
794
  OPTIMIZE_CFLAGS="-O"
 
795
fi
 
796
if test "$ac_cv_prog_cxx_g" = "yes"
 
797
then
 
798
  SYMBOLS_CXXFLAGS="-ggdb3"
 
799
  DEBUG_OPTIMIZE_CXX="-O0"
 
800
  OPTIMIZE_CXXFLAGS="-O2"
 
801
else
 
802
  SYMBOLS_CXXFLAGS="-g"
 
803
  DEBUG_OPTIMIZE_CXX=""
 
804
  OPTIMIZE_CXXFLAGS="-O"
 
805
fi
 
806
 
 
807
# If the user specified CFLAGS, we won't add any optimizations
 
808
if test -n "$SAVE_CFLAGS"
 
809
then
 
810
  OPTIMIZE_CFLAGS=""
 
811
  DEBUG_OPTIMIZE_CC=""
 
812
fi
 
813
# Ditto for CXXFLAGS
 
814
if test -n "$SAVE_CXXFLAGS"
 
815
then
 
816
  OPTIMIZE_CXXFLAGS=""
 
817
  DEBUG_OPTIMIZE_CXX=""
 
818
fi
 
819
 
 
820
dnl TODO: Remove this define once we are using 2.61 across the board.
 
821
# AC_HEADER_ASSERT
 
822
# ----------------
 
823
# Check whether to enable assertions.
 
824
ifdef([AC_HEADER_ASSERT], [], [AC_DEFUN([AC_HEADER_ASSERT],
 
825
[
 
826
  AC_MSG_CHECKING([whether to enable assertions])
 
827
  AC_ARG_ENABLE([assert],
 
828
    [  --disable-assert        turn off assertions],
 
829
    [AC_MSG_RESULT([no])
 
830
     AC_DEFINE(NDEBUG, 1, [Define to 1 if assertions should be disabled.])],
 
831
    [AC_MSG_RESULT(yes)])
 
832
])])
 
833
 
 
834
AC_HEADER_ASSERT
 
835
 
 
836
CFLAGS="${SYMBOLS_CFLAGS} ${CFLAGS}"
 
837
CXXFLAGS="${SYMBOLS_CXXFLAGS} ${CXXFLAGS}"
 
838
 
 
839
AC_ARG_WITH([debug],
 
840
    [AS_HELP_STRING([--with-debug],
 
841
       [Add debug code/turns off optimizations (yes|no) @<:@default=no@:>@])],
 
842
    [with_debug=$withval],
 
843
    [with_debug=no])
 
844
if test "$with_debug" = "yes"
 
845
then
 
846
  # Medium debug.
 
847
  CFLAGS="$DEBUG_OPTIMIZE_CC $CFLAGS"
 
848
  CXXFLAGS="$DEBUG_OPTIMIZE_CXX $CXXFLAGS"
 
849
else
 
850
  # Optimized version. No debug
 
851
  CFLAGS="$OPTIMIZE_CFLAGS $CFLAGS"
 
852
  CXXFLAGS="$OPTIMIZE_CXXFLAGS $CXXFLAGS"
 
853
fi
991
854
 
992
855
 
993
856
AC_ARG_WITH([fast-mutexes],
1015
878
else
1016
879
  COMPILATION_COMMENT="Source distribution"
1017
880
fi
1018
 
AC_DEFINE_UNQUOTED([COMPILATION_COMMENT],["$COMPILATION_COMMENT"],
1019
 
                   [Comment about compilation environment])
 
881
AC_SUBST(COMPILATION_COMMENT)
 
882
 
 
883
if expr "$target_os" : "[[Ll]]inux.*" > /dev/null
 
884
then
 
885
  TARGET_LINUX="true"
 
886
  AC_DEFINE([TARGET_OS_LINUX], [1], [Whether we build for Linux])
 
887
else
 
888
  TARGET_LINUX="false"
 
889
fi
1020
890
 
1021
891
dnl Checks for typedefs, structures, and compiler characteristics.
1022
892
AC_C_CONST
1023
893
AC_C_INLINE
1024
 
AC_C_VOLATILE
1025
894
AC_TYPE_OFF_T
1026
895
AC_HEADER_TIME
1027
896
AC_STRUCT_TM
 
897
# AC_CHECK_SIZEOF return 0 when it does not find the size of a
 
898
# type. We want a error instead.
 
899
AC_CHECK_SIZEOF(char, 1)
 
900
if test "$ac_cv_sizeof_char" -eq 0
 
901
then
 
902
  AC_MSG_ERROR([No size for char type.])
 
903
fi
 
904
AC_CHECK_SIZEOF(char*, 4)
 
905
AC_CHECK_SIZEOF(short, 2)
 
906
AC_CHECK_SIZEOF(int, 4)
 
907
if test "$ac_cv_sizeof_int" -eq 0
 
908
then
 
909
  AC_MSG_ERROR("No size for int type.")
 
910
fi
 
911
AC_CHECK_SIZEOF(long, 4)
 
912
if test "$ac_cv_sizeof_long" -eq 0
 
913
then
 
914
  AC_MSG_ERROR("No size for long type.")
 
915
fi
 
916
AC_CHECK_SIZEOF(long long, 8)
 
917
if test "$ac_cv_sizeof_long_long" -eq 0
 
918
then
 
919
  AC_MSG_ERROR("Drizzle needs a long long type.")
 
920
fi
1028
921
# off_t is not a builtin type
1029
922
AC_CHECK_SIZEOF(off_t, 4)
1030
923
if test "$ac_cv_sizeof_off_t" -eq 0
1036
929
dnl check if time_t is unsigned
1037
930
dnl
1038
931
 
1039
 
DRIZZLE_CHECK_TIME_T
1040
 
 
 
932
MYSQL_CHECK_TIME_T
 
933
 
 
934
 
 
935
# do we need #pragma interface/#pragma implementation ?
 
936
# yes if it's gcc 2.x, and not icc pretending to be gcc, and not cygwin
 
937
AC_MSG_CHECKING(the need for @%:@pragma interface/implementation)
 
938
# instead of trying to match SYSTEM_TYPE and CC_VERSION (that doesn't
 
939
# follow any standard), we'll use well-defined preprocessor macros:
 
940
AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
 
941
#if !defined(__CYGWIN__) && !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ < 3)
 
942
#error USE_PRAGMA_IMPLEMENTATION
 
943
#endif
 
944
]])],[AC_MSG_RESULT(no) ],[AC_MSG_RESULT(yes) ; CXXFLAGS="$CXXFLAGS -DUSE_PRAGMA_IMPLEMENTATION"])
1041
945
 
1042
946
# This always gives a warning. Ignore it unless you are cross compiling
1043
947
AC_C_BIGENDIAN
1044
948
#---START: Used in for client configure
1045
949
# Check base type of last arg to accept
1046
 
DRIZZLE_TYPE_ACCEPT
 
950
MYSQL_TYPE_ACCEPT
1047
951
#---END:
1048
952
# Figure out what type of struct rlimit to use with setrlimit
1049
 
DRIZZLE_TYPE_STRUCT_RLIMIT
 
953
MYSQL_TYPE_STRUCT_RLIMIT
1050
954
# Find where the stack goes
1051
 
DRIZZLE_STACK_DIRECTION
 
955
MYSQL_STACK_DIRECTION
1052
956
# We want to skip alloca on irix unconditionally. It may work on some version..
1053
 
DRIZZLE_FUNC_ALLOCA
 
957
MYSQL_FUNC_ALLOCA
1054
958
# Do struct timespec have members tv_sec or ts_sec
1055
959
DRIZZLE_TIMESPEC_TS
1056
960
# Do we have the tzname variable
1057
 
DRIZZLE_TZNAME
 
961
MYSQL_TZNAME
 
962
# Do the c++ compiler have a bool type
 
963
MYSQL_CXX_BOOL
1058
964
AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>])
1059
 
AC_CHECK_TYPES([uint, ulong])
 
965
AC_CHECK_TYPES([size_t], [], [], [#include <stdio.h>])
 
966
AC_CHECK_TYPES([u_int32_t])
1060
967
 
1061
 
DRIZZLE_PTHREAD_YIELD
 
968
MYSQL_PTHREAD_YIELD
1062
969
 
1063
970
 
1064
971
dnl Checks for header files.
1065
 
AC_CHECK_HEADERS(malloc.h)
 
972
AC_CHECK_HEADERS(malloc.h sys/cdefs.h)
1066
973
 
1067
974
dnl Checks for library functions.
1068
975
AC_FUNC_ALLOCA
1069
976
AC_PROG_GCC_TRADITIONAL
1070
977
AC_TYPE_SIGNAL
1071
 
 
 
978
AC_CHECK_FUNCS(re_comp regcomp strdup)
 
979
 
 
980
dnl Sun compilers have their own vis.h that is about something
 
981
dnl totally different. So, not to change the libedit source, we
 
982
dnl do some additional checks before we define HAVE_VIS_H.
 
983
AC_CHECK_HEADER(vis.h,
 
984
  [AC_CHECK_FUNC(strvis,
 
985
    [AC_DEFINE([HAVE_VIS_H], [1],[Found vis.h and the strvis() function])])])
 
986
 
 
987
AC_CHECK_FUNCS(strlcat strlcpy)
1072
988
AC_CHECK_FUNCS(issetugid)
 
989
AC_CHECK_FUNCS(getline flockfile)
1073
990
 
1074
991
# from old readline settting:
1075
992
 
1077
994
AC_SUBST(MAKE_SHELL)
1078
995
 
1079
996
# Already-done: stdlib.h string.h unistd.h termios.h
1080
 
AC_CHECK_HEADERS(stdarg.h dirent.h locale.h ndir.h sys/dir.h \
1081
 
 sys/ndir.h sys/select.h \
1082
 
 sys/mman.h termcap.h termio.h asm/termbits.h grp.h \
1083
 
 paths.h)
 
997
AC_CHECK_HEADERS(varargs.h stdarg.h dirent.h locale.h ndir.h sys/dir.h \
 
998
 sys/file.h sys/ndir.h sys/ptem.h sys/pte.h sys/select.h sys/stream.h \
 
999
 sys/mman.h curses.h termcap.h termio.h termbits.h asm/termbits.h grp.h \
 
1000
paths.h semaphore.h)
1084
1001
 
1085
1002
# Already-done: strcasecmp
1086
 
AC_CHECK_FUNCS(lstat select)
 
1003
AC_CHECK_FUNCS(lstat putenv select setenv setlocale strcoll tcgetattr)
1087
1004
 
1088
1005
AC_HEADER_STAT
1089
 
DRIZZLE_SIGNAL_CHECK
1090
 
DRIZZLE_CHECK_GETPW_FUNCS
1091
 
DRIZZLE_HAVE_TIOCGWINSZ
1092
 
DRIZZLE_HAVE_TIOCSTAT
1093
 
DRIZZLE_TYPE_SIGHANDLER
 
1006
MYSQL_SIGNAL_CHECK
 
1007
MYSQL_CHECK_GETPW_FUNCS
 
1008
MYSQL_HAVE_TIOCGWINSZ
 
1009
MYSQL_HAVE_FIONREAD
 
1010
MYSQL_HAVE_TIOCSTAT
 
1011
MYSQL_STRUCT_DIRENT_D_INO
 
1012
MYSQL_STRUCT_DIRENT_D_NAMLEN
 
1013
MYSQL_TYPE_SIGHANDLER
 
1014
MYSQL_CHECK_MULTIBYTE
1094
1015
if test "$with_named_curses" = "no"
1095
1016
then
1096
 
  DRIZZLE_CHECK_LIB_TERMCAP
 
1017
  MYSQL_CHECK_LIB_TERMCAP
1097
1018
else
1098
1019
  TERMCAP_LIBS="$with_named_curses"
1099
1020
fi
1100
1021
AC_SUBST(TERMCAP_LIBS)
1101
1022
 
 
1023
# Check if the termcap function 'tgoto' is already declared in
 
1024
# system header files or if it need to be declared locally
 
1025
AC_CHECK_DECLS(tgoto,,,[
 
1026
#ifdef HAVE_CURSES_H
 
1027
# include <curses.h>
 
1028
#elif HAVE_NCURSES_H
 
1029
# include <ncurses.h>
 
1030
#endif
 
1031
#ifdef HAVE_TERM_H
 
1032
# include <term.h>
 
1033
#endif
 
1034
])
 
1035
 
1102
1036
# End of readline/libedit stuff
1103
1037
#########################################################################
1104
1038
 
1116
1050
 
1117
1051
#AC_FUNC_MMAP
1118
1052
AC_TYPE_SIGNAL
1119
 
DRIZZLE_TYPE_QSORT
 
1053
MYSQL_TYPE_QSORT
1120
1054
AC_FUNC_UTIME_NULL
1121
1055
AC_FUNC_VPRINTF
1122
1056
 
1127
1061
fi
1128
1062
 
1129
1063
AC_CONFIG_LIBOBJ_DIR([mystrings])
 
1064
AC_REPLACE_FUNCS([strtoll strstr strtoull strmov getpagesize])
1130
1065
 
1131
 
AC_CHECK_FUNCS( \
 
1066
AC_CHECK_FUNCS(bsearch \
1132
1067
  cuserid fchmod \
1133
 
  fdatasync fpresetsticky fpsetmask fsync \
1134
 
  getpassphrase getpwnam \
1135
 
  getpwuid getrlimit getrusage index initgroups isnan \
 
1068
  fdatasync finite fpresetsticky fpsetmask fsync ftruncate \
 
1069
  getcwd getpass getpassphrase getpwnam \
 
1070
  getpwuid getrlimit getrusage getwd index initgroups isnan \
1136
1071
  localtime_r gethrtime gmtime_r \
1137
 
  madvise \
1138
 
  mkstemp mlockall poll pread pthread_attr_create mmap mmap64 \
 
1072
  locking longjmp lrand48 madvise mallinfo \
 
1073
  memmove \
 
1074
  mkstemp mlockall perror poll pread pthread_attr_create mmap mmap64 \
1139
1075
  pthread_attr_getstacksize pthread_attr_setprio pthread_attr_setschedparam \
1140
1076
  pthread_attr_setstacksize pthread_condattr_create pthread_getsequence_np \
1141
1077
  pthread_key_delete pthread_rwlock_rdlock pthread_setprio \
1142
1078
  pthread_setprio_np pthread_setschedparam pthread_sigmask readlink \
1143
 
  realpath rename rwlock_init setupterm \
1144
 
  sigaction \
1145
 
  sigthreadmask \
1146
 
  snprintf strpbrk \
1147
 
  tell tempnam \
1148
 
  backtrace backtrace_symbols backtrace_symbols_fd)
1149
 
 
1150
 
AC_LANG_PUSH(C++)
1151
 
# Test whether madvise() is declared in C++ code -- it is not on some
1152
 
# systems, such as Solaris
1153
 
AC_CHECK_DECLS([madvise], [], [], [AC_INCLUDES_DEFAULT[
1154
 
#if HAVE_SYS_MMAN_H
1155
 
#include <sys/types.h>
1156
 
#include <sys/mman.h>
1157
 
#endif
1158
 
]])
1159
 
AC_LANG_POP()
1160
 
 
 
1079
  realpath rename rint rwlock_init setupterm \
 
1080
  shmget shmat shmdt shmctl sigaction sigemptyset sigaddset \
 
1081
  sighold sigset sigthreadmask port_create sleep \
 
1082
  snprintf socket stpcpy strcasecmp strerror strsignal strnlen strpbrk \
 
1083
  tell tempnam vidattr \
 
1084
  posix_fallocate backtrace backtrace_symbols backtrace_symbols_fd)
1161
1085
 
1162
1086
AM_CONDITIONAL(BUILD_THR_RWLOCK,[test "$ac_cv_func_rwlock_init" -a "$ac_cv_funn_pthread_rwlock_rdlock"])
1163
1087
 
 
1088
# Check that isinf() is available in math.h and can be used in both C and C++
 
1089
# code
 
1090
AC_MSG_CHECKING(for isinf in math.h)
 
1091
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]], [[
 
1092
    float f = 0.0; 
 
1093
    int r = isinf(f); 
 
1094
    return r;
 
1095
  ]])],[
 
1096
    AC_MSG_RESULT(yes)
 
1097
    AC_MSG_CHECKING(whether isinf() can be used in C++ code)
 
1098
    AC_LANG_PUSH([C++])
 
1099
    AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]], [[
 
1100
      float f = 0.0;
 
1101
      int r = isinf(f);
 
1102
      return r;
 
1103
    ]])],[
 
1104
      AC_MSG_RESULT(yes)
 
1105
      AC_DEFINE(HAVE_ISINF, [1], [isinf() macro or function])
 
1106
    ],[
 
1107
      AC_MSG_RESULT(no)
 
1108
    ])
 
1109
    AC_LANG_POP([])
 
1110
  ],[
 
1111
  AC_MSG_RESULT(no)])
 
1112
 
1164
1113
 
1165
1114
CFLAGS="$ORG_CFLAGS"
1166
1115
 
1167
1116
# Sanity check: We chould not have any fseeko symbol unless
1168
1117
# large_file_support=yes
1169
1118
AC_CHECK_FUNC(fseeko,
1170
 
[if test "$large_file_support" = no -a "x$TARGET_LINUX" = "xtrue";
 
1119
[if test "$large_file_support" = no -a "$TARGET_LINUX" = "true";
1171
1120
then
1172
1121
  AC_MSG_ERROR("Found fseeko symbol but large_file_support is not enabled!")
1173
1122
fi]
1283
1232
  AC_DEFINE([HAVE_PTHREAD_ATTR_SETSCOPE], [1], [pthread_attr_setscope])
1284
1233
fi
1285
1234
 
 
1235
# Check for bad includes
 
1236
AC_MSG_CHECKING("can netinet files be included")
 
1237
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
 
1238
#include <sys/socket.h>
 
1239
#include <netinet/in_systm.h>
 
1240
#include <netinet/in.h>
 
1241
#include <netinet/ip.h>
 
1242
#include <netinet/tcp.h>]], [[ printf("1\n"); ]])],[netinet_inc=yes],[netinet_inc=no])
 
1243
if test "$netinet_inc" = "no"
 
1244
then
 
1245
  AC_DEFINE([HAVE_BROKEN_NETINET_INCLUDES], [1], [Can netinet be included])
 
1246
fi
 
1247
AC_MSG_RESULT("$netinet_inc")
 
1248
 
1286
1249
AC_LANG_PUSH([C++])
1287
1250
AC_CHECK_HEADERS(cxxabi.h)
1288
1251
AC_CACHE_CHECK([checking for abi::__cxa_demangle], mysql_cv_cxa_demangle,
1301
1264
# Check for requested features
1302
1265
#--------------------------------------------------------------------
1303
1266
 
1304
 
DRIZZLE_CHECK_MAX_INDEXES
1305
 
DRIZZLE_CHECK_VIO
 
1267
MYSQL_CHECK_BIG_TABLES
 
1268
MYSQL_CHECK_MAX_INDEXES
 
1269
MYSQL_CHECK_VIO
1306
1270
 
1307
1271
#--------------------------------------------------------------------
1308
1272
# Declare our plugin modules
1310
1274
# functions tested above
1311
1275
#--------------------------------------------------------------------
1312
1276
 
1313
 
DRIZZLE_CONFIGURE_PLUGINS([none])
 
1277
MYSQL_CONFIGURE_PLUGINS([none])
1314
1278
 
1315
1279
AC_SUBST(mysql_plugin_dirs)
1316
1280
AC_SUBST(mysql_plugin_libs)
1317
1281
AC_SUBST(mysql_plugin_defs)
1318
1282
 
1319
 
 
1320
1283
AC_ARG_ENABLE([profiling],
1321
1284
    [AS_HELP_STRING([--enable-profiling],
1322
1285
       [Toggle profiling @<:@default=off@:>@])],
1359
1322
    [ac_warn_strict_aliasing="$enableval"],
1360
1323
    [ac_warn_strict_aliasing="no"])
1361
1324
 
1362
 
AC_ARG_ENABLE([cast-warnings],
1363
 
    [AS_HELP_STRING([--enable-cast-warnings],
1364
 
       [Enable warnings about use of old C-style casts @<:@default=off@:>@])],
1365
 
    [ac_warn_cast="$enableval"],
1366
 
    [ac_warn_cast="no"])
1367
 
 
1368
 
AC_ARG_ENABLE([effective-style],
1369
 
    [AS_HELP_STRING([--enable-effective-style],
1370
 
       [Enable warnings violating Effective C++ Style Guidelines @<:@default=off@:>@])],
1371
 
    [ac_warn_effc="$enableval"],
1372
 
    [ac_warn_effc="no"])
1373
 
 
1374
 
AC_ARG_ENABLE([go-crazy],
1375
 
    [AS_HELP_STRING([--enable-go-crazy],
1376
 
       [Enables extra little warnings that might be too much @<:@default=off@:>@])],
1377
 
    [ac_warn_go_crazy="$enableval"],
1378
 
    [ac_warn_go_crazy="no"])
1379
 
 
1380
1325
 
1381
1326
if test "$GCC" = "yes"
1382
1327
then
1383
1328
 
1384
 
 
1385
 
  if test "$ac_warn_fail" = "yes"
1386
 
  then
1387
 
    W_FAIL="-Werror"
1388
 
  fi
1389
 
  BASE_WARNINGS="-W -Wall -Wextra ${W_FAIL}"
1390
 
 
1391
1329
  if test "$ac_warn_longlong" = "yes"
1392
1330
  then
1393
1331
    W_LONGLONG="-Wlong-long"
1418
1356
 
1419
1357
  if test "$ac_warn_pedantic" = "yes"
1420
1358
  then
1421
 
    save_CXXFLAGS="${CXXFLAGS}"
1422
 
    CXXFLAGS="${CXXFLAGS} ${W_FAIL} -Wredundant-decls"
1423
 
    AC_CACHE_CHECK([whether it is safe to use -Wredundant-decls],
1424
 
      [ac_cv_safe_to_use_Wredundant_decls_],
1425
 
      [AC_LANG_PUSH(C++)
1426
 
       AC_COMPILE_IFELSE(
1427
 
         [AC_LANG_PROGRAM([
1428
 
template <typename E> struct C { void foo(); };
1429
 
template <typename E> void C<E>::foo() { }
1430
 
template <> void C<int>::foo();
1431
 
            AC_INCLUDES_DEFAULT])],
1432
 
          [ac_cv_safe_to_use_Wredundant_decls_=yes],
1433
 
          [ac_cv_safe_to_use_Wredundant_decls_=no])
1434
 
        AC_LANG_POP()])
1435
 
    if test $ac_cv_safe_to_use_Wredundant_decls_ = yes
1436
 
    then
1437
 
      GXX_W_REDUNDANT_DECLS="-Wredundant-decls"
1438
 
    else
1439
 
      GXX_W_REDUNDANT_DECLS="-Wno-redundant-decls"
1440
 
    fi
1441
 
    
1442
1359
    GCC_PEDANTIC="-pedantic -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls ${W_STRICT_ALIASING}"
1443
 
    GXX_PEDANTIC="-pedantic -Wundef ${GXX_W_REDUNDANT_DECLS} ${W_LONGLONG} ${W_STRICT_ALIASING}"
1444
 
 
1445
 
    AC_CACHE_CHECK([whether __attribute__ visibility "hidden" is supported],
1446
 
      [ac_cv_can_use_hidden_],
1447
 
      [AC_LANG_PUSH(C++)
1448
 
       AC_COMPILE_IFELSE(
1449
 
         [AC_LANG_PROGRAM([
1450
 
          AC_INCLUDES_DEFAULT
1451
 
__attribute__((visibility ("hidden")))
1452
 
void testme() {  };],[
1453
 
     testme();])],  
1454
 
         [ac_cv_can_use_hidden_=yes],
1455
 
         [ac_cv_can_use_hidden_=no])
1456
 
       AC_LANG_POP()])
1457
 
    if test "$ac_cv_can_use_hidden_" = "yes"
1458
 
    then
1459
 
      AC_DEFINE(HAVE_ATTR_HIDDEN, 1,
1460
 
                [Define to 1 if you have support for __attribute__((visibility("hidden")))])
1461
 
    fi
1462
 
 
1463
 
    CXXFLAGS="${save_CXXFLAGS}"
 
1360
    GXX_PEDANTIC="-pedantic -Wundef -Wredundant-decls ${W_LONGLONG} ${W_STRICT_ALIASING}"
1464
1361
  fi
1465
1362
 
1466
1363
  if test "$ac_warn_unreachable" = "yes"
1467
1364
  then
1468
1365
    W_UNREACHABLE="-Wunreachable-code"
1469
1366
  fi
1470
 
  if test "$ac_warn_cast" = "yes"
1471
 
  then
1472
 
    W_CAST="-Wold-style-cast"
1473
 
  fi
1474
 
 
1475
 
  if test "$ac_warn_effc" = "yes"
1476
 
  then
1477
 
    W_EFFC="-Weffc++"
1478
 
  fi
1479
 
 
1480
 
  if test "$ac_warn_gocrazy" = "yes"
1481
 
  then
1482
 
    W_CRAZY="-Wshadow -Wconversion -Winvalid-pch"
1483
 
  fi
1484
 
 
1485
 
  CC_WARNINGS="${C99_SUPPORT_HACK} ${BASE_WARNINGS} ${GCC_PEDANTIC} ${W_UNREACHABLE} ${GPROF_PROFILING} ${GPROF_COVERAGE} ${W_CRAZY}"
1486
 
  CXX_WARNINGS="${BASE_WARNINGS} ${GXX_PEDANTIC} ${W_UNREACHABLE} ${GPROF_PROFILING} ${GPROF_COVERAGE} ${W_CAST} ${W_EFFC} ${W_CRAZY}"
1487
 
 
1488
 
  NO_EXCEPTIONS="-fno-exceptions"
1489
 
  W_EXCEPTIONS="-fexceptions"
1490
 
  NO_UNUSED_MACROS="-Wno-unused-macros"
1491
 
  NO_REDUNDANT_DECLS="-Wno-redundant-decls"
1492
 
  # Disable exceptions as they seams to create problems with gcc and threads.
1493
 
  # drizzled doesn't use run-time-type-checking, so we disable it.
1494
 
  AM_CXXFLAGS="${AM_CXXFLAGS} -fno-rtti"
1495
 
  CPPFLAGS="${CPPFLAGS} -fpch-deps"
1496
 
fi
1497
 
if test "$SUNCC" = "yes"
1498
 
then
1499
 
  CC_WARNINGS="-v -xc99=all -errtags=yes"
1500
 
  CXX_WARNINGS="+w +w2 -xport64 -errtags=yes -erroff=attrskipunsup -compat=5"
1501
 
  NO_EXCEPTIONS="-features=no%except"
1502
 
  W_EXCEPTIONS="-features=except"
1503
 
fi
1504
 
AM_CXXFLAGS="${CXX_WARNINGS} ${NO_EXCEPTIONS}  ${AM_CXXFLAGS}"
1505
 
AM_CFLAGS="${CC_WARNINGS} ${AM_CFLAGS}"
1506
 
 
1507
 
AC_SUBST(NO_EXCEPTIONS)
1508
 
AC_SUBST(W_EXCEPTIONS)
1509
 
AC_SUBST(NO_UNUSED_MACROS)
1510
 
AC_SUBST(NO_REDUNDANT_DECLS)
 
1367
 
 
1368
  if test "$ac_warn_fail" = "yes"
 
1369
  then
 
1370
    W_FAIL="-Werror"
 
1371
  fi
 
1372
 
 
1373
  BASE_WARNINGS="-W -Wall -Wextra"
 
1374
  GCC_WARNINGS="${C99_SUPPORT_HACK} ${BASE_WARNINGS} ${GCC_PEDANTIC} ${W_UNREACHABLE} ${W_FAIL} ${GPROF_PROFILING} ${GPROF_COVERAGE}"
 
1375
  GXX_WARNINGS="${BASE_WARNINGS} ${GXX_PEDANTIC} ${W_UNREACHABLE} ${W_FAIL} ${GPROF_PROFILING} ${GPROF_COVERAGE}"
 
1376
 
 
1377
  CXXFLAGS="$CXXFLAGS ${GXX_WARNINGS}"
 
1378
  CFLAGS="$CFLAGS ${GCC_WARNINGS} "
 
1379
fi
1511
1380
 
1512
1381
AC_SUBST([GLOBAL_CPPFLAGS],['-I$(top_srcdir) -I$(top_builddir)'])
1513
1382
AC_SUBST([AM_CPPFLAGS],['${GLOBAL_CPPFLAGS}'])
1514
 
AC_SUBST([AM_CFLAGS])
1515
 
AC_SUBST([AM_CXXFLAGS])
1516
1383
 
1517
1384
# Some usefull subst
1518
1385
AC_SUBST(CC)
1529
1396
esac
1530
1397
AC_SUBST(MAKE_BINARY_DISTRIBUTION_OPTIONS)
1531
1398
 
1532
 
dnl GCC Precompiled Header Support
1533
 
dnl re-enable later
1534
 
dnl AM_CONDITIONAL([GCC_PCH],[test "$GCC" = "yes"])
1535
 
AM_CONDITIONAL([GCC_PCH],[test "no" = "yes"])
1536
 
 
1537
 
AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl
1538
 
 mystrings/Makefile storage/Makefile dnl
1539
 
 po/Makefile.in dnl
 
1399
AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile mysys/tests/Makefile dnl
 
1400
 mystrings/Makefile mystrings/tests/Makefile storage/Makefile dnl
 
1401
 vio/Makefile po/Makefile.in dnl
1540
1402
 libdrizzle/Makefile client/Makefile dnl
1541
1403
 drizzled/Makefile dnl
1542
1404
 drizzled/field/Makefile dnl
1543
 
 drizzled/item/Makefile dnl
1544
 
 drizzled/serialize/Makefile dnl
1545
 
 drizzled/functions/Makefile dnl
1546
 
 drizzled/functions/str/Makefile dnl
1547
 
 drizzled/functions/time/Makefile dnl
1548
 
 drizzled/util/Makefile dnl
1549
1405
 drizzled/sql_builtin.cc dnl
 
1406
 drizzled/share/Makefile dnl
1550
1407
 support-files/Makefile dnl
1551
1408
 tests/Makefile tests/install_test_db dnl
1552
 
 plugin/Makefile dnl
 
1409
 drizzled/version.h plugin/Makefile dnl
1553
1410
 drizzled/drizzled_safe support-files/libdrizzle.pc dnl
1554
1411
 support-files/drizzle.server support-files/drizzle-log-rotate)
1555
1412
 
1556
1413
AC_CONFIG_COMMANDS([default], , test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h)
1557
1414
 
1558
1415
# Ensure that table handlers gets all modifications to CFLAGS/CXXFLAGS
1559
 
AC_CONFIG_COMMANDS_POST(ac_configure_args="$ac_configure_args CFLAGS='$CFLAGS' CXXFLAGS='$CXXFLAGS' AM_CFLAGS='$AM_CFLAGS' AM_CXXFLAGS='$AM_CXXFLAGS'")
 
1416
AC_CONFIG_COMMANDS_POST(ac_configure_args="$ac_configure_args CFLAGS='$CFLAGS' CXXFLAGS='$CXXFLAGS'")
1560
1417
 
1561
1418
AC_OUTPUT
1562
 
 
1563
 
echo "---"
1564
 
echo "Configuration summary for $PACKAGE_NAME version $VERSION"
1565
 
echo ""
1566
 
echo "   * Installation prefix:       $prefix"
1567
 
echo "   * System type:               $SYSTEM_TYPE"
1568
 
echo "   * Host CPU:                  $host_cpu"
1569
 
echo "   * C Compiler:                $CC_VERSION"
1570
 
echo "   * C++ Compiler:              $CXX"
1571
 
echo "   * Build auth_pam:            $ac_cv_header_security_pam_appl_h"
1572
 
echo "   * Assertions enabled:        $ac_cv_assert"
1573
 
echo "   * Debug enabled:             $with_debug"
1574
 
echo "   * Profiling enabled:         $ac_profiling"
1575
 
echo "   * Coverage enabled:          $ac_coverage"
1576
 
echo "   * Warnings as failure:       $ac_warn_fail"
1577
 
echo "   * C++ cstdint location:      $ac_cv_cxx_cstdint"
1578
 
echo "   * C++ hash_map location:     $ac_cv_cxx_hash_map"
1579
 
echo "   * C++ hash namespace:        $ac_cv_cxx_hash_namespace"
1580
 
echo "   * C++ cmath location:        $ac_cv_cxx_cmath"
1581
 
echo "   * C++ cmath namespace:       $ac_cv_cxx_cmath_namespace"
1582
 
echo ""
1583
 
echo "---"