~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
992.1.25 by Monty Taylor
Moved myisam to new plugin system.
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
77.1.65 by Monty Taylor
We don't really require 2.61, 2.59 is actually fine.
20
AC_PREREQ(2.59)dnl		Minimum Autoconf version required.
1081.1.1 by Monty Taylor
Whole boat-load of build fixes.
21
AC_INIT([drizzle],[RELEASE_VERSION],[http://bugs.launchpad.net/drizzle])
214 by Brian Aker
Rename of fields (fix issue with string and decimal .h clashing).
22
AC_CONFIG_SRCDIR([drizzled/drizzled.cc])
39 by Brian Aker
Move build helper files into config
23
AC_CONFIG_AUX_DIR(config)
236.1.9 by Monty Taylor
Cleaned up configure.ac line.
24
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.
25
AC_CONFIG_MACRO_DIR([m4])
435.1.1 by Monty Taylor
Fixed -O3 optimization for gcc.
26
1085.1.9 by Monty Taylor
Fix canonical_target args.
27
PANDORA_CANONICAL_TARGET(less-warnings, warnings-always-on, use-gnulib, require-cxx, force-gcc42)
873.2.41 by Monty Taylor
Fixed the ol build for ol Solaris.
28
1081.1.1 by Monty Taylor
Whole boat-load of build fixes.
29
# Version with no dots
30
AC_DEFINE([DRIZZLE_VERSION_ID],[RELEASE_ID],
31
	  [Version ID that can be easily used for numeric comparison])
1 by brian
clean slate
32
859.1.4 by Monty Taylor
Hack to allow use of hash_map in gcc 4.3.
33
AC_DEFINE([_BACKWARD_BACKWARD_WARNING_H],[1],[Hack to disable deprecation warning in gcc])
34
971.3.48 by Eric Day
New Listen interface about done, not quite compiling yet, but need a backup.
35
# The port that was assigned by IANA.
301 by Brian Aker
Clean up port startup
36
DRIZZLE_TCP_PORT_DEFAULT=4427
1 by brian
clean slate
37
722.2.9 by Monty Taylor
I _think_ I've got the plug.in triggering rebuild thing going on right.
38
m4_include(m4/character_sets.m4)
722.1.3 by Monty Taylor
Cleaned up a few build things.
39
AC_SUBST(AVAILABLE_LANGUAGES)
40
840.1.2 by Monty Taylor
Fix for msgmerge possibly being gmsgmerge.
41
722.1.3 by Monty Taylor
Cleaned up a few build things.
42
# Set this for plugins to use
43
ac_build_drizzle="yes"
441 by Monty Taylor
Move unconditional defines to config.h.
44
45
1 by brian
clean slate
46
# Canonicalize the configuration name.
47
1081.1.1 by Monty Taylor
Whole boat-load of build fixes.
48
AC_DEFINE_UNQUOTED([HOST_VENDOR], ["$host_vendor"],[Vendor of Build System])
49
AC_DEFINE_UNQUOTED([HOST_OS], ["$host_os"], [OS of Build System])
50
AC_DEFINE_UNQUOTED([HOST_CPU], ["$host_cpu"], [CPU of Build System])
1 by brian
clean slate
51
1081.1.1 by Monty Taylor
Whole boat-load of build fixes.
52
AC_DEFINE_UNQUOTED([TARGET_VENDOR], ["$target_vendor"],[Vendor of Target System])
53
AC_DEFINE_UNQUOTED([TARGET_OS], ["$target_os"], [OS of Target System])
54
AC_DEFINE_UNQUOTED([TARGET_CPU], ["$target_cpu"], [CPU of Target System])
1 by brian
clean slate
55
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.
56
520.4.41 by mordred
Fixed configure.ac to work cleanly on Solaris - and define some good compile flags.
57
case "$target_os" in
58
  *linux*)
59
  TARGET_LINUX="true"
60
  AC_SUBST(TARGET_LINUX)
61
  AC_DEFINE([TARGET_OS_LINUX], [1], [Whether we build for Linux])
62
    ;;
1054.2.24 by Monty Taylor
Fixed the check for building on OSX.
63
  *darwin*)
520.4.41 by mordred
Fixed configure.ac to work cleanly on Solaris - and define some good compile flags.
64
    TARGET_OSX="true"
65
    AC_SUBST(TARGET_OSX)
271 by Brian Aker
OSX fix
66
    AC_DEFINE([TARGET_OS_OSX], [1], [Whether we build for OSX])
1 by brian
clean slate
67
    ;;
520.4.41 by mordred
Fixed configure.ac to work cleanly on Solaris - and define some good compile flags.
68
  *solaris*)
69
    TARGET_SOLARIS="true"
70
    AC_SUBST(TARGET_SOLARIS)
71
    AC_DEFINE([TARGET_OS_SOLARIS], [1], [Whether we are building for Solaris])
72
    ;;
1 by brian
clean slate
73
  *)
74
    ;;
75
esac
435.1.1 by Monty Taylor
Fixed -O3 optimization for gcc.
76
873.2.4 by Monty Taylor
Fixed some configure errors.
77
AC_PATH_PROG(GPERF, gperf)
78
AS_IF([test "x$GPERF" = "x"],
917.1.5 by Monty Taylor
Added more verbose failure messages.
79
      AC_MSG_ERROR("Drizzle requires gperf to build."))
779.4.5 by Monty Taylor
Replaced gen_lex_hash with gperf. Yay for no more building tools to build source!!!
80
840.1.3 by Monty Taylor
Fixed gperf checking to fail properly.
81
AC_PATH_PROG(LCOV, lcov)
82
AC_PATH_PROG(GENHTML, genhtml)
779.1.25 by Monty Taylor
Put in LCOV checks. Put output in subdir.
83
873.2.4 by Monty Taylor
Fixed some configure errors.
84
AM_CONDITIONAL(HAVE_LCOV,[test "x$LCOV" != "x"])
779.1.25 by Monty Taylor
Put in LCOV checks. Put output in subdir.
85
629.1.1 by Monty Taylor
More solaris fixes.
86
AC_CHECK_PROGS(YACC, ['bison -y'])
1081.1.1 by Monty Taylor
Whole boat-load of build fixes.
87
if test -z "$YACC" && test "$building_from_bzr" = "yes"
77.1.70 by Monty Taylor
Added a failure if you don't have bison and you're building from a .bzr branch.
88
then
89
  AC_MSG_ERROR(["bison is required for Drizzle to build from a bzr branch"])
90
fi
1 by brian
clean slate
91
971.4.1 by Monty Taylor
GCC on Solaris build fixes.
92
919.2.22 by Monty Taylor
Fixed the latest stuff on Solaris.
93
AM_GNU_GETTEXT(external, need-formatstring-macros)
94
if test "x$MSGMERGE" = "x" -o "x$MSGMERGE" = "x:"
95
then
96
  AM_PATH_PROG_WITH_TEST(GMSGMERGE, gmsgmerge,
97
    [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
98
  MSGMERGE="${GMSGMERGE}"
99
fi
100
AM_CONDITIONAL([BUILD_GETTEXT],[test "x$MSGMERGE" != "x" -a "x$MSGMERGE" != "x:"])
101
102
520.4.44 by mordred
A whole bunch of solaris/sun studio compile fixes.
103
AC_CXX_STL_HASH
104
AC_CXX_CSTDINT
105
AC_CXX_CINTTYPES
1 by brian
clean slate
106
779.2.1 by Monty Taylor
Added new pthread m4 file. Changing lib checks to use AC_LIB_HAVE_LINKFLAGS
107
AC_LIB_PREFIX
108
287.3.30 by Monty Taylor
Added step one of finding libprotobuf.
109
#--------------------------------------------------------------------
1022.2.40 by Monty Taylor
Moved pthread check so that the protobuf check works right for real.
110
# Check for libpthread
111
#--------------------------------------------------------------------
112
113
ACX_PTHREAD(,AC_MSG_ERROR(could not find libpthread))
114
LIBS="${PTHREAD_LIBS} ${LIBS}"
1081.1.1 by Monty Taylor
Whole boat-load of build fixes.
115
AM_CFLAGS="${PTHREAD_CFLAGS} ${AM_CFLAGS}"
1022.2.40 by Monty Taylor
Moved pthread check so that the protobuf check works right for real.
116
CC="$PTHREAD_CC"
117
118
#--------------------------------------------------------------------
287.3.30 by Monty Taylor
Added step one of finding libprotobuf.
119
# Check for Google Proto Buffers
120
#--------------------------------------------------------------------
121
629.2.4 by Monty Taylor
Cleaned up the lib searching - now base some searches off of the prefix.
122
AC_LANG_PUSH([C++])
1068 by Brian Aker
Fixes proto 2.1 issue
123
AC_LIB_HAVE_LINKFLAGS(protobuf,pthread,
779.2.1 by Monty Taylor
Added new pthread m4 file. Changing lib checks to use AC_LIB_HAVE_LINKFLAGS
124
[#include <google/protobuf/descriptor.h>
125
],
992.1.5 by Monty Taylor
Added ability to make a searched-for lib use -isystem so we can do that for protobuf.
126
[google::protobuf::FileDescriptor* file;],system)
779.2.1 by Monty Taylor
Added new pthread m4 file. Changing lib checks to use AC_LIB_HAVE_LINKFLAGS
127
AS_IF([test x$ac_cv_libprotobuf = xno],
917.1.5 by Monty Taylor
Added more verbose failure messages.
128
      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.]))
629.2.4 by Monty Taylor
Cleaned up the lib searching - now base some searches off of the prefix.
129
910.2.2 by Monty Taylor
Split out protobuf version check from the check for protobuf version so that we can give better error message.
130
AC_CACHE_CHECK([if protobuf is recent enough], [drizzle_cv_protobuf_recent],
131
  [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
132
#include <google/protobuf/descriptor.h>
133
#if GOOGLE_PROTOBUF_VERSION < 2000002
134
# error Your version of Protobuf is too old
135
#endif
136
    ]])],
137
    [drizzle_cv_protobuf_recent=yes],
138
    [drizzle_cv_protobuf_recent=no])])
139
if test "$drizzle_cv_protobuf_recent" = "no"
140
then
141
  AC_MSG_ERROR([Your version of Google Protocol Buffers is too old. Drizzle requires at least version 2.0.2])
142
fi
143
779.2.1 by Monty Taylor
Added new pthread m4 file. Changing lib checks to use AC_LIB_HAVE_LINKFLAGS
144
AC_PATH_PROG([PROTOC],[protoc],[no],[$LIBPROTOBUF_PREFIX/bin:$PATH])
520.4.47 by Monty Taylor
Added check for protoc to protobuf checks.
145
if test "x$PROTOC" = "xno"
146
then
917.1.5 by Monty Taylor
Added more verbose failure messages.
147
  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.])
520.4.47 by Monty Taylor
Added check for protoc to protobuf checks.
148
fi
149
287.3.30 by Monty Taylor
Added step one of finding libprotobuf.
150
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.
151
77.1.63 by Monty Taylor
Fail also if we can't find libevent or pthread.h.
152
#--------------------------------------------------------------------
520.4.27 by Monty Taylor
Fail if we don't find uuid/uuid.h.
153
# Check for libuuid
154
#--------------------------------------------------------------------
155
779.2.1 by Monty Taylor
Added new pthread m4 file. Changing lib checks to use AC_LIB_HAVE_LINKFLAGS
156
dnl Do this by hand. Need to check for uuid/uuid.h, but uuid may or may
157
dnl not be a lib is weird.
158
590.2.13 by Monty Taylor
Reverted libuuid check code.
159
AC_CHECK_HEADERS(uuid/uuid.h)
160
if test "x$ac_cv_header_uuid_uuid_h" = "xno"
161
then
917.1.5 by Monty Taylor
Added more verbose failure messages.
162
  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.])
590.2.13 by Monty Taylor
Reverted libuuid check code.
163
fi
779.2.3 by Monty Taylor
Added stdlib.h depend for readline.
164
AC_LIB_HAVE_LINKFLAGS(uuid,,
165
[
166
#include <uuid/uuid.h>
167
],
168
[
169
  uuid_t uout;
170
  uuid_generate(uout);
171
])
172
134.2.1 by Antony Curtis
Changes for proper detection of libraries
173
77.1.63 by Monty Taylor
Fail also if we can't find libevent or pthread.h.
174
175
176
#--------------------------------------------------------------------
612.2.5 by Monty Taylor
Added test for mtmalloc, if we haven't explicitly asked for tcmalloc.
177
# 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.
178
#--------------------------------------------------------------------
179
1089.3.6 by Monty Taylor
Changed Trond's patch to also support libumem on Linux - since I just discovered that we have it. Woot.
180
AC_ARG_ENABLE([umem],
181
  [AS_HELP_STRING([--enable-umem],
182
     [Enable linking with libumem @<:@default=off@:>@])],
183
  [ac_enable_umem="$enableval"],
184
  [ac_enable_umem="no"])
185
186
AC_ARG_ENABLE([tcmalloc],
187
  [AS_HELP_STRING([--enable-tcmalloc],
188
     [Enable linking with tcmalloc @<:@default=off@:>@])],
189
  [ac_enable_tcmalloc="$enableval"],
190
  [ac_enable_tcmalloc="no"])
191
192
AC_ARG_ENABLE([mtmalloc],
193
  [AS_HELP_STRING([--disable-mtmalloc],
194
     [Enable linking with mtmalloc @<:@default=on@:>@])],
195
  [ac_enable_mtmalloc="$enableval"],
196
  [ac_enable_mtmalloc="yes"])
197
198
AS_IF([test "x$ac_enable_umem" = "xyes"],[
199
  AC_CHECK_LIB(umem,malloc,[],[])
200
],[
201
  case "$target_os" in
202
    *linux*)
203
      AS_IF([test "x$ac_enable_tcmalloc" != "xno"],[
204
        AC_CHECK_LIB(tcmalloc-minimal,malloc,[],[])
205
        AS_IF([test "x$ac_cv_lib_tcmalloc_minimal_malloc" != "xyes"],[
206
          AC_CHECK_LIB(tcmalloc,malloc,[],[])
207
        ])
208
      ])
209
      ;;
210
    *solaris*)
211
      AS_IF([test "x$ac_enable_mtmalloc" != "xno"],[
212
        AC_CHECK_LIB(mtmalloc,malloc,[],[])
213
      ])
214
      ;;
215
  esac
216
])
779.2.1 by Monty Taylor
Added new pthread m4 file. Changing lib checks to use AC_LIB_HAVE_LINKFLAGS
217
77.1.111 by Monty Taylor
Added --enable-tcmalloc which will enable searching for and linking with tcmalloc if you have it.
218
#--------------------------------------------------------------------
779.1.15 by Monty Taylor
Added libdrizzle configure support.
219
# Check for libdrizzle
220
#--------------------------------------------------------------------
221
1081.1.1 by Monty Taylor
Whole boat-load of build fixes.
222
AC_LANG_PUSH(C++)
779.1.15 by Monty Taylor
Added libdrizzle configure support.
223
AC_LIB_HAVE_LINKFLAGS(drizzle,,
224
[#include <libdrizzle/drizzle.h>],
225
[
226
  const char *version= drizzle_version()
227
])
928.1.1 by Eric Day
Started client changes.
228
AS_IF([test x$ac_cv_libdrizzle = xno],
229
      AC_MSG_ERROR([libdrizzle is required for Drizzle]))
1089.3.10 by Monty Taylor
Put in configure trap for libdrizzle version.
230
231
AC_CACHE_CHECK([if libdrizzle has virtual columns], [drizzle_cv_libdrizzle_vcol],
232
  [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
233
#include <libdrizzle/drizzle.h>
234
int foo= DRIZZLE_COLUMN_TYPE_DRIZZLE_VIRTUAL;
235
    ]])],
236
    [drizzle_cv_libdrizzle_vcol=yes],
237
    [drizzle_cv_libdrizzle_vcol=no])])
238
if test "$drizzle_cv_libdrizzle_vcol" = "yes"
239
then
240
  AC_MSG_ERROR([Your version of libdrizzle is too old. Drizzle requires at least version 0.4])
241
fi
1081.1.1 by Monty Taylor
Whole boat-load of build fixes.
242
AC_LANG_POP
779.1.15 by Monty Taylor
Added libdrizzle configure support.
243
244
245
#--------------------------------------------------------------------
77.1.63 by Monty Taylor
Fail also if we can't find libevent or pthread.h.
246
# Check for libz
247
#--------------------------------------------------------------------
248
779.2.1 by Monty Taylor
Added new pthread m4 file. Changing lib checks to use AC_LIB_HAVE_LINKFLAGS
249
AC_LIB_HAVE_LINKFLAGS(z,,
250
[#include <zlib.h>],
251
[
252
  crc32(0, Z_NULL, 0);
253
])
254
AS_IF([test x$ac_cv_libz = xno],
917.1.5 by Monty Taylor
Added more verbose failure messages.
255
      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.]))
201.2.3 by Monty Taylor
Cleaned up some LIBS bits in the build.
256
612.2.9 by Monty Taylor
Woot. No more extra CFLAGS on the command line!
257
#--------------------------------------------------------------------
910.5.2 by Monty Taylor
Applied atomic patch to current tree.
258
# Check for TBB
259
#--------------------------------------------------------------------
260
261
AC_LANG_PUSH(C++)
262
AC_LIB_HAVE_LINKFLAGS(tbb,,
263
[#include <tbb/atomic.h>
264
 #include <stdint.h>
265
],
266
[
267
  tbb::atomic<uint64_t> x;
268
  tbb::atomic<uint8_t> y;
269
  x=0;
270
  y=0;
271
  x++;
272
  y++;
273
])
274
AC_LANG_POP()
275
276
#--------------------------------------------------------------------
182.1.5 by Jim Winstead
Detect and make the Mac OS X libedit readline interface look like the
277
# Check for libreadline or compatible (libedit on Mac OS X)
278
#--------------------------------------------------------------------
77.1.63 by Monty Taylor
Fail also if we can't find libevent or pthread.h.
279
779.2.5 by Monty Taylor
Split out readline.
280
save_LIBS="${LIBS}"
281
LIBS=""
779.2.4 by Monty Taylor
Updated some more build stuff.
282
VL_LIB_READLINE
873.2.4 by Monty Taylor
Fixed some configure errors.
283
AS_IF([test "x$vl_cv_lib_readline" = "xno"],
917.1.5 by Monty Taylor
Added more verbose failure messages.
284
      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.]))
779.2.5 by Monty Taylor
Split out readline.
285
READLINE_LIBS="${LIBS}"
286
LIBS="${save_LIBS}"
287
AC_SUBST(READLINE_LIBS)
207.1.2 by Jim Winstead
Fix test for libreadline to test a function that exists in all usable
288
319.1.1 by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_
289
DRIZZLE_CHECK_NEW_RL_INTERFACE
287.3.30 by Monty Taylor
Added step one of finding libprotobuf.
290
77.1.63 by Monty Taylor
Fail also if we can't find libevent or pthread.h.
291
#--------------------------------------------------------------------
292
# Check for libpcre
293
#--------------------------------------------------------------------
294
971.5.2 by Eric Day
Fixed more autoconf bugs.
295
AC_LIB_HAVE_LINKFLAGS(pcre,,
296
[#include <pcre.h>],
297
[
298
  pcre *re= NULL;
299
  pcre_version();
300
])
971.5.1 by Eric Day
Fix for bug #372367, pcre header detection.
301
AS_IF([test "x$ac_cv_libpcre" = "xno"],
302
[
914.1.1 by Monty Taylor
Quick OpenSolaris build fix.
303
  unset ac_cv_libpcre
971.5.2 by Eric Day
Fixed more autoconf bugs.
304
  unset HAVE_LIBPCRE
305
  unset LIBPCRE
306
  unset LIBPCRE_PREFIX
307
  unset LTLIBPCRE
308
  AC_LIB_HAVE_LINKFLAGS(pcre,,
309
  [#include <pcre/pcre.h>],
310
  [
311
    pcre *re= NULL;
312
    pcre_version();
313
  ])
914.1.1 by Monty Taylor
Quick OpenSolaris build fix.
314
  AS_IF([test "x$ac_cv_libpcre" = "xno"],
971.5.1 by Eric Day
Fix for bug #372367, pcre header detection.
315
  [
316
    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.])
317
  ],[
318
    AC_DEFINE(PCRE_HEADER,[<pcre/pcre.h>],[Location of pcre header])
319
  ])
914.1.1 by Monty Taylor
Quick OpenSolaris build fix.
320
],[
321
  AC_DEFINE(PCRE_HEADER,[<pcre.h>],[Location of pcre header])
322
])
779.2.9 by Monty Taylor
Put back in pkg-config check- pcre.h is in /usr/include for older versions and
323
77.1.63 by Monty Taylor
Fail also if we can't find libevent or pthread.h.
324
1 by brian
clean slate
325
AC_PATH_PROG(PERL, perl, no)
1081.1.1 by Monty Taylor
Whole boat-load of build fixes.
326
1 by brian
clean slate
327
28.1.39 by Monty Taylor
Made everything use AS_HELP_STRING (except for charsets, which are dying anyway)
328
AC_ARG_WITH([server-suffix],
329
    [AS_HELP_STRING([--with-server-suffix],
330
      [Append value to the version string.])],
319.1.1 by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_
331
    [ DRIZZLE_SERVER_SUFFIX=`echo "$withval" | sed -e  's/^\(...................................\)..*$/\1/'` ],
332
    [ DRIZZLE_SERVER_SUFFIX= ]
1 by brian
clean slate
333
    )
546 by Monty Taylor
Cleaned up version.h. (And by cleaned, I mean removed)
334
AC_DEFINE_UNQUOTED([DRIZZLE_SERVER_SUFFIX],[$DRIZZLE_SERVER_SUFFIX],
335
                   [Append value to the version string])
1 by brian
clean slate
336
337
# 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)
338
AC_ARG_WITH([named-curses-libs],
339
    [AS_HELP_STRING([--with-named-curses-libs=ARG],
340
            [Use specified curses libraries instead of those
341
		automatically found by configure.])],
1 by brian
clean slate
342
    [ with_named_curses=$withval ],
343
    [ with_named_curses=no ]
344
    )
345
28.1.39 by Monty Taylor
Made everything use AS_HELP_STRING (except for charsets, which are dying anyway)
346
AC_ARG_WITH([tcp-port],
347
    [AS_HELP_STRING([--with-tcp-port=port-number],
971.3.48 by Eric Day
New Listen interface about done, not quite compiling yet, but need a backup.
348
            [Which port to use for Drizzle TCP services @<:@default=4427@:>@])],
971.3.51 by Eric Day
Finished up new Listen plugin interface.
349
    [ DRIZZLE_TCP_PORT=$withval ],
301 by Brian Aker
Clean up port startup
350
    [ DRIZZLE_TCP_PORT=$DRIZZLE_TCP_PORT_DEFAULT
1 by brian
clean slate
351
      # if we actually defaulted (as opposed to the pathological case of
301 by Brian Aker
Clean up port startup
352
      # --with-tcp-port=<DRIZZLE_TCP_PORT_DEFAULT> which might in theory
1 by brian
clean slate
353
      # happen if whole batch of servers was built from a script), set
354
      # the default to zero to indicate that; we don't lose information
355
      # that way, because 0 obviously indicates that we can get the
301 by Brian Aker
Clean up port startup
356
      # default value from DRIZZLE_TCP_PORT. this seems really evil, but
357
      # testing for DRIZZLE_TCP_PORT==DRIZZLE_TCP_PORT_DEFAULT would make a
358
      # a port of DRIZZLE_TCP_PORT_DEFAULT magic even if the builder did not
1 by brian
clean slate
359
      # 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
360
      # from /etc/services if you can", but really, really meant 4427 when
361
      # they passed in 4427. When they pass in a specific value, let them
1 by brian
clean slate
362
      # have it; don't second guess user and think we know better, this will
363
      # just make people cross.  this makes the the logic work like this
364
      # (which is complicated enough):
365
      #
366
      # - if a port was set during build, use that as a default.
367
      #
368
      # - otherwise, try to look up a port in /etc/services; if that fails,
301 by Brian Aker
Clean up port startup
369
      #   use DRIZZLE_TCP_PORT_DEFAULT (at the time of this writing 4427)
1 by brian
clean slate
370
      #
301 by Brian Aker
Clean up port startup
371
      # - allow the DRIZZLE_TCP_PORT environment variable to override that.
1 by brian
clean slate
372
      #
373
      # - allow command-line parameters to override all of the above.
374
      #
301 by Brian Aker
Clean up port startup
375
      # the top-most DRIZZLE_TCP_PORT_DEFAULT is read from win/configure.js,
1 by brian
clean slate
376
      # so don't mess with that.
301 by Brian Aker
Clean up port startup
377
      DRIZZLE_TCP_PORT_DEFAULT=0 ]
1 by brian
clean slate
378
    )
971.3.48 by Eric Day
New Listen interface about done, not quite compiling yet, but need a backup.
379
301 by Brian Aker
Clean up port startup
380
AC_SUBST(DRIZZLE_TCP_PORT)
381
AC_SUBST(DRIZZLE_TCP_PORT_DEFAULT)
971.3.48 by Eric Day
New Listen interface about done, not quite compiling yet, but need a backup.
382
AC_DEFINE_UNQUOTED([DRIZZLE_TCP_PORT],[$DRIZZLE_TCP_PORT],
546 by Monty Taylor
Cleaned up version.h. (And by cleaned, I mean removed)
383
                   [Drizzle port to use])
971.3.48 by Eric Day
New Listen interface about done, not quite compiling yet, but need a backup.
384
AC_DEFINE_UNQUOTED([DRIZZLE_TCP_PORT_DEFAULT],[$DRIZZLE_TCP_PORT_DEFAULT],
385
                   [If we defaulted to DRIZZLE_PORT, then this will be zero])
386
1 by brian
clean slate
387
388
# 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.
389
AC_ARG_WITH([drizzled-user],
390
    [AS_HELP_STRING([--with-drizzled-user=username],
391
            [What user the drizzled daemon shall be run as.
392
		@<:@default=drizzle@:>@])],
393
    [ DRIZZLED_USER=$withval ],
394
    [ DRIZZLED_USER=drizzle ]
1 by brian
clean slate
395
    )
572.2.1 by ysano
Replace --with-mysqld-user configure option with --with-drizzled-user.
396
AC_SUBST(DRIZZLED_USER)
1 by brian
clean slate
397
398
# If we should allow LOAD DATA LOCAL
399
AC_MSG_CHECKING(If we should should enable LOAD DATA LOCAL by default)
400
AC_ARG_ENABLE(local-infile,
401
    [  --enable-local-infile   Enable LOAD DATA LOCAL INFILE (default: disabled)],
402
    [ ENABLED_LOCAL_INFILE=$enableval ],
403
    [ ENABLED_LOCAL_INFILE=no ]
404
    )
405
if test "$ENABLED_LOCAL_INFILE" = "yes"
406
then
407
  AC_MSG_RESULT([yes])
408
  AC_DEFINE([ENABLED_LOCAL_INFILE], [1],
409
            [If LOAD DATA LOCAL INFILE should be enabled by default])
410
else
411
  AC_MSG_RESULT([no])
412
fi
413
414
#--------------------------------------------------------------------
415
# Check for system header files
416
#--------------------------------------------------------------------
417
418
AC_HEADER_DIRENT
419
AC_HEADER_STDC
420
AC_HEADER_SYS_WAIT
53.2.2 by Monty Taylor
Updated everything that needs updating to compile with -std=gnu99 -pedantic
421
AC_HEADER_STDBOOL
77.1.22 by Monty Taylor
Removed refs to floatingpoint.h (which we only used for fconvert) and fconvert
422
AC_CHECK_HEADERS(fcntl.h float.h fpu_control.h ieeefp.h)
53.2.29 by Monty Taylor
Cleaned up headers a little more.
423
AC_CHECK_HEADERS(limits.h pwd.h select.h linux/config.h)
424
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.
425
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.
426
AC_CHECK_HEADERS([curses.h term.h],[],[],
427
[[#ifdef HAVE_CURSES_H
428
# include <curses.h>
429
#endif
430
]])
202.1.4 by Monty Taylor
Removed openssl refs.
431
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.
432
AC_CHECK_HEADERS(sys/prctl.h ieeefp.h)
53.2.29 by Monty Taylor
Cleaned up headers a little more.
433
AC_CHECK_HEADERS(execinfo.h)
1 by brian
clean slate
434
77.1.31 by Monty Taylor
Replaced regex lib with pcre. Reworked mysqltest to use it.
435
#--------------------------------------------------------------------
1 by brian
clean slate
436
# Check for system libraries. Adds the library to $LIBS
437
# and defines HAVE_LIBM etc
438
#--------------------------------------------------------------------
439
440
AC_CHECK_LIB(m, floor, [], AC_CHECK_LIB(m, __infinity))
441
236.1.39 by Monty Taylor
autoconf warning cleanups.
442
AC_CHECK_FUNC(setsockopt, [], [AC_CHECK_LIB(socket, setsockopt)])
443
AC_CHECK_FUNC(yp_get_default_domain, [],
444
  [AC_CHECK_LIB(nsl, yp_get_default_domain)])
445
AC_CHECK_FUNC(p2open, [], [AC_CHECK_LIB(gen, p2open)])
1 by brian
clean slate
446
# This may get things to compile even if bind-8 is installed
236.1.39 by Monty Taylor
autoconf warning cleanups.
447
AC_CHECK_FUNC(bind, [], [AC_CHECK_LIB(bind, bind)])
1 by brian
clean slate
448
# Check if crypt() exists in libc or libcrypt, sets LIBS if needed
449
AC_SEARCH_LIBS(crypt, crypt, AC_DEFINE(HAVE_CRYPT, 1, [crypt]))
450
451
# Check rt for aio_read
452
AC_CHECK_LIB(rt, aio_read)
453
454
# For the sched_yield() function on Solaris
236.1.39 by Monty Taylor
autoconf warning cleanups.
455
AC_CHECK_FUNC(sched_yield, [],
456
  [AC_CHECK_LIB(posix4, [sched_yield],
997.2.8 by Monty Taylor
Fixed a few loose ends.
457
    [AC_DEFINE(HAVE_SCHED_YIELD, 1, [Have sched_yield function]) LIBS="$LIBS -lposix4"])])
1 by brian
clean slate
458
459
if test "$ac_cv_header_termio_h" = "no" -a "$ac_cv_header_termios_h" = "no"
460
then
236.1.39 by Monty Taylor
autoconf warning cleanups.
461
  AC_CHECK_FUNC(gtty, [], [AC_CHECK_LIB(compat, gtty)])
1 by brian
clean slate
462
fi
463
464
AC_CHECK_TYPES([fp_except], [], [], [
465
#include <sys/types.h>
466
#include <ieeefp.h>
467
])
468
25 by Brian Aker
Clean up of configure.in
469
my_save_LIBS="$LIBS"
470
LIBS=""
471
AC_CHECK_LIB(dl,dlopen)
572.1.4 by Monty Taylor
Removed a bunch of unusued tests and defines from autoconf.
472
AC_CHECK_FUNCS(dlopen)
177.3.1 by mark
remove ifdef HAVE_DLOPEN, make configure require dlopen()
473
if test "$ac_cv_func_dlopen" != "yes"
474
then
475
  AC_MSG_ERROR([Drizzle requires dlopen])
476
fi
201.2.3 by Monty Taylor
Cleaned up some LIBS bits in the build.
477
LIBDL_LIBS="$LIBS"
25 by Brian Aker
Clean up of configure.in
478
LIBS="$my_save_LIBS"
201.2.3 by Monty Taylor
Cleaned up some LIBS bits in the build.
479
AC_SUBST(LIBDL_LIBS)
25 by Brian Aker
Clean up of configure.in
480
201.2.4 by Monty Taylor
Re-enabled optimizations for the normal build, and added back the --with-debug option to turn them off.
481
840.1.6 by Monty Taylor
Added back atomic builtins check.
482
AC_ARG_WITH([atomic-ops],
840.1.12 by Monty Taylor
Updated AC_HELP_STRING to AS_HELP_STRING
483
    [AS_HELP_STRING([--with-atomic-ops=rwlocks|smp|up],
484
       [Implement atomic operations using pthread rwlocks or atomic CPU
485
        instructions for multi-processor or uniprocessor
486
        configuration. By default gcc built-in sync functions are used,
487
        if available and 'smp' configuration otherwise.])],
488
    [with_atomic_ops="$withval"],
489
    [with_atomic_ops=smp])
840.1.6 by Monty Taylor
Added back atomic builtins check.
490
491
case "$with_atomic_ops" in
492
  "up") AC_DEFINE([MY_ATOMIC_MODE_DUMMY], [1],
493
                  [Assume single-CPU mode, no concurrency]) ;;
494
  "rwlocks") AC_DEFINE([MY_ATOMIC_MODE_RWLOCKS], [1],
495
                  [Use pthread rwlocks for atomic ops]) ;;
910.5.2 by Monty Taylor
Applied atomic patch to current tree.
496
  "smp") 
840.1.6 by Monty Taylor
Added back atomic builtins check.
497
    AC_CACHE_CHECK(
498
      [whether the compiler provides atomic builtins],
499
      [ac_cv_gcc_atomic_builtins],
942.1.5 by Monty Taylor
Replace AC_TRY_* with AC_*_IFELSE
500
      [AC_RUN_IFELSE(
501
        [AC_LANG_PROGRAM([],[[
840.1.6 by Monty Taylor
Added back atomic builtins check.
502
          int foo= -10; int bar= 10;
503
          if (!__sync_fetch_and_add(&foo, bar) || foo)
504
            return -1;
505
          bar= __sync_lock_test_and_set(&foo, bar);
506
          if (bar || foo != 10)
507
            return -1;
508
          bar= __sync_val_compare_and_swap(&bar, foo, 15);
509
          if (bar)
510
            return -1;
511
          return 0;
942.1.5 by Monty Taylor
Replace AC_TRY_* with AC_*_IFELSE
512
        ]])],
840.1.6 by Monty Taylor
Added back atomic builtins check.
513
       [ac_cv_gcc_atomic_builtins=yes],
514
       [ac_cv_gcc_atomic_builtins=no])])
515
516
    if test "x$ac_cv_gcc_atomic_builtins" = "xyes"; then
517
      AC_DEFINE(HAVE_GCC_ATOMIC_BUILTINS, 1,
518
                [Define to 1 if compiler provides atomic builtins.])
519
    fi
520
   ;;
521
   *) AC_MSG_ERROR(["$with_atomic_ops" is not a valid value for --with-atomic-ops]) ;;
522
esac
523
524
28.1.39 by Monty Taylor
Made everything use AS_HELP_STRING (except for charsets, which are dying anyway)
525
AC_ARG_WITH([comment],
526
    [AS_HELP_STRING([--with-comment],
527
            [Comment about compilation environment. @<:@default=off@:>@])],
1 by brian
clean slate
528
    [with_comment=$withval],
529
    [with_comment=no])
530
if test "$with_comment" != "no"
531
then
532
  COMPILATION_COMMENT=$with_comment
533
else
1081.1.1 by Monty Taylor
Whole boat-load of build fixes.
534
  COMPILATION_COMMENT="Source distribution (RELEASE_COMMENT)"
1 by brian
clean slate
535
fi
546 by Monty Taylor
Cleaned up version.h. (And by cleaned, I mean removed)
536
AC_DEFINE_UNQUOTED([COMPILATION_COMMENT],["$COMPILATION_COMMENT"],
537
                   [Comment about compilation environment])
1 by brian
clean slate
538
539
dnl Checks for typedefs, structures, and compiler characteristics.
1081.1.1 by Monty Taylor
Whole boat-load of build fixes.
540
1 by brian
clean slate
541
AC_STRUCT_TM
542
# off_t is not a builtin type
543
AC_CHECK_SIZEOF(off_t, 4)
544
if test "$ac_cv_sizeof_off_t" -eq 0
545
then
91 by Brian Aker
Main binary now named drizzled
546
  AC_MSG_ERROR("Drizzle needs a off_t type.")
1 by brian
clean slate
547
fi
968.2.1 by Monty Taylor
Build fix making 64-bit atomic<> work on 32-bit systems.
548
AC_CHECK_SIZEOF(size_t)
549
AC_DEFINE_UNQUOTED([SIZEOF_SIZE_T],[$ac_cv_sizeof_size_t],[Size of size_t as computed by sizeof()])
550
AC_CHECK_SIZEOF(long long)
551
AC_DEFINE_UNQUOTED(SIZEOF_LONG_LONG,[$ac_cv_sizeof_long_long],[Size of long long as computed by sizeof()])
1 by brian
clean slate
552
553
dnl
554
dnl check if time_t is unsigned
555
dnl
556
319.1.1 by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_
557
DRIZZLE_CHECK_TIME_T
1 by brian
clean slate
558
1081.1.1 by Monty Taylor
Whole boat-load of build fixes.
559
DRIZZLE_STACK_DIRECTION
942.1.8 by Monty Taylor
Removed more unused macros/things we don't need to check because they are posix.
560
1 by brian
clean slate
561
AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>])
520.4.43 by mordred
A set of Solaris fixes.
562
AC_CHECK_TYPES([uint, ulong])
1 by brian
clean slate
563
319.1.1 by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_
564
DRIZZLE_PTHREAD_YIELD
1 by brian
clean slate
565
134.2.1 by Antony Curtis
Changes for proper detection of libraries
566
1 by brian
clean slate
567
dnl Checks for header files.
572.1.4 by Monty Taylor
Removed a bunch of unusued tests and defines from autoconf.
568
AC_CHECK_HEADERS(malloc.h)
1 by brian
clean slate
569
570
dnl Checks for library functions.
571
AC_FUNC_ALLOCA
572.1.4 by Monty Taylor
Removed a bunch of unusued tests and defines from autoconf.
572
1 by brian
clean slate
573
AC_CHECK_FUNCS(issetugid)
574
575
# Already-done: stdlib.h string.h unistd.h termios.h
398.1.9 by Monty Taylor
Cleaned up stuff out of global.h.
576
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.
577
 sys/ndir.h sys/select.h \
578
 sys/mman.h termcap.h termio.h asm/termbits.h grp.h \
579
 paths.h)
1 by brian
clean slate
580
581
# Already-done: strcasecmp
572.1.4 by Monty Taylor
Removed a bunch of unusued tests and defines from autoconf.
582
AC_CHECK_FUNCS(lstat select)
1 by brian
clean slate
583
28.1.33 by Monty Taylor
Added -Wall
584
AC_HEADER_STAT
319.1.1 by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_
585
DRIZZLE_HAVE_TIOCGWINSZ
586
DRIZZLE_HAVE_TIOCSTAT
1 by brian
clean slate
587
588
#########################################################################
589
590
dnl Checks for library functions.
591
592
AC_FUNC_UTIME_NULL
593
AC_FUNC_VPRINTF
594
77.1.24 by Monty Taylor
Removed non-fcntl code and made it a fatal configure error if it's not there.
595
AC_CHECK_FUNCS(fcntl)
596
if test "x$ac_cv_func_fcntl" != "xyes"
597
then
598
  AC_MSG_ERROR("Drizzle requires fcntl.")
599
fi
600
815.1.6 by Monty Taylor
Some tweaks to get timegm working on Solaris.
601
AC_CONFIG_LIBOBJ_DIR([gnulib])
236.1.50 by Monty Taylor
Added automake conditional compilation of distributed system replacement functions.
602
572.1.4 by Monty Taylor
Removed a bunch of unusued tests and defines from autoconf.
603
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.
604
  cuserid fchmod \
572.1.4 by Monty Taylor
Removed a bunch of unusued tests and defines from autoconf.
605
  fdatasync fpresetsticky fpsetmask fsync \
575.4.6 by Monty Taylor
Removed my_getwd.
606
  getpassphrase getpwnam \
607
  getpwuid getrlimit getrusage index initgroups isnan \
1 by brian
clean slate
608
  localtime_r gethrtime gmtime_r \
572.1.4 by Monty Taylor
Removed a bunch of unusued tests and defines from autoconf.
609
  madvise \
610
  mkstemp mlockall poll pread pthread_attr_create mmap mmap64 \
1 by brian
clean slate
611
  pthread_attr_getstacksize pthread_attr_setprio pthread_attr_setschedparam \
612
  pthread_attr_setstacksize pthread_condattr_create pthread_getsequence_np \
613
  pthread_key_delete pthread_rwlock_rdlock pthread_setprio \
614
  pthread_setprio_np pthread_setschedparam pthread_sigmask readlink \
449 by Monty Taylor
Removed rint check - rint is part of C99.
615
  realpath rename rwlock_init setupterm \
572.1.4 by Monty Taylor
Removed a bunch of unusued tests and defines from autoconf.
616
  sigaction \
617
  sigthreadmask \
618
  snprintf strpbrk \
619
  tell tempnam \
620
  backtrace backtrace_symbols backtrace_symbols_fd)
1 by brian
clean slate
621
287.3.18 by Monty Taylor
Put -fno-exceptions flag in selectively. Add back HAVE_DECL_MADVISE check so
622
AC_LANG_PUSH(C++)
623
# Test whether madvise() is declared in C++ code -- it is not on some
624
# systems, such as Solaris
373.1.3 by Monty Taylor
Fixed test for HAVE_DECL_MADVISE to actually work.
625
AC_CHECK_DECLS([madvise], [], [], [AC_INCLUDES_DEFAULT[
626
#if HAVE_SYS_MMAN_H
287.3.18 by Monty Taylor
Put -fno-exceptions flag in selectively. Add back HAVE_DECL_MADVISE check so
627
#include <sys/types.h>
628
#include <sys/mman.h>
373.1.3 by Monty Taylor
Fixed test for HAVE_DECL_MADVISE to actually work.
629
#endif
630
]])
287.3.18 by Monty Taylor
Put -fno-exceptions flag in selectively. Add back HAVE_DECL_MADVISE check so
631
AC_LANG_POP()
632
633
236.1.59 by Monty Taylor
Turn thr_rwlock.c into a conditionally built source file.
634
AM_CONDITIONAL(BUILD_THR_RWLOCK,[test "$ac_cv_func_rwlock_init" -a "$ac_cv_funn_pthread_rwlock_rdlock"])
635
28.1.33 by Monty Taylor
Added -Wall
636
1 by brian
clean slate
637
# Sanity check: We chould not have any fseeko symbol unless
638
# large_file_support=yes
639
AC_CHECK_FUNC(fseeko,
520.4.41 by mordred
Fixed configure.ac to work cleanly on Solaris - and define some good compile flags.
640
[if test "$large_file_support" = no -a "x$TARGET_LINUX" = "xtrue";
1 by brian
clean slate
641
then
642
  AC_MSG_ERROR("Found fseeko symbol but large_file_support is not enabled!")
643
fi]
644
)
645
646
# Check definition of pthread_getspecific
236.1.39 by Monty Taylor
autoconf warning cleanups.
647
AC_CACHE_CHECK([args to pthread_getspecific], [mysql_cv_getspecific_args],
632.1.11 by Monty Taylor
Fixed Sun Studio warnings in mysys.
648
  [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
649
#if !defined(_REENTRANT)
1 by brian
clean slate
650
#define _REENTRANT
651
#endif
632.1.11 by Monty Taylor
Fixed Sun Studio warnings in mysys.
652
#ifndef _POSIX_PTHREAD_SEMANTICS 
1 by brian
clean slate
653
#define _POSIX_PTHREAD_SEMANTICS 
632.1.11 by Monty Taylor
Fixed Sun Studio warnings in mysys.
654
#endif
942.1.5 by Monty Taylor
Replace AC_TRY_* with AC_*_IFELSE
655
#include <pthread.h>
656
   ]], [[
657
void *pthread_getspecific(pthread_key_t key);
658
pthread_getspecific((pthread_key_t) NULL);
659
   ]])],
236.1.39 by Monty Taylor
autoconf warning cleanups.
660
    [mysql_cv_getspecific_args=POSIX],
661
    [mysql_cv_getspecific_args=other])])
1 by brian
clean slate
662
  if test "$mysql_cv_getspecific_args" = "other"
663
  then
664
    AC_DEFINE([HAVE_NONPOSIX_PTHREAD_GETSPECIFIC], [1],
665
              [For some non posix threads])
666
  fi
667
668
  # Check definition of pthread_mutex_init
236.1.39 by Monty Taylor
autoconf warning cleanups.
669
  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.
670
    [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
671
#ifndef _REENTRANT
672
#define _REENTRANT
673
#endif
674
#ifndef _POSIX_PTHREAD_SEMANTICS
1 by brian
clean slate
675
#define _POSIX_PTHREAD_SEMANTICS 
632.1.11 by Monty Taylor
Fixed Sun Studio warnings in mysys.
676
#endif
28.1.33 by Monty Taylor
Added -Wall
677
#include <pthread.h> ]], [[ 
1 by brian
clean slate
678
  pthread_mutexattr_t attr;
679
  pthread_mutex_t mp;
236.1.39 by Monty Taylor
autoconf warning cleanups.
680
  pthread_mutex_init(&mp,&attr); ]])],
681
      [mysql_cv_mutex_init_args=POSIX],
682
      [mysql_cv_mutex_init_args=other])])
1 by brian
clean slate
683
  if test "$mysql_cv_mutex_init_args" = "other"
684
  then
685
    AC_DEFINE([HAVE_NONPOSIX_PTHREAD_MUTEX_INIT], [1],
686
              [For some non posix threads])
687
  fi
688
#---END:
689
690
#---START: Used in for client configure
691
# Check definition of readdir_r
236.1.39 by Monty Taylor
autoconf warning cleanups.
692
AC_CACHE_CHECK([args to readdir_r], [mysql_cv_readdir_r],
632.1.11 by Monty Taylor
Fixed Sun Studio warnings in mysys.
693
  [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
694
#ifndef _REENTRANT
695
#define _REENTRANT
696
#endif
697
#ifndef _POSIX_PTHREAD_SEMANTICS 
1 by brian
clean slate
698
#define _POSIX_PTHREAD_SEMANTICS 
632.1.11 by Monty Taylor
Fixed Sun Studio warnings in mysys.
699
#endif
1 by brian
clean slate
700
#include <pthread.h>
28.1.33 by Monty Taylor
Added -Wall
701
#include <dirent.h>]], [[ int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result);
236.1.39 by Monty Taylor
autoconf warning cleanups.
702
readdir_r((DIR *) NULL, (struct dirent *) NULL, (struct dirent **) NULL); ]])],
703
    [mysql_cv_readdir_r=POSIX],
704
    [mysql_cv_readdir_r=other])])
1 by brian
clean slate
705
if test "$mysql_cv_readdir_r" = "POSIX"
706
then
707
  AC_DEFINE([HAVE_READDIR_R], [1], [POSIX readdir_r])
708
fi
709
710
# Check definition of posix sigwait()
236.1.39 by Monty Taylor
autoconf warning cleanups.
711
AC_CACHE_CHECK([style of sigwait], [mysql_cv_sigwait],
712
  [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
632.1.11 by Monty Taylor
Fixed Sun Studio warnings in mysys.
713
#ifndef _REENTRANT
236.1.39 by Monty Taylor
autoconf warning cleanups.
714
#define _REENTRANT
632.1.11 by Monty Taylor
Fixed Sun Studio warnings in mysys.
715
#endif
716
#ifndef _POSIX_PTHREAD_SEMANTICS
1 by brian
clean slate
717
#define _POSIX_PTHREAD_SEMANTICS 
632.1.11 by Monty Taylor
Fixed Sun Studio warnings in mysys.
718
#endif
1 by brian
clean slate
719
#include <pthread.h>
236.1.39 by Monty Taylor
autoconf warning cleanups.
720
#include <signal.h>
721
      ]], [[
722
#ifndef _AIX
1 by brian
clean slate
723
sigset_t set;
724
int sig;
725
sigwait(&set,&sig);
236.1.39 by Monty Taylor
autoconf warning cleanups.
726
#endif
727
      ]])],
728
    [mysql_cv_sigwait=POSIX],
729
    [mysql_cv_sigwait=other])])
1 by brian
clean slate
730
if test "$mysql_cv_sigwait" = "POSIX"
731
then
732
  AC_DEFINE([HAVE_SIGWAIT], [1], [POSIX sigwait])
733
fi
734
735
if test "$mysql_cv_sigwait" != "POSIX"
736
then
737
unset mysql_cv_sigwait
738
# Check definition of posix sigwait()
236.1.39 by Monty Taylor
autoconf warning cleanups.
739
AC_CACHE_CHECK([style of sigwait], [mysql_cv_sigwait],
740
  [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
632.1.11 by Monty Taylor
Fixed Sun Studio warnings in mysys.
741
#ifndef _REENTRANT
236.1.39 by Monty Taylor
autoconf warning cleanups.
742
#define _REENTRANT
632.1.11 by Monty Taylor
Fixed Sun Studio warnings in mysys.
743
#endif
744
#ifndef _POSIX_PTHREAD_SEMANTICS
1 by brian
clean slate
745
#define _POSIX_PTHREAD_SEMANTICS 
632.1.11 by Monty Taylor
Fixed Sun Studio warnings in mysys.
746
#endif
1 by brian
clean slate
747
#include <pthread.h>
236.1.39 by Monty Taylor
autoconf warning cleanups.
748
#include <signal.h>
749
      ]], [[
750
sigset_t set;
1 by brian
clean slate
751
int sig;
236.1.39 by Monty Taylor
autoconf warning cleanups.
752
sigwait(&set);
753
      ]])],
754
    [mysql_cv_sigwait=NONPOSIX],
755
    [mysql_cv_sigwait=other])])
1 by brian
clean slate
756
if test "$mysql_cv_sigwait" = "NONPOSIX"
757
then
758
  AC_DEFINE([HAVE_NONPOSIX_SIGWAIT], [1], [sigwait with one argument])
759
fi
760
fi
761
#---END:
762
763
# Check if pthread_attr_setscope() exists
236.1.39 by Monty Taylor
autoconf warning cleanups.
764
AC_CACHE_CHECK([for pthread_attr_setscope], [mysql_cv_pthread_attr_setscope],
765
  [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
632.1.11 by Monty Taylor
Fixed Sun Studio warnings in mysys.
766
#ifndef _REENTRANT
236.1.39 by Monty Taylor
autoconf warning cleanups.
767
#define _REENTRANT
632.1.11 by Monty Taylor
Fixed Sun Studio warnings in mysys.
768
#endif
769
#ifndef _POSIX_PTHREAD_SEMANTICS
1 by brian
clean slate
770
#define _POSIX_PTHREAD_SEMANTICS 
632.1.11 by Monty Taylor
Fixed Sun Studio warnings in mysys.
771
#endif
236.1.39 by Monty Taylor
autoconf warning cleanups.
772
#include <pthread.h>
773
      ]], [[
774
pthread_attr_t thr_attr;
775
pthread_attr_setscope(&thr_attr,0);
776
      ]])],
777
    [mysql_cv_pthread_attr_setscope=yes],
778
    [mysql_cv_pthread_attr_setscope=no])])
1 by brian
clean slate
779
if test "$mysql_cv_pthread_attr_setscope" = "yes"
780
then
781
  AC_DEFINE([HAVE_PTHREAD_ATTR_SETSCOPE], [1], [pthread_attr_setscope])
782
fi
783
28.1.33 by Monty Taylor
Added -Wall
784
AC_LANG_PUSH([C++])
1 by brian
clean slate
785
AC_CHECK_HEADERS(cxxabi.h)
786
AC_CACHE_CHECK([checking for abi::__cxa_demangle], mysql_cv_cxa_demangle,
28.1.33 by Monty Taylor
Added -Wall
787
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <cxxabi.h>]], [[
1 by brian
clean slate
788
  char *foo= 0; int bar= 0;
789
  foo= abi::__cxa_demangle(foo, foo, 0, &bar);
28.1.33 by Monty Taylor
Added -Wall
790
]])],[mysql_cv_cxa_demangle=yes],[mysql_cv_cxa_demangle=no])])
791
AC_LANG_POP([])
1 by brian
clean slate
792
793
if test "x$mysql_cv_cxa_demangle" = xyes; then
794
  AC_DEFINE(HAVE_ABI_CXA_DEMANGLE, 1,
795
            [Define to 1 if you have the `abi::__cxa_demangle' function.])
796
fi
797
798
#--------------------------------------------------------------------
799
# Check for requested features
800
#--------------------------------------------------------------------
801
319.1.1 by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_
802
DRIZZLE_CHECK_MAX_INDEXES
1 by brian
clean slate
803
804
#--------------------------------------------------------------------
805
# Declare our plugin modules
806
# Has to be done late, as the plugin may need to check for existence of
807
# functions tested above
808
#--------------------------------------------------------------------
809
992.1.21 by Monty Taylor
First pass at replacing plugin.m4.
810
m4_include(config/plugin.ac)
811
dnl Add code here to read set plugin lists and  set drizzled_default_plugin_list
812
AC_DEFINE_UNQUOTED([DRIZZLED_PLUGIN_LIST],[$drizzled_default_plugin_list],
813
                   [List of plugins that should be loaded on startup if no
814
                    value is given for --plugin-load])
1 by brian
clean slate
815
992.1.22 by Monty Taylor
Moved towards having register_plugins.py make builtin plugins, so we can have a first step.
816
drizzled_builtin_list=`echo $drizzled_builtin_list | sed 's/, *$//'`
817
AC_DEFINE_UNQUOTED([DRIZZLED_BUILTIN_LIST],[$drizzled_builtin_list],
818
                   [List of plugins to be loaded in sql_builtin.cc])
997.2.19 by Monty Taylor
Reverted back to building drizzled in drizzled.
819
AC_SUBST(drizzled_plugin_libs)
820
821
AC_SUBST(mysql_plugin_dirs)
822
AC_SUBST(mysql_plugin_libs)
823
drizzled_plugin_defs=`echo $drizzled_plugin_defs | sed 's/, *$//'`
824
AC_SUBST(drizzled_plugin_defs)
825
AC_SUBST(DRIZZLED_PLUGIN_DEP_LIBS)
992.1.22 by Monty Taylor
Moved towards having register_plugins.py make builtin plugins, so we can have a first step.
826
992.1.4 by Monty Taylor
Fixed quick configure bug. /* isn't a valid comment in shell script, thanks.
827
dnl Must be done once we turn on warnings and such
971.4.1 by Monty Taylor
GCC on Solaris build fixes.
828
AC_CACHE_CHECK(
829
  [whether __attribute__ visibility "hidden" is supported],
992.1.4 by Monty Taylor
Fixed quick configure bug. /* isn't a valid comment in shell script, thanks.
830
  [ac_cv_can_use_hidden_],[
831
    AC_LANG_PUSH(C++)
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
832
    save_CXXFLAGS="${CXXFLAGS}"
833
    CXXFLAGS="${AM_CXXFLAGS}"
992.1.7 by Monty Taylor
Sometimes it helps to actually set -Werror before the check you've marked as needing to happen after -Werror.
834
    AC_LINK_IFELSE([
992.1.4 by Monty Taylor
Fixed quick configure bug. /* isn't a valid comment in shell script, thanks.
835
      AC_LANG_PROGRAM(
836
        [[
971.4.1 by Monty Taylor
GCC on Solaris build fixes.
837
__attribute__((visibility ("hidden")))
992.1.21 by Monty Taylor
First pass at replacing plugin.m4.
838
void testme() {  }
992.1.18 by Monty Taylor
Moved client build into root Makefile.
839
        ]],[[testme()]]
992.1.4 by Monty Taylor
Fixed quick configure bug. /* isn't a valid comment in shell script, thanks.
840
      )],  
841
      [ac_cv_can_use_hidden_=yes],
842
      [ac_cv_can_use_hidden_=no])
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
843
    CXXFLAGS="${save_CXXFLAGS}"
992.1.4 by Monty Taylor
Fixed quick configure bug. /* isn't a valid comment in shell script, thanks.
844
    AC_LANG_POP()])
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
845
AS_IF([test "$ac_cv_can_use_hidden_" = "yes"],[
971.4.1 by Monty Taylor
GCC on Solaris build fixes.
846
  AC_DEFINE(HAVE_ATTR_HIDDEN, 1,
847
  [Define to 1 if you have support for __attribute__((visibility("hidden")))])
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
848
])
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.
849
1 by brian
clean slate
850
722.1.4 by Monty Taylor
Removed all the setting of DEFS everywhere. Use configmake.h to get the values
851
AC_SUBST(pkgplugindir,"\$(pkglibdir)/plugin")
852
492.1.7 by Monty Taylor
Moved test() to its own file.
853
dnl GCC Precompiled Header Support
584.4.3 by Monty Taylor
Disabled pre-compiled headers for now.
854
dnl re-enable later
632.1.25 by Monty Taylor
Removed AM_CONDITIONAL from SEARCH_FOR_LIB. Aligned naming of AM_CONDITIONALS.
855
dnl AM_CONDITIONAL([BUILD_GCC_PCH],[test "$GCC" = "yes"])
856
AM_CONDITIONAL([BUILD_GCC_PCH],[test "no" = "yes"])
492.1.7 by Monty Taylor
Moved test() to its own file.
857
992.1.17 by Monty Taylor
Moved extra/ into root Makefile.am
858
AC_CONFIG_FILES(Makefile dnl
815.1.1 by Monty Taylor
Add timegm which is missing on Solaris.
859
 gnulib/Makefile dnl
575.2.2 by Monty Taylor
Moved vio stuff into libdrizzle.
860
 po/Makefile.in dnl
988.1.1 by Jay Pipes
Changes libserialize to libdrizzledmessage per ML discussion. All GPB messages are now in the drizzled::message namespace.
861
 drizzled/message/Makefile dnl
997.2.19 by Monty Taylor
Reverted back to building drizzled in drizzled.
862
 drizzled/Makefile dnl
28.1.31 by Monty Taylor
Deleted tons of pointless garbage from scripts.
863
 support-files/Makefile dnl
77.1.47 by Monty Taylor
Moved test to tests...
864
 tests/Makefile tests/install_test_db dnl
1025.1.1 by Trond Norbye
Add configuration files to integrate to Solaris SMF
865
 support-files/drizzle.server support-files/drizzle-log-rotate
866
 support-files/smf/Makefile dnl
867
 support-files/smf/install.sh dnl
868
 support-files/smf/drizzle.xml dnl
869
 support-files/smf/drizzle)
1 by brian
clean slate
870
512.2.2 by C.J. Adams-Collier
added checks to determine which threading plugins have been enabled on
871
scheduling_plugins_available="
872
  pool_of_threads 
873
  single_thread
874
"
875
876
for sched_plugin in $scheduling_plugins_available
877
do
878
  varname="\${with_plugin_${sched_plugin}}"
879
  result=`eval "echo $varname"`
880
  if test "x$result" = "xyes"
881
  then
882
    scheduling_plugins="$sched_plugin $scheduling_plugins"
883
  fi
884
done
885
1 by brian
clean slate
886
AC_OUTPUT
489.2.1 by C.J. Adams-Collier
2008-10-07T1437 C.J. Adams-Collier <cjac@colliertech.org>
887
888
echo "---"
1081.1.1 by Monty Taylor
Whole boat-load of build fixes.
889
echo "Configuration summary for $PACKAGE_NAME version $VERSION RELEASE_COMMENT"
489.2.1 by C.J. Adams-Collier
2008-10-07T1437 C.J. Adams-Collier <cjac@colliertech.org>
890
echo ""
891
echo "   * Installation prefix:       $prefix"
1081.1.1 by Monty Taylor
Whole boat-load of build fixes.
892
echo "   * System type:               $host_vendor-$host_os"
492.2.1 by C.J. Adams-Collier
* fixed --disable-assert code (thanks Monty)
893
echo "   * Host CPU:                  $host_cpu"
489.2.1 by C.J. Adams-Collier
2008-10-07T1437 C.J. Adams-Collier <cjac@colliertech.org>
894
echo "   * C Compiler:                $CC_VERSION"
632.1.21 by Monty Taylor
Cleaned up compiler version checking.
895
echo "   * C++ Compiler:              $CXX_VERSION"
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
896
echo "   * Build auth_pam:            $ac_cv_libpam"
492.2.1 by C.J. Adams-Collier
* fixed --disable-assert code (thanks Monty)
897
echo "   * Assertions enabled:        $ac_cv_assert"
489.2.1 by C.J. Adams-Collier
2008-10-07T1437 C.J. Adams-Collier <cjac@colliertech.org>
898
echo "   * Debug enabled:             $with_debug"
899
echo "   * Profiling enabled:         $ac_profiling"
900
echo "   * Coverage enabled:          $ac_coverage"
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
901
echo "   * Warnings as failure:       $ac_cv_warnings_as_errors"
492.2.1 by C.J. Adams-Collier
* fixed --disable-assert code (thanks Monty)
902
echo "   * C++ cstdint location:      $ac_cv_cxx_cstdint"
903
echo "   * C++ hash_map location:     $ac_cv_cxx_hash_map"
904
echo "   * C++ hash namespace:        $ac_cv_cxx_hash_namespace"
919.2.19 by Monty Taylor
Added check for shared_ptr in advance of actually thinking about using it. I think this should cover all platforms we care about... but let's doublecheck.
905
echo "   * C++ shared_ptr namespace:  $ac_cv_shared_ptr_namespace"
489.2.1 by C.J. Adams-Collier
2008-10-07T1437 C.J. Adams-Collier <cjac@colliertech.org>
906
echo ""
907
echo "---"
908.1.4 by Monty Taylor
Fix to fake-out libtoolize, since AC_INIT is in bzr_version.m4 now.
908
909
dnl libtoolize scans configure.ac  and needs to see some text
910
m4_define([LIBTOOLIZE_AC_INIT], [])