~drizzle-trunk/drizzle/development

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