~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to configure.ac

Merged Nathan from lp:~nlws/drizzle/fix-string-c-ptr-overrun

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
dnl -*- bash -*-
2
2
dnl Process this file with autoconf to produce a configure script.
3
3
 
 
4
dnl  Copyright (C) 2009 Sun Microsystems
 
5
dnl
 
6
dnl  This program is free software; you can redistribute it and/or modify
 
7
dnl  it under the terms of the GNU General Public License as published by
 
8
dnl  the Free Software Foundation; version 2 of the License.
 
9
dnl
 
10
dnl  This program is distributed in the hope that it will be useful,
 
11
dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
dnl  GNU General Public License for more details.
 
14
dnl
 
15
dnl  You should have received a copy of the GNU General Public License
 
16
dnl  along with this program; if not, write to the Free Software
 
17
dnl  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
18
 
 
19
 
4
20
AC_PREREQ(2.59)dnl              Minimum Autoconf version required.
5
21
 
6
 
AC_INIT(drizzle, [7.0.0], [http://bugs.launchpad.net/drizzle])
 
22
m4_include(m4/bzr_version.m4)
 
23
 
7
24
AC_CONFIG_SRCDIR([drizzled/drizzled.cc])
8
25
AC_CONFIG_AUX_DIR(config)
9
26
AC_CONFIG_HEADERS([config.h])
 
27
AC_CONFIG_MACRO_DIR([m4])
10
28
 
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
# Setting CFLAGS here prevents AC_CANONICAL_TARGET from injecting them
 
30
SAVE_CFLAGS=${CFLAGS}
 
31
SAVE_CXXFLAGS=${CXXFLAGS}
 
32
CFLAGS=
 
33
CXXFLAGS=
29
34
 
30
35
AC_CANONICAL_TARGET
31
 
AM_INIT_AUTOMAKE(-Wall -Wno-portability -Werror)
32
 
 
33
 
PROTOCOL_VERSION=10
34
 
DOT_FRM_VERSION=6
35
 
# See the libtool docs for information on how to do shared lib versions.
36
 
SHARED_LIB_MAJOR_VERSION=1
37
 
SHARED_LIB_VERSION=$SHARED_LIB_MAJOR_VERSION:0:0
38
 
 
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
 
36
 
 
37
CFLAGS=${SAVE_CFLAGS}
 
38
CXXFLAGS=${SAVE_CXXFLAGS}
 
39
 
 
40
AM_INIT_AUTOMAKE(nostdinc subdir-objects -Wall -Werror)
60
41
 
61
42
if test "x${enable_dependency_tracking}" = "x"
62
43
then
63
44
  enable_dependency_tracking=yes
64
45
fi
65
46
 
66
 
################ End of section to be done before AC_PROG_CC #################
 
47
gl_EARLY
 
48
 
67
49
 
68
50
dnl Checks for programs.
69
 
AC_PROG_CC
70
 
ifdef([AC_PROG_CC_C99],[
71
 
  dnl TODO: Need to fix this to use c99 instead of gnu99
72
 
  AC_PROG_CC_C99([],[AC_MSG_ERROR([C99 support required for compiling Drizzle])])
73
 
  C99_SUPPORT_HACK=""
74
 
],[C99_SUPPORT_HACK="-std=gnu99"])
75
 
 
76
 
ifdef([AC_USE_SYSTEM_EXTENSIONS],[
77
 
  AC_USE_SYSTEM_EXTENSIONS
78
 
],[
79
 
 
80
 
  AH_VERBATIM([__EXTENSIONS__],
81
 
[/* Enable extensions on Solaris.  */
82
 
#ifndef __EXTENSIONS__
83
 
# undef __EXTENSIONS__
84
 
#endif
85
 
#ifndef _POSIX_PTHREAD_SEMANTICS
86
 
# undef _POSIX_PTHREAD_SEMANTICS
87
 
#endif
88
 
#ifndef _TANDEM_SOURCE
89
 
# undef _TANDEM_SOURCE
90
 
#endif])
91
 
 
92
 
  AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
93
 
    [ac_cv_safe_to_define___extensions__],
94
 
    [AC_COMPILE_IFELSE(
95
 
       [AC_LANG_PROGRAM([
96
 
#         define __EXTENSIONS__ 1
97
 
          AC_INCLUDES_DEFAULT])],
98
 
       [ac_cv_safe_to_define___extensions__=yes],
99
 
       [ac_cv_safe_to_define___extensions__=no])])
100
 
  test $ac_cv_safe_to_define___extensions__ = yes &&
101
 
    AC_DEFINE([__EXTENSIONS__])
102
 
  AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
103
 
  AC_DEFINE([_TANDEM_SOURCE])
104
 
])
105
 
 
106
51
AC_PROG_CXX
 
52
 
 
53
gl_USE_SYSTEM_EXTENSIONS
 
54
if test "$GCC" = "yes"
 
55
then
 
56
  # If you're on a Mac, and you didn't ask for a specific compiler
 
57
  # You're gonna get 4.2.
 
58
  if test "$host_vendor" = "apple" -a "x${ac_cv_env_CC_set}" = "x"
 
59
  then
 
60
    CPP="/usr/bin/gcc-4.2 -E"
 
61
    CC=/usr/bin/gcc-4.2
 
62
    CXX=/usr/bin/g++-4.2
 
63
  fi
 
64
  AC_CACHE_CHECK([if GCC is recent enough], [drizzle_cv_gcc_recent],
 
65
    [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 
66
#if !defined(__GNUC__) || (__GNUC__ < 4) || ((__GNUC__ >= 4) && (__GNUC_MINOR__ < 1))
 
67
# error GCC is Too Old!
 
68
#endif
 
69
      ]])],
 
70
      [drizzle_cv_gcc_recent=yes],
 
71
      [drizzle_cv_gcc_recent=no])])
 
72
  if test "$drizzle_cv_gcc_recent" = "no" -a "$host_vendor" = "apple"
 
73
  then
 
74
    AC_MSG_ERROR([Your version of GCC is too old. Drizzle requires at least version 4.2 on OSX. You may need to install a version of XCode >= 3.1.2])
 
75
  fi
 
76
  if test "$drizzle_cv_gcc_recent" = "no"
 
77
  then
 
78
    AC_MSG_ERROR([Your version of GCC is too old. Drizzle requires at least version 4.1])
 
79
  fi
 
80
fi
107
81
AC_CXX_HEADER_STDCXX_98
108
82
if test "$ac_cv_cxx_stdcxx_98" = "no"
109
83
then
110
 
  AC_MSG_ERROR([C++ Compiler required to compile Drizzle])
 
84
  AC_MSG_ERROR([No working C++ Compiler has been found. Drizzle requires a C++ compiler that can handle C++98])
111
85
fi
112
86
AC_PROG_CPP
113
87
AM_PROG_CC_C_O
114
88
 
 
89
if test "$am_cv_prog_cc_stdc" = "no"
 
90
then
 
91
  AC_MSG_ERROR([Drizzle requires an ANSI C compiler (and a C++ compiler). Try gcc. See the Installation chapter in the Reference Manual.])
 
92
fi
 
93
 
 
94
 
 
95
 
 
96
gl_INIT
 
97
 
115
98
AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
116
99
 
117
 
dnl AC_CANONICAL_HOST thinks it's a good idea to just set CFLAGS to 
118
 
dnl -g -O2 if you're running gcc. We would like to use something else, thanks.
119
 
if test "x${CFLAGS}" = "x-g -O2"
120
 
then
121
 
  CFLAGS=
122
 
fi
123
 
if test "x${CXXFLAGS}" = "x-g -O2"
124
 
then
125
 
  CXXFLAGS=
126
 
fi
 
100
AC_PROG_GCC_TRADITIONAL
127
101
 
128
102
 
129
103
# Set all version vars based on $VERSION. How do we do this more elegant ?
141
115
DRIZZLE_BASE_VERSION=`echo $DRIZZLE_NUMERIC_VERSION | sed -e "s|\.[[^.]]*$||"`
142
116
DRIZZLE_VERSION_ID=`echo $DRIZZLE_NUMERIC_VERSION | \
143
117
    awk -F. '{printf "%d%0.2d%0.2d", $1, $2, $3}'`
144
 
 
145
 
# The port should be constant for a LONG time
146
 
DRIZZLE_TCP_PORT_DEFAULT=4427
147
 
 
148
 
sinclude(m4/dtrace.m4)
149
 
sinclude(m4/character_sets.m4)
150
 
sinclude(m4/gettext.m4)
151
 
 
152
 
AM_GNU_GETTEXT([external])
153
 
AM_GNU_GETTEXT_VERSION(0.17)
154
 
 
155
 
AM_CONDITIONAL([BUILD_GETTEXT],[test "x$MSGMERGE" != "x" -a "x$MSGMERGE" != "x:"])
156
 
 
157
 
AC_SUBST(DRIZZLE_NO_DASH_VERSION)
158
118
AC_DEFINE_UNQUOTED(DRIZZLE_BASE_VERSION,["$DRIZZLE_BASE_VERSION"],
159
 
                  [Major and minor version])
160
 
AC_SUBST(DRIZZLE_VERSION_ID)
 
119
                   [Major and minor version])
161
120
AC_DEFINE_UNQUOTED([DRIZZLE_VERSION_ID],[$DRIZZLE_VERSION_ID],
162
121
                   [Version ID that can be easily used for numeric comparison])
163
 
AC_SUBST(DRIZZLE_PREVIOUS_BASE_VERSION)
164
 
AC_SUBST(PROTOCOL_VERSION)
165
 
AC_DEFINE_UNQUOTED([PROTOCOL_VERSION], [$PROTOCOL_VERSION],
166
 
                   [mysql client protocol version])
167
 
AC_SUBST(DOT_FRM_VERSION)
168
 
AC_DEFINE_UNQUOTED([FRM_VER], [$DOT_FRM_VERSION],
169
 
                   [Version of .frm files])
170
 
AC_DEFINE_UNQUOTED([DRIZZLE_CONFIG_NAME],["drizzled"],[Name of server config section])
171
 
 
172
 
AC_SUBST(SHARED_LIB_MAJOR_VERSION)
173
 
AC_SUBST(SHARED_LIB_VERSION)
 
122
 
 
123
AC_DEFINE([_BACKWARD_BACKWARD_WARNING_H],[1],[Hack to disable deprecation warning in gcc])
 
124
 
 
125
# The port should be constant for a LONG time
 
126
DRIZZLE_TCP_PORT_DEFAULT=4427
 
127
 
 
128
m4_include(m4/dtrace.m4)
 
129
 
 
130
m4_include(m4/character_sets.m4)
174
131
AC_SUBST(AVAILABLE_LANGUAGES)
175
132
 
176
 
dnl Ok. This is sort of lame, but we need to be nice to plugins Makefile.am's.
177
 
AM_CONDITIONAL(BUILDING_DRIZZLE,[test "x" = "x"])
178
 
 
179
 
 
180
 
# General Constants
181
 
AC_DEFINE([IO_SIZE], [4096], [Io buffer size; Must be a power of 2 and 
182
 
  a multiple of 512. May be
183
 
  smaller what the disk page size. This influences the speed of the
184
 
  isam btree library. eg to big to slow.])
185
 
AC_DEFINE([SC_MAXWIDTH],[256], [Max width of screen (for error messages)])
186
 
AC_DEFINE([FN_LEN],[256 ], [Max file name len ])
187
 
AC_DEFINE([FN_EXTLEN],[20], [Max length of extension (part of FN_LEN) ])
188
 
AC_DEFINE([FN_REFLEN],[512], [Max length of full path-name ])
189
 
AC_DEFINE([FN_EXTCHAR],['.'], [File extension character])
190
 
AC_DEFINE([FN_HOMELIB],['~'], [~/ is used as abbrev for home dir ])
191
 
AC_DEFINE([FN_CURLIB],['.'], [./ is used as abbrev for current dir ])
192
 
AC_DEFINE([FN_PARENTDIR],[".."], [Parent directory; Must be a string ])
193
 
 
194
 
AC_DEFINE([MASTER],[1],[Compile without unireg])
195
 
 
196
 
AH_VERBATIM([QUOTE_ARG],[
197
 
/* Quote argument (before cpp) */
198
 
#ifndef QUOTE_ARG
199
 
# define QUOTE_ARG(x) #x
200
 
#endif
201
 
/* Quote argument, (after cpp) */
202
 
#ifndef STRINGIFY_ARG
203
 
# define STRINGIFY_ARG(x) QUOTE_ARG(x)
204
 
#endif
205
 
])
206
 
 
207
 
AH_VERBATIM([builtin_expect],[
208
 
/*
209
 
 * The macros below are borrowed from include/linux/compiler.h in the
210
 
 * Linux kernel. Use them to indicate the likelyhood of the truthfulness
211
 
 * of a condition. This serves two purposes - newer versions of gcc will be
212
 
 * able to optimize for branch predication, which could yield siginficant
213
 
 * performance gains in frequently executed sections of the code, and the
214
 
 * other reason to use them is for documentation
215
 
 */
216
 
#if !defined(__GNUC__)
217
 
#define __builtin_expect(x, expected_value) (x)
218
 
#endif
219
 
 
220
 
#define likely(x)  __builtin_expect((x),1)
221
 
#define unlikely(x)  __builtin_expect((x),0)
222
 
])
223
 
 
224
 
dnl  InnoDB depends on some Drizzle's internals which other plugins should not
225
 
dnl  need.  This is because of InnoDB's foreign key support, "safe" binlog
226
 
dnl  truncation, and other similar legacy features.
227
 
 
228
 
dnl  We define accessors for these internals unconditionally, but do not
229
 
dnl  expose them in mysql/plugin.h.  They are declared in ha_innodb.h for
230
 
dnl  InnoDB's use.
231
 
 
232
 
AC_DEFINE([INNODB_COMPATIBILITY_HOOKS],[1],[TODO: Remove the need for this])
233
 
dnl TODO: Make a test for when this needs to be set.
234
 
AC_DEFINE([_REENTRANT],[1],[Some thread libraries require this])
235
 
 
236
 
AH_VERBATIM([posix_pthread],[
237
 
/* We want posix threads */
238
 
#ifndef _POSIX_PTHREAD_SEMANTICS
239
 
#define _POSIX_PTHREAD_SEMANTICS
240
 
#endif
241
 
])
 
133
 
 
134
# Set this for plugins to use
 
135
ac_build_drizzle="yes"
242
136
 
243
137
 
244
138
# Canonicalize the configuration name.
251
145
    [SYSTEM_TYPE="$host_vendor-$host_os"])
252
146
AC_ARG_WITH([machine-type],
253
147
    [AS_HELP_STRING([--with-machine-type],
254
 
       [Set the machine type, like "powerpc"])],
 
148
       [Set the machine type, like "sparc"])],
255
149
    [MACHINE_TYPE="$withval"],
256
150
    [MACHINE_TYPE="$host_cpu"])
257
151
AC_SUBST(SYSTEM_TYPE)
267
161
  i?86) BASE_MACHINE_TYPE=i386 ;;
268
162
esac
269
163
 
270
 
AM_SANITY_CHECK
271
 
# This is needed is SUBDIRS is set
272
 
AC_PROG_MAKE_SET
273
 
 
274
164
 
275
165
case "$target_os" in
276
166
  *linux*)
292
182
    ;;
293
183
esac
294
184
 
295
 
dnl AC_CANONICAL_HOST thinks it's a good idea to just set CFLAGS to 
296
 
dnl -g -O2 if you're running gcc. We would like to use something else, thanks.
297
 
if test "x${CFLAGS}" = "x-g -O2"
298
 
then
299
 
  CFLAGS=
300
 
fi
301
 
if test "x${CXXFLAGS}" = "x-g -O2"
302
 
then
303
 
  CXXFLAGS=
304
 
fi
305
 
 
306
185
DRIZZLE_CHECK_C_VERSION
307
186
DRIZZLE_CHECK_CXX_VERSION
308
187
 
310
189
 
311
190
AC_PROG_AWK
312
191
 
313
 
if test "$ac_cv_c_compiler_gnu" = "yes"
314
 
then
315
 
  AS="$CC -c"
316
 
  AC_SUBST(AS)
317
 
else
318
 
  AC_PATH_PROG(AS, as, as)
319
 
fi
320
 
 
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
 
# We use libtool
357
 
AC_PROG_LIBTOOL
358
 
 
359
 
# Ensure that we have --preserve-dup-deps defines, otherwise we get link
360
 
# problems of 'mysql' with CXX=g++
361
 
LIBTOOL="$LIBTOOL --preserve-dup-deps"
362
 
AC_SUBST(LIBTOOL)dnl
 
192
 
 
193
AC_PATH_PROG(GPERF, gperf)
 
194
AS_IF([test "x$GPERF" = "x"],
 
195
      AC_MSG_ERROR("Drizzle requires gperf to build."))
 
196
 
 
197
AC_PATH_PROG(LCOV, lcov)
 
198
AC_PATH_PROG(GENHTML, genhtml)
 
199
 
 
200
AM_CONDITIONAL(HAVE_LCOV,[test "x$LCOV" != "x"])
363
201
 
364
202
AC_SUBST(NM)dnl
365
203
 
366
204
AC_PROG_INSTALL
367
 
test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
368
 
 
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
205
 
378
206
dnl Not critical since the generated file is distributed
379
 
AC_PROG_YACC
380
 
if test -z "$YACC" && test -d ".bzr"
 
207
AC_CHECK_PROGS(YACC, ['bison -y'])
 
208
if test -z "$YACC" && test -d "$srcdir/.bzr"
381
209
then
382
210
  AC_MSG_ERROR(["bison is required for Drizzle to build from a bzr branch"])
383
211
fi
384
212
 
385
 
AC_PATH_PROG(uname_prog, uname, no)
386
 
 
387
 
# We should go through this and put all the explictly system dependent
388
 
# stuff in one place
389
 
AC_MSG_CHECKING(operating system)
390
 
AC_CACHE_VAL(mysql_cv_sys_os,
391
 
[
392
 
if test "$uname_prog" != "no"; then
393
 
  mysql_cv_sys_os="`uname`"
394
 
else
395
 
  mysql_cv_sys_os="Not Solaris"
396
 
fi
397
 
])
398
 
AC_MSG_RESULT($mysql_cv_sys_os)
399
 
 
400
 
 
401
 
# The following is required for portable results of floating point calculations
402
 
# on PowerPC. The same must also be done for IA-64, but this options is missing
403
 
# in the IA-64 gcc backend.
404
 
 
 
213
AC_CHECK_PROGS(ISAINFO, [isainfo], [no])
 
214
AS_IF([test "x$ISAINFO" != "xno"],
 
215
      [isainfo_b=`isainfo -b`],
 
216
      [isainfo_b="x"])
 
217
 
 
218
# Build optimized or debug version ?
 
219
# First check for gcc and g++
405
220
if test "$GCC" = "yes"
406
221
then
 
222
  if test "$isainfo_b" = "64"
 
223
  then
 
224
    IS_64="-m64"
 
225
  fi
 
226
  AC_DEFINE([_GNU_SOURCE],[1],[Fix problem with S_ISLNK() on Linux])
 
227
 
 
228
  dnl The following is required for portable results of floating point 
 
229
  dnl calculations on PowerPC. The same must also be done for IA-64, but 
 
230
  dnl this options is missing in the IA-64 gcc backend.
407
231
  case "$host_cpu" in
408
232
    *ppc* | *powerpc*)
409
 
      AM_CFLAGS="$CFLAGS -mno-fused-madd"
410
 
      AM_CXXFLAGS="$CXXFLAGS -mno-fused-madd"
 
233
      CFLAGS="-mno-fused-madd ${CFLAGS}"
 
234
      CXXFLAGS="-mno-fused-madd ${CXXFLAGS}"
411
235
    ;;
412
236
  esac
413
 
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"
 
237
 
 
238
  CFLAGS="-ggdb3 ${IS_64} -std=gnu99 ${CFLAGS}"
 
239
  CXXFLAGS="-ggdb3  ${IS_64} ${CXXFLAGS}"
 
240
  AC_CXX_CHECK_STANDARD
 
241
  
 
242
 
 
243
  DEBUG_CFLAGS="-O0"
 
244
  DEBUG_CXXFLAGS="-O0"
 
245
 
425
246
  OPTIMIZE_CFLAGS="-O3"
426
 
  DEBUG_OPTIMIZE_CXX="-O0"
427
247
  OPTIMIZE_CXXFLAGS="-O3"
428
248
fi
429
249
if test "$SUNCC" = "yes"
430
250
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
 
251
  if test "$isainfo_b" = "64"
 
252
  then
 
253
    IS_64="-m64"
 
254
  fi
 
255
  dnl we put CPPFLAGS and LDFLAGS first here, because if the user has specified
 
256
  dnl command line CPPFLAGS or LDFLAGS, their -I or -L should come _first_
 
257
  if test "$target_cpu" = "sparc"
 
258
  then
 
259
    MEMALIGN_FLAGS="-xmemalign=8s"
 
260
  fi
 
261
 
 
262
  if test "x$use_additional" != "xyes"
 
263
  then
 
264
    AS_IF([test "$isainfo_b" != "none"],[
 
265
      LDFLAGS="${LDFLAGS} -L/usr/local/lib/${isainfo_b} -L/usr/local/lib -L/opt/csw/lib/${isainfo_b} -L/opt/csw/lib"
 
266
      ],[
 
267
      LDFLAGS="${LDFLAGS} -L/usr/local/lib -L/opt/csw/lib"
 
268
      ])
 
269
      CPPFLAGS="${CPPFLAGS} -I/usr/local/include -I/opt/csw/include"
 
270
  fi
 
271
  AS_IF([test "$isainfo_b" != "none"],
 
272
        [LDFLAGS="${LDFLAGS} -L/usr/lib/${isainfo_b}"])
 
273
 
 
274
  CXXFLAGS="-xlang=c99 -g -mt -compat=5 -library=stlport4 -template=no%extdef ${IS_64} ${MEMALIGN_FLAGS} ${CXXFLAGS}"
 
275
  CFLAGS="-g -mt -xc99=all ${IS_64} ${MEMALIGN_FLAGS} ${CFLAGS}"
 
276
  DEBUG_CFLAGS="-xO0"
 
277
  DEBUG_CXXFLAGS="-xO0" 
 
278
 
 
279
  dnl TODO: -xO4 causes a Sun Studio failure in innodb... let's check back
 
280
  dnl       in on this one.
 
281
  OPTIMIZE_FLAGS="-xO3 -xlibmil -xdepend"
 
282
  OPTIMIZE_CFLAGS="${OPTIMIZE_FLAGS} -Xa -xstrconst"
 
283
  OPTIMIZE_CXXFLAGS="${OPTIMIZE_FLAGS}"
 
284
 
 
285
fi
 
286
 
 
287
m4_include(m4/gettext.m4)
 
288
AM_GNU_GETTEXT(external, need-formatstring-macros)
 
289
if test "x$MSGMERGE" = "x" -o "x$MSGMERGE" = "x:"
 
290
then
 
291
  AM_PATH_PROG_WITH_TEST(GMSGMERGE, gmsgmerge,
 
292
    [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
 
293
  MSGMERGE="${GMSGMERGE}"
 
294
fi
 
295
AM_CONDITIONAL([BUILD_GETTEXT],[test "x$MSGMERGE" != "x" -a "x$MSGMERGE" != "x:"])
 
296
 
 
297
 
 
298
# We use libtool
 
299
AC_PROG_LIBTOOL
439
300
 
440
301
dnl TODO: Remove this define once we are using 2.61 across the board.
441
302
# AX_HEADER_ASSERT
454
315
 
455
316
AX_HEADER_ASSERT
456
317
 
457
 
CFLAGS="${SYMBOLS_FLAGS} ${CFLAGS}"
458
 
CXXFLAGS="${SYMBOLS_FLAGS} ${CXXFLAGS}"
459
 
 
460
318
AC_ARG_WITH([debug],
461
319
    [AS_HELP_STRING([--with-debug],
462
320
       [Add debug code/turns off optimizations (yes|no) @<:@default=no@:>@])],
464
322
    [with_debug=no])
465
323
if test "$with_debug" = "yes"
466
324
then
467
 
  # Medium debug.
468
 
  CFLAGS="$DEBUG_OPTIMIZE_CC -DDEBUG $CFLAGS ${SAVE_CFLAGS}"
469
 
  CXXFLAGS="$DEBUG_OPTIMIZE_CXX -DDEBUG $CXXFLAGS ${SAVE_CXXFLAGS}"
 
325
  # Debuging. No optimization.
 
326
  CFLAGS="${DEBUG_CFLAGS} ${CFLAGS}"
 
327
  CXXFLAGS="${DEBUG_CXXFLAGS} ${CXXFLAGS}"
470
328
else
471
329
  # Optimized version. No debug
472
 
  CFLAGS="${OPTIMIZE_CFLAGS} ${CFLAGS} ${SAVE_CFLAGS}"
473
 
  CXXFLAGS="$OPTIMIZE_CXXFLAGS $CXXFLAGS ${SAVE_CXXFLAGS}"
 
330
  CFLAGS="${OPTIMIZE_CFLAGS} ${CFLAGS}"
 
331
  CXXFLAGS="${OPTIMIZE_CXXFLAGS} ${CXXFLAGS}"
474
332
fi
475
333
 
476
 
AC_SUBST(CC)
477
 
AC_SUBST(CFLAGS)
478
 
AC_SUBST(CXX)
479
 
AC_SUBST(CXXFLAGS)
480
 
AC_SUBST(ASFLAGS)
481
 
AC_SUBST(LD)
482
 
AC_SUBST(INSTALL_SCRIPT)
483
 
 
484
 
 
485
 
export CC CXX CFLAGS LD LDFLAGS AR ARFLAGS
486
334
 
487
335
AC_CXX_STL_HASH
488
336
AC_CXX_CSTDINT
489
337
AC_CXX_CINTTYPES
490
 
AC_CXX_CMATH
 
338
AC_CXX_SHARED_PTR
491
339
 
492
340
DRIZZLE_PROG_AR
493
341
 
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"
497
 
fi
498
 
AC_SUBST(LD_VERSION_SCRIPT)
 
342
AC_LIB_PREFIX
499
343
 
500
344
#--------------------------------------------------------------------
501
345
# Check for Google Proto Buffers
502
346
#--------------------------------------------------------------------
503
347
 
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"
 
348
AC_LANG_PUSH([C++])
 
349
AC_LIB_HAVE_LINKFLAGS(protobuf,pthread,
 
350
[#include <google/protobuf/descriptor.h>
 
351
],
 
352
[google::protobuf::FileDescriptor* file;],system)
 
353
AS_IF([test x$ac_cv_libprotobuf = xno],
 
354
      AC_MSG_ERROR([protobuf is required for Drizzle. On Debian this can be found in libprotobuf-dev. On RedHat this can be found in protobuf-devel.]))
 
355
 
 
356
AC_CACHE_CHECK([if protobuf is recent enough], [drizzle_cv_protobuf_recent],
 
357
  [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 
358
#include <google/protobuf/descriptor.h>
 
359
#if GOOGLE_PROTOBUF_VERSION < 2000002
 
360
# error Your version of Protobuf is too old
 
361
#endif
 
362
    ]])],
 
363
    [drizzle_cv_protobuf_recent=yes],
 
364
    [drizzle_cv_protobuf_recent=no])])
 
365
if test "$drizzle_cv_protobuf_recent" = "no"
515
366
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 
 
367
  AC_MSG_ERROR([Your version of Google Protocol Buffers is too old. Drizzle requires at least version 2.0.2])
 
368
fi
524
369
 
525
 
AC_PATH_PROG([PROTOC],[protoc],[no],[$PROTO_PATH])
 
370
AC_PATH_PROG([PROTOC],[protoc],[no],[$LIBPROTOBUF_PREFIX/bin:$PATH])
526
371
if test "x$PROTOC" = "xno"
527
372
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"
 
373
  AC_MSG_ERROR([Couldn't find the protoc compiler. On Debian this can be found in protobuf-compiler. On RedHat this can be found in protobuf-compiler.])
 
374
fi
 
375
 
556
376
AC_LANG_POP()
557
377
 
558
378
#--------------------------------------------------------------------
559
379
# Check for libuuid
560
380
#--------------------------------------------------------------------
561
381
 
562
 
dnl Do this by hand instead of with SEARCH_FOR_LIB, because uuid is weird.
 
382
dnl Do this by hand. Need to check for uuid/uuid.h, but uuid may or may
 
383
dnl not be a lib is weird.
 
384
 
563
385
AC_CHECK_HEADERS(uuid/uuid.h)
564
386
if test "x$ac_cv_header_uuid_uuid_h" = "xno"
565
387
then
566
 
  AC_MSG_ERROR([Couldn't find uuid/uuid.h. Try installing libuuid development packages])
 
388
  AC_MSG_ERROR([Couldn't find uuid/uuid.h. On Debian this can be found in uuid-dev. On Redhat this can be found in e2fsprogs-devel.])
567
389
fi
568
 
AC_CHECK_LIB(uuid, uuid_generate)
569
 
 
570
 
#--------------------------------------------------------------------
571
 
# Check for libevent
572
 
#--------------------------------------------------------------------
573
 
 
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"
580
 
  save_LIBS="$LIBS"
581
 
  CPPFLAGS="$EVENT_CPPFLAGS"
582
 
  LIBS="$EVENT_LIBS"
583
 
  AC_TRY_LINK([
584
 
#include <sys/types.h>
585
 
#include <sys/time.h>
586
 
#include <stdlib.h>
587
 
#include <event.h>],[
588
 
        struct bufferevent bev;
589
 
        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,
592
 
        check http://www.monkey.org/~provos/libevent/])
593
 
  ])
594
 
 
595
 
  CPPFLAGS="$save_CPPFLAGS"
596
 
  LIBS="$save_LIBS"
 
390
AC_LIB_HAVE_LINKFLAGS(uuid,,
 
391
[
 
392
#include <uuid/uuid.h>
 
393
],
 
394
[
 
395
  uuid_t uout;
 
396
  uuid_generate(uout);
597
397
])
598
398
 
599
399
 
 
400
 
600
401
#--------------------------------------------------------------------
601
402
# Check for libpthread
602
403
#--------------------------------------------------------------------
603
404
 
604
 
AC_CHECK_HEADERS(pthread.h)
605
 
if test "x$ac_cv_header_pthread_h" != "xyes"
606
 
then
607
 
  AC_MSG_ERROR([Couldn't find pthread.h.])
608
 
fi
609
 
AC_CHECK_LIB(pthread, pthread_create, [], [AC_MSG_ERROR(could not find libpthread)])
 
405
ACX_PTHREAD(,AC_MSG_ERROR(could not find libpthread))
 
406
LIBS="$PTHREAD_LIBS $LIBS"
 
407
CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS}"
 
408
CC="$PTHREAD_CC"
610
409
 
611
410
#--------------------------------------------------------------------
612
411
# Check for tcmalloc/mtmalloc
613
412
#--------------------------------------------------------------------
614
413
 
615
414
AC_ARG_ENABLE([tcmalloc],
616
 
    [AS_HELP_STRING([--enable-tcmalloc],
617
 
       [Enable linking with tcmalloc @<:@default=off@:>@])],
 
415
    [AS_HELP_STRING([--disable-tcmalloc],
 
416
       [Enable linking with tcmalloc @<:@default=on@:>@])],
618
417
    [ac_enable_tcmalloc="$enableval"],
619
 
    [ac_enable_tcmalloc="no"])
 
418
    [ac_enable_tcmalloc="yes"])
620
419
 
621
420
if test "x$ac_enable_tcmalloc" != "xno"
622
421
then
628
427
  AC_CHECK_LIB(mtmalloc,malloc,[],[])
629
428
fi
630
429
 
 
430
 
 
431
#--------------------------------------------------------------------
 
432
# Check for libdrizzle
 
433
#--------------------------------------------------------------------
 
434
 
 
435
AC_LIB_HAVE_LINKFLAGS(drizzle,,
 
436
[#include <libdrizzle/drizzle.h>],
 
437
[
 
438
  const char *version= drizzle_version()
 
439
])
 
440
AS_IF([test x$ac_cv_libdrizzle = xno],
 
441
      AC_MSG_ERROR([libdrizzle is required for Drizzle]))
 
442
 
 
443
 
631
444
#--------------------------------------------------------------------
632
445
# Check for libz
633
446
#--------------------------------------------------------------------
634
447
 
635
 
SEARCH_FOR_LIB(z, crc32, zlib.h, 
636
 
               AC_MSG_ERROR([libz is required for Drizzle]))
637
 
 
638
 
#--------------------------------------------------------------------
639
 
# Check for libncurses
640
 
#--------------------------------------------------------------------
641
 
 
642
 
 
643
 
SEARCH_FOR_LIB(ncurses, tgetent, ncurses/ncurses.h, AC_MSG_ERROR(Couldn't find ncurses)) 
 
448
AC_LIB_HAVE_LINKFLAGS(z,,
 
449
[#include <zlib.h>],
 
450
[
 
451
  crc32(0, Z_NULL, 0);
 
452
])
 
453
AS_IF([test x$ac_cv_libz = xno],
 
454
      AC_MSG_ERROR([libz is required for Drizzle. On Debian this can be found in zlib1g-dev. On RedHat this can be found in zlib-devel.]))
 
455
 
 
456
#--------------------------------------------------------------------
 
457
# Check for TBB
 
458
#--------------------------------------------------------------------
 
459
 
 
460
AC_LANG_PUSH(C++)
 
461
AC_LIB_HAVE_LINKFLAGS(tbb,,
 
462
[#include <tbb/atomic.h>
 
463
 #include <stdint.h>
 
464
],
 
465
[
 
466
  tbb::atomic<uint64_t> x;
 
467
  tbb::atomic<uint8_t> y;
 
468
  x=0;
 
469
  y=0;
 
470
  x++;
 
471
  y++;
 
472
])
 
473
AC_LANG_POP()
644
474
 
645
475
#--------------------------------------------------------------------
646
476
# Check for libreadline or compatible (libedit on Mac OS X)
647
477
#--------------------------------------------------------------------
648
478
 
649
 
 
650
 
SEARCH_FOR_LIB(readline, rl_initialize, readline/readline.h,
651
 
               AC_MSG_ERROR([libreadline is required for Drizzle]),
652
 
               [$NCURSES_LIBS]) 
653
 
 
654
 
save_CPPFLAGS="$CPPFLAGS"
655
 
CPPFLAGS="$CPPFLAGS $READLINE_CPPFLAGS"
656
 
AC_CHECK_HEADERS(readline/history.h)
657
 
AC_CHECK_TYPES([HIST_ENTRY], [], [], [AC_INCLUDES_DEFAULT[
658
 
#ifdef HAVE_READLINE_HISTORY_H
659
 
#include <readline/history.h>
660
 
#endif
661
 
#include <readline/readline.h>
662
 
]])
663
 
AC_CHECK_DECLS([completion_matches], [], [], [AC_INCLUDES_DEFAULT[
664
 
#ifdef HAVE_READLINE_HISTORY_H
665
 
#include <readline/history.h>
666
 
#endif
667
 
#include <readline/readline.h>
668
 
]])
 
479
save_LIBS="${LIBS}"
 
480
LIBS=""
 
481
VL_LIB_READLINE
 
482
AS_IF([test "x$vl_cv_lib_readline" = "xno"],
 
483
      AC_MSG_ERROR([libreadline is required for Drizzle. On Debian this can be found in libreadline5-dev. On RedHat this can be found in readline-devel.]))
 
484
READLINE_LIBS="${LIBS}"
 
485
LIBS="${save_LIBS}"
 
486
AC_SUBST(READLINE_LIBS)
669
487
 
670
488
DRIZZLE_CHECK_NEW_RL_INTERFACE
671
 
CPPFLAGS="$save_CPPFLAGS"
672
 
 
673
489
 
674
490
#--------------------------------------------------------------------
675
491
# Check for libpcre
676
492
#--------------------------------------------------------------------
677
493
 
678
 
AC_PATH_PROG(PKG_CONFIG, pkg-config, AC_MSG_ERROR([pkg-config wasn't found.]))
679
 
PKG_CHECK_MODULES(PCRE, [libpcre >= 3], [found_pcre="yes"],[found_pcre="no"])
 
494
AC_LIB_HAVE_LINKFLAGS(pcre,,
 
495
[#include <pcre.h>],
 
496
[
 
497
  pcre *re= NULL;
 
498
  pcre_version();
 
499
])
 
500
AS_IF([test "x$ac_cv_libpcre" = "xno"],
 
501
[
 
502
  unset ac_cv_libpcre
 
503
  unset HAVE_LIBPCRE
 
504
  unset LIBPCRE
 
505
  unset LIBPCRE_PREFIX
 
506
  unset LTLIBPCRE
 
507
  AC_LIB_HAVE_LINKFLAGS(pcre,,
 
508
  [#include <pcre/pcre.h>],
 
509
  [
 
510
    pcre *re= NULL;
 
511
    pcre_version();
 
512
  ])
 
513
  AS_IF([test "x$ac_cv_libpcre" = "xno"],
 
514
  [
 
515
    AC_MSG_ERROR([libpcre is required for Drizzle. On Debian this can be found in libpcre3-dev. On RedHat this can be found in pcre-devel.])
 
516
  ],[
 
517
    AC_DEFINE(PCRE_HEADER,[<pcre/pcre.h>],[Location of pcre header])
 
518
  ])
 
519
],[
 
520
  AC_DEFINE(PCRE_HEADER,[<pcre.h>],[Location of pcre header])
 
521
])
680
522
 
681
 
if test "$found_pcre" = "no"
682
 
then
683
 
  SEARCH_FOR_LIB(pcre, pcre_compile, pcre.h, 
684
 
                 AC_MSG_ERROR([libpcre is required for Drizzle]))
685
 
fi
686
 
AM_CONDITIONAL([HAVE_PCRE],[test "$ac_cv_have_pcre" = "yes"])
687
 
AC_SUBST(PCRE_LIBS)
688
 
AC_SUBST(PCRE_CFLAGS)
689
523
 
690
524
dnl Find paths to some shell programs
691
525
AC_PATH_PROG(LN, ln, ln)
799
633
AC_SUBST(CHECK_PID)
800
634
AC_MSG_RESULT("$CHECK_PID")
801
635
 
802
 
# We need an ANSI C compiler
803
 
AM_PROG_CC_STDC
804
 
 
805
 
# We need an assembler, too
806
 
AM_PROG_AS
807
 
CCASFLAGS="$CCASFLAGS $ASFLAGS"
808
636
 
809
637
# Check if we need noexec stack for assembler
810
638
AC_CHECK_NOEXECSTACK
811
639
 
812
 
if test "$am_cv_prog_cc_stdc" = "no"
813
 
then
814
 
  AC_MSG_ERROR([Drizzle requires an ANSI C compiler (and a C++ compiler). Try gcc. See the Installation chapter in the Reference Manual.])
815
 
fi
816
 
 
817
 
 
818
640
AC_ARG_WITH([server-suffix],
819
641
    [AS_HELP_STRING([--with-server-suffix],
820
642
      [Append value to the version string.])],
946
768
# For the sched_yield() function on Solaris
947
769
AC_CHECK_FUNC(sched_yield, [],
948
770
  [AC_CHECK_LIB(posix4, [sched_yield],
949
 
    [AC_DEFINE(HAVE_SCHED_YIELD) LIBS="$LIBS -lposix4"])])
 
771
    [AC_DEFINE(HAVE_SCHED_YIELD, 1, [Have sched_yield function]) LIBS="$LIBS -lposix4"])])
950
772
 
951
773
if test "$ac_cv_header_termio_h" = "no" -a "$ac_cv_header_termios_h" = "no"
952
774
then
970
792
LIBS="$my_save_LIBS"
971
793
AC_SUBST(LIBDL_LIBS)
972
794
 
973
 
AC_CHECK_FUNCS(strtok_r)
974
 
 
975
 
 
976
 
 
977
 
AC_ARG_WITH([fast-mutexes],
978
 
    [AS_HELP_STRING([--with-fast-mutexes],
979
 
            [Compile with fast mutexes  @<:@default=off@:>@])],
980
 
    [with_fast_mutexes=$withval],
981
 
    [with_fast_mutexes=no])
982
 
 
983
 
if test "$with_fast_mutexes" != "no"
984
 
then
985
 
        AC_DEFINE([MY_PTHREAD_FASTMUTEX], [1], 
986
 
                        [Define to 1 if you want to use fast mutexes])
987
 
fi
988
 
 
989
 
AM_CONDITIONAL(BUILD_FAST_MUTEX,[test "$with_fast_mutexes" != "no"])
 
795
 
 
796
AC_ARG_WITH([atomic-ops],
 
797
    [AS_HELP_STRING([--with-atomic-ops=rwlocks|smp|up],
 
798
       [Implement atomic operations using pthread rwlocks or atomic CPU
 
799
        instructions for multi-processor or uniprocessor
 
800
        configuration. By default gcc built-in sync functions are used,
 
801
        if available and 'smp' configuration otherwise.])],
 
802
    [with_atomic_ops="$withval"],
 
803
    [with_atomic_ops=smp])
 
804
 
 
805
case "$with_atomic_ops" in
 
806
  "up") AC_DEFINE([MY_ATOMIC_MODE_DUMMY], [1],
 
807
                  [Assume single-CPU mode, no concurrency]) ;;
 
808
  "rwlocks") AC_DEFINE([MY_ATOMIC_MODE_RWLOCKS], [1],
 
809
                  [Use pthread rwlocks for atomic ops]) ;;
 
810
  "smp") 
 
811
    AC_CACHE_CHECK(
 
812
      [whether the compiler provides atomic builtins],
 
813
      [ac_cv_gcc_atomic_builtins],
 
814
      [AC_RUN_IFELSE(
 
815
        [AC_LANG_PROGRAM([],[[
 
816
          int foo= -10; int bar= 10;
 
817
          if (!__sync_fetch_and_add(&foo, bar) || foo)
 
818
            return -1;
 
819
          bar= __sync_lock_test_and_set(&foo, bar);
 
820
          if (bar || foo != 10)
 
821
            return -1;
 
822
          bar= __sync_val_compare_and_swap(&bar, foo, 15);
 
823
          if (bar)
 
824
            return -1;
 
825
          return 0;
 
826
        ]])],
 
827
       [ac_cv_gcc_atomic_builtins=yes],
 
828
       [ac_cv_gcc_atomic_builtins=no])])
 
829
 
 
830
    if test "x$ac_cv_gcc_atomic_builtins" = "xyes"; then
 
831
      AC_DEFINE(HAVE_GCC_ATOMIC_BUILTINS, 1,
 
832
                [Define to 1 if compiler provides atomic builtins.])
 
833
    fi
 
834
   ;;
 
835
   *) AC_MSG_ERROR(["$with_atomic_ops" is not a valid value for --with-atomic-ops]) ;;
 
836
esac
 
837
 
990
838
 
991
839
AC_ARG_WITH([comment],
992
840
    [AS_HELP_STRING([--with-comment],
1015
863
then
1016
864
  AC_MSG_ERROR("Drizzle needs a off_t type.")
1017
865
fi
 
866
AC_CHECK_SIZEOF(size_t)
 
867
AC_DEFINE_UNQUOTED([SIZEOF_SIZE_T],[$ac_cv_sizeof_size_t],[Size of size_t as computed by sizeof()])
 
868
AC_CHECK_SIZEOF(long long)
 
869
AC_DEFINE_UNQUOTED(SIZEOF_LONG_LONG,[$ac_cv_sizeof_long_long],[Size of long long as computed by sizeof()])
1018
870
 
1019
871
dnl
1020
872
dnl check if time_t is unsigned
1025
877
 
1026
878
# This always gives a warning. Ignore it unless you are cross compiling
1027
879
AC_C_BIGENDIAN
1028
 
#---START: Used in for client configure
1029
 
# Check base type of last arg to accept
1030
 
DRIZZLE_TYPE_ACCEPT
1031
 
#---END:
1032
 
# Figure out what type of struct rlimit to use with setrlimit
1033
 
DRIZZLE_TYPE_STRUCT_RLIMIT
 
880
 
1034
881
# Find where the stack goes
1035
882
DRIZZLE_STACK_DIRECTION
1036
883
# We want to skip alloca on irix unconditionally. It may work on some version..
1037
884
DRIZZLE_FUNC_ALLOCA
1038
 
# Do struct timespec have members tv_sec or ts_sec
1039
 
DRIZZLE_TIMESPEC_TS
1040
 
# Do we have the tzname variable
1041
 
DRIZZLE_TZNAME
 
885
 
1042
886
AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>])
1043
887
AC_CHECK_TYPES([uint, ulong])
1044
888
 
1074
918
DRIZZLE_CHECK_GETPW_FUNCS
1075
919
DRIZZLE_HAVE_TIOCGWINSZ
1076
920
DRIZZLE_HAVE_TIOCSTAT
1077
 
DRIZZLE_TYPE_SIGHANDLER
1078
 
if test "$with_named_curses" = "no"
1079
 
then
1080
 
  DRIZZLE_CHECK_LIB_TERMCAP
1081
 
else
1082
 
  TERMCAP_LIBS="$with_named_curses"
1083
 
fi
1084
 
AC_SUBST(TERMCAP_LIBS)
1085
921
 
1086
 
# End of readline/libedit stuff
1087
922
#########################################################################
1088
923
 
1089
924
dnl Checks for library functions.
1090
925
 
1091
 
#
1092
 
# The following code disables intrinsic function support while we test for
1093
 
# library functions.  This is to avoid configure problems with Intel ecc
1094
 
# compiler
1095
 
 
1096
 
ORG_CFLAGS="$CFLAGS"
1097
 
if test "$GCC" != "yes"; then
1098
 
  AC_SYS_COMPILER_FLAG(-nolib_inline,nolib_inline,CFLAGS,[],[])
1099
 
fi
1100
 
 
1101
 
#AC_FUNC_MMAP
1102
 
AC_TYPE_SIGNAL
1103
 
DRIZZLE_TYPE_QSORT
1104
926
AC_FUNC_UTIME_NULL
1105
927
AC_FUNC_VPRINTF
1106
928
 
1110
932
  AC_MSG_ERROR("Drizzle requires fcntl.")
1111
933
fi
1112
934
 
1113
 
AC_CONFIG_LIBOBJ_DIR([mystrings])
 
935
AC_CONFIG_LIBOBJ_DIR([gnulib])
1114
936
 
1115
937
AC_CHECK_FUNCS( \
1116
938
  cuserid fchmod \
1146
968
AM_CONDITIONAL(BUILD_THR_RWLOCK,[test "$ac_cv_func_rwlock_init" -a "$ac_cv_funn_pthread_rwlock_rdlock"])
1147
969
 
1148
970
 
1149
 
CFLAGS="$ORG_CFLAGS"
1150
 
 
1151
971
# Sanity check: We chould not have any fseeko symbol unless
1152
972
# large_file_support=yes
1153
973
AC_CHECK_FUNC(fseeko,
1159
979
 
1160
980
# Check definition of pthread_getspecific
1161
981
AC_CACHE_CHECK([args to pthread_getspecific], [mysql_cv_getspecific_args],
1162
 
  [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if !defined(_REENTRANT)
 
982
  [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 
983
#if !defined(_REENTRANT)
1163
984
#define _REENTRANT
1164
985
#endif
 
986
#ifndef _POSIX_PTHREAD_SEMANTICS 
1165
987
#define _POSIX_PTHREAD_SEMANTICS 
1166
 
#include <pthread.h> ]], [[ void *pthread_getspecific(pthread_key_t key);
1167
 
pthread_getspecific((pthread_key_t) NULL); ]])],
 
988
#endif
 
989
#include <pthread.h>
 
990
   ]], [[
 
991
void *pthread_getspecific(pthread_key_t key);
 
992
pthread_getspecific((pthread_key_t) NULL);
 
993
   ]])],
1168
994
    [mysql_cv_getspecific_args=POSIX],
1169
995
    [mysql_cv_getspecific_args=other])])
1170
996
  if test "$mysql_cv_getspecific_args" = "other"
1175
1001
 
1176
1002
  # Check definition of pthread_mutex_init
1177
1003
  AC_CACHE_CHECK([args to pthread_mutex_init], [mysql_cv_mutex_init_args],
1178
 
    [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#define _REENTRANT
 
1004
    [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 
1005
#ifndef _REENTRANT
 
1006
#define _REENTRANT
 
1007
#endif
 
1008
#ifndef _POSIX_PTHREAD_SEMANTICS
1179
1009
#define _POSIX_PTHREAD_SEMANTICS 
 
1010
#endif
1180
1011
#include <pthread.h> ]], [[ 
1181
1012
  pthread_mutexattr_t attr;
1182
1013
  pthread_mutex_t mp;
1193
1024
#---START: Used in for client configure
1194
1025
# Check definition of readdir_r
1195
1026
AC_CACHE_CHECK([args to readdir_r], [mysql_cv_readdir_r],
1196
 
  [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define _REENTRANT
 
1027
  [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
 
1028
#ifndef _REENTRANT
 
1029
#define _REENTRANT
 
1030
#endif
 
1031
#ifndef _POSIX_PTHREAD_SEMANTICS 
1197
1032
#define _POSIX_PTHREAD_SEMANTICS 
 
1033
#endif
1198
1034
#include <pthread.h>
1199
1035
#include <dirent.h>]], [[ int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result);
1200
1036
readdir_r((DIR *) NULL, (struct dirent *) NULL, (struct dirent **) NULL); ]])],
1208
1044
# Check definition of posix sigwait()
1209
1045
AC_CACHE_CHECK([style of sigwait], [mysql_cv_sigwait],
1210
1046
  [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
 
1047
#ifndef _REENTRANT
1211
1048
#define _REENTRANT
 
1049
#endif
 
1050
#ifndef _POSIX_PTHREAD_SEMANTICS
1212
1051
#define _POSIX_PTHREAD_SEMANTICS 
 
1052
#endif
1213
1053
#include <pthread.h>
1214
1054
#include <signal.h>
1215
1055
      ]], [[
1232
1072
# Check definition of posix sigwait()
1233
1073
AC_CACHE_CHECK([style of sigwait], [mysql_cv_sigwait],
1234
1074
  [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
 
1075
#ifndef _REENTRANT
1235
1076
#define _REENTRANT
 
1077
#endif
 
1078
#ifndef _POSIX_PTHREAD_SEMANTICS
1236
1079
#define _POSIX_PTHREAD_SEMANTICS 
 
1080
#endif
1237
1081
#include <pthread.h>
1238
1082
#include <signal.h>
1239
1083
      ]], [[
1253
1097
# Check if pthread_attr_setscope() exists
1254
1098
AC_CACHE_CHECK([for pthread_attr_setscope], [mysql_cv_pthread_attr_setscope],
1255
1099
  [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
 
1100
#ifndef _REENTRANT
1256
1101
#define _REENTRANT
 
1102
#endif
 
1103
#ifndef _POSIX_PTHREAD_SEMANTICS
1257
1104
#define _POSIX_PTHREAD_SEMANTICS 
 
1105
#endif
1258
1106
#include <pthread.h>
1259
1107
      ]], [[
1260
1108
pthread_attr_t thr_attr;
1286
1134
#--------------------------------------------------------------------
1287
1135
 
1288
1136
DRIZZLE_CHECK_MAX_INDEXES
1289
 
DRIZZLE_CHECK_VIO
1290
1137
 
1291
1138
#--------------------------------------------------------------------
1292
1139
# Declare our plugin modules
1294
1141
# functions tested above
1295
1142
#--------------------------------------------------------------------
1296
1143
 
1297
 
DRIZZLE_CONFIGURE_PLUGINS([none])
 
1144
m4_include(config/plugin.ac)
 
1145
dnl Add code here to read set plugin lists and  set drizzled_default_plugin_list
 
1146
AC_DEFINE_UNQUOTED([DRIZZLED_PLUGIN_LIST],[$drizzled_default_plugin_list],
 
1147
                   [List of plugins that should be loaded on startup if no
 
1148
                    value is given for --plugin-load])
 
1149
 
 
1150
drizzled_builtin_list=`echo $drizzled_builtin_list | sed 's/, *$//'`
 
1151
AC_DEFINE_UNQUOTED([DRIZZLED_BUILTIN_LIST],[$drizzled_builtin_list],
 
1152
                   [List of plugins to be loaded in sql_builtin.cc])
 
1153
AC_SUBST(drizzled_plugin_libs)
1298
1154
 
1299
1155
AC_SUBST(mysql_plugin_dirs)
1300
1156
AC_SUBST(mysql_plugin_libs)
1301
 
AC_SUBST(mysql_plugin_defs)
 
1157
drizzled_plugin_defs=`echo $drizzled_plugin_defs | sed 's/, *$//'`
 
1158
AC_SUBST(drizzled_plugin_defs)
 
1159
AC_SUBST(DRIZZLED_PLUGIN_DEP_LIBS)
1302
1160
 
1303
1161
 
1304
1162
AC_ARG_ENABLE([profiling],
1355
1213
    [ac_warn_effc="$enableval"],
1356
1214
    [ac_warn_effc="no"])
1357
1215
 
1358
 
AC_ARG_ENABLE([go-crazy],
1359
 
    [AS_HELP_STRING([--enable-go-crazy],
1360
 
       [Enables extra little warnings that might be too much @<:@default=off@:>@])],
1361
 
    [ac_warn_go_crazy="$enableval"],
1362
 
    [ac_warn_go_crazy="no"])
1363
 
 
 
1216
AC_ARG_ENABLE([shadow],
 
1217
    [AS_HELP_STRING([--disable-shadow],
 
1218
       [Disables warnings about scope shadowing @<:@default=on@:>@])],
 
1219
    [ac_warn_shadow="$enableval"],
 
1220
    [ac_warn_shadow="yes"])
 
1221
 
 
1222
AC_ARG_ENABLE([conversion],
 
1223
    [AS_HELP_STRING([--enable-conversion],
 
1224
       [Enables conversion warnings @<:@default=off@:>@])],
 
1225
    [ac_warn_conversion="$enableval"],
 
1226
    [ac_warn_conversion="no"])
 
1227
 
 
1228
AC_ARG_ENABLE([datarace],
 
1229
    [AS_HELP_STRING([--enable-datarace],
 
1230
       [Enables Sun Studio data race detection @<:@default=off@:>@])],
 
1231
    [ac_datarace="$enableval"],
 
1232
    [ac_datarace="no"])
 
1233
 
 
1234
AC_ARG_ENABLE([exceptions],
 
1235
    [AS_HELP_STRING([--disable-exceptions],
 
1236
        [Disables use of Exceptions in the build @<:@default=on@:>@])],
 
1237
    [ac_exceptions="$enableval"],
 
1238
    [ac_exceptions="yes"])
 
1239
 
 
1240
AC_ARG_ENABLE([cast-align-warnings],
 
1241
    [AS_HELP_STRING([--enable-cast-align-warnings],
 
1242
       [Toggle cast alignment warnings @<:@default=off@:>@])],
 
1243
    [ac_warn_cast_align="$enableval"],
 
1244
    [ac_warn_cast_align="no"])
1364
1245
 
1365
1246
if test "$GCC" = "yes"
1366
1247
then
1367
 
 
 
1248
  if test "$ac_warn_cast_align" = "yes"
 
1249
  then
 
1250
    W_CAST_ALIGN="-Wcast-align"
 
1251
  else
 
1252
    W_CAST_ALIGN="-Wno-cast-align"
 
1253
  fi
1368
1254
 
1369
1255
  if test "$ac_warn_fail" = "yes"
1370
1256
  then
1371
1257
    W_FAIL="-Werror"
1372
1258
  fi
1373
 
  BASE_WARNINGS="-W -Wall -Wextra ${W_FAIL}"
 
1259
  BASE_WARNINGS="-Wall -Wextra ${W_FAIL} ${W_CAST_ALIGN}"
1374
1260
 
1375
1261
  if test "$ac_warn_longlong" = "yes"
1376
1262
  then
1386
1272
    W_STRICT_ALIASING="-Wno-strict-aliasing"
1387
1273
  fi
1388
1274
 
 
1275
  if test "$ac_warn_shadow" = "yes"
 
1276
  then
 
1277
    W_SHADOW="-Wshadow"
 
1278
    NO_SHADOW="-Wno-shadow"
 
1279
  else
 
1280
    W_SHADOW="-Wno-shadow"
 
1281
    NO_SHADOW=""
 
1282
  fi
 
1283
 
1389
1284
  if test "$ac_profiling" = "yes"
1390
1285
  then
1391
1286
    GPROF_PROFILING="-pg"
 
1287
    save_LIBS="${LIBS}"
 
1288
    LIBS=""
 
1289
    AC_CHECK_LIB(c_p, read)
 
1290
    LIBC_P="${LIBS}"
 
1291
    LIBS="${save_LIBS}"
1392
1292
  else
1393
1293
    GPROF_PROFILING=" "
1394
1294
  fi
1402
1302
 
1403
1303
  if test "$ac_warn_pedantic" = "yes"
1404
1304
  then
1405
 
    save_CXXFLAGS="${CXXFLAGS}"
1406
 
    CXXFLAGS="${CXXFLAGS} ${W_FAIL} -Wredundant-decls"
1407
1305
    AC_CACHE_CHECK([whether it is safe to use -Wredundant-decls],
1408
1306
      [ac_cv_safe_to_use_Wredundant_decls_],
1409
1307
      [AC_LANG_PUSH(C++)
 
1308
       save_CXXFLAGS="${CXXFLAGS}"
 
1309
       CXXFLAGS="${CXXFLAGS} ${W_FAIL} -Wredundant-decls"
1410
1310
       AC_COMPILE_IFELSE(
1411
1311
         [AC_LANG_PROGRAM([
1412
1312
template <typename E> struct C { void foo(); };
1415
1315
            AC_INCLUDES_DEFAULT])],
1416
1316
          [ac_cv_safe_to_use_Wredundant_decls_=yes],
1417
1317
          [ac_cv_safe_to_use_Wredundant_decls_=no])
 
1318
        CXXFLAGS="${save_CXXFLAGS}"
1418
1319
        AC_LANG_POP()])
1419
1320
    if test $ac_cv_safe_to_use_Wredundant_decls_ = yes
1420
1321
    then
1424
1325
    fi
1425
1326
    
1426
1327
    GCC_PEDANTIC="-pedantic -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls ${W_STRICT_ALIASING}"
1427
 
    GXX_PEDANTIC="-pedantic -Wundef ${GXX_W_REDUNDANT_DECLS} ${W_LONGLONG} ${W_STRICT_ALIASING}"
1428
 
 
1429
 
    AC_CACHE_CHECK([whether __attribute__ visibility "hidden" is supported],
1430
 
      [ac_cv_can_use_hidden_],
1431
 
      [AC_LANG_PUSH(C++)
1432
 
       AC_COMPILE_IFELSE(
1433
 
         [AC_LANG_PROGRAM([
1434
 
          AC_INCLUDES_DEFAULT
1435
 
__attribute__((visibility ("hidden")))
1436
 
void testme() {  };],[
1437
 
     testme();])],  
1438
 
         [ac_cv_can_use_hidden_=yes],
1439
 
         [ac_cv_can_use_hidden_=no])
1440
 
       AC_LANG_POP()])
1441
 
    if test "$ac_cv_can_use_hidden_" = "yes"
1442
 
    then
1443
 
      AC_DEFINE(HAVE_ATTR_HIDDEN, 1,
1444
 
                [Define to 1 if you have support for __attribute__((visibility("hidden")))])
1445
 
    fi
1446
 
 
1447
 
    CXXFLAGS="${save_CXXFLAGS}"
 
1328
    GXX_PEDANTIC="-pedantic -Wundef -Woverloaded-virtual  -Wnon-virtual-dtor -Wctor-dtor-privacy ${GXX_W_REDUNDANT_DECLS} ${W_LONGLONG} ${W_STRICT_ALIASING}"
1448
1329
  fi
1449
1330
 
1450
1331
  if test "$ac_warn_unreachable" = "yes"
1451
1332
  then
1452
1333
    W_UNREACHABLE="-Wunreachable-code"
1453
1334
  fi
 
1335
 
1454
1336
  if test "$ac_warn_cast" = "yes"
1455
1337
  then
1456
1338
    W_CAST="-Wold-style-cast"
1461
1343
    W_EFFC="-Weffc++"
1462
1344
  fi
1463
1345
 
1464
 
  if test "$ac_warn_gocrazy" = "yes"
1465
 
  then
1466
 
    W_CRAZY="-Wshadow -Wconversion -Winvalid-pch"
1467
 
  fi
1468
 
 
1469
 
  CC_WARNINGS="${C99_SUPPORT_HACK} ${BASE_WARNINGS} ${GCC_PEDANTIC} ${W_UNREACHABLE} ${GPROF_PROFILING} ${GPROF_COVERAGE} ${W_CRAZY}"
1470
 
  CXX_WARNINGS="${BASE_WARNINGS} ${GXX_PEDANTIC} ${W_UNREACHABLE} ${GPROF_PROFILING} ${GPROF_COVERAGE} ${W_CAST} ${W_EFFC} ${W_CRAZY}"
1471
 
 
1472
 
  NO_EXCEPTIONS="-fno-exceptions"
1473
 
  W_EXCEPTIONS="-fexceptions"
1474
 
  NO_UNUSED_MACROS="-Wno-unused-macros"
 
1346
  if test "$ac_warn_conversion" = "yes"
 
1347
  then
 
1348
    W_CONVERSION="-Wconversion"
 
1349
  fi
 
1350
 
 
1351
  CC_WARNINGS="${BASE_WARNINGS} ${GCC_PEDANTIC} ${W_UNREACHABLE} ${GPROF_PROFILING} ${GPROF_COVERAGE} ${W_SHADOW} ${W_CONVERSION}"
 
1352
  CXX_WARNINGS="${BASE_WARNINGS} ${GXX_PEDANTIC} ${W_UNREACHABLE} ${GPROF_PROFILING} ${GPROF_COVERAGE} ${W_CAST} ${W_SHADOW} ${W_EFFC} ${W_CONVERSION}"
 
1353
 
 
1354
  if test "$ac_exceptions" = "no"
 
1355
  then
 
1356
    NO_EXCEPTIONS="-fno-exceptions"
 
1357
    W_EXCEPTIONS="-fexceptions"
 
1358
  fi
1475
1359
  NO_REDUNDANT_DECLS="-Wno-redundant-decls"
1476
 
  # Disable exceptions as they seams to create problems with gcc and threads.
1477
 
  # drizzled doesn't use run-time-type-checking, so we disable it.
1478
 
  AM_CXXFLAGS="${AM_CXXFLAGS} -fno-rtti"
1479
 
  CPPFLAGS="${CPPFLAGS} -fpch-deps"
 
1360
  PROTOSKIP_WARNINGS="-Wno-effc++ -Wno-shadow"
1480
1361
fi
1481
1362
if test "$SUNCC" = "yes"
1482
1363
then
1483
 
  CC_WARNINGS="-v -xc99=all -errtags=yes"
1484
 
  CXX_WARNINGS="+w +w2 -xport64 -errtags=yes -erroff=attrskipunsup -compat=5"
1485
 
  NO_EXCEPTIONS="-features=no%except"
1486
 
  W_EXCEPTIONS="-features=except"
 
1364
  if test "$ac_datarace" = "yes"
 
1365
  then
 
1366
    CFLAGS="-xinstrument=datarace ${CFLAGS}"
 
1367
    CXXFLAGS="-xinstrument=datarace ${CXXFLAGS}"
 
1368
  fi
 
1369
 
 
1370
  if test "$ac_warn_fail" = "yes"
 
1371
  then
 
1372
    W_FAIL="-errwarn=%all"
 
1373
  fi
 
1374
 
 
1375
  CC_WARNINGS="-v -errtags=yes -erroff=E_ATTRIBUTE_NOT_VAR ${W_FAIL}"
 
1376
  CXX_WARNINGS="+w +w2 -xport64 -errtags=yes -erroff=attrskipunsup,doubunder,reftotemp,inllargeuse,truncwarn1,signextwarn,inllargeint ${W_FAIL}" 
 
1377
  PROTOSKIP_WARNINGS="-erroff=attrskipunsup,doubunder,reftotemp,wbadinitl,identexpected,inllargeuse,truncwarn1,signextwarn"
 
1378
  NO_UNREACHED="-erroff=E_STATEMENT_NOT_REACHED"
 
1379
  if test "$ac_exceptions" = "no"
 
1380
  then
 
1381
    NO_EXCEPTIONS="-features=no%except"
 
1382
    W_EXCEPTIONS="-features=except"
 
1383
  fi
1487
1384
fi
1488
 
AM_CXXFLAGS="${CXX_WARNINGS} ${NO_EXCEPTIONS}  ${AM_CXXFLAGS}"
1489
 
AM_CFLAGS="${CC_WARNINGS} ${AM_CFLAGS}"
1490
 
 
1491
1385
AC_SUBST(NO_EXCEPTIONS)
1492
1386
AC_SUBST(W_EXCEPTIONS)
1493
 
AC_SUBST(NO_UNUSED_MACROS)
 
1387
AC_SUBST(NO_SHADOW)
 
1388
AC_SUBST(W_SHADOW)
1494
1389
AC_SUBST(NO_REDUNDANT_DECLS)
1495
 
 
1496
 
AC_SUBST([GLOBAL_CPPFLAGS],['-I$(top_srcdir) -I$(top_builddir)'])
1497
 
AC_SUBST([AM_CPPFLAGS],['${GLOBAL_CPPFLAGS}'])
 
1390
AC_SUBST(PROTOSKIP_WARNINGS)
 
1391
AC_SUBST(NO_UNREACHED)
 
1392
 
 
1393
if test "x${gl_LIBOBJS}" != "x"
 
1394
then
 
1395
  if test "$GCC" = "yes"
 
1396
  then
 
1397
    CPPFLAGS="-isystem \$(top_srcdir)/gnulib -isystem \$(top_builddir)/gnulib ${CPPFLAGS}"
 
1398
  else
 
1399
    CPPFLAGS="-I\$(top_srcdir)/gnulib -I\$(top_builddir)/gnulib ${CPPFLAGS}"
 
1400
  fi
 
1401
fi
 
1402
 
 
1403
CPPFLAGS="-I\$(top_srcdir) -I\$(top_builddir) ${CPPFLAGS}"
 
1404
CFLAGS="${CC_WARNINGS} ${CFLAGS}"
 
1405
CXXFLAGS="${CXX_WARNINGS} ${W_EXCEPTIONS} ${CXXFLAGS}"
 
1406
 
 
1407
dnl Must be done once we turn on warnings and such
 
1408
AC_CACHE_CHECK(
 
1409
  [whether __attribute__ visibility "hidden" is supported],
 
1410
  [ac_cv_can_use_hidden_],[
 
1411
    AC_LANG_PUSH(C++)
 
1412
    AC_LINK_IFELSE([
 
1413
      AC_LANG_PROGRAM(
 
1414
        [[
 
1415
__attribute__((visibility ("hidden")))
 
1416
void testme() {  }
 
1417
        ]],[[testme()]]
 
1418
      )],  
 
1419
      [ac_cv_can_use_hidden_=yes],
 
1420
      [ac_cv_can_use_hidden_=no])
 
1421
    AC_LANG_POP()])
 
1422
if test "$ac_cv_can_use_hidden_" = "yes"
 
1423
then
 
1424
  AC_DEFINE(HAVE_ATTR_HIDDEN, 1,
 
1425
  [Define to 1 if you have support for __attribute__((visibility("hidden")))])
 
1426
fi
 
1427
 
 
1428
AM_CPPFLAGS="${CPPFLAGS}"
 
1429
AM_CFLAGS="${CFLAGS}"
 
1430
AM_CXXFLAGS="${CXXFLAGS}"
 
1431
 
 
1432
AC_SUBST([AM_CPPFLAGS])
1498
1433
AC_SUBST([AM_CFLAGS])
1499
1434
AC_SUBST([AM_CXXFLAGS])
1500
1435
 
1501
 
# Some usefull subst
1502
 
AC_SUBST(CC)
1503
 
AC_SUBST(GXX)
 
1436
dnl We've collected the flags in AM_*FLAGS now, so blank these.
 
1437
CFLAGS=""
 
1438
CXXFLAGS=""
 
1439
CPPFLAGS=""
1504
1440
 
1505
 
# Set configuration options for make_binary_distribution
1506
 
case $SYSTEM_TYPE in
1507
 
  *netware*)
1508
 
    MAKE_BINARY_DISTRIBUTION_OPTIONS="$MAKE_BINARY_DISTRIBUTION_OPTIONS --no-strip"
1509
 
    ;;
1510
 
  *)
1511
 
    : # no change for other platforms yet
1512
 
    ;;
1513
 
esac
1514
 
AC_SUBST(MAKE_BINARY_DISTRIBUTION_OPTIONS)
 
1441
AC_SUBST(pkgplugindir,"\$(pkglibdir)/plugin")
1515
1442
 
1516
1443
dnl GCC Precompiled Header Support
1517
1444
dnl re-enable later
1518
 
dnl AM_CONDITIONAL([GCC_PCH],[test "$GCC" = "yes"])
1519
 
AM_CONDITIONAL([GCC_PCH],[test "no" = "yes"])
 
1445
dnl AM_CONDITIONAL([BUILD_GCC_PCH],[test "$GCC" = "yes"])
 
1446
AM_CONDITIONAL([BUILD_GCC_PCH],[test "no" = "yes"])
1520
1447
 
1521
 
AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl
1522
 
 mystrings/Makefile storage/Makefile dnl
 
1448
AC_CONFIG_FILES(Makefile dnl
 
1449
 gnulib/Makefile dnl
1523
1450
 po/Makefile.in dnl
1524
 
 libdrizzle/Makefile client/Makefile dnl
 
1451
 drizzled/message/Makefile dnl
1525
1452
 drizzled/Makefile dnl
1526
 
 drizzled/field/Makefile dnl
1527
 
 drizzled/item/Makefile dnl
1528
 
 drizzled/serialize/Makefile dnl
1529
 
 drizzled/functions/Makefile dnl
1530
 
 drizzled/functions/str/Makefile dnl
1531
 
 drizzled/functions/time/Makefile dnl
1532
 
 drizzled/util/Makefile dnl
1533
 
 drizzled/sql_builtin.cc dnl
1534
1453
 support-files/Makefile dnl
1535
1454
 tests/Makefile tests/install_test_db dnl
1536
 
 plugin/Makefile dnl
1537
 
 drizzled/drizzled_safe support-files/libdrizzle.pc dnl
 
1455
 drizzled/drizzled_safe dnl
1538
1456
 support-files/drizzle.server support-files/drizzle-log-rotate)
1539
1457
 
1540
 
AC_CONFIG_COMMANDS([default], , test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h)
 
1458
scheduling_plugins_available="
 
1459
  pool_of_threads 
 
1460
  single_thread
 
1461
"
 
1462
 
 
1463
for sched_plugin in $scheduling_plugins_available
 
1464
do
 
1465
  varname="\${with_plugin_${sched_plugin}}"
 
1466
  result=`eval "echo $varname"`
 
1467
  if test "x$result" = "xyes"
 
1468
  then
 
1469
    scheduling_plugins="$sched_plugin $scheduling_plugins"
 
1470
  fi
 
1471
done
 
1472
 
 
1473
AC_CONFIG_COMMANDS([timestamp-h], , test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h)
 
1474
 
 
1475
AC_CONFIG_COMMANDS_PRE([
 
1476
if test "x$EGREP" != "x" -a -d po
 
1477
then
 
1478
  echo "# This file is auto-generated from configure. Do not edit directly" > po/POTFILES.in.in
 
1479
  # The grep -v 'drizzle-' is to exclude any distcheck leftovers
 
1480
  for f in `find . | grep -v 'drizzle-' | ${EGREP} '\.(cc|c|h|yy)$' | cut -c3- | sort`
 
1481
  do
 
1482
    if grep gettext.h "$f" | grep include >/dev/null 2>&1
 
1483
    then
 
1484
      echo "$f" >> po/POTFILES.in.in
 
1485
    fi
 
1486
  done
 
1487
  if ! diff po/POTFILES.in.in po/POTFILES.in >/dev/null 2>&1
 
1488
  then
 
1489
    mv po/POTFILES.in.in po/POTFILES.in
 
1490
  else
 
1491
    rm po/POTFILES.in.in
 
1492
  fi
 
1493
else
 
1494
  touch po/POTFILES.in
 
1495
fi
 
1496
])
1541
1497
 
1542
1498
# Ensure that table handlers gets all modifications to CFLAGS/CXXFLAGS
1543
1499
AC_CONFIG_COMMANDS_POST(ac_configure_args="$ac_configure_args CFLAGS='$CFLAGS' CXXFLAGS='$CXXFLAGS' AM_CFLAGS='$AM_CFLAGS' AM_CXXFLAGS='$AM_CXXFLAGS'")
1551
1507
echo "   * System type:               $SYSTEM_TYPE"
1552
1508
echo "   * Host CPU:                  $host_cpu"
1553
1509
echo "   * C Compiler:                $CC_VERSION"
1554
 
echo "   * C++ Compiler:              $CXX"
 
1510
echo "   * C++ Compiler:              $CXX_VERSION"
1555
1511
echo "   * Build auth_pam:            $ac_cv_header_security_pam_appl_h"
1556
1512
echo "   * Assertions enabled:        $ac_cv_assert"
1557
1513
echo "   * Debug enabled:             $with_debug"
1558
1514
echo "   * Profiling enabled:         $ac_profiling"
1559
1515
echo "   * Coverage enabled:          $ac_coverage"
1560
1516
echo "   * Warnings as failure:       $ac_warn_fail"
 
1517
echo "   * Scheduling Plugins:        $scheduling_plugins"
1561
1518
echo "   * C++ cstdint location:      $ac_cv_cxx_cstdint"
1562
1519
echo "   * C++ hash_map location:     $ac_cv_cxx_hash_map"
1563
1520
echo "   * C++ hash namespace:        $ac_cv_cxx_hash_namespace"
1564
 
echo "   * C++ cmath location:        $ac_cv_cxx_cmath"
1565
 
echo "   * C++ cmath namespace:       $ac_cv_cxx_cmath_namespace"
 
1521
echo "   * C++ shared_ptr namespace:  $ac_cv_shared_ptr_namespace"
1566
1522
echo ""
1567
1523
echo "---"
 
1524
 
 
1525
dnl libtoolize scans configure.ac  and needs to see some text
 
1526
m4_define([LIBTOOLIZE_AC_INIT], [])