~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Monty Taylor
  • Date: 2008-12-10 23:20:13 UTC
  • mto: (670.1.19 devel)
  • mto: This revision was merged to the branch mainline in revision 672.
  • Revision ID: monty@inaugust.com-20081210232013-mf299fj8pvc1lcu5
Fix the serialize build order problem (for now).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
dnl -*- bash -*-
2
2
dnl Process this file with autoconf to produce a configure script.
3
3
 
4
 
dnl  Copyright (C) 2009 Sun Microsystems
5
 
dnl
6
 
dnl  This program is free software; you can redistribute it and/or modify
7
 
dnl  it under the terms of the GNU General Public License as published by
8
 
dnl  the Free Software Foundation; version 2 of the License.
9
 
dnl
10
 
dnl  This program is distributed in the hope that it will be useful,
11
 
dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
dnl  GNU General Public License for more details.
14
 
dnl
15
 
dnl  You should have received a copy of the GNU General Public License
16
 
dnl  along with this program; if not, write to the Free Software
17
 
dnl  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
 
 
19
 
 
20
4
AC_PREREQ(2.59)dnl              Minimum Autoconf version required.
21
 
AC_INIT([drizzle],[RELEASE_VERSION],[http://bugs.launchpad.net/drizzle])
 
5
 
 
6
AC_INIT(drizzle, [7.0.0], [http://bugs.launchpad.net/drizzle])
22
7
AC_CONFIG_SRCDIR([drizzled/drizzled.cc])
23
8
AC_CONFIG_AUX_DIR(config)
24
9
AC_CONFIG_HEADERS([config.h])
25
 
AC_CONFIG_MACRO_DIR([m4])
26
10
 
27
 
# Setting CFLAGS here prevents AC_CANONICAL_TARGET from injecting them
28
 
SAVE_CFLAGS=${CFLAGS}
29
 
SAVE_CXXFLAGS=${CXXFLAGS}
30
 
CFLAGS=
31
 
CXXFLAGS=
 
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)
32
29
 
33
30
AC_CANONICAL_TARGET
34
 
 
35
 
CFLAGS=${SAVE_CFLAGS}
36
 
CXXFLAGS=${SAVE_CXXFLAGS}
37
 
 
38
 
AM_INIT_AUTOMAKE(nostdinc subdir-objects -Wall -Werror)
39
 
gl_EARLY
 
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
40
60
 
41
61
if test "x${enable_dependency_tracking}" = "x"
42
62
then
43
63
  enable_dependency_tracking=yes
44
64
fi
45
65
 
46
 
if test -d "${srcdir}/.bzr"
47
 
then
48
 
  building_from_bzr=yes
49
 
else
50
 
  building_from_bzr=no
51
 
fi
52
 
 
 
66
################ End of section to be done before AC_PROG_CC #################
 
67
 
 
68
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
AC_USE_SYSTEM_EXTENSIONS
53
77
AC_PROG_CXX
54
 
 
55
 
gl_USE_SYSTEM_EXTENSIONS
56
 
 
 
78
AC_CXX_HEADER_STDCXX_98
 
79
if test "$ac_cv_cxx_stdcxx_98" = "no"
 
80
then
 
81
  AC_MSG_ERROR([C++ Compiler required to compile Drizzle])
 
82
fi
57
83
AC_PROG_CPP
58
84
AM_PROG_CC_C_O
59
85
 
60
 
CHECK_GCC_VERSION
61
 
dnl Once we can use a modern autoconf, we can use this
62
 
dnl AC_PROG_CC_C99
63
 
AC_CXX_CHECK_STANDARD
64
 
AC_CXX_HEADER_STDCXX_98
65
 
if test "$ac_cv_cxx_stdcxx_98" = "no"
66
 
then
67
 
  AC_MSG_ERROR([No working C++ Compiler has been found. Drizzle requires a C++ compiler that can handle C++98])
68
 
fi
69
 
 
70
 
 
71
 
gl_INIT
72
 
 
73
 
AC_C_BIGENDIAN
74
 
AC_C_CONST
75
 
AC_C_INLINE
76
 
AC_C_VOLATILE
77
 
AC_HEADER_TIME
78
 
AC_FUNC_MALLOC
79
 
AC_FUNC_REALLOC
80
 
 
81
86
AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
82
87
 
83
 
# Version with no dots
84
 
AC_DEFINE([DRIZZLE_VERSION_ID],[RELEASE_ID],
85
 
          [Version ID that can be easily used for numeric comparison])
86
 
 
87
 
AC_DEFINE([_BACKWARD_BACKWARD_WARNING_H],[1],[Hack to disable deprecation warning in gcc])
88
 
 
89
 
# The port that was assigned by IANA.
 
88
dnl AC_CANONICAL_HOST thinks it's a good idea to just set CFLAGS to 
 
89
dnl -g -O2 if you're running gcc. We would like to use something else, thanks.
 
90
if test "x${CFLAGS}" = "x-g -O2"
 
91
then
 
92
  CFLAGS=
 
93
fi
 
94
if test "x${CXXFLAGS}" = "x-g -O2"
 
95
then
 
96
  CXXFLAGS=
 
97
fi
 
98
 
 
99
 
 
100
# Set all version vars based on $VERSION. How do we do this more elegant ?
 
101
# Remember that regexps needs to quote [ and ] since this is run through m4
 
102
# We take some made up examples
 
103
#
 
104
#  VERSION                  5.1.40sp1-alpha     5.0.34a
 
105
#  DRIZZLE_NO_DASH_VERSION    5.1.40sp1           5.0.34a
 
106
#  DRIZZLE_NUMERIC_VERSION    5.1.40              5.0.34
 
107
#  DRIZZLE_BASE_VERSION       5.1                 5.0
 
108
#  DRIZZLE_VERSION_ID         50140               50034
 
109
#
 
110
DRIZZLE_NO_DASH_VERSION=`echo $VERSION | sed -e "s|-.*$||"`
 
111
DRIZZLE_NUMERIC_VERSION=`echo $DRIZZLE_NO_DASH_VERSION | sed -e "s|[[a-z]][[a-z0-9]]*$||"`
 
112
DRIZZLE_BASE_VERSION=`echo $DRIZZLE_NUMERIC_VERSION | sed -e "s|\.[[^.]]*$||"`
 
113
DRIZZLE_VERSION_ID=`echo $DRIZZLE_NUMERIC_VERSION | \
 
114
    awk -F. '{printf "%d%0.2d%0.2d", $1, $2, $3}'`
 
115
 
 
116
# The port should be constant for a LONG time
90
117
DRIZZLE_TCP_PORT_DEFAULT=4427
91
118
 
92
 
m4_include(m4/dtrace.m4)
93
 
 
94
 
m4_include(m4/character_sets.m4)
 
119
sinclude(m4/dtrace.m4)
 
120
sinclude(m4/character_sets.m4)
 
121
sinclude(m4/gettext.m4)
 
122
 
 
123
AM_GNU_GETTEXT([external])
 
124
AM_GNU_GETTEXT_VERSION([0.17])
 
125
 
 
126
AM_CONDITIONAL([BUILD_GETTEXT],[test "x$MSGMERGE" != "x" -a "x$MSGMERGE" != "x:"])
 
127
 
 
128
AC_SUBST(DRIZZLE_NO_DASH_VERSION)
 
129
AC_DEFINE_UNQUOTED(DRIZZLE_BASE_VERSION,["$DRIZZLE_BASE_VERSION"],
 
130
                  [Major and minor version])
 
131
AC_SUBST(DRIZZLE_VERSION_ID)
 
132
AC_DEFINE_UNQUOTED([DRIZZLE_VERSION_ID],[$DRIZZLE_VERSION_ID],
 
133
                   [Version ID that can be easily used for numeric comparison])
 
134
AC_SUBST(DRIZZLE_PREVIOUS_BASE_VERSION)
 
135
AC_SUBST(PROTOCOL_VERSION)
 
136
AC_DEFINE_UNQUOTED([PROTOCOL_VERSION], [$PROTOCOL_VERSION],
 
137
                   [mysql client protocol version])
 
138
AC_SUBST(DOT_FRM_VERSION)
 
139
AC_DEFINE_UNQUOTED([FRM_VER], [$DOT_FRM_VERSION],
 
140
                   [Version of .frm files])
 
141
AC_DEFINE_UNQUOTED([DRIZZLE_CONFIG_NAME],["drizzled"],[Name of server config section])
 
142
 
 
143
AC_SUBST(SHARED_LIB_MAJOR_VERSION)
 
144
AC_SUBST(SHARED_LIB_VERSION)
95
145
AC_SUBST(AVAILABLE_LANGUAGES)
96
146
 
97
 
 
98
 
# Set this for plugins to use
99
 
ac_build_drizzle="yes"
 
147
dnl Ok. This is sort of lame, but we need to be nice to plugins Makefile.am's.
 
148
AM_CONDITIONAL(BUILD_DRIZZLE,[test "x" = "x"])
 
149
 
 
150
 
 
151
# General Constants
 
152
AC_DEFINE([IO_SIZE], [4096], [Io buffer size; Must be a power of 2 and 
 
153
  a multiple of 512. May be
 
154
  smaller what the disk page size. This influences the speed of the
 
155
  isam btree library. eg to big to slow.])
 
156
AC_DEFINE([SC_MAXWIDTH],[256], [Max width of screen (for error messages)])
 
157
AC_DEFINE([FN_LEN],[256 ], [Max file name len ])
 
158
AC_DEFINE([FN_EXTLEN],[20], [Max length of extension (part of FN_LEN) ])
 
159
AC_DEFINE([FN_REFLEN],[512], [Max length of full path-name ])
 
160
AC_DEFINE([FN_EXTCHAR],['.'], [File extension character])
 
161
AC_DEFINE([FN_HOMELIB],['~'], [~/ is used as abbrev for home dir ])
 
162
AC_DEFINE([FN_CURLIB],['.'], [./ is used as abbrev for current dir ])
 
163
AC_DEFINE([FN_PARENTDIR],[".."], [Parent directory; Must be a string ])
 
164
 
 
165
AC_DEFINE([MASTER],[1],[Compile without unireg])
 
166
 
 
167
AH_VERBATIM([QUOTE_ARG],[
 
168
/* Quote argument (before cpp) */
 
169
#ifndef QUOTE_ARG
 
170
# define QUOTE_ARG(x) #x
 
171
#endif
 
172
/* Quote argument, (after cpp) */
 
173
#ifndef STRINGIFY_ARG
 
174
# define STRINGIFY_ARG(x) QUOTE_ARG(x)
 
175
#endif
 
176
])
 
177
 
 
178
AH_VERBATIM([builtin_expect],[
 
179
/*
 
180
 * The macros below are borrowed from include/linux/compiler.h in the
 
181
 * Linux kernel. Use them to indicate the likelyhood of the truthfulness
 
182
 * of a condition. This serves two purposes - newer versions of gcc will be
 
183
 * able to optimize for branch predication, which could yield siginficant
 
184
 * performance gains in frequently executed sections of the code, and the
 
185
 * other reason to use them is for documentation
 
186
 */
 
187
#if !defined(__GNUC__)
 
188
#define __builtin_expect(x, expected_value) (x)
 
189
#endif
 
190
 
 
191
#define likely(x)  __builtin_expect((x),1)
 
192
#define unlikely(x)  __builtin_expect((x),0)
 
193
])
 
194
 
 
195
dnl  InnoDB depends on some Drizzle's internals which other plugins should not
 
196
dnl  need.  This is because of InnoDB's foreign key support, "safe" binlog
 
197
dnl  truncation, and other similar legacy features.
 
198
 
 
199
dnl  We define accessors for these internals unconditionally, but do not
 
200
dnl  expose them in mysql/plugin.h.  They are declared in ha_innodb.h for
 
201
dnl  InnoDB's use.
 
202
 
 
203
AC_DEFINE([INNODB_COMPATIBILITY_HOOKS],[1],[TODO: Remove the need for this])
 
204
dnl TODO: Make a test for when this needs to be set.
 
205
AC_DEFINE([_REENTRANT],[1],[Some thread libraries require this])
 
206
 
 
207
AH_VERBATIM([posix_pthread],[
 
208
/* We want posix threads */
 
209
#ifndef _POSIX_PTHREAD_SEMANTICS
 
210
#define _POSIX_PTHREAD_SEMANTICS
 
211
#endif
 
212
])
100
213
 
101
214
 
102
215
# Canonicalize the configuration name.
103
216
 
104
 
AC_DEFINE_UNQUOTED([HOST_VENDOR], ["$host_vendor"],[Vendor of Build System])
105
 
AC_DEFINE_UNQUOTED([HOST_OS], ["$host_os"], [OS of Build System])
106
 
AC_DEFINE_UNQUOTED([HOST_CPU], ["$host_cpu"], [CPU of Build System])
107
 
 
108
 
AC_DEFINE_UNQUOTED([TARGET_VENDOR], ["$target_vendor"],[Vendor of Target System])
109
 
AC_DEFINE_UNQUOTED([TARGET_OS], ["$target_os"], [OS of Target System])
110
 
AC_DEFINE_UNQUOTED([TARGET_CPU], ["$target_cpu"], [CPU of Target System])
 
217
# Check whether --with-system-type or --without-system-type was given.
 
218
AC_ARG_WITH([system-type],
 
219
    [AS_HELP_STRING([--with-system-type],
 
220
       [Set the system type, like "sun-solaris10"])],
 
221
    [SYSTEM_TYPE="$withval"],
 
222
    [SYSTEM_TYPE="$host_vendor-$host_os"])
 
223
AC_ARG_WITH([machine-type],
 
224
    [AS_HELP_STRING([--with-machine-type],
 
225
       [Set the machine type, like "powerpc"])],
 
226
    [MACHINE_TYPE="$withval"],
 
227
    [MACHINE_TYPE="$host_cpu"])
 
228
AC_SUBST(SYSTEM_TYPE)
 
229
AC_DEFINE_UNQUOTED([SYSTEM_TYPE], ["$SYSTEM_TYPE"],
 
230
                   [Name of system, eg sun-solaris])
 
231
AC_SUBST(MACHINE_TYPE)
 
232
AC_DEFINE_UNQUOTED([MACHINE_TYPE], ["$MACHINE_TYPE"],
 
233
                   [Machine type name, eg sparc])
 
234
 
 
235
# Detect intel x86 like processor
 
236
BASE_MACHINE_TYPE=$MACHINE_TYPE
 
237
case $MACHINE_TYPE in
 
238
  i?86) BASE_MACHINE_TYPE=i386 ;;
 
239
esac
 
240
 
 
241
AM_SANITY_CHECK
 
242
# This is needed is SUBDIRS is set
 
243
AC_PROG_MAKE_SET
111
244
 
112
245
 
113
246
case "$target_os" in
116
249
  AC_SUBST(TARGET_LINUX)
117
250
  AC_DEFINE([TARGET_OS_LINUX], [1], [Whether we build for Linux])
118
251
    ;;
119
 
  *darwin*)
 
252
  *apple-darwin*)
120
253
    TARGET_OSX="true"
121
254
    AC_SUBST(TARGET_OSX)
122
255
    AC_DEFINE([TARGET_OS_OSX], [1], [Whether we build for OSX])
130
263
    ;;
131
264
esac
132
265
 
 
266
dnl AC_CANONICAL_HOST thinks it's a good idea to just set CFLAGS to 
 
267
dnl -g -O2 if you're running gcc. We would like to use something else, thanks.
 
268
if test "x${CFLAGS}" = "x-g -O2"
 
269
then
 
270
  CFLAGS=
 
271
fi
 
272
if test "x${CXXFLAGS}" = "x-g -O2"
 
273
then
 
274
  CXXFLAGS=
 
275
fi
 
276
 
133
277
DRIZZLE_CHECK_C_VERSION
134
278
DRIZZLE_CHECK_CXX_VERSION
135
279
 
136
280
AC_SYS_LARGEFILE
137
281
 
138
 
AC_PATH_PROG(GPERF, gperf)
139
 
AS_IF([test "x$GPERF" = "x"],
140
 
      AC_MSG_ERROR("Drizzle requires gperf to build."))
141
 
 
142
 
AC_PATH_PROG(LCOV, lcov)
143
 
AC_PATH_PROG(GENHTML, genhtml)
144
 
 
145
 
AM_CONDITIONAL(HAVE_LCOV,[test "x$LCOV" != "x"])
146
 
 
 
282
AC_PROG_AWK
 
283
 
 
284
if test "$ac_cv_c_compiler_gnu" = "yes"
 
285
then
 
286
  AS="$CC -c"
 
287
  AC_SUBST(AS)
 
288
else
 
289
  AC_PATH_PROG(AS, as, as)
 
290
fi
 
291
 
 
292
dnl TODO: This needs to go away and be replaced with _ISOC99_SOURCE
 
293
if test "$ac_cv_c_compiler_gnu" = "yes" -o "$target_os" = "linux-gnu"
 
294
then
 
295
  AC_DEFINE([_GNU_SOURCE],[1],[Fix problem with S_ISLNK() on Linux])
 
296
fi
 
297
 
 
298
dnl  Solaris 9 include file <sys/feature_tests.h> refers to X/Open document
 
299
 
 
300
dnl  System Interfaces and Headers, Issue 5
 
301
 
 
302
dnl  saying we should define _XOPEN_SOURCE=500 to get POSIX.1c prototypes,
 
303
dnl  but apparently other systems (namely FreeBSD) don't agree.
 
304
 
 
305
dnl  On a newer Solaris 10, the above file recognizes also _XOPEN_SOURCE=600.
 
306
dnl  Furthermore, it tests that if a program requires older standard
 
307
dnl  (_XOPEN_SOURCE<600 or _POSIX_C_SOURCE<200112L) it cannot be
 
308
dnl  run on a new compiler (that defines _STDC_C99) and issues an #error.
 
309
dnl  It's also an #error if a program requires new standard (_XOPEN_SOURCE=600
 
310
dnl  or _POSIX_C_SOURCE=200112L) and a compiler does not define _STDC_C99.
 
311
 
 
312
dnl  To add more to this mess, Sun Studio C compiler defines _STDC_C99 while
 
313
dnl  C++ compiler does not!
 
314
 
 
315
dnl TODO: Can _ISOC99_SOURCE be defined on all platforms and remove the 
 
316
dnl       Need for all of this? 
 
317
if test "$GCC" = "yes"
 
318
then
 
319
  case "$target_os" in
 
320
    *solaris*)
 
321
    CFLAGS="${CFLAGS} -D_XOPEN_SOURCE=600"
 
322
    CXXFLAGS="${CXXFLAGS} -D__C99FEATURES__"
 
323
    ;;
 
324
  esac
 
325
fi
 
326
 
 
327
# We use libtool
 
328
AC_PROG_LIBTOOL
 
329
 
 
330
# Ensure that we have --preserve-dup-deps defines, otherwise we get link
 
331
# problems of 'mysql' with CXX=g++
 
332
LIBTOOL="$LIBTOOL --preserve-dup-deps"
 
333
AC_SUBST(LIBTOOL)dnl
 
334
 
 
335
AC_SUBST(NM)dnl
 
336
 
 
337
AC_PROG_INSTALL
 
338
test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
 
339
 
 
340
# Look for "(group|user)add". 
 
341
# TODO: If the programs do not exist, inform the DBA that the user
 
342
#       was not created at the end of the install routine.
 
343
AC_CHECK_PROGS(GROUPADD, groupadd addgroup)
 
344
AC_CHECK_PROGS(USERADD, useradd adduser)
 
345
 
 
346
dnl Needed for ltmain
 
347
AC_PROG_RANLIB
 
348
 
 
349
dnl Not critical since the generated file is distributed
147
350
AC_CHECK_PROGS(YACC, ['bison -y'])
148
 
if test -z "$YACC" && test "$building_from_bzr" = "yes"
 
351
if test -z "$YACC" && test -d ".bzr"
149
352
then
150
353
  AC_MSG_ERROR(["bison is required for Drizzle to build from a bzr branch"])
151
354
fi
152
355
 
153
 
 
 
356
AC_PATH_PROG(uname_prog, uname, no)
 
357
 
 
358
# We should go through this and put all the explictly system dependent
 
359
# stuff in one place
 
360
AC_MSG_CHECKING(operating system)
 
361
AC_CACHE_VAL(mysql_cv_sys_os,
 
362
[
 
363
if test "$uname_prog" != "no"; then
 
364
  mysql_cv_sys_os="`uname`"
 
365
else
 
366
  mysql_cv_sys_os="Not Solaris"
 
367
fi
 
368
])
 
369
AC_MSG_RESULT($mysql_cv_sys_os)
 
370
 
 
371
 
 
372
# The following is required for portable results of floating point calculations
 
373
# on PowerPC. The same must also be done for IA-64, but this options is missing
 
374
# in the IA-64 gcc backend.
 
375
 
 
376
if test "$GCC" = "yes"
 
377
then
 
378
  case "$host_cpu" in
 
379
    *ppc* | *powerpc*)
 
380
      AM_CFLAGS="$CFLAGS -mno-fused-madd"
 
381
      AM_CXXFLAGS="$CXXFLAGS -mno-fused-madd"
 
382
    ;;
 
383
  esac
 
384
fi
154
385
# Build optimized or debug version ?
155
386
# First check for gcc and g++
 
387
SYMBOLS_FLAGS="-g"
 
388
DEBUG_OPTIMIZE_CC=""
 
389
OPTIMIZE_CFLAGS="-O"
 
390
DEBUG_OPTIMIZE_CXX=""
 
391
OPTIMIZE_CXXFLAGS="-O"
156
392
if test "$GCC" = "yes"
157
393
then
158
 
 
159
 
  AC_DEFINE([_GNU_SOURCE],[1],[Fix problem with S_ISLNK() on Linux])
160
 
 
161
 
  dnl The following is required for portable results of floating point 
162
 
  dnl calculations on PowerPC. The same must also be done for IA-64, but 
163
 
  dnl this options is missing in the IA-64 gcc backend.
164
 
  case "$target_cpu" in
165
 
    *ppc* | *powerpc*)
166
 
      AM_CFLAGS="-mno-fused-madd ${AM_CFLAGS}"
167
 
      AM_CXXFLAGS="-mno-fused-madd ${AM_CXXFLAGS}"
168
 
    ;;
169
 
  esac
170
 
 
171
 
  dnl Once we can use a modern autoconf, we can replace the std=gnu99 here
172
 
  dnl with using AC_CC_STD_C99 above
173
 
  CC="${CC} -std=gnu99"
174
 
 
175
 
  AM_CFLAGS="-ggdb3 ${AM_CFLAGS}"
176
 
  AM_CXXFLAGS="-ggdb3 ${AM_CXXFLAGS}"
177
 
  
178
 
  DEBUG_CFLAGS="-O0"
179
 
  DEBUG_CXXFLAGS="-O0"
180
 
 
 
394
  SYMBOLS_FLAGS="-ggdb3"
 
395
  DEBUG_OPTIMIZE_CC="-O0"
181
396
  OPTIMIZE_CFLAGS="-O3"
 
397
  DEBUG_OPTIMIZE_CXX="-O0"
182
398
  OPTIMIZE_CXXFLAGS="-O3"
183
399
fi
184
400
if test "$SUNCC" = "yes"
185
401
then
186
 
  dnl Once we can use a modern autoconf, we can replace the -xc99=all here
187
 
  dnl with using AC_CC_STD_C99 above
188
 
  CC="${CC} -xc99=all"
189
 
 
190
 
  AM_CFLAGS="-g -mt ${AM_CFLAGS}"
191
 
  AM_CXXFLAGS="-xlang=c99 -g -mt -compat=5 -library=stlport4 -template=no%extdef ${AM_CXXFLAGS}"
192
 
 
193
 
  OPTIMIZE_FLAGS="-xO3 -xlibmil -xdepend -xbuiltin -lmopt"
194
 
  OPTIMIZE_CFLAGS="${OPTIMIZE_FLAGS} -Xa -xstrconst"
195
 
  OPTIMIZE_CXXFLAGS="${OPTIMIZE_FLAGS}"
196
 
 
197
 
fi
198
 
ENABLE_64BIT
199
 
 
200
 
AM_GNU_GETTEXT(external, need-formatstring-macros)
201
 
if test "x$MSGMERGE" = "x" -o "x$MSGMERGE" = "x:"
202
 
then
203
 
  AM_PATH_PROG_WITH_TEST(GMSGMERGE, gmsgmerge,
204
 
    [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
205
 
  MSGMERGE="${GMSGMERGE}"
206
 
fi
207
 
AM_CONDITIONAL([BUILD_GETTEXT],[test "x$MSGMERGE" != "x" -a "x$MSGMERGE" != "x:"])
208
 
 
209
 
 
210
 
# We use libtool
211
 
AC_PROG_LIBTOOL
 
402
  dnl I'm cheating here and sticking C99 support in SYMBOLS_FLAGS
 
403
  SYMBOLS_FLAGS=""
 
404
  DEBUG_OPTIMIZE_CC=""
 
405
  OPTIMIZE_CFLAGS="-xO4 -xlibmil -xdepend -Xa -mt -xstrconst -D_FORTEC_"
 
406
  DEBUG_OPTIMIZE_CXX=""
 
407
  #Put back in once isnan is figured out
 
408
  OPTIMIZE_CXXFLAGS="-xO4 -xlibmil -mt -D_FORTEC_ -xlang=c99 -compat=5 -library=stlport4"
 
409
fi
212
410
 
213
411
dnl TODO: Remove this define once we are using 2.61 across the board.
214
412
# AX_HEADER_ASSERT
227
425
 
228
426
AX_HEADER_ASSERT
229
427
 
 
428
CFLAGS="${SYMBOLS_FLAGS} ${CFLAGS}"
 
429
CXXFLAGS="${SYMBOLS_FLAGS} ${CXXFLAGS}"
 
430
 
230
431
AC_ARG_WITH([debug],
231
432
    [AS_HELP_STRING([--with-debug],
232
433
       [Add debug code/turns off optimizations (yes|no) @<:@default=no@:>@])],
234
435
    [with_debug=no])
235
436
if test "$with_debug" = "yes"
236
437
then
237
 
  # Debuging. No optimization.
238
 
  AM_CFLAGS="${DEBUG_CFLAGS} ${AM_CFLAGS}"
239
 
  AM_CXXFLAGS="${DEBUG_CXXFLAGS} ${AM_CXXFLAGS}"
 
438
  # Medium debug.
 
439
  CFLAGS="$DEBUG_OPTIMIZE_CC -DDEBUG $CFLAGS ${SAVE_CFLAGS}"
 
440
  CXXFLAGS="$DEBUG_OPTIMIZE_CXX -DDEBUG $CXXFLAGS ${SAVE_CXXFLAGS}"
240
441
else
241
442
  # Optimized version. No debug
242
 
  AM_CFLAGS="${OPTIMIZE_CFLAGS} ${AM_CFLAGS}"
243
 
  AM_CXXFLAGS="${OPTIMIZE_CXXFLAGS} ${AM_CXXFLAGS}"
 
443
  CFLAGS="${OPTIMIZE_CFLAGS} ${CFLAGS} ${SAVE_CFLAGS}"
 
444
  CXXFLAGS="$OPTIMIZE_CXXFLAGS $CXXFLAGS ${SAVE_CXXFLAGS}"
244
445
fi
245
446
 
 
447
AC_SUBST(CC)
 
448
AC_SUBST(CFLAGS)
 
449
AC_SUBST(CXX)
 
450
AC_SUBST(CXXFLAGS)
 
451
AC_SUBST(ASFLAGS)
 
452
AC_SUBST(LD)
 
453
AC_SUBST(INSTALL_SCRIPT)
 
454
 
 
455
 
 
456
export CC CXX CFLAGS LD LDFLAGS AR ARFLAGS
246
457
 
247
458
AC_CXX_STL_HASH
248
459
AC_CXX_CSTDINT
249
460
AC_CXX_CINTTYPES
250
 
AC_CXX_SHARED_PTR
251
 
 
252
 
AC_LIB_PREFIX
253
 
 
254
 
#--------------------------------------------------------------------
255
 
# Check for libpthread
256
 
#--------------------------------------------------------------------
257
 
 
258
 
ACX_PTHREAD(,AC_MSG_ERROR(could not find libpthread))
259
 
LIBS="${PTHREAD_LIBS} ${LIBS}"
260
 
AM_CFLAGS="${PTHREAD_CFLAGS} ${AM_CFLAGS}"
261
 
CC="$PTHREAD_CC"
 
461
AC_CXX_CMATH
 
462
 
 
463
DRIZZLE_PROG_AR
 
464
 
 
465
# libdrizzle versioning when linked with GNU ld.
 
466
if test "x$EGREP" != "x"
 
467
then
 
468
  if test "$lt_cv_prog_gnu_ld" = "yes" -a $LD --version 2>/dev/null|${EGREP} -q GNU
 
469
  then
 
470
    LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_srcdir)/libdrizzle/libdrizzle.ver"
 
471
  fi
 
472
fi
 
473
AC_SUBST(LD_VERSION_SCRIPT)
262
474
 
263
475
#--------------------------------------------------------------------
264
476
# Check for Google Proto Buffers
265
477
#--------------------------------------------------------------------
266
478
 
267
479
AC_LANG_PUSH([C++])
268
 
AC_LIB_HAVE_LINKFLAGS(protobuf,pthread,
269
 
[#include <google/protobuf/descriptor.h>
270
 
],
271
 
[google::protobuf::FileDescriptor* file;],system)
272
 
AS_IF([test x$ac_cv_libprotobuf = xno],
273
 
      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.]))
274
 
 
275
 
AC_CACHE_CHECK([if protobuf is recent enough], [drizzle_cv_protobuf_recent],
276
 
  [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
277
 
#include <google/protobuf/descriptor.h>
278
 
#if GOOGLE_PROTOBUF_VERSION < 2000002
279
 
# error Your version of Protobuf is too old
280
 
#endif
281
 
    ]])],
282
 
    [drizzle_cv_protobuf_recent=yes],
283
 
    [drizzle_cv_protobuf_recent=no])])
284
 
if test "$drizzle_cv_protobuf_recent" = "no"
285
 
then
286
 
  AC_MSG_ERROR([Your version of Google Protocol Buffers is too old. Drizzle requires at least version 2.0.2])
287
 
fi
288
 
 
289
 
AC_PATH_PROG([PROTOC],[protoc],[no],[$LIBPROTOBUF_PREFIX/bin:$PATH])
 
480
SEARCH_FOR_LIB(protobuf, printf, google/protobuf/message.h,
 
481
               AC_MSG_ERROR([protobuf is required for Drizzle]))
 
482
 
 
483
AC_PATH_PROG([PROTOC],[protoc],[no],[$PROTOBUF_PATH])
290
484
if test "x$PROTOC" = "xno"
291
485
then
292
 
  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.])
 
486
  AC_MSG_ERROR([Couldn't find protoc. Try installing Google Protocol Buffer.])
293
487
fi
294
488
 
295
489
AC_LANG_POP()
298
492
# Check for libuuid
299
493
#--------------------------------------------------------------------
300
494
 
301
 
dnl Do this by hand. Need to check for uuid/uuid.h, but uuid may or may
302
 
dnl not be a lib is weird.
303
 
 
 
495
dnl Do this by hand instead of with SEARCH_FOR_LIB, because uuid is weird.
304
496
AC_CHECK_HEADERS(uuid/uuid.h)
305
497
if test "x$ac_cv_header_uuid_uuid_h" = "xno"
306
498
then
307
 
  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.])
 
499
  AC_MSG_ERROR([Couldn't find uuid/uuid.h. Try installing libuuid development packages])
308
500
fi
309
 
AC_LIB_HAVE_LINKFLAGS(uuid,,
310
 
[
311
 
#include <uuid/uuid.h>
312
 
],
313
 
[
314
 
  uuid_t uout;
315
 
  uuid_generate(uout);
 
501
AC_CHECK_LIB(uuid, uuid_generate)
 
502
 
 
503
#--------------------------------------------------------------------
 
504
# Check for libevent
 
505
#--------------------------------------------------------------------
 
506
 
 
507
SEARCH_FOR_LIB(event, event_loop, event.h, 
 
508
               AC_MSG_ERROR([libevent is required for Drizzle]))
 
509
 
 
510
 
 
511
AC_CACHE_CHECK([for bufferevent in libevent], ac_cv_libevent_works, [
 
512
  save_CPPFLAGS="$CPPFLAGS"
 
513
  save_LIBS="$LIBS"
 
514
  CPPFLAGS="$EVENT_CFLAGS"
 
515
  LIBS="$EVENT_LIBS"
 
516
  AC_TRY_LINK([
 
517
#include <sys/types.h>
 
518
#include <sys/time.h>
 
519
#include <stdlib.h>
 
520
#include <event.h>],[
 
521
        struct bufferevent bev;
 
522
        bufferevent_settimeout(&bev, 1, 1);
 
523
  ], ac_cv_libevent_works=yes, [
 
524
        AC_MSG_ERROR([you need to install a more recent version of libevent,
 
525
        check http://www.monkey.org/~provos/libevent/])
 
526
  ])
 
527
 
 
528
  CPPFLAGS="$save_CPPFLAGS"
 
529
  LIBS="$save_LIBS"
316
530
])
317
531
 
318
532
 
 
533
#--------------------------------------------------------------------
 
534
# Check for libpthread
 
535
#--------------------------------------------------------------------
319
536
 
 
537
AC_CHECK_HEADERS(pthread.h)
 
538
if test "x$ac_cv_header_pthread_h" != "xyes"
 
539
then
 
540
  AC_MSG_ERROR([Couldn't find pthread.h.])
 
541
fi
 
542
AC_CHECK_LIB(pthread, pthread_create, [], [AC_MSG_ERROR(could not find libpthread)])
320
543
 
321
544
#--------------------------------------------------------------------
322
545
# Check for tcmalloc/mtmalloc
323
546
#--------------------------------------------------------------------
324
547
 
325
 
case "$target_os" in
326
 
  *linux*)
327
 
    AC_ARG_ENABLE([tcmalloc],
328
 
      [AS_HELP_STRING([--enable-tcmalloc],
329
 
         [Enable linking with tcmalloc @<:@default=off@:>@])],
330
 
      [ac_enable_tcmalloc="$enableval"],
331
 
      [ac_enable_tcmalloc="no"])
332
 
 
333
 
    if test "x$ac_enable_tcmalloc" != "xno"
334
 
    then
335
 
      AC_CHECK_LIB(tcmalloc-minimal,malloc,[],[])
336
 
 
337
 
      if test "x$ac_cv_lib_tcmalloc_minimal_malloc" != "xyes"
338
 
      then
339
 
        AC_CHECK_LIB(tcmalloc,malloc,[],[])
340
 
      fi
341
 
    fi
342
 
 
343
 
    ;;
344
 
  *solaris*)
345
 
    AC_ARG_ENABLE([mtmalloc],
346
 
      [AS_HELP_STRING([--disable-mtmalloc],
347
 
         [Enable linking with mtmalloc @<:@default=on@:>@])],
348
 
      [ac_enable_mtmalloc="$enableval"],
349
 
      [ac_enable_mtmalloc="yes"])
350
 
 
351
 
    if test "x$ac_enable_mtmalloc" != "xno"
352
 
    then
353
 
      AC_CHECK_LIB(mtmalloc,malloc,[],[])
354
 
    fi
355
 
    ;;
356
 
esac
357
 
 
358
 
 
359
 
#--------------------------------------------------------------------
360
 
# Check for libdrizzle
361
 
#--------------------------------------------------------------------
362
 
 
363
 
AC_LANG_PUSH(C++)
364
 
AC_LIB_HAVE_LINKFLAGS(drizzle,,
365
 
[#include <libdrizzle/drizzle.h>],
366
 
[
367
 
  const char *version= drizzle_version()
368
 
])
369
 
AS_IF([test x$ac_cv_libdrizzle = xno],
370
 
      AC_MSG_ERROR([libdrizzle is required for Drizzle]))
371
 
AC_LANG_POP
372
 
 
 
548
AC_ARG_ENABLE([tcmalloc],
 
549
    [AS_HELP_STRING([--enable-tcmalloc],
 
550
       [Enable linking with tcmalloc @<:@default=off@:>@])],
 
551
    [ac_enable_tcmalloc="$enableval"],
 
552
    [ac_enable_tcmalloc="no"])
 
553
 
 
554
if test "x$ac_enable_tcmalloc" != "xno"
 
555
then
 
556
  AC_CHECK_LIB(tcmalloc,malloc,[],[])
 
557
fi
 
558
 
 
559
if test "x$ac_cv_lib_tcmalloc_malloc" != "xyes"
 
560
then
 
561
  AC_CHECK_LIB(mtmalloc,malloc,[],[])
 
562
fi
373
563
 
374
564
#--------------------------------------------------------------------
375
565
# Check for libz
376
566
#--------------------------------------------------------------------
377
567
 
378
 
AC_LIB_HAVE_LINKFLAGS(z,,
379
 
[#include <zlib.h>],
380
 
[
381
 
  crc32(0, Z_NULL, 0);
382
 
])
383
 
AS_IF([test x$ac_cv_libz = xno],
384
 
      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.]))
385
 
 
386
 
#--------------------------------------------------------------------
387
 
# Check for TBB
388
 
#--------------------------------------------------------------------
389
 
 
390
 
AC_LANG_PUSH(C++)
391
 
AC_LIB_HAVE_LINKFLAGS(tbb,,
392
 
[#include <tbb/atomic.h>
393
 
 #include <stdint.h>
394
 
],
395
 
[
396
 
  tbb::atomic<uint64_t> x;
397
 
  tbb::atomic<uint8_t> y;
398
 
  x=0;
399
 
  y=0;
400
 
  x++;
401
 
  y++;
402
 
])
403
 
AC_LANG_POP()
 
568
SEARCH_FOR_LIB(z, crc32, zlib.h, 
 
569
               AC_MSG_ERROR([libz is required for Drizzle]))
 
570
 
 
571
#--------------------------------------------------------------------
 
572
# Check for libncurses
 
573
#--------------------------------------------------------------------
 
574
 
 
575
 
 
576
SEARCH_FOR_LIB(ncurses, tgetent, ncurses/ncurses.h, [
 
577
        SEARCH_FOR_LIB(tinfo, tgetent, ncurses/ncurses.h,
 
578
                AC_MSG_ERROR([Couldn't find ncurses])
 
579
        )
 
580
        ]
 
581
)
404
582
 
405
583
#--------------------------------------------------------------------
406
584
# Check for libreadline or compatible (libedit on Mac OS X)
407
585
#--------------------------------------------------------------------
408
586
 
409
 
save_LIBS="${LIBS}"
410
 
LIBS=""
411
 
VL_LIB_READLINE
412
 
AS_IF([test "x$vl_cv_lib_readline" = "xno"],
413
 
      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.]))
414
 
READLINE_LIBS="${LIBS}"
415
 
LIBS="${save_LIBS}"
416
 
AC_SUBST(READLINE_LIBS)
 
587
 
 
588
SEARCH_FOR_LIB(readline, rl_initialize, readline/readline.h,
 
589
               AC_MSG_ERROR([libreadline is required for Drizzle]),
 
590
               [$NCURSES_LIBS]) 
 
591
 
 
592
save_CPPFLAGS="$CPPFLAGS"
 
593
CPPFLAGS="$CPPFLAGS $READLINE_CFLAGS"
 
594
AC_CHECK_HEADERS(readline/history.h)
 
595
AC_CHECK_TYPES([HIST_ENTRY], [], [], [AC_INCLUDES_DEFAULT[
 
596
#ifdef HAVE_READLINE_HISTORY_H
 
597
#include <readline/history.h>
 
598
#endif
 
599
#include <readline/readline.h>
 
600
]])
 
601
AC_CHECK_DECLS([completion_matches], [], [], [AC_INCLUDES_DEFAULT[
 
602
#ifdef HAVE_READLINE_HISTORY_H
 
603
#include <readline/history.h>
 
604
#endif
 
605
#include <readline/readline.h>
 
606
]])
417
607
 
418
608
DRIZZLE_CHECK_NEW_RL_INTERFACE
 
609
CPPFLAGS="$save_CPPFLAGS"
 
610
 
419
611
 
420
612
#--------------------------------------------------------------------
421
613
# Check for libpcre
422
614
#--------------------------------------------------------------------
423
615
 
424
 
AC_LIB_HAVE_LINKFLAGS(pcre,,
425
 
[#include <pcre.h>],
426
 
[
427
 
  pcre *re= NULL;
428
 
  pcre_version();
429
 
])
430
 
AS_IF([test "x$ac_cv_libpcre" = "xno"],
431
 
[
432
 
  unset ac_cv_libpcre
433
 
  unset HAVE_LIBPCRE
434
 
  unset LIBPCRE
435
 
  unset LIBPCRE_PREFIX
436
 
  unset LTLIBPCRE
437
 
  AC_LIB_HAVE_LINKFLAGS(pcre,,
438
 
  [#include <pcre/pcre.h>],
439
 
  [
440
 
    pcre *re= NULL;
441
 
    pcre_version();
442
 
  ])
443
 
  AS_IF([test "x$ac_cv_libpcre" = "xno"],
444
 
  [
445
 
    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.])
446
 
  ],[
447
 
    AC_DEFINE(PCRE_HEADER,[<pcre/pcre.h>],[Location of pcre header])
448
 
  ])
449
 
],[
450
 
  AC_DEFINE(PCRE_HEADER,[<pcre.h>],[Location of pcre header])
451
 
])
452
 
 
453
 
 
 
616
AC_PATH_PROG(PKG_CONFIG, pkg-config, AC_MSG_ERROR([pkg-config wasn't found.]))
 
617
PKG_CHECK_MODULES(PCRE, [libpcre >= 3], [found_pcre="yes"],[found_pcre="no"])
 
618
 
 
619
if test "$found_pcre" = "no"
 
620
then
 
621
  SEARCH_FOR_LIB(pcre, pcre_compile, pcre.h, 
 
622
                 AC_MSG_ERROR([libpcre is required for Drizzle]))
 
623
fi
 
624
AC_SUBST(PCRE_LIBS)
 
625
AC_SUBST(PCRE_CFLAGS)
 
626
 
 
627
dnl Find paths to some shell programs
 
628
AC_PATH_PROG(LN, ln, ln)
 
629
# This must be able to take a -f flag like normal unix ln.
 
630
AC_PATH_PROG(LN_CP_F, ln, ln)
 
631
 
 
632
AC_PATH_PROG(MV, mv, mv)
 
633
AC_PATH_PROG(RM, rm, rm)
 
634
AC_PATH_PROG(CP, cp, cp)
 
635
AC_PATH_PROG(SED, sed, sed)
 
636
AC_PATH_PROG(CMP, cmp, cmp)
 
637
AC_PATH_PROG(CHMOD, chmod, chmod)
 
638
AC_PATH_PROG(HOSTNAME, hostname, hostname)
 
639
# Check for a GNU tar named 'gtar', or 'gnutar' (MacOS X) and
 
640
# fall back to 'tar' otherwise and hope that it's a GNU tar as well
 
641
AC_CHECK_PROGS(TAR, gnutar gtar tar)
 
642
 
 
643
dnl We use a path for perl so the script startup works
 
644
dnl We make sure to use perl, not perl5, in hopes that the RPMs will
 
645
dnl not depend on the perl5 binary being installed (probably a bug in RPM)
454
646
AC_PATH_PROG(PERL, perl, no)
 
647
if test "$PERL" != "no" && $PERL -e 'require 5' > /dev/null 2>&1
 
648
then
 
649
  PERL5=$PERL
 
650
else
 
651
  AC_PATH_PROG(PERL5, perl5, no)
 
652
  if test "$PERL5" != no
 
653
  then
 
654
    PERL=$PERL5
 
655
    ac_cv_path_PERL=$ac_cv_path_PERL5
 
656
  fi
 
657
fi
 
658
 
 
659
AC_SUBST(HOSTNAME)
 
660
AC_SUBST(PERL)
 
661
AC_SUBST(PERL5)
 
662
 
 
663
# icheck, used for ABI check
 
664
AC_PATH_PROG(ICHECK, icheck, no)
 
665
# "icheck" is also the name of a file system check program on Tru64.
 
666
# Verify the program found is really the interface checker.
 
667
if test "x$ICHECK" != "xno"
 
668
then
 
669
  AC_MSG_CHECKING(if $ICHECK works as expected)
 
670
  echo "int foo;" > conftest.h
 
671
  $ICHECK --canonify -o conftest.ic conftest.h 2>/dev/null
 
672
  if test -f "conftest.ic"
 
673
  then
 
674
    AC_MSG_RESULT(yes)
 
675
  else
 
676
    AC_MSG_RESULT(no)
 
677
    ICHECK=no
 
678
  fi
 
679
  rm -f conftest.ic conftest.h
 
680
fi
 
681
AC_SUBST(ICHECK)
 
682
 
 
683
# Lock for PS
 
684
AC_PATH_PROG(PS, ps, ps)
 
685
AC_MSG_CHECKING("how to check if pid exists")
 
686
PS=$ac_cv_path_PS
 
687
# Linux style
 
688
if $PS p $$ 2> /dev/null | grep `echo $0 | sed s/\-//` > /dev/null
 
689
then
 
690
  FIND_PROC="$PS p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
 
691
# Solaris
 
692
elif $PS -fp $$ 2> /dev/null | grep $0 > /dev/null
 
693
then
 
694
  FIND_PROC="$PS -p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
 
695
# BSD style
 
696
elif $PS -uaxww 2> /dev/null | grep $0 > /dev/null
 
697
then
 
698
  FIND_PROC="$PS -uaxww | grep -v grep | grep \$\$MYSQLD | grep \" \$\$PID \" > /dev/null"
 
699
# SysV style
 
700
elif $PS -ef 2> /dev/null | grep $0 > /dev/null
 
701
then
 
702
  FIND_PROC="$PS -ef | grep -v grep | grep \$\$MYSQLD | grep \" \$\$PID \" > /dev/null"
 
703
# Do anybody use this?
 
704
elif $PS $$ 2> /dev/null | grep $0 > /dev/null
 
705
then
 
706
  FIND_PROC="$PS \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
 
707
else
 
708
  case $SYSTEM_TYPE in
 
709
    *freebsd*|*dragonfly*|*cygwin*)
 
710
      FIND_PROC="$PS p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
 
711
      ;;
 
712
    *darwin*)
 
713
      FIND_PROC="$PS -uaxww | grep -v grep | grep \$\$MYSQLD | grep \" \$\$PID \" > /dev/null"
 
714
      ;;
 
715
    *)
 
716
      AC_MSG_ERROR([Could not find the right ps switches. Which OS is this ?. See the Installation chapter in the Reference Manual.])
 
717
      ;;
 
718
  esac
 
719
fi
 
720
AC_SUBST(FIND_PROC)
 
721
AC_MSG_RESULT("$FIND_PROC")
 
722
 
 
723
# Check if a pid is valid
 
724
AC_PATH_PROG(KILL, kill, kill)
 
725
AC_MSG_CHECKING("for kill switches")
 
726
if $ac_cv_path_KILL -0 $$
 
727
then
 
728
  CHECK_PID="$ac_cv_path_KILL -0 \$\$PID > /dev/null 2> /dev/null"
 
729
elif kill -s 0 $$
 
730
then
 
731
  CHECK_PID="$ac_cv_path_KILL -s 0 \$\$PID > /dev/null 2> /dev/null"
 
732
else
 
733
  AC_MSG_WARN([kill -0 to check for pid seems to fail])
 
734
    CHECK_PID="$ac_cv_path_KILL -s SIGCONT \$\$PID > /dev/null 2> /dev/null"
 
735
fi
 
736
AC_SUBST(CHECK_PID)
 
737
AC_MSG_RESULT("$CHECK_PID")
 
738
 
 
739
# We need an ANSI C compiler
 
740
AM_PROG_CC_STDC
 
741
 
 
742
# We need an assembler, too
 
743
AM_PROG_AS
 
744
CCASFLAGS="$CCASFLAGS $ASFLAGS"
 
745
 
 
746
# Check if we need noexec stack for assembler
 
747
AC_CHECK_NOEXECSTACK
 
748
 
 
749
if test "$am_cv_prog_cc_stdc" = "no"
 
750
then
 
751
  AC_MSG_ERROR([Drizzle requires an ANSI C compiler (and a C++ compiler). Try gcc. See the Installation chapter in the Reference Manual.])
 
752
fi
455
753
 
456
754
 
457
755
AC_ARG_WITH([server-suffix],
474
772
 
475
773
AC_ARG_WITH([tcp-port],
476
774
    [AS_HELP_STRING([--with-tcp-port=port-number],
477
 
            [Which port to use for Drizzle TCP services @<:@default=4427@:>@])],
 
775
            [Which port to use for Drizzle services @<:@default=4427@:>@])],
478
776
    [ DRIZZLE_TCP_PORT=$withval ],
479
777
    [ DRIZZLE_TCP_PORT=$DRIZZLE_TCP_PORT_DEFAULT
480
778
      # if we actually defaulted (as opposed to the pathological case of
505
803
      # so don't mess with that.
506
804
      DRIZZLE_TCP_PORT_DEFAULT=0 ]
507
805
    )
508
 
 
509
806
AC_SUBST(DRIZZLE_TCP_PORT)
 
807
# We might want to document the assigned port in the manual.
510
808
AC_SUBST(DRIZZLE_TCP_PORT_DEFAULT)
511
 
AC_DEFINE_UNQUOTED([DRIZZLE_TCP_PORT],[$DRIZZLE_TCP_PORT],
 
809
AC_DEFINE_UNQUOTED([DRIZZLE_PORT],[$DRIZZLE_TCP_PORT],
512
810
                   [Drizzle port to use])
513
 
AC_DEFINE_UNQUOTED([DRIZZLE_TCP_PORT_DEFAULT],[$DRIZZLE_TCP_PORT_DEFAULT],
514
 
                   [If we defaulted to DRIZZLE_PORT, then this will be zero])
515
 
 
 
811
AC_DEFINE_UNQUOTED([DRIZZLE_PORT_DEFAULT],[$DRIZZLE_TCP_PORT_DEFAULT],
 
812
                   [If we defaulted to DRIZZLE_PORT, then this will be zero])
516
813
 
517
814
# Use this to set the place used for unix socket used to local communication.
518
815
AC_ARG_WITH([drizzled-user],
540
837
  AC_MSG_RESULT([no])
541
838
fi
542
839
 
 
840
# Types that must be checked AFTER large file support is checked
 
841
AC_TYPE_SIZE_T
 
842
 
543
843
#--------------------------------------------------------------------
544
844
# Check for system header files
545
845
#--------------------------------------------------------------------
583
883
# For the sched_yield() function on Solaris
584
884
AC_CHECK_FUNC(sched_yield, [],
585
885
  [AC_CHECK_LIB(posix4, [sched_yield],
586
 
    [AC_DEFINE(HAVE_SCHED_YIELD, 1, [Have sched_yield function]) LIBS="$LIBS -lposix4"])])
 
886
    [AC_DEFINE(HAVE_SCHED_YIELD) LIBS="$LIBS -lposix4"])])
587
887
 
588
888
if test "$ac_cv_header_termio_h" = "no" -a "$ac_cv_header_termios_h" = "no"
589
889
then
607
907
LIBS="$my_save_LIBS"
608
908
AC_SUBST(LIBDL_LIBS)
609
909
 
610
 
 
611
 
AC_ARG_WITH([atomic-ops],
612
 
    [AS_HELP_STRING([--with-atomic-ops=rwlocks|smp|up],
613
 
       [Implement atomic operations using pthread rwlocks or atomic CPU
614
 
        instructions for multi-processor or uniprocessor
615
 
        configuration. By default gcc built-in sync functions are used,
616
 
        if available and 'smp' configuration otherwise.])],
617
 
    [with_atomic_ops="$withval"],
618
 
    [with_atomic_ops=smp])
619
 
 
620
 
case "$with_atomic_ops" in
621
 
  "up") AC_DEFINE([MY_ATOMIC_MODE_DUMMY], [1],
622
 
                  [Assume single-CPU mode, no concurrency]) ;;
623
 
  "rwlocks") AC_DEFINE([MY_ATOMIC_MODE_RWLOCKS], [1],
624
 
                  [Use pthread rwlocks for atomic ops]) ;;
625
 
  "smp") 
626
 
    AC_CACHE_CHECK(
627
 
      [whether the compiler provides atomic builtins],
628
 
      [ac_cv_gcc_atomic_builtins],
629
 
      [AC_RUN_IFELSE(
630
 
        [AC_LANG_PROGRAM([],[[
631
 
          int foo= -10; int bar= 10;
632
 
          if (!__sync_fetch_and_add(&foo, bar) || foo)
633
 
            return -1;
634
 
          bar= __sync_lock_test_and_set(&foo, bar);
635
 
          if (bar || foo != 10)
636
 
            return -1;
637
 
          bar= __sync_val_compare_and_swap(&bar, foo, 15);
638
 
          if (bar)
639
 
            return -1;
640
 
          return 0;
641
 
        ]])],
642
 
       [ac_cv_gcc_atomic_builtins=yes],
643
 
       [ac_cv_gcc_atomic_builtins=no])])
644
 
 
645
 
    if test "x$ac_cv_gcc_atomic_builtins" = "xyes"; then
646
 
      AC_DEFINE(HAVE_GCC_ATOMIC_BUILTINS, 1,
647
 
                [Define to 1 if compiler provides atomic builtins.])
648
 
    fi
649
 
   ;;
650
 
   *) AC_MSG_ERROR(["$with_atomic_ops" is not a valid value for --with-atomic-ops]) ;;
651
 
esac
652
 
 
 
910
AC_CHECK_FUNCS(strtok_r)
 
911
 
 
912
 
 
913
 
 
914
AC_ARG_WITH([fast-mutexes],
 
915
    [AS_HELP_STRING([--with-fast-mutexes],
 
916
            [Compile with fast mutexes  @<:@default=off@:>@])],
 
917
    [with_fast_mutexes=$withval],
 
918
    [with_fast_mutexes=no])
 
919
 
 
920
if test "$with_fast_mutexes" != "no"
 
921
then
 
922
        AC_DEFINE([MY_PTHREAD_FASTMUTEX], [1], 
 
923
                        [Define to 1 if you want to use fast mutexes])
 
924
fi
 
925
 
 
926
AM_CONDITIONAL(BUILD_FAST_MUTEX,[test "$with_fast_mutexes" != "no"])
653
927
 
654
928
AC_ARG_WITH([comment],
655
929
    [AS_HELP_STRING([--with-comment],
660
934
then
661
935
  COMPILATION_COMMENT=$with_comment
662
936
else
663
 
  COMPILATION_COMMENT="Source distribution (RELEASE_COMMENT)"
 
937
  COMPILATION_COMMENT="Source distribution"
664
938
fi
665
939
AC_DEFINE_UNQUOTED([COMPILATION_COMMENT],["$COMPILATION_COMMENT"],
666
940
                   [Comment about compilation environment])
667
941
 
668
942
dnl Checks for typedefs, structures, and compiler characteristics.
669
 
 
 
943
AC_C_CONST
 
944
AC_C_INLINE
 
945
AC_C_VOLATILE
 
946
AC_TYPE_OFF_T
 
947
AC_HEADER_TIME
670
948
AC_STRUCT_TM
671
949
# off_t is not a builtin type
672
950
AC_CHECK_SIZEOF(off_t, 4)
674
952
then
675
953
  AC_MSG_ERROR("Drizzle needs a off_t type.")
676
954
fi
677
 
AC_CHECK_SIZEOF(size_t)
678
 
AC_DEFINE_UNQUOTED([SIZEOF_SIZE_T],[$ac_cv_sizeof_size_t],[Size of size_t as computed by sizeof()])
679
 
AC_CHECK_SIZEOF(long long)
680
 
AC_DEFINE_UNQUOTED(SIZEOF_LONG_LONG,[$ac_cv_sizeof_long_long],[Size of long long as computed by sizeof()])
681
955
 
682
956
dnl
683
957
dnl check if time_t is unsigned
686
960
DRIZZLE_CHECK_TIME_T
687
961
 
688
962
 
 
963
# This always gives a warning. Ignore it unless you are cross compiling
 
964
AC_C_BIGENDIAN
 
965
#---START: Used in for client configure
 
966
# Check base type of last arg to accept
 
967
DRIZZLE_TYPE_ACCEPT
 
968
#---END:
 
969
# Figure out what type of struct rlimit to use with setrlimit
 
970
DRIZZLE_TYPE_STRUCT_RLIMIT
 
971
# Find where the stack goes
 
972
DRIZZLE_STACK_DIRECTION
689
973
# We want to skip alloca on irix unconditionally. It may work on some version..
690
974
DRIZZLE_FUNC_ALLOCA
691
 
DRIZZLE_STACK_DIRECTION
692
 
 
 
975
# Do struct timespec have members tv_sec or ts_sec
 
976
DRIZZLE_TIMESPEC_TS
 
977
# Do we have the tzname variable
 
978
DRIZZLE_TZNAME
693
979
AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>])
694
980
AC_CHECK_TYPES([uint, ulong])
695
981
 
702
988
dnl Checks for library functions.
703
989
AC_FUNC_ALLOCA
704
990
AC_PROG_GCC_TRADITIONAL
705
 
 
 
991
AC_TYPE_SIGNAL
706
992
 
707
993
AC_CHECK_FUNCS(issetugid)
708
994
 
 
995
# from old readline settting:
 
996
 
 
997
MAKE_SHELL=/bin/sh
 
998
AC_SUBST(MAKE_SHELL)
 
999
 
709
1000
# Already-done: stdlib.h string.h unistd.h termios.h
710
1001
AC_CHECK_HEADERS(stdarg.h dirent.h locale.h ndir.h sys/dir.h \
711
1002
 sys/ndir.h sys/select.h \
716
1007
AC_CHECK_FUNCS(lstat select)
717
1008
 
718
1009
AC_HEADER_STAT
 
1010
DRIZZLE_SIGNAL_CHECK
 
1011
DRIZZLE_CHECK_GETPW_FUNCS
719
1012
DRIZZLE_HAVE_TIOCGWINSZ
720
1013
DRIZZLE_HAVE_TIOCSTAT
 
1014
DRIZZLE_TYPE_SIGHANDLER
 
1015
if test "$with_named_curses" = "no"
 
1016
then
 
1017
  DRIZZLE_CHECK_LIB_TERMCAP
 
1018
else
 
1019
  TERMCAP_LIBS="$with_named_curses"
 
1020
fi
 
1021
AC_SUBST(TERMCAP_LIBS)
721
1022
 
 
1023
# End of readline/libedit stuff
722
1024
#########################################################################
723
1025
 
724
1026
dnl Checks for library functions.
725
1027
 
 
1028
#
 
1029
# The following code disables intrinsic function support while we test for
 
1030
# library functions.  This is to avoid configure problems with Intel ecc
 
1031
# compiler
 
1032
 
 
1033
ORG_CFLAGS="$CFLAGS"
 
1034
if test "$GCC" != "yes"; then
 
1035
  AC_SYS_COMPILER_FLAG(-nolib_inline,nolib_inline,CFLAGS,[],[])
 
1036
fi
 
1037
 
 
1038
#AC_FUNC_MMAP
 
1039
AC_TYPE_SIGNAL
 
1040
DRIZZLE_TYPE_QSORT
726
1041
AC_FUNC_UTIME_NULL
727
1042
AC_FUNC_VPRINTF
728
1043
 
732
1047
  AC_MSG_ERROR("Drizzle requires fcntl.")
733
1048
fi
734
1049
 
735
 
AC_CONFIG_LIBOBJ_DIR([gnulib])
 
1050
AC_CONFIG_LIBOBJ_DIR([mystrings])
736
1051
 
737
1052
AC_CHECK_FUNCS( \
738
1053
  cuserid fchmod \
768
1083
AM_CONDITIONAL(BUILD_THR_RWLOCK,[test "$ac_cv_func_rwlock_init" -a "$ac_cv_funn_pthread_rwlock_rdlock"])
769
1084
 
770
1085
 
 
1086
CFLAGS="$ORG_CFLAGS"
 
1087
 
771
1088
# Sanity check: We chould not have any fseeko symbol unless
772
1089
# large_file_support=yes
773
1090
AC_CHECK_FUNC(fseeko,
786
1103
#ifndef _POSIX_PTHREAD_SEMANTICS 
787
1104
#define _POSIX_PTHREAD_SEMANTICS 
788
1105
#endif
789
 
#include <pthread.h>
790
 
   ]], [[
791
 
void *pthread_getspecific(pthread_key_t key);
792
 
pthread_getspecific((pthread_key_t) NULL);
793
 
   ]])],
 
1106
#include <pthread.h> ]], [[ void *pthread_getspecific(pthread_key_t key);
 
1107
pthread_getspecific((pthread_key_t) NULL); ]])],
794
1108
    [mysql_cv_getspecific_args=POSIX],
795
1109
    [mysql_cv_getspecific_args=other])])
796
1110
  if test "$mysql_cv_getspecific_args" = "other"
934
1248
#--------------------------------------------------------------------
935
1249
 
936
1250
DRIZZLE_CHECK_MAX_INDEXES
 
1251
DRIZZLE_CHECK_VIO
937
1252
 
938
1253
#--------------------------------------------------------------------
939
1254
# Declare our plugin modules
941
1256
# functions tested above
942
1257
#--------------------------------------------------------------------
943
1258
 
944
 
m4_include(config/plugin.ac)
945
 
dnl Add code here to read set plugin lists and  set drizzled_default_plugin_list
946
 
AC_DEFINE_UNQUOTED([DRIZZLED_PLUGIN_LIST],[$drizzled_default_plugin_list],
947
 
                   [List of plugins that should be loaded on startup if no
948
 
                    value is given for --plugin-load])
949
 
 
950
 
drizzled_builtin_list=`echo $drizzled_builtin_list | sed 's/, *$//'`
951
 
AC_DEFINE_UNQUOTED([DRIZZLED_BUILTIN_LIST],[$drizzled_builtin_list],
952
 
                   [List of plugins to be loaded in sql_builtin.cc])
953
 
AC_SUBST(drizzled_plugin_libs)
 
1259
DRIZZLE_CONFIGURE_PLUGINS([none])
954
1260
 
955
1261
AC_SUBST(mysql_plugin_dirs)
956
1262
AC_SUBST(mysql_plugin_libs)
957
 
drizzled_plugin_defs=`echo $drizzled_plugin_defs | sed 's/, *$//'`
958
 
AC_SUBST(drizzled_plugin_defs)
959
 
AC_SUBST(DRIZZLED_PLUGIN_DEP_LIBS)
 
1263
AC_SUBST(mysql_plugin_defs)
960
1264
 
961
1265
 
962
1266
AC_ARG_ENABLE([profiling],
1013
1317
    [ac_warn_effc="$enableval"],
1014
1318
    [ac_warn_effc="no"])
1015
1319
 
1016
 
AC_ARG_ENABLE([shadow],
1017
 
    [AS_HELP_STRING([--disable-shadow],
1018
 
       [Disables warnings about scope shadowing @<:@default=on@:>@])],
1019
 
    [ac_warn_shadow="$enableval"],
1020
 
    [ac_warn_shadow="yes"])
1021
 
 
1022
 
AC_ARG_ENABLE([conversion],
1023
 
    [AS_HELP_STRING([--enable-conversion],
1024
 
       [Enables conversion warnings @<:@default=off@:>@])],
1025
 
    [ac_warn_conversion="$enableval"],
1026
 
    [ac_warn_conversion="no"])
1027
 
 
1028
 
AC_ARG_ENABLE([datarace],
1029
 
    [AS_HELP_STRING([--enable-datarace],
1030
 
       [Enables Sun Studio data race detection @<:@default=off@:>@])],
1031
 
    [ac_datarace="$enableval"],
1032
 
    [ac_datarace="no"])
1033
 
 
1034
 
AC_ARG_ENABLE([exceptions],
1035
 
    [AS_HELP_STRING([--disable-exceptions],
1036
 
        [Disables use of Exceptions in the build @<:@default=on@:>@])],
1037
 
    [ac_exceptions="$enableval"],
1038
 
    [ac_exceptions="yes"])
1039
 
 
1040
 
AC_ARG_ENABLE([cast-align-warnings],
1041
 
    [AS_HELP_STRING([--enable-cast-align-warnings],
1042
 
       [Toggle cast alignment warnings @<:@default=off@:>@])],
1043
 
    [ac_warn_cast_align="$enableval"],
1044
 
    [ac_warn_cast_align="yes"])
 
1320
AC_ARG_ENABLE([go-crazy],
 
1321
    [AS_HELP_STRING([--enable-go-crazy],
 
1322
       [Enables extra little warnings that might be too much @<:@default=off@:>@])],
 
1323
    [ac_warn_go_crazy="$enableval"],
 
1324
    [ac_warn_go_crazy="no"])
 
1325
 
1045
1326
 
1046
1327
if test "$GCC" = "yes"
1047
1328
then
1048
 
  if test "$ac_warn_cast_align" = "yes"
1049
 
  then
1050
 
    W_CAST_ALIGN="-Wcast-align"
1051
 
  else
1052
 
    W_CAST_ALIGN="-Wno-cast-align"
1053
 
  fi
 
1329
 
1054
1330
 
1055
1331
  if test "$ac_warn_fail" = "yes"
1056
1332
  then
1057
1333
    W_FAIL="-Werror"
1058
1334
  fi
1059
 
  BASE_WARNINGS="-Wall -Wextra ${W_FAIL} ${W_CAST_ALIGN} -fdiagnostics-show-option"
 
1335
  BASE_WARNINGS="-W -Wall -Wextra ${W_FAIL}"
1060
1336
 
1061
1337
  if test "$ac_warn_longlong" = "yes"
1062
1338
  then
1067
1343
 
1068
1344
  if test "$ac_warn_strict_aliasing" = "yes"
1069
1345
  then
1070
 
    W_STRICT_ALIASING="-fstrict-aliasing -Wstrict-aliasing"
 
1346
    W_STRICT_ALIASING="-Wstrict-aliasing"
1071
1347
  else
1072
1348
    W_STRICT_ALIASING="-Wno-strict-aliasing"
1073
1349
  fi
1074
1350
 
1075
 
  if test "$ac_warn_shadow" = "yes"
1076
 
  then
1077
 
    W_SHADOW="-Wshadow"
1078
 
    NO_SHADOW="-Wno-shadow"
1079
 
  else
1080
 
    W_SHADOW="-Wno-shadow"
1081
 
    NO_SHADOW=""
1082
 
  fi
1083
 
 
1084
1351
  if test "$ac_profiling" = "yes"
1085
1352
  then
1086
1353
    GPROF_PROFILING="-pg"
1087
 
    save_LIBS="${LIBS}"
1088
 
    LIBS=""
1089
 
    AC_CHECK_LIB(c_p, read)
1090
 
    LIBC_P="${LIBS}"
1091
 
    LIBS="${save_LIBS}"
1092
1354
  else
1093
1355
    GPROF_PROFILING=" "
1094
1356
  fi
1102
1364
 
1103
1365
  if test "$ac_warn_pedantic" = "yes"
1104
1366
  then
 
1367
    save_CXXFLAGS="${CXXFLAGS}"
 
1368
    CXXFLAGS="${CXXFLAGS} ${W_FAIL} -Wredundant-decls"
1105
1369
    AC_CACHE_CHECK([whether it is safe to use -Wredundant-decls],
1106
1370
      [ac_cv_safe_to_use_Wredundant_decls_],
1107
1371
      [AC_LANG_PUSH(C++)
1108
 
       save_CXXFLAGS="${CXXFLAGS}"
1109
 
       CXXFLAGS="${CXXFLAGS} ${W_FAIL} -Wredundant-decls"
1110
1372
       AC_COMPILE_IFELSE(
1111
1373
         [AC_LANG_PROGRAM([
1112
1374
template <typename E> struct C { void foo(); };
1115
1377
            AC_INCLUDES_DEFAULT])],
1116
1378
          [ac_cv_safe_to_use_Wredundant_decls_=yes],
1117
1379
          [ac_cv_safe_to_use_Wredundant_decls_=no])
1118
 
        CXXFLAGS="${save_CXXFLAGS}"
1119
1380
        AC_LANG_POP()])
1120
1381
    if test $ac_cv_safe_to_use_Wredundant_decls_ = yes
1121
1382
    then
1125
1386
    fi
1126
1387
    
1127
1388
    GCC_PEDANTIC="-pedantic -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls ${W_STRICT_ALIASING}"
1128
 
    GXX_PEDANTIC="-pedantic -Wundef -Woverloaded-virtual  -Wnon-virtual-dtor -Wctor-dtor-privacy ${GXX_W_REDUNDANT_DECLS} ${W_LONGLONG} ${W_STRICT_ALIASING}"
 
1389
    GXX_PEDANTIC="-pedantic -Wundef ${GXX_W_REDUNDANT_DECLS} ${W_LONGLONG} ${W_STRICT_ALIASING}"
 
1390
 
 
1391
    AC_CACHE_CHECK([whether __attribute__ visibility "hidden" is supported],
 
1392
      [ac_cv_can_use_hidden_],
 
1393
      [AC_LANG_PUSH(C++)
 
1394
       AC_COMPILE_IFELSE(
 
1395
         [AC_LANG_PROGRAM([
 
1396
          AC_INCLUDES_DEFAULT
 
1397
__attribute__((visibility ("hidden")))
 
1398
void testme() {  };],[
 
1399
     testme();])],  
 
1400
         [ac_cv_can_use_hidden_=yes],
 
1401
         [ac_cv_can_use_hidden_=no])
 
1402
       AC_LANG_POP()])
 
1403
    if test "$ac_cv_can_use_hidden_" = "yes"
 
1404
    then
 
1405
      AC_DEFINE(HAVE_ATTR_HIDDEN, 1,
 
1406
                [Define to 1 if you have support for __attribute__((visibility("hidden")))])
 
1407
    fi
 
1408
 
 
1409
    CXXFLAGS="${save_CXXFLAGS}"
1129
1410
  fi
1130
1411
 
1131
1412
  if test "$ac_warn_unreachable" = "yes"
1132
1413
  then
1133
1414
    W_UNREACHABLE="-Wunreachable-code"
1134
1415
  fi
1135
 
 
1136
1416
  if test "$ac_warn_cast" = "yes"
1137
1417
  then
1138
1418
    W_CAST="-Wold-style-cast"
1143
1423
    W_EFFC="-Weffc++"
1144
1424
  fi
1145
1425
 
1146
 
  if test "$ac_warn_conversion" = "yes"
1147
 
  then
1148
 
    W_CONVERSION="-Wconversion"
1149
 
  fi
1150
 
 
1151
 
  CC_WARNINGS="${BASE_WARNINGS} ${GCC_PEDANTIC} ${W_UNREACHABLE} ${GPROF_PROFILING} ${GPROF_COVERAGE} ${W_SHADOW} ${W_CONVERSION}"
1152
 
  CXX_WARNINGS="${BASE_WARNINGS} ${GXX_PEDANTIC} ${W_UNREACHABLE} ${GPROF_PROFILING} ${GPROF_COVERAGE} ${W_CAST} ${W_SHADOW} ${W_EFFC} ${W_CONVERSION}"
1153
 
 
1154
 
  if test "$ac_exceptions" = "no"
1155
 
  then
1156
 
    NO_EXCEPTIONS="-fno-exceptions"
1157
 
    W_EXCEPTIONS="-fexceptions"
1158
 
  fi
 
1426
  if test "$ac_warn_gocrazy" = "yes"
 
1427
  then
 
1428
    W_CRAZY="-Wshadow -Wconversion -Winvalid-pch"
 
1429
  fi
 
1430
 
 
1431
  CC_WARNINGS="${C99_SUPPORT_HACK} ${BASE_WARNINGS} ${GCC_PEDANTIC} ${W_UNREACHABLE} ${GPROF_PROFILING} ${GPROF_COVERAGE} ${W_CRAZY}"
 
1432
  CXX_WARNINGS="${BASE_WARNINGS} ${GXX_PEDANTIC} ${W_UNREACHABLE} ${GPROF_PROFILING} ${GPROF_COVERAGE} ${W_CAST} ${W_EFFC} ${W_CRAZY}"
 
1433
 
 
1434
  NO_EXCEPTIONS="-fno-exceptions"
 
1435
  W_EXCEPTIONS="-fexceptions"
 
1436
  NO_UNUSED_MACROS="-Wno-unused-macros"
1159
1437
  NO_REDUNDANT_DECLS="-Wno-redundant-decls"
1160
 
  PROTOSKIP_WARNINGS="-Wno-effc++ -Wno-shadow"
 
1438
  # Disable exceptions as they seams to create problems with gcc and threads.
 
1439
  # drizzled doesn't use run-time-type-checking, so we disable it.
 
1440
  AM_CXXFLAGS="${AM_CXXFLAGS} -fno-rtti"
 
1441
  CPPFLAGS="${CPPFLAGS} -fpch-deps"
1161
1442
fi
1162
1443
if test "$SUNCC" = "yes"
1163
1444
then
1164
 
  if test "$ac_datarace" = "yes"
1165
 
  then
1166
 
    AM_CFLAGS="-xinstrument=datarace ${AM_CFLAGS}"
1167
 
    AM_CXXFLAGS="-xinstrument=datarace ${AM_CXXFLAGS}"
1168
 
  fi
1169
 
 
1170
 
  if test "$ac_warn_fail" = "yes"
1171
 
  then
1172
 
    W_FAIL="-errwarn=%all"
1173
 
  fi
1174
 
 
1175
 
  CC_WARNINGS="-v -errtags=yes -erroff=E_ATTRIBUTE_NOT_VAR ${W_FAIL}"
1176
 
  CXX_WARNINGS="+w +w2 -xport64 -errtags=yes -erroff=attrskipunsup,doubunder,reftotemp,inllargeuse,truncwarn1,signextwarn,inllargeint ${W_FAIL}" 
1177
 
  PROTOSKIP_WARNINGS="-erroff=attrskipunsup,doubunder,reftotemp,wbadinitl,identexpected,inllargeuse,truncwarn1,signextwarn"
1178
 
  NO_UNREACHED="-erroff=E_STATEMENT_NOT_REACHED"
1179
 
  if test "$ac_exceptions" = "no"
1180
 
  then
1181
 
    NO_EXCEPTIONS="-features=no%except"
1182
 
    W_EXCEPTIONS="-features=except"
1183
 
  fi
 
1445
  CC_WARNINGS="-v -xc99=all -errtags=yes"
 
1446
  CXX_WARNINGS="+w +w2 -xport64 -errtags=yes -erroff=attrskipunsup -compat=5"
 
1447
  NO_EXCEPTIONS="-features=no%except"
 
1448
  W_EXCEPTIONS="-features=except"
1184
1449
fi
 
1450
AM_CXXFLAGS="${CXX_WARNINGS} ${NO_EXCEPTIONS}  ${AM_CXXFLAGS}"
 
1451
AM_CFLAGS="${CC_WARNINGS} ${AM_CFLAGS}"
 
1452
 
1185
1453
AC_SUBST(NO_EXCEPTIONS)
1186
1454
AC_SUBST(W_EXCEPTIONS)
1187
 
AC_SUBST(NO_SHADOW)
1188
 
AC_SUBST(W_SHADOW)
 
1455
AC_SUBST(NO_UNUSED_MACROS)
1189
1456
AC_SUBST(NO_REDUNDANT_DECLS)
1190
 
AC_SUBST(PROTOSKIP_WARNINGS)
1191
 
AC_SUBST(NO_UNREACHED)
1192
 
 
1193
 
if test "x${gl_LIBOBJS}" != "x"
1194
 
then
1195
 
  if test "$GCC" = "yes"
1196
 
  then
1197
 
    AM_CPPFLAGS="-isystem \$(top_srcdir)/gnulib -isystem \$(top_builddir)/gnulib ${AM_CPPFLAGS}"
1198
 
  else
1199
 
    AM_CPPFLAGS="-I\$(top_srcdir)/gnulib -I\$(top_builddir)/gnulib ${AM_CPPFLAGS}"
1200
 
  fi
1201
 
fi
1202
 
 
1203
 
AM_CPPFLAGS="-I\$(top_srcdir) -I\$(top_builddir) ${AM_CPPFLAGS}"
1204
 
AM_CFLAGS="${CC_WARNINGS} ${AM_CFLAGS}"
1205
 
AM_CXXFLAGS="${CXX_WARNINGS} ${W_EXCEPTIONS} ${AM_CXXFLAGS}"
1206
 
 
1207
 
dnl Must be done once we turn on warnings and such
1208
 
AC_CACHE_CHECK(
1209
 
  [whether __attribute__ visibility "hidden" is supported],
1210
 
  [ac_cv_can_use_hidden_],[
1211
 
    AC_LANG_PUSH(C++)
1212
 
    AC_LINK_IFELSE([
1213
 
      AC_LANG_PROGRAM(
1214
 
        [[
1215
 
__attribute__((visibility ("hidden")))
1216
 
void testme() {  }
1217
 
        ]],[[testme()]]
1218
 
      )],  
1219
 
      [ac_cv_can_use_hidden_=yes],
1220
 
      [ac_cv_can_use_hidden_=no])
1221
 
    AC_LANG_POP()])
1222
 
if test "$ac_cv_can_use_hidden_" = "yes"
1223
 
then
1224
 
  AC_DEFINE(HAVE_ATTR_HIDDEN, 1,
1225
 
  [Define to 1 if you have support for __attribute__((visibility("hidden")))])
1226
 
fi
1227
 
 
1228
 
AC_SUBST([AM_CPPFLAGS])
 
1457
 
 
1458
AC_SUBST([GLOBAL_CPPFLAGS],['-I$(top_srcdir) -I$(top_builddir)'])
 
1459
AC_SUBST([AM_CPPFLAGS],['${GLOBAL_CPPFLAGS}'])
1229
1460
AC_SUBST([AM_CFLAGS])
1230
1461
AC_SUBST([AM_CXXFLAGS])
1231
1462
 
 
1463
# Some usefull subst
 
1464
AC_SUBST(CC)
 
1465
AC_SUBST(GXX)
1232
1466
 
1233
 
AC_SUBST(pkgplugindir,"\$(pkglibdir)/plugin")
 
1467
# Set configuration options for make_binary_distribution
 
1468
case $SYSTEM_TYPE in
 
1469
  *netware*)
 
1470
    MAKE_BINARY_DISTRIBUTION_OPTIONS="$MAKE_BINARY_DISTRIBUTION_OPTIONS --no-strip"
 
1471
    ;;
 
1472
  *)
 
1473
    : # no change for other platforms yet
 
1474
    ;;
 
1475
esac
 
1476
AC_SUBST(MAKE_BINARY_DISTRIBUTION_OPTIONS)
1234
1477
 
1235
1478
dnl GCC Precompiled Header Support
1236
1479
dnl re-enable later
1237
1480
dnl AM_CONDITIONAL([BUILD_GCC_PCH],[test "$GCC" = "yes"])
1238
1481
AM_CONDITIONAL([BUILD_GCC_PCH],[test "no" = "yes"])
1239
1482
 
1240
 
AC_CONFIG_FILES(Makefile dnl
1241
 
 gnulib/Makefile dnl
 
1483
AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl
 
1484
 mystrings/Makefile storage/Makefile dnl
1242
1485
 po/Makefile.in dnl
1243
 
 drizzled/message/Makefile dnl
 
1486
 libdrizzle/Makefile client/Makefile dnl
1244
1487
 drizzled/Makefile dnl
 
1488
 drizzled/field/Makefile dnl
 
1489
 drizzled/item/Makefile dnl
 
1490
 drizzled/serialize/Makefile dnl
 
1491
 drizzled/functions/Makefile dnl
 
1492
 drizzled/functions/str/Makefile dnl
 
1493
 drizzled/functions/time/Makefile dnl
 
1494
 drizzled/util/Makefile dnl
 
1495
 drizzled/sql_builtin.cc dnl
1245
1496
 support-files/Makefile dnl
1246
1497
 tests/Makefile tests/install_test_db dnl
1247
 
 support-files/drizzle.server support-files/drizzle-log-rotate
1248
 
 support-files/smf/Makefile dnl
1249
 
 support-files/smf/install.sh dnl
1250
 
 support-files/smf/drizzle.xml dnl
1251
 
 support-files/smf/drizzle)
1252
 
 
1253
 
scheduling_plugins_available="
1254
 
  pool_of_threads 
1255
 
  single_thread
1256
 
"
1257
 
 
1258
 
for sched_plugin in $scheduling_plugins_available
1259
 
do
1260
 
  varname="\${with_plugin_${sched_plugin}}"
1261
 
  result=`eval "echo $varname"`
1262
 
  if test "x$result" = "xyes"
1263
 
  then
1264
 
    scheduling_plugins="$sched_plugin $scheduling_plugins"
1265
 
  fi
1266
 
done
 
1498
 plugin/Makefile dnl
 
1499
 drizzled/drizzled_safe support-files/libdrizzle.pc dnl
 
1500
 support-files/drizzle.server support-files/drizzle-log-rotate)
 
1501
 
 
1502
AC_CONFIG_COMMANDS([default], , test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h)
 
1503
 
 
1504
# Ensure that table handlers gets all modifications to CFLAGS/CXXFLAGS
 
1505
AC_CONFIG_COMMANDS_POST(ac_configure_args="$ac_configure_args CFLAGS='$CFLAGS' CXXFLAGS='$CXXFLAGS' AM_CFLAGS='$AM_CFLAGS' AM_CXXFLAGS='$AM_CXXFLAGS'")
1267
1506
 
1268
1507
AC_OUTPUT
1269
1508
 
1270
1509
echo "---"
1271
 
echo "Configuration summary for $PACKAGE_NAME version $VERSION RELEASE_COMMENT"
 
1510
echo "Configuration summary for $PACKAGE_NAME version $VERSION"
1272
1511
echo ""
1273
1512
echo "   * Installation prefix:       $prefix"
1274
 
echo "   * System type:               $host_vendor-$host_os"
 
1513
echo "   * System type:               $SYSTEM_TYPE"
1275
1514
echo "   * Host CPU:                  $host_cpu"
1276
1515
echo "   * C Compiler:                $CC_VERSION"
1277
1516
echo "   * C++ Compiler:              $CXX_VERSION"
1281
1520
echo "   * Profiling enabled:         $ac_profiling"
1282
1521
echo "   * Coverage enabled:          $ac_coverage"
1283
1522
echo "   * Warnings as failure:       $ac_warn_fail"
1284
 
echo "   * Scheduling Plugins:        $scheduling_plugins"
1285
1523
echo "   * C++ cstdint location:      $ac_cv_cxx_cstdint"
1286
1524
echo "   * C++ hash_map location:     $ac_cv_cxx_hash_map"
1287
1525
echo "   * C++ hash namespace:        $ac_cv_cxx_hash_namespace"
1288
 
echo "   * C++ shared_ptr namespace:  $ac_cv_shared_ptr_namespace"
 
1526
echo "   * C++ cmath location:        $ac_cv_cxx_cmath"
 
1527
echo "   * C++ cmath namespace:       $ac_cv_cxx_cmath_namespace"
1289
1528
echo ""
1290
1529
echo "---"
1291
 
 
1292
 
dnl libtoolize scans configure.ac  and needs to see some text
1293
 
m4_define([LIBTOOLIZE_AC_INIT], [])