~drizzle-trunk/drizzle/development

1 by brian
clean slate
1
dnl -*- ksh -*-
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
28.1.33 by Monty Taylor
Added -Wall
6
AC_INIT
54.1.4 by Stewart Smith
merge from mainline
7
AC_CONFIG_SRCDIR([server/drizzled.cc])
39 by Brian Aker
Move build helper files into config
8
AC_CONFIG_AUX_DIR(config)
28.1.33 by Monty Taylor
Added -Wall
9
AC_CONFIG_HEADERS([include/config.h:config.h.in])
10
AC_CANONICAL_TARGET
91 by Brian Aker
Main binary now named drizzled
11
AM_INIT_AUTOMAKE(drizzle, 7.0.0, no-define)
1 by brian
clean slate
12
13
PROTOCOL_VERSION=10
14
DOT_FRM_VERSION=6
15
# See the libtool docs for information on how to do shared lib versions.
16
SHARED_LIB_MAJOR_VERSION=16
17
SHARED_LIB_VERSION=$SHARED_LIB_MAJOR_VERSION:0:0
18
19
20
21
# Set all version vars based on $VERSION. How do we do this more elegant ?
22
# Remember that regexps needs to quote [ and ] since this is run through m4
23
# We take some made up examples
24
#
25
#  VERSION                  5.1.40sp1-alpha     5.0.34a
26
#  MYSQL_NO_DASH_VERSION    5.1.40sp1           5.0.34a
27
#  MYSQL_NUMERIC_VERSION    5.1.40              5.0.34
28
#  MYSQL_BASE_VERSION       5.1                 5.0
29
#  MYSQL_VERSION_ID         50140               50034
30
#
31
MYSQL_NO_DASH_VERSION=`echo $VERSION | sed -e "s|-.*$||"`
32
MYSQL_NUMERIC_VERSION=`echo $MYSQL_NO_DASH_VERSION | sed -e "s|[[a-z]][[a-z0-9]]*$||"`
33
MYSQL_BASE_VERSION=`echo $MYSQL_NUMERIC_VERSION | sed -e "s|\.[[^.]]*$||"`
34
MYSQL_VERSION_ID=`echo $MYSQL_NUMERIC_VERSION | \
35
    awk -F. '{printf "%d%0.2d%0.2d", $1, $2, $3}'`
36
37
# The port should be constant for a LONG time
165.1.1 by Elliot Murphy
new port number from IANA
38
MYSQL_TCP_PORT_DEFAULT=4427
1 by brian
clean slate
39
40
dnl Include m4 
41
sinclude(config/ac-macros/alloca.m4)
42
sinclude(config/ac-macros/check_cpu.m4)
43
sinclude(config/ac-macros/character_sets.m4)
44
sinclude(config/ac-macros/compiler_flag.m4)
45
sinclude(config/ac-macros/dtrace.m4)
46
sinclude(config/ac-macros/plugins.m4)
47
sinclude(config/ac-macros/large_file.m4)
48
sinclude(config/ac-macros/misc.m4)
49
sinclude(config/ac-macros/readline.m4)
50
sinclude(config/ac-macros/ssl.m4)
77.1.73 by Monty Taylor
Added sinclude of pkg.m4
51
sinclude(config/ac-macros/pkg.m4)
1 by brian
clean slate
52
54.1.3 by Stewart Smith
sql => server (initial patch)
53
# Remember to add a directory server/share/LANGUAGE
1 by brian
clean slate
54
AVAILABLE_LANGUAGES="\
55
czech danish dutch english estonian french german greek hungarian \
56
italian japanese korean norwegian norwegian-ny polish portuguese \
57
romanian russian serbian slovak spanish swedish ukrainian"
58
59
#####
60
#####
61
62
AC_SUBST(MYSQL_NO_DASH_VERSION)
63
AC_SUBST(MYSQL_BASE_VERSION)
64
AC_SUBST(MYSQL_VERSION_ID)
65
AC_SUBST(MYSQL_PREVIOUS_BASE_VERSION)
66
AC_SUBST(PROTOCOL_VERSION)
67
AC_DEFINE_UNQUOTED([PROTOCOL_VERSION], [$PROTOCOL_VERSION],
68
                   [mysql client protocol version])
69
AC_SUBST(DOT_FRM_VERSION)
70
AC_DEFINE_UNQUOTED([DOT_FRM_VERSION], [$DOT_FRM_VERSION],
71
                   [Version of .frm files])
72
AC_SUBST(SHARED_LIB_MAJOR_VERSION)
73
AC_SUBST(SHARED_LIB_VERSION)
74
AC_SUBST(AVAILABLE_LANGUAGES)
75
76
77
# Canonicalize the configuration name.
78
79
# Check whether --with-system-type or --without-system-type was given.
28.1.33 by Monty Taylor
Added -Wall
80
AC_ARG_WITH([system-type],
81
    [AS_HELP_STRING([--with-system-type],
82
       [Set the system type, like "sun-solaris10"])],
1 by brian
clean slate
83
    [SYSTEM_TYPE="$withval"],
84
    [SYSTEM_TYPE="$host_vendor-$host_os"])
28.1.33 by Monty Taylor
Added -Wall
85
AC_ARG_WITH([machine-type],
86
    [AS_HELP_STRING([--with-machine-type],
87
       [Set the machine type, like "powerpc"])],
1 by brian
clean slate
88
    [MACHINE_TYPE="$withval"],
89
    [MACHINE_TYPE="$host_cpu"])
90
AC_SUBST(SYSTEM_TYPE)
91
AC_DEFINE_UNQUOTED([SYSTEM_TYPE], ["$SYSTEM_TYPE"],
92
                   [Name of system, eg sun-solaris])
93
AC_SUBST(MACHINE_TYPE)
94
AC_DEFINE_UNQUOTED([MACHINE_TYPE], ["$MACHINE_TYPE"],
95
                   [Machine type name, eg sparc])
96
97
# Detect intel x86 like processor
98
BASE_MACHINE_TYPE=$MACHINE_TYPE
99
case $MACHINE_TYPE in
100
  i?86) BASE_MACHINE_TYPE=i386 ;;
101
esac
102
103
# Save some variables and the command line options for mysqlbug
104
SAVE_CC="$CC"
105
SAVE_CXX="$CXX"
106
SAVE_ASFLAGS="$ASFLAGS"
107
SAVE_CFLAGS="$CFLAGS"
108
SAVE_CXXFLAGS="$CXXFLAGS"
109
SAVE_LDFLAGS="$LDFLAGS"
110
SAVE_CXXLDFLAGS="$CXXLDFLAGS"
111
CONF_COMMAND="$0 $ac_configure_args"
112
AC_SUBST(CONF_COMMAND)
113
AC_SUBST(SAVE_CC)
114
AC_SUBST(SAVE_CXX)
115
AC_SUBST(SAVE_ASFLAGS)
116
AC_SUBST(SAVE_CFLAGS)
117
AC_SUBST(SAVE_CXXFLAGS)
118
AC_SUBST(SAVE_LDFLAGS)
119
AC_SUBST(SAVE_CXXLDFLAGS)
120
AC_SUBST(CXXLDFLAGS)
121
122
AM_SANITY_CHECK
123
# This is needed is SUBDIRS is set
124
AC_PROG_MAKE_SET
125
126
##############################################################################
127
# The below section needs to be done before AC_PROG_CC
128
##############################################################################
129
130
if test "x${CFLAGS-}" = x ; then
131
  cflags_is_set=no
132
else
133
  cflags_is_set=yes
134
fi
135
136
if test "x${CPPFLAGS-}" = x ; then
137
  cppflags_is_set=no
138
else
139
  cppflags_is_set=yes
140
fi
141
142
if test "x${LDFLAGS-}" = x ; then
143
  ldflags_is_set=no
144
else
145
  ldflags_is_set=yes
146
fi
147
148
################ End of section to be done before AC_PROG_CC #################
149
150
# The following hack should ensure that configure doesn't add optimizing
151
# or debugging flags to CFLAGS or CXXFLAGS
152
# C_EXTRA_FLAGS are flags that are automaticly added to both
153
# CFLAGS and CXXFLAGS
154
CFLAGS="$CFLAGS $C_EXTRA_FLAGS "
155
CXXFLAGS="$CXXFLAGS $C_EXTRA_FLAGS "
156
157
dnl Checks for programs.
158
AC_PROG_AWK
159
AC_PROG_CC
160
AC_PROG_CXX
161
AC_PROG_CPP
162
AM_PROG_CC_C_O
163
164
# Print version of CC and CXX compiler (if they support --version)
165
case $SYSTEM_TYPE in
166
  *netware*)
167
CC_VERSION=`$CC -version | grep -i version`
168
    ;;
169
  *)
170
CC_VERSION=`$CC --version | sed 1q`
171
    ;;
172
esac
173
if test $? -eq "0"
174
then
175
  AC_MSG_CHECKING("C Compiler version")
176
  AC_MSG_RESULT("$CC $CC_VERSION")
177
else
178
CC_VERSION=""
179
fi
180
AC_SUBST(CC_VERSION)
181
MYSQL_CHECK_CXX_VERSION
182
28.1.33 by Monty Taylor
Added -Wall
183
if test "$ac_cv_c_compiler_gnu" = "yes"
1 by brian
clean slate
184
then
185
  AS="$CC -c"
186
  AC_SUBST(AS)
187
else
188
  AC_PATH_PROG(AS, as, as)
189
fi
190
191
# We use libtool
192
#AC_LIBTOOL_WIN32_DLL
193
AC_PROG_LIBTOOL
194
195
# Ensure that we have --preserve-dup-deps defines, otherwise we get link
196
# problems of 'mysql' with CXX=g++
197
LIBTOOL="$LIBTOOL --preserve-dup-deps"
198
AC_SUBST(LIBTOOL)dnl
199
200
AC_SUBST(NM)dnl
201
202
AC_PROG_INSTALL
203
test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
204
205
# Not critical since the generated file is distributed
206
AC_CHECK_PROGS(YACC, ['bison -y -p MYSQL'])
77.1.70 by Monty Taylor
Added a failure if you don't have bison and you're building from a .bzr branch.
207
if test -z "$YACC" && test -d ".bzr"
208
then
209
  AC_MSG_ERROR(["bison is required for Drizzle to build from a bzr branch"])
210
fi
1 by brian
clean slate
211
212
AC_PATH_PROG(uname_prog, uname, no)
213
214
# We should go through this and put all the explictly system dependent
215
# stuff in one place
216
AC_MSG_CHECKING(operating system)
217
AC_CACHE_VAL(mysql_cv_sys_os,
218
[
219
if test "$uname_prog" != "no"; then
220
  mysql_cv_sys_os="`uname`"
221
else
222
  mysql_cv_sys_os="Not Solaris"
223
fi
224
])
225
AC_MSG_RESULT($mysql_cv_sys_os)
226
227
# This should be rewritten to use $target_os
228
case "$target_os" in
229
  *solaris*)
230
    TARGET_SOLARIS="true"
231
    AC_DEFINE([TARGET_OS_SOLARIS], [1], [Whether we are building for Solaris])
232
    AC_SUBST(TARGET_SOLARIS)
233
  ;;
234
esac
235
236
# The following is required for portable results of floating point calculations
237
# on PowerPC. The same must also be done for IA-64, but this options is missing
238
# in the IA-64 gcc backend.
239
240
if test "$GCC" = "yes"
241
then
242
  case "$host_cpu" in
243
    *ppc* | *powerpc*)
244
      CFLAGS="$CFLAGS -mno-fused-madd"
245
      CXXFLAGS="$CXXFLAGS -mno-fused-madd"
246
    ;;
247
  esac
248
fi
249
250
AC_SUBST(CC)
251
AC_SUBST(CFLAGS)
252
AC_SUBST(CXX)
253
AC_SUBST(CXXFLAGS)
254
AC_SUBST(ASFLAGS)
255
AC_SUBST(LD)
256
AC_SUBST(INSTALL_SCRIPT)
257
53.2.1 by Monty Taylor
Added --disable-pedantic-warnings and --enable-fail.
258
1 by brian
clean slate
259
export CC CXX CFLAGS LD LDFLAGS AR ARFLAGS
260
261
if test "$GCC" = "yes"
262
then
263
  # mysqld requires -fno-implicit-templates.
264
  # Disable exceptions as they seams to create problems with gcc and threads.
265
  # mysqld doesn't use run-time-type-checking, so we disable it.
266
  # We should use -Wno-invalid-offsetof flag to disable some warnings from gcc
267
  # regarding offset() usage in C++ which are done in a safe manner in the
268
  # server
77.1.68 by Monty Taylor
Turned on -g and optimization for normal builds. -ggdb3 for gcc builds.
269
  CXXFLAGS="$CXXFLAGS -fno-implicit-templates -fno-exceptions -fno-rtti"
1 by brian
clean slate
270
  AC_DEFINE([HAVE_EXPLICIT_TEMPLATE_INSTANTIATION],
271
    [1], [Defined by configure. Use explicit template instantiation.])
272
fi
273
274
MYSQL_PROG_AR
275
276
# libmysqlclient versioning when linked with GNU ld.
277
if $LD --version 2>/dev/null|grep -q GNU; then
77.1.38 by Monty Taylor
Renamed more stuff to drizzle.
278
  LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_builddir)/libdrizzle/libdrizzle.ver"
279
  AC_CONFIG_FILES(libdrizzle/libdrizzle.ver)
1 by brian
clean slate
280
fi
281
AC_SUBST(LD_VERSION_SCRIPT)
282
77.1.111 by Monty Taylor
Added --enable-tcmalloc which will enable searching for and linking with tcmalloc if you have it.
283
77.1.63 by Monty Taylor
Fail also if we can't find libevent or pthread.h.
284
#--------------------------------------------------------------------
285
# Check for libevent
286
#--------------------------------------------------------------------
287
288
AC_CHECK_HEADERS(event.h)
289
if test "x$ac_cv_header_event_h" != "xyes"
290
then
291
  AC_MSG_ERROR([Couldn't find event.h. Try installing libevent development packages])
292
fi
293
AC_CHECK_LIB(event, event_loop, [], [AC_MSG_ERROR(could not find libevent)])
294
295
#--------------------------------------------------------------------
296
# Check for libpthread
297
#--------------------------------------------------------------------
298
299
AC_CHECK_HEADERS(pthread.h)
300
if test "x$ac_cv_header_pthread_h" != "xyes"
301
then
302
  AC_MSG_ERROR([Couldn't find pthread.h.])
303
fi
304
AC_CHECK_LIB(pthread, pthread_create, [], [AC_MSG_ERROR(could not find libpthread)])
305
306
#--------------------------------------------------------------------
77.1.111 by Monty Taylor
Added --enable-tcmalloc which will enable searching for and linking with tcmalloc if you have it.
307
# Check for tcmalloc
308
#--------------------------------------------------------------------
309
310
AC_ARG_ENABLE([tcmalloc],
311
    [AS_HELP_STRING([--enable-tcmalloc],
312
       [Enable linking with tcmalloc @<:@default=off@:>@])],
313
    [ac_warn_strict_aliasing="$enableval"],
314
    [ac_warn_strict_aliasing="no"])
315
316
if test "x$ac_warn_strict_aliasing" = "xyes"
317
then
318
  AC_CHECK_LIB(tcmalloc,malloc,[],[])
319
fi
320
321
#--------------------------------------------------------------------
77.1.63 by Monty Taylor
Fail also if we can't find libevent or pthread.h.
322
# Check for libz
323
#--------------------------------------------------------------------
324
325
AC_CHECK_HEADERS(zlib.h)
326
if test "x$ac_cv_header_zlib_h" != "xyes"
327
then
328
  AC_MSG_ERROR([Couldn't find zlib.h. Try installing zlib development packages])
329
fi
330
AC_CHECK_LIB(z, crc32, [], [AC_MSG_ERROR(could not find libz)])
331
332
333
AC_CHECK_HEADERS([readline/readline.h])
334
if test "x$ac_cv_header_readline_readline_h" != "xyes"
335
then
336
  AC_MSG_ERROR([Couldn't find readline/readline.h. Try installing readline development packages.])
337
fi
338
339
#--------------------------------------------------------------------
340
# Check for libpcre
341
#--------------------------------------------------------------------
342
343
AC_LANG_PUSH([C++])
344
AC_PATH_PROG(PKG_CONFIG, pkg-config, AC_MSG_ERROR([pkg-config wasn't found.]))
345
PKG_CHECK_MODULES(PCRE, [libpcrecpp >= 3], [found_pcre="yes"],[
77.1.64 by Monty Taylor
YA fix for libpcrecpp finding...
346
  dnl Only check the header here, because autoconf can't handle
347
  dnl checking for C++ methods without C linkages
77.1.63 by Monty Taylor
Fail also if we can't find libevent or pthread.h.
348
  AC_CHECK_HEADERS(pcrecpp.h)
77.1.102 by Monty Taylor
Fixed a PCRE detection bug.
349
  if test "x$ac_cv_header_pcrecpp_h" != "xyes" 
77.1.63 by Monty Taylor
Fail also if we can't find libevent or pthread.h.
350
  then
351
    found_pcre="no"
77.1.64 by Monty Taylor
YA fix for libpcrecpp finding...
352
  else
353
    found_pcre="yes"
77.1.69 by Monty Taylor
Added the PCRE libs so that we can actually link against them :(
354
    # We can't search for these well, but we sure do need them!
355
    PCRE_LIBS="-lpcrecpp -lpcre"
77.1.63 by Monty Taylor
Fail also if we can't find libevent or pthread.h.
356
  fi
357
  ])
358
if test "x$found_pcre" != "xyes"
359
then
360
    AC_MSG_ERROR([Couldn't find pcrecpp.h. Try installing the development package associated with libpcre on your system.])
361
fi
362
AC_LANG_POP([])
363
AC_SUBST(PCRE_LIBS)
364
AC_SUBST(PCRE_CFLAGS)
365
77.3.5 by Monty Taylor
Added GLIB check.
366
AM_PATH_GLIB_2_0
77.3.6 by Monty Taylor
Added m4 macros for glib.
367
if test "x$no_glib" != "x" ; then
368
    AC_MSG_ERROR([Couldn't find GLib2. Try installing libglib2.0-dev or glib2-devel])
369
fi
1 by brian
clean slate
370
371
dnl Find paths to some shell programs
372
AC_PATH_PROG(LN, ln, ln)
373
# This must be able to take a -f flag like normal unix ln.
374
AC_PATH_PROG(LN_CP_F, ln, ln)
375
376
AC_PATH_PROG(MV, mv, mv)
377
AC_PATH_PROG(RM, rm, rm)
378
AC_PATH_PROG(CP, cp, cp)
379
AC_PATH_PROG(SED, sed, sed)
380
AC_PATH_PROG(CMP, cmp, cmp)
381
AC_PATH_PROG(CHMOD, chmod, chmod)
382
AC_PATH_PROG(HOSTNAME, hostname, hostname)
383
# Check for a GNU tar named 'gtar', or 'gnutar' (MacOS X) and
384
# fall back to 'tar' otherwise and hope that it's a GNU tar as well
385
AC_CHECK_PROGS(TAR, gnutar gtar tar)
386
387
dnl We use a path for perl so the script startup works
388
dnl We make sure to use perl, not perl5, in hopes that the RPMs will
389
dnl not depend on the perl5 binary being installed (probably a bug in RPM)
390
AC_PATH_PROG(PERL, perl, no)
391
if test "$PERL" != "no" && $PERL -e 'require 5' > /dev/null 2>&1
392
then
393
  PERL5=$PERL
394
else
395
  AC_PATH_PROG(PERL5, perl5, no)
396
  if test "$PERL5" != no
397
  then
398
    PERL=$PERL5
399
    ac_cv_path_PERL=$ac_cv_path_PERL5
400
  fi
401
fi
402
403
AC_SUBST(HOSTNAME)
404
AC_SUBST(PERL)
405
AC_SUBST(PERL5)
406
407
# icheck, used for ABI check
408
AC_PATH_PROG(ICHECK, icheck, no)
409
# "icheck" is also the name of a file system check program on Tru64.
410
# Verify the program found is really the interface checker.
411
if test "x$ICHECK" != "xno"
412
then
413
  AC_MSG_CHECKING(if $ICHECK works as expected)
414
  echo "int foo;" > conftest.h
415
  $ICHECK --canonify -o conftest.ic conftest.h 2>/dev/null
416
  if test -f "conftest.ic"
417
  then
418
    AC_MSG_RESULT(yes)
419
  else
420
    AC_MSG_RESULT(no)
421
    ICHECK=no
422
  fi
423
  rm -f conftest.ic conftest.h
424
fi
425
AC_SUBST(ICHECK)
426
427
# Lock for PS
428
AC_PATH_PROG(PS, ps, ps)
429
AC_MSG_CHECKING("how to check if pid exists")
430
PS=$ac_cv_path_PS
431
# Linux style
432
if $PS p $$ 2> /dev/null | grep `echo $0 | sed s/\-//` > /dev/null
433
then
434
  FIND_PROC="$PS p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
435
# Solaris
436
elif $PS -fp $$ 2> /dev/null | grep $0 > /dev/null
437
then
438
  FIND_PROC="$PS -p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
439
# BSD style
440
elif $PS -uaxww 2> /dev/null | grep $0 > /dev/null
441
then
442
  FIND_PROC="$PS -uaxww | grep -v grep | grep \$\$MYSQLD | grep \" \$\$PID \" > /dev/null"
443
# SysV style
444
elif $PS -ef 2> /dev/null | grep $0 > /dev/null
445
then
446
  FIND_PROC="$PS -ef | grep -v grep | grep \$\$MYSQLD | grep \" \$\$PID \" > /dev/null"
447
# Do anybody use this?
448
elif $PS $$ 2> /dev/null | grep $0 > /dev/null
449
then
450
  FIND_PROC="$PS \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
451
else
452
  case $SYSTEM_TYPE in
453
    *freebsd*|*dragonfly*)
454
      FIND_PROC="$PS p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
455
      ;;
456
    *darwin*)
457
      FIND_PROC="$PS -uaxww | grep -v grep | grep \$\$MYSQLD | grep \" \$\$PID \" > /dev/null"
458
      ;;
459
    *)
460
      AC_MSG_ERROR([Could not find the right ps switches. Which OS is this ?. See the Installation chapter in the Reference Manual.])
461
  esac
462
fi
463
AC_SUBST(FIND_PROC)
464
AC_MSG_RESULT("$FIND_PROC")
465
466
# Check if a pid is valid
467
AC_PATH_PROG(KILL, kill, kill)
468
AC_MSG_CHECKING("for kill switches")
469
if $ac_cv_path_KILL -0 $$
470
then
471
  CHECK_PID="$ac_cv_path_KILL -0 \$\$PID > /dev/null 2> /dev/null"
472
elif kill -s 0 $$
473
then
474
  CHECK_PID="$ac_cv_path_KILL -s 0 \$\$PID > /dev/null 2> /dev/null"
475
else
476
  AC_MSG_WARN([kill -0 to check for pid seems to fail])
477
    CHECK_PID="$ac_cv_path_KILL -s SIGCONT \$\$PID > /dev/null 2> /dev/null"
478
fi
479
AC_SUBST(CHECK_PID)
480
AC_MSG_RESULT("$CHECK_PID")
481
482
# We need an ANSI C compiler
483
AM_PROG_CC_STDC
484
485
# We need an assembler, too
486
AM_PROG_AS
487
CCASFLAGS="$CCASFLAGS $ASFLAGS"
488
489
# Check if we need noexec stack for assembler
490
AC_CHECK_NOEXECSTACK
491
492
if test "$am_cv_prog_cc_stdc" = "no"
493
then
91 by Brian Aker
Main binary now named drizzled
494
  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
495
fi
496
497
28.1.39 by Monty Taylor
Made everything use AS_HELP_STRING (except for charsets, which are dying anyway)
498
AC_ARG_WITH([server-suffix],
499
    [AS_HELP_STRING([--with-server-suffix],
500
      [Append value to the version string.])],
1 by brian
clean slate
501
    [ MYSQL_SERVER_SUFFIX=`echo "$withval" | sed -e  's/^\(...................................\)..*$/\1/'` ],
502
    [ MYSQL_SERVER_SUFFIX= ]
503
    )
504
AC_SUBST(MYSQL_SERVER_SUFFIX)
505
506
# 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)
507
AC_ARG_WITH([named-curses-libs],
508
    [AS_HELP_STRING([--with-named-curses-libs=ARG],
509
            [Use specified curses libraries instead of those
510
		automatically found by configure.])],
1 by brian
clean slate
511
    [ with_named_curses=$withval ],
512
    [ with_named_curses=no ]
513
    )
514
515
# compile with strings functions in assembler
28.1.39 by Monty Taylor
Made everything use AS_HELP_STRING (except for charsets, which are dying anyway)
516
AC_ARG_ENABLE([assembler],
517
    [AS_HELP_STRING([--enable-assembler],
518
	    [Use assembler versions of some string functions if available.])],
1 by brian
clean slate
519
    [ ENABLE_ASSEMBLER=$enableval ],
520
    [ ENABLE_ASSEMBLER=no ]
521
    )
522
523
AC_MSG_CHECKING(if we should use assembler functions)
524
# For now we only support assembler on i386 and sparc systems
525
AM_CONDITIONAL(ASSEMBLER_x86, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "i386" && $AS strings/strings-x86.s -o checkassembler >/dev/null 2>&1 && test -f checkassembler && (rm -f checkassembler; exit 0;))
526
AM_CONDITIONAL(ASSEMBLER_sparc32, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "sparc")
527
AM_CONDITIONAL(ASSEMBLER_sparc64, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "sparcv9")
528
AM_CONDITIONAL(ASSEMBLER, test "$ASSEMBLER_x86_TRUE" = "" -o "$ASSEMBLER_sparc32_TRUE" = "")
529
530
if test "$ASSEMBLER_TRUE" = ""
531
then
532
  AC_MSG_RESULT([yes])
533
else
534
  AC_MSG_RESULT([no])
535
fi
536
28.1.39 by Monty Taylor
Made everything use AS_HELP_STRING (except for charsets, which are dying anyway)
537
AC_ARG_WITH([tcp-port],
538
    [AS_HELP_STRING([--with-tcp-port=port-number],
165.1.1 by Elliot Murphy
new port number from IANA
539
            [Which port to use for Drizzle services @<:@default=4427@:>@])],
1 by brian
clean slate
540
    [ MYSQL_TCP_PORT=$withval ],
541
    [ MYSQL_TCP_PORT=$MYSQL_TCP_PORT_DEFAULT
542
      # if we actually defaulted (as opposed to the pathological case of
543
      # --with-tcp-port=<MYSQL_TCP_PORT_DEFAULT> which might in theory
544
      # happen if whole batch of servers was built from a script), set
545
      # the default to zero to indicate that; we don't lose information
546
      # that way, because 0 obviously indicates that we can get the
547
      # default value from MYSQL_TCP_PORT. this seems really evil, but
548
      # testing for MYSQL_TCP_PORT==MYSQL_TCP_PORT_DEFAULT would make a
549
      # a port of MYSQL_TCP_PORT_DEFAULT magic even if the builder did not
550
      # 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
551
      # from /etc/services if you can", but really, really meant 4427 when
552
      # they passed in 4427. When they pass in a specific value, let them
1 by brian
clean slate
553
      # have it; don't second guess user and think we know better, this will
554
      # just make people cross.  this makes the the logic work like this
555
      # (which is complicated enough):
556
      #
557
      # - if a port was set during build, use that as a default.
558
      #
559
      # - otherwise, try to look up a port in /etc/services; if that fails,
165.1.1 by Elliot Murphy
new port number from IANA
560
      #   use MYSQL_TCP_PORT_DEFAULT (at the time of this writing 4427)
1 by brian
clean slate
561
      #
562
      # - allow the MYSQL_TCP_PORT environment variable to override that.
563
      #
564
      # - allow command-line parameters to override all of the above.
565
      #
566
      # the top-most MYSQL_TCP_PORT_DEFAULT is read from win/configure.js,
567
      # so don't mess with that.
568
      MYSQL_TCP_PORT_DEFAULT=0 ]
569
    )
570
AC_SUBST(MYSQL_TCP_PORT)
571
# We might want to document the assigned port in the manual.
572
AC_SUBST(MYSQL_TCP_PORT_DEFAULT)
573
574
# Use this to set the place used for unix socket used to local communication.
28.1.39 by Monty Taylor
Made everything use AS_HELP_STRING (except for charsets, which are dying anyway)
575
AC_ARG_WITH([mysqld-user],
576
    [AS_HELP_STRING([--with-mysqld-user=username],
577
            [What user the mysqld daemon shall be run as.
578
		@<:@default=mysql@:>@])],
1 by brian
clean slate
579
    [ MYSQLD_USER=$withval ],
580
    [ MYSQLD_USER=mysql ]
581
    )
582
AC_SUBST(MYSQLD_USER)
583
584
# If we should allow LOAD DATA LOCAL
585
AC_MSG_CHECKING(If we should should enable LOAD DATA LOCAL by default)
586
AC_ARG_ENABLE(local-infile,
587
    [  --enable-local-infile   Enable LOAD DATA LOCAL INFILE (default: disabled)],
588
    [ ENABLED_LOCAL_INFILE=$enableval ],
589
    [ ENABLED_LOCAL_INFILE=no ]
590
    )
591
if test "$ENABLED_LOCAL_INFILE" = "yes"
592
then
593
  AC_MSG_RESULT([yes])
594
  AC_DEFINE([ENABLED_LOCAL_INFILE], [1],
595
            [If LOAD DATA LOCAL INFILE should be enabled by default])
596
else
597
  AC_MSG_RESULT([no])
598
fi
599
600
MYSQL_SYS_LARGEFILE
601
602
# Types that must be checked AFTER large file support is checked
603
AC_TYPE_SIZE_T
604
605
#--------------------------------------------------------------------
606
# Check for system header files
607
#--------------------------------------------------------------------
608
609
AC_HEADER_DIRENT
610
AC_HEADER_STDC
611
AC_HEADER_SYS_WAIT
53.2.2 by Monty Taylor
Updated everything that needs updating to compile with -std=gnu99 -pedantic
612
AC_HEADER_STDBOOL
77.1.22 by Monty Taylor
Removed refs to floatingpoint.h (which we only used for fconvert) and fconvert
613
AC_CHECK_HEADERS(fcntl.h float.h fpu_control.h ieeefp.h)
53.2.29 by Monty Taylor
Cleaned up headers a little more.
614
AC_CHECK_HEADERS(limits.h pwd.h select.h linux/config.h)
615
AC_CHECK_HEADERS(sys/fpu.h utime.h sys/utime.h )
616
AC_CHECK_HEADERS(synch.h sys/mman.h sys/socket.h netinet/in.h arpa/inet.h)
77.1.57 by Monty Taylor
Removed dual-compile needs on client.c. Get the symbols now from libdrizzle.
617
AC_CHECK_HEADERS(sys/timeb.h sys/vadvise.h sys/wait.h term.h)
53.2.29 by Monty Taylor
Cleaned up headers a little more.
618
AC_CHECK_HEADERS(termio.h termios.h sched.h crypt.h alloca.h)
619
AC_CHECK_HEADERS(sys/ioctl.h malloc.h sys/malloc.h sys/ipc.h sys/shm.h)
620
AC_CHECK_HEADERS(sys/prctl.h sys/resource.h sys/param.h port.h ieeefp.h)
621
AC_CHECK_HEADERS(execinfo.h)
1 by brian
clean slate
622
623
AC_CHECK_HEADERS([xfs/xfs.h])
77.1.62 by Monty Taylor
Added checks for libz and readline devel files.
624
77.1.31 by Monty Taylor
Replaced regex lib with pcre. Reworked mysqltest to use it.
625
#--------------------------------------------------------------------
1 by brian
clean slate
626
# Check for system libraries. Adds the library to $LIBS
627
# and defines HAVE_LIBM etc
628
#--------------------------------------------------------------------
629
630
AC_CHECK_LIB(m, floor, [], AC_CHECK_LIB(m, __infinity))
631
AC_CHECK_FUNCS(log2)
632
633
AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
634
AC_CHECK_FUNC(yp_get_default_domain, ,
635
  AC_CHECK_LIB(nsl, yp_get_default_domain))
636
AC_CHECK_FUNC(p2open, , AC_CHECK_LIB(gen, p2open))
637
# This may get things to compile even if bind-8 is installed
638
AC_CHECK_FUNC(bind, , AC_CHECK_LIB(bind, bind))
639
# Check if crypt() exists in libc or libcrypt, sets LIBS if needed
640
AC_SEARCH_LIBS(crypt, crypt, AC_DEFINE(HAVE_CRYPT, 1, [crypt]))
641
642
# Check rt for aio_read
643
AC_CHECK_LIB(rt, aio_read)
644
645
# For the sched_yield() function on Solaris
646
AC_CHECK_FUNC(sched_yield, , AC_CHECK_LIB(posix4, sched_yield,
647
[AC_DEFINE(HAVE_SCHED_YIELD) LIBS="$LIBS -lposix4"]))
648
649
if test "$ac_cv_header_termio_h" = "no" -a "$ac_cv_header_termios_h" = "no"
650
then
651
  AC_CHECK_FUNC(gtty, , AC_CHECK_LIB(compat, gtty))
652
fi
653
654
AC_CHECK_TYPES([int8, uint8, int16, uint16, int32, uint32, int64, uint64,
655
                uchar, uint, ulong],[],[], [
656
#include <sys/types.h>
657
])
658
AC_CHECK_TYPES([fp_except], [], [], [
659
#include <sys/types.h>
660
#include <ieeefp.h>
661
])
662
25 by Brian Aker
Clean up of configure.in
663
my_save_LIBS="$LIBS"
664
LIBS=""
665
AC_CHECK_LIB(dl,dlopen)
177.3.1 by mark
remove ifdef HAVE_DLOPEN, make configure require dlopen()
666
AC_CHECK_FUNCS(dlopen dlerror)
667
if test "$ac_cv_func_dlopen" != "yes"
668
then
669
  AC_MSG_ERROR([Drizzle requires dlopen])
670
fi
25 by Brian Aker
Clean up of configure.in
671
LIBDL=$LIBS
672
LIBS="$my_save_LIBS"
673
AC_SUBST(LIBDL)
674
675
AC_CHECK_FUNCS(strtok_r)
1 by brian
clean slate
676
677
# Build optimized or debug version ?
678
# First check for gcc and g++
28.1.33 by Monty Taylor
Added -Wall
679
if test "$ac_cv_c_compiler_gnu" = "yes"
1 by brian
clean slate
680
then
77.1.68 by Monty Taylor
Turned on -g and optimization for normal builds. -ggdb3 for gcc builds.
681
  SYMBOLS_CFLAGS="-ggdb3"
77.1.78 by Monty Taylor
One last bunch of warnings edits.
682
  DEBUG_OPTIMIZE_CC="-O0"
683
  OPTIMIZE_CFLAGS="-O2"
1 by brian
clean slate
684
else
77.1.68 by Monty Taylor
Turned on -g and optimization for normal builds. -ggdb3 for gcc builds.
685
  SYMBOLS_CFLAGS="-g"
1 by brian
clean slate
686
  DEBUG_OPTIMIZE_CC=""
687
  OPTIMIZE_CFLAGS="-O"
688
fi
689
if test "$ac_cv_prog_cxx_g" = "yes"
690
then
77.1.68 by Monty Taylor
Turned on -g and optimization for normal builds. -ggdb3 for gcc builds.
691
  SYMBOLS_CXXFLAGS="-ggdb3"
77.1.78 by Monty Taylor
One last bunch of warnings edits.
692
  DEBUG_OPTIMIZE_CXX="-O0"
693
  OPTIMIZE_CXXFLAGS="-O2"
1 by brian
clean slate
694
else
77.1.68 by Monty Taylor
Turned on -g and optimization for normal builds. -ggdb3 for gcc builds.
695
  SYMBOLS_CXXFLAGS="-g"
1 by brian
clean slate
696
  DEBUG_OPTIMIZE_CXX=""
697
  OPTIMIZE_CXXFLAGS="-O"
698
fi
699
700
# If the user specified CFLAGS, we won't add any optimizations
701
if test -n "$SAVE_CFLAGS"
702
then
703
  OPTIMIZE_CFLAGS=""
704
  DEBUG_OPTIMIZE_CC=""
705
fi
706
# Ditto for CXXFLAGS
707
if test -n "$SAVE_CXXFLAGS"
708
then
709
  OPTIMIZE_CXXFLAGS=""
710
  DEBUG_OPTIMIZE_CXX=""
711
fi
712
77.1.68 by Monty Taylor
Turned on -g and optimization for normal builds. -ggdb3 for gcc builds.
713
CFLAGS="${SYMBOLS_CFLAGS} ${CFLAGS}"
714
CXXFLAGS="${SYMBOLS_CXXFLAGS} ${CXXFLAGS}"
715
1 by brian
clean slate
716
AC_ARG_WITH([fast-mutexes],
28.1.39 by Monty Taylor
Made everything use AS_HELP_STRING (except for charsets, which are dying anyway)
717
    [AS_HELP_STRING([--with-fast-mutexes],
718
	    [Compile with fast mutexes  @<:@default=off@:>@])],
719
    [with_fast_mutexes=$withval],
720
    [with_fast_mutexes=no])
1 by brian
clean slate
721
722
if test "$with_fast_mutexes" != "no"
723
then
51.3.26 by Jay Pipes
Final removal of DBUG library and cleanup of Makefiles
724
	AC_DEFINE([MY_PTHREAD_FASTMUTEX], [1], 
725
			[Define to 1 if you want to use fast mutexes])
1 by brian
clean slate
726
fi
727
28.1.39 by Monty Taylor
Made everything use AS_HELP_STRING (except for charsets, which are dying anyway)
728
AC_ARG_WITH([comment],
729
    [AS_HELP_STRING([--with-comment],
730
            [Comment about compilation environment. @<:@default=off@:>@])],
1 by brian
clean slate
731
    [with_comment=$withval],
732
    [with_comment=no])
733
if test "$with_comment" != "no"
734
then
735
  COMPILATION_COMMENT=$with_comment
736
else
737
  COMPILATION_COMMENT="Source distribution"
738
fi
739
AC_SUBST(COMPILATION_COMMENT)
740
77.1.96 by Monty Taylor
Removed skip-external-locking.
741
if expr "$target_os" : "[[Ll]]inux.*" > /dev/null
742
then
743
  TARGET_LINUX="true"
744
  AC_DEFINE([TARGET_OS_LINUX], [1], [Whether we build for Linux])
745
else
746
  TARGET_LINUX="false"
747
fi
748
1 by brian
clean slate
749
dnl Checks for typedefs, structures, and compiler characteristics.
750
AC_C_CONST
751
AC_C_INLINE
752
AC_TYPE_OFF_T
753
AC_HEADER_TIME
754
AC_STRUCT_TM
755
MYSQL_NEEDS_MYSYS_NEW
756
# AC_CHECK_SIZEOF return 0 when it does not find the size of a
757
# type. We want a error instead.
758
AC_CHECK_SIZEOF(char, 1)
759
if test "$ac_cv_sizeof_char" -eq 0
760
then
77.1.28 by Monty Taylor
Removed a crapload of files I hate.
761
  AC_MSG_ERROR([No size for char type.])
1 by brian
clean slate
762
fi
763
AC_CHECK_SIZEOF(char*, 4)
764
AC_CHECK_SIZEOF(short, 2)
765
AC_CHECK_SIZEOF(int, 4)
766
if test "$ac_cv_sizeof_int" -eq 0
767
then
768
  AC_MSG_ERROR("No size for int type.")
769
fi
770
AC_CHECK_SIZEOF(long, 4)
771
if test "$ac_cv_sizeof_long" -eq 0
772
then
773
  AC_MSG_ERROR("No size for long type.")
774
fi
775
AC_CHECK_SIZEOF(long long, 8)
776
if test "$ac_cv_sizeof_long_long" -eq 0
777
then
91 by Brian Aker
Main binary now named drizzled
778
  AC_MSG_ERROR("Drizzle needs a long long type.")
1 by brian
clean slate
779
fi
780
# off_t is not a builtin type
781
AC_CHECK_SIZEOF(off_t, 4)
782
if test "$ac_cv_sizeof_off_t" -eq 0
783
then
91 by Brian Aker
Main binary now named drizzled
784
  AC_MSG_ERROR("Drizzle needs a off_t type.")
1 by brian
clean slate
785
fi
786
787
dnl
788
dnl check if time_t is unsigned
789
dnl
790
791
MYSQL_CHECK_TIME_T
792
793
794
# do we need #pragma interface/#pragma implementation ?
795
# yes if it's gcc 2.x, and not icc pretending to be gcc, and not cygwin
796
AC_MSG_CHECKING(the need for @%:@pragma interface/implementation)
797
# instead of trying to match SYSTEM_TYPE and CC_VERSION (that doesn't
798
# follow any standard), we'll use well-defined preprocessor macros:
28.1.33 by Monty Taylor
Added -Wall
799
AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
1 by brian
clean slate
800
#if !defined(__CYGWIN__) && !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ < 3)
801
#error USE_PRAGMA_IMPLEMENTATION
802
#endif
28.1.33 by Monty Taylor
Added -Wall
803
]])],[AC_MSG_RESULT(no) ],[AC_MSG_RESULT(yes) ; CXXFLAGS="$CXXFLAGS -DUSE_PRAGMA_IMPLEMENTATION"])
1 by brian
clean slate
804
805
# This always gives a warning. Ignore it unless you are cross compiling
806
AC_C_BIGENDIAN
807
#---START: Used in for client configure
808
# Check base type of last arg to accept
809
MYSQL_TYPE_ACCEPT
810
#---END:
811
# Figure out what type of struct rlimit to use with setrlimit
812
MYSQL_TYPE_STRUCT_RLIMIT
813
# Find where the stack goes
814
MYSQL_STACK_DIRECTION
815
# We want to skip alloca on irix unconditionally. It may work on some version..
816
MYSQL_FUNC_ALLOCA
817
# Do struct timespec have members tv_sec or ts_sec
818
MYSQL_TIMESPEC_TS
819
# Do we have the tzname variable
820
MYSQL_TZNAME
821
# Do the c++ compiler have a bool type
822
MYSQL_CXX_BOOL
823
AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>])
824
AC_CHECK_TYPES([size_t], [], [], [#include <stdio.h>])
825
AC_CHECK_TYPES([u_int32_t])
826
827
MYSQL_PTHREAD_YIELD
828
829
######################################################################
830
# For readline/libedit (We simply move the mimimum amount of stuff from
831
# the readline/libedit configure.in here)
832
833
dnl Checks for header files.
834
AC_CHECK_HEADERS(malloc.h sys/cdefs.h)
835
836
dnl Checks for library functions.
837
AC_FUNC_ALLOCA
838
AC_PROG_GCC_TRADITIONAL
839
AC_TYPE_SIGNAL
840
AC_CHECK_FUNCS(re_comp regcomp strdup)
841
842
dnl Sun compilers have their own vis.h that is about something
843
dnl totally different. So, not to change the libedit source, we
844
dnl do some additional checks before we define HAVE_VIS_H.
845
AC_CHECK_HEADER(vis.h,
846
  [AC_CHECK_FUNC(strvis,
847
    [AC_DEFINE([HAVE_VIS_H], [1],[Found vis.h and the strvis() function])])])
848
849
AC_CHECK_FUNCS(strlcat strlcpy)
850
AC_CHECK_FUNCS(issetugid)
851
AC_CHECK_FUNCS(getline flockfile)
852
853
# from old readline settting:
854
855
MAKE_SHELL=/bin/sh
856
AC_SUBST(MAKE_SHELL)
857
858
# Already-done: stdlib.h string.h unistd.h termios.h
859
AC_CHECK_HEADERS(varargs.h stdarg.h dirent.h locale.h ndir.h sys/dir.h \
860
 sys/file.h sys/ndir.h sys/ptem.h sys/pte.h sys/select.h sys/stream.h \
861
 sys/mman.h curses.h termcap.h termio.h termbits.h asm/termbits.h grp.h \
862
paths.h semaphore.h)
863
864
# Already-done: strcasecmp
865
AC_CHECK_FUNCS(lstat putenv select setenv setlocale strcoll tcgetattr)
866
28.1.33 by Monty Taylor
Added -Wall
867
AC_HEADER_STAT
1 by brian
clean slate
868
MYSQL_SIGNAL_CHECK
869
MYSQL_CHECK_GETPW_FUNCS
870
MYSQL_HAVE_TIOCGWINSZ
871
MYSQL_HAVE_FIONREAD
872
MYSQL_HAVE_TIOCSTAT
873
MYSQL_STRUCT_DIRENT_D_INO
874
MYSQL_STRUCT_DIRENT_D_NAMLEN
875
MYSQL_TYPE_SIGHANDLER
876
MYSQL_CHECK_MULTIBYTE
877
if test "$with_named_curses" = "no"
878
then
879
  MYSQL_CHECK_LIB_TERMCAP
880
else
881
  TERMCAP_LIB="$with_named_curses"
882
fi
883
AC_SUBST(TERMCAP_LIB)
884
885
# Check if the termcap function 'tgoto' is already declared in
886
# system header files or if it need to be declared locally
887
AC_CHECK_DECLS(tgoto,,,[
888
#ifdef HAVE_CURSES_H
889
# include <curses.h>
890
#elif HAVE_NCURSES_H
891
# include <ncurses.h>
892
#endif
893
#ifdef HAVE_TERM_H
894
# include <term.h>
895
#endif
896
])
897
898
# End of readline/libedit stuff
899
#########################################################################
900
901
dnl Checks for library functions.
902
903
#
904
# The following code disables intrinsic function support while we test for
905
# library functions.  This is to avoid configure problems with Intel ecc
906
# compiler
907
908
ORG_CFLAGS="$CFLAGS"
909
if test "$GCC" != "yes"; then
910
  AC_SYS_COMPILER_FLAG(-nolib_inline,nolib_inline,CFLAGS,[],[])
911
fi
912
913
#AC_FUNC_MMAP
914
AC_TYPE_SIGNAL
915
MYSQL_TYPE_QSORT
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
53.2.16 by Monty Taylor
Removed my_alarm. Made my_lock only do the non-alarm version. Moved my_lock to MyISAM where it belongs.
925
AC_CHECK_FUNCS(bcmp bfill bmove bsearch bzero \
77.1.24 by Monty Taylor
Removed non-fcntl code and made it a fatal configure error if it's not there.
926
  cuserid fchmod \
77.1.22 by Monty Taylor
Removed refs to floatingpoint.h (which we only used for fconvert) and fconvert
927
  fdatasync finite fpresetsticky fpsetmask fsync ftruncate \
1 by brian
clean slate
928
  getcwd getpass getpassphrase getpwnam \
929
  getpwuid getrlimit getrusage getwd index initgroups isnan \
930
  localtime_r gethrtime gmtime_r \
931
  locking longjmp lrand48 madvise mallinfo memcpy memmove \
932
  mkstemp mlockall perror poll pread pthread_attr_create mmap mmap64 getpagesize \
933
  pthread_attr_getstacksize pthread_attr_setprio pthread_attr_setschedparam \
934
  pthread_attr_setstacksize pthread_condattr_create pthread_getsequence_np \
935
  pthread_key_delete pthread_rwlock_rdlock pthread_setprio \
936
  pthread_setprio_np pthread_setschedparam pthread_sigmask readlink \
937
  realpath rename rint rwlock_init setupterm \
938
  shmget shmat shmdt shmctl sigaction sigemptyset sigaddset \
939
  sighold sigset sigthreadmask port_create sleep \
940
  snprintf socket stpcpy strcasecmp strerror strsignal strnlen strpbrk strstr \
6 by Brian Aker
Second pass on pthread cleanup
941
  strtol strtoll strtoul strtoull tell tempnam vidattr \
1 by brian
clean slate
942
  posix_fallocate backtrace backtrace_symbols backtrace_symbols_fd)
943
28.1.33 by Monty Taylor
Added -Wall
944
# Check that isinf() is available in math.h and can be used in both C and C++
1 by brian
clean slate
945
# code
28.1.33 by Monty Taylor
Added -Wall
946
AC_MSG_CHECKING(for isinf in math.h)
947
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]], [[
948
    float f = 0.0; 
949
    int r = isinf(f); 
950
    return r;
951
  ]])],[
1 by brian
clean slate
952
    AC_MSG_RESULT(yes)
28.1.33 by Monty Taylor
Added -Wall
953
    AC_MSG_CHECKING(whether isinf() can be used in C++ code)
954
    AC_LANG_PUSH([C++])
955
    AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]], [[
956
      float f = 0.0;
957
      int r = isinf(f);
958
      return r;
959
    ]])],[
960
      AC_MSG_RESULT(yes)
961
      AC_DEFINE(HAVE_ISINF, [1], [isinf() macro or function])
962
    ],[
963
      AC_MSG_RESULT(no)
964
    ])
965
    AC_LANG_POP([])
966
  ],[
967
  AC_MSG_RESULT(no)])
968
969
1 by brian
clean slate
970
CFLAGS="$ORG_CFLAGS"
971
972
# Sanity check: We chould not have any fseeko symbol unless
973
# large_file_support=yes
974
AC_CHECK_FUNC(fseeko,
975
[if test "$large_file_support" = no -a "$TARGET_LINUX" = "true";
976
then
977
  AC_MSG_ERROR("Found fseeko symbol but large_file_support is not enabled!")
978
fi]
979
)
980
981
# Check definition of pthread_getspecific
982
AC_CACHE_CHECK("args to pthread_getspecific", mysql_cv_getspecific_args,
28.1.33 by Monty Taylor
Added -Wall
983
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if !defined(_REENTRANT)
1 by brian
clean slate
984
#define _REENTRANT
985
#endif
986
#define _POSIX_PTHREAD_SEMANTICS 
28.1.33 by Monty Taylor
Added -Wall
987
#include <pthread.h> ]], [[ void *pthread_getspecific(pthread_key_t key);
988
pthread_getspecific((pthread_key_t) NULL); ]])],[mysql_cv_getspecific_args=POSIX],[mysql_cv_getspecific_args=other]))
1 by brian
clean slate
989
  if test "$mysql_cv_getspecific_args" = "other"
990
  then
991
    AC_DEFINE([HAVE_NONPOSIX_PTHREAD_GETSPECIFIC], [1],
992
              [For some non posix threads])
993
  fi
994
995
  # Check definition of pthread_mutex_init
996
  AC_CACHE_CHECK("args to pthread_mutex_init", mysql_cv_mutex_init_args,
28.1.33 by Monty Taylor
Added -Wall
997
  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#define _REENTRANT
1 by brian
clean slate
998
#define _POSIX_PTHREAD_SEMANTICS 
28.1.33 by Monty Taylor
Added -Wall
999
#include <pthread.h> ]], [[ 
1 by brian
clean slate
1000
  pthread_mutexattr_t attr;
1001
  pthread_mutex_t mp;
28.1.33 by Monty Taylor
Added -Wall
1002
  pthread_mutex_init(&mp,&attr); ]])],[mysql_cv_mutex_init_args=POSIX],[mysql_cv_mutex_init_args=other]))
1 by brian
clean slate
1003
  if test "$mysql_cv_mutex_init_args" = "other"
1004
  then
1005
    AC_DEFINE([HAVE_NONPOSIX_PTHREAD_MUTEX_INIT], [1],
1006
              [For some non posix threads])
1007
  fi
1008
#---END:
1009
1010
#---START: Used in for client configure
1011
# Check definition of readdir_r
1012
AC_CACHE_CHECK("args to readdir_r", mysql_cv_readdir_r,
28.1.33 by Monty Taylor
Added -Wall
1013
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define _REENTRANT
1 by brian
clean slate
1014
#define _POSIX_PTHREAD_SEMANTICS 
1015
#include <pthread.h>
28.1.33 by Monty Taylor
Added -Wall
1016
#include <dirent.h>]], [[ int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result);
1017
readdir_r((DIR *) NULL, (struct dirent *) NULL, (struct dirent **) NULL); ]])],[mysql_cv_readdir_r=POSIX],[mysql_cv_readdir_r=other]))
1 by brian
clean slate
1018
if test "$mysql_cv_readdir_r" = "POSIX"
1019
then
1020
  AC_DEFINE([HAVE_READDIR_R], [1], [POSIX readdir_r])
1021
fi
1022
1023
# Check definition of posix sigwait()
1024
AC_CACHE_CHECK("style of sigwait", mysql_cv_sigwait,
28.1.33 by Monty Taylor
Added -Wall
1025
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define _REENTRANT
1 by brian
clean slate
1026
#define _POSIX_PTHREAD_SEMANTICS 
1027
#include <pthread.h>
28.1.33 by Monty Taylor
Added -Wall
1028
#include <signal.h>]], [[#ifndef _AIX
1 by brian
clean slate
1029
sigset_t set;
1030
int sig;
1031
sigwait(&set,&sig);
28.1.33 by Monty Taylor
Added -Wall
1032
#endif]])],[mysql_cv_sigwait=POSIX],[mysql_cv_sigwait=other]))
1 by brian
clean slate
1033
if test "$mysql_cv_sigwait" = "POSIX"
1034
then
1035
  AC_DEFINE([HAVE_SIGWAIT], [1], [POSIX sigwait])
1036
fi
1037
1038
if test "$mysql_cv_sigwait" != "POSIX"
1039
then
1040
unset mysql_cv_sigwait
1041
# Check definition of posix sigwait()
1042
AC_CACHE_CHECK("style of sigwait", mysql_cv_sigwait,
28.1.33 by Monty Taylor
Added -Wall
1043
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define _REENTRANT
1 by brian
clean slate
1044
#define _POSIX_PTHREAD_SEMANTICS 
1045
#include <pthread.h>
28.1.33 by Monty Taylor
Added -Wall
1046
#include <signal.h>]], [[sigset_t set;
1 by brian
clean slate
1047
int sig;
28.1.33 by Monty Taylor
Added -Wall
1048
sigwait(&set);]])],[mysql_cv_sigwait=NONPOSIX],[mysql_cv_sigwait=other]))
1 by brian
clean slate
1049
if test "$mysql_cv_sigwait" = "NONPOSIX"
1050
then
1051
  AC_DEFINE([HAVE_NONPOSIX_SIGWAIT], [1], [sigwait with one argument])
1052
fi
1053
fi
1054
#---END:
1055
1056
# Check if pthread_attr_setscope() exists
1057
AC_CACHE_CHECK("for pthread_attr_setscope", mysql_cv_pthread_attr_setscope,
28.1.33 by Monty Taylor
Added -Wall
1058
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define _REENTRANT
1 by brian
clean slate
1059
#define _POSIX_PTHREAD_SEMANTICS 
28.1.33 by Monty Taylor
Added -Wall
1060
#include <pthread.h>]], [[pthread_attr_t thr_attr;
1061
pthread_attr_setscope(&thr_attr,0);]])],[mysql_cv_pthread_attr_setscope=yes],[mysql_cv_pthread_attr_setscope=no]))
1 by brian
clean slate
1062
if test "$mysql_cv_pthread_attr_setscope" = "yes"
1063
then
1064
  AC_DEFINE([HAVE_PTHREAD_ATTR_SETSCOPE], [1], [pthread_attr_setscope])
1065
fi
1066
1067
# Check for bad includes
1068
AC_MSG_CHECKING("can netinet files be included")
28.1.33 by Monty Taylor
Added -Wall
1069
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
1 by brian
clean slate
1070
#include <sys/socket.h>
1071
#include <netinet/in_systm.h>
1072
#include <netinet/in.h>
1073
#include <netinet/ip.h>
28.1.33 by Monty Taylor
Added -Wall
1074
#include <netinet/tcp.h>]], [[ printf("1\n"); ]])],[netinet_inc=yes],[netinet_inc=no])
1 by brian
clean slate
1075
if test "$netinet_inc" = "no"
1076
then
1077
  AC_DEFINE([HAVE_BROKEN_NETINET_INCLUDES], [1], [Can netinet be included])
1078
fi
1079
AC_MSG_RESULT("$netinet_inc")
1080
28.1.33 by Monty Taylor
Added -Wall
1081
AC_LANG_PUSH([C++])
1 by brian
clean slate
1082
AC_CHECK_HEADERS(cxxabi.h)
1083
AC_CACHE_CHECK([checking for abi::__cxa_demangle], mysql_cv_cxa_demangle,
28.1.33 by Monty Taylor
Added -Wall
1084
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <cxxabi.h>]], [[
1 by brian
clean slate
1085
  char *foo= 0; int bar= 0;
1086
  foo= abi::__cxa_demangle(foo, foo, 0, &bar);
28.1.33 by Monty Taylor
Added -Wall
1087
]])],[mysql_cv_cxa_demangle=yes],[mysql_cv_cxa_demangle=no])])
1088
AC_LANG_POP([])
1 by brian
clean slate
1089
1090
if test "x$mysql_cv_cxa_demangle" = xyes; then
1091
  AC_DEFINE(HAVE_ABI_CXA_DEMANGLE, 1,
1092
            [Define to 1 if you have the `abi::__cxa_demangle' function.])
1093
fi
1094
1095
#--------------------------------------------------------------------
1096
# Check for requested features
1097
#--------------------------------------------------------------------
1098
1099
MYSQL_CHECK_BIG_TABLES
1100
MYSQL_CHECK_MAX_INDEXES
1101
MYSQL_CHECK_VIO
1102
1103
#--------------------------------------------------------------------
1104
# Declare our plugin modules
1105
# Has to be done late, as the plugin may need to check for existence of
1106
# functions tested above
1107
#--------------------------------------------------------------------
1108
1109
MYSQL_CONFIGURE_PLUGINS([none])
1110
1111
AC_SUBST(mysql_plugin_dirs)
1112
AC_SUBST(mysql_plugin_libs)
1113
AC_SUBST(mysql_plugin_defs)
1114
189 by Brian Aker
Refactor of configure.ac. Added profile. One note... I believe this should
1115
AC_ARG_ENABLE([profiling],
1116
    [AS_HELP_STRING([--enable-profiling],
1117
       [Toggle profiling @<:@default=off@:>@])],
1118
    [ac_profiling="$enableval"],
1119
    [ac_profiling="no"])
1120
1121
AC_ARG_ENABLE([coverage],
1122
    [AS_HELP_STRING([--enable-coverage],
1123
       [Toggle coverage @<:@default=off@:>@])],
1124
    [ac_coverage="$enableval"],
1125
    [ac_coverage="no"])
1126
53.2.1 by Monty Taylor
Added --disable-pedantic-warnings and --enable-fail.
1127
AC_ARG_ENABLE([pedantic-warnings],
1128
    [AS_HELP_STRING([--disable-pedantic-warnings],
1129
       [Toggle pedanticness @<:@default=on@:>@])],
1130
    [ac_warn_pedantic="$enableval"],
1131
    [ac_warn_pedantic="yes"])
1132
1133
AC_ARG_ENABLE([fail],
77.1.112 by Monty Taylor
Fixed comment on --enable-fail -> --disable-fail.
1134
    [AS_HELP_STRING([--disable-fail],
1135
       [Turn warnings into failures @<:@default=on@:>@])],
53.2.1 by Monty Taylor
Added --disable-pedantic-warnings and --enable-fail.
1136
    [ac_warn_fail="$enableval"],
77.1.108 by Monty Taylor
Turn on -Werror again by default.
1137
    [ac_warn_fail="yes"])
53.2.1 by Monty Taylor
Added --disable-pedantic-warnings and --enable-fail.
1138
53.2.6 by Monty Taylor
Turned unreachable code warnings into a configure option.
1139
AC_ARG_ENABLE([unreachable],
1140
    [AS_HELP_STRING([--enable-unreachable],
1141
       [Enable warnings about unreachable code @<:@default=off@:>@])],
1142
    [ac_warn_unreachable="$enableval"],
1143
    [ac_warn_unreachable="no"])
1144
77.1.109 by Monty Taylor
Made --disable-pedantic-warnings only disable the pedantic warnings, rather than also removing the -std=gnu99 part.
1145
AC_ARG_ENABLE([longlong-warnings],
1146
    [AS_HELP_STRING([--enable-longlong-warnings],
1147
       [Enable warnings about longlong in C++ @<:@default=off@:>@])],
1148
    [ac_warn_longlong="$enableval"],
1149
    [ac_warn_longlong="no"])
1150
1151
AC_ARG_ENABLE([strict-aliasing],
1152
    [AS_HELP_STRING([--enable-strict-aliasing],
1153
       [Enable warnings about stict-aliasing @<:@default=off@:>@])],
1154
    [ac_warn_strict_aliasing="$enableval"],
1155
    [ac_warn_strict_aliasing="no"])
1156
53.2.2 by Monty Taylor
Updated everything that needs updating to compile with -std=gnu99 -pedantic
1157
53.2.1 by Monty Taylor
Added --disable-pedantic-warnings and --enable-fail.
1158
if test "$GCC" = "yes"
1159
then
53.2.2 by Monty Taylor
Updated everything that needs updating to compile with -std=gnu99 -pedantic
1160
77.1.109 by Monty Taylor
Made --disable-pedantic-warnings only disable the pedantic warnings, rather than also removing the -std=gnu99 part.
1161
  if test "$ac_warn_longlong" = "yes"
1162
  then
1163
    W_LONGLONG="-Wlong-long"
1164
  else
1165
    W_LONGLONG="-Wno-long-long"
1166
  fi
53.2.1 by Monty Taylor
Added --disable-pedantic-warnings and --enable-fail.
1167
77.1.109 by Monty Taylor
Made --disable-pedantic-warnings only disable the pedantic warnings, rather than also removing the -std=gnu99 part.
1168
  if test "$ac_warn_strict_aliasing" = "yes"
1169
  then
1170
    W_STRICT_ALIASING="-Wstrict-aliasing"
1171
  else
77.1.110 by Monty Taylor
Fixed a typo.
1172
    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.
1173
  fi
53.2.1 by Monty Taylor
Added --disable-pedantic-warnings and --enable-fail.
1174
189 by Brian Aker
Refactor of configure.ac. Added profile. One note... I believe this should
1175
  if test "$ac_profiling" = "yes"
1176
  then
1177
    GPROF_PROFILING="-pg"
1178
  else
1179
    GPROF_PROFILING=" "
1180
  fi
1181
1182
  if test "$ac_coverage" = "yes"
1183
  then
1184
    GPROF_COVERAGE="-fprofile-arcs -ftest-coverage"
1185
  else
1186
    GPROF_COVERAGE=" "
1187
  fi
1188
53.2.1 by Monty Taylor
Added --disable-pedantic-warnings and --enable-fail.
1189
  if test "$ac_warn_pedantic" = "yes"
1190
  then
77.1.109 by Monty Taylor
Made --disable-pedantic-warnings only disable the pedantic warnings, rather than also removing the -std=gnu99 part.
1191
    GCC_PEDANTIC="-pedantic -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls ${W_STRICT_ALIASING}"
1192
    GXX_PEDANTIC="-pedantic -Wundef -Wredundant-decls ${W_LONGLONG} ${W_STRICT_ALIASING}"
53.2.1 by Monty Taylor
Added --disable-pedantic-warnings and --enable-fail.
1193
  fi
1194
53.2.6 by Monty Taylor
Turned unreachable code warnings into a configure option.
1195
  if test "$ac_warn_unreachable" = "yes"
1196
  then
77.1.109 by Monty Taylor
Made --disable-pedantic-warnings only disable the pedantic warnings, rather than also removing the -std=gnu99 part.
1197
    W_UNREACHABLE="-Wunreachable-code"
53.2.6 by Monty Taylor
Turned unreachable code warnings into a configure option.
1198
  fi
1199
53.2.1 by Monty Taylor
Added --disable-pedantic-warnings and --enable-fail.
1200
  if test "$ac_warn_fail" = "yes"
1201
  then
77.1.109 by Monty Taylor
Made --disable-pedantic-warnings only disable the pedantic warnings, rather than also removing the -std=gnu99 part.
1202
    W_FAIL="-Werror"
53.2.1 by Monty Taylor
Added --disable-pedantic-warnings and --enable-fail.
1203
  fi
1204
77.1.109 by Monty Taylor
Made --disable-pedantic-warnings only disable the pedantic warnings, rather than also removing the -std=gnu99 part.
1205
  BASE_WARNINGS="-W -Wall -Wextra"
189 by Brian Aker
Refactor of configure.ac. Added profile. One note... I believe this should
1206
  GCC_WARNINGS="${BASE_WARNINGS} -std=gnu99 ${GCC_PEDANTIC} ${W_UNREACHABLE} ${W_FAIL} ${GPROF_PROFILING} ${GPROF_COVERAGE}"
1207
  GXX_WARNINGS="${BASE_WARNINGS} -std=gnu++98 ${GXX_PEDANTIC} ${W_UNREACHABLE} ${W_FAIL} ${GPROF_PROFILING} ${GPROF_COVERAGE}"
77.1.109 by Monty Taylor
Made --disable-pedantic-warnings only disable the pedantic warnings, rather than also removing the -std=gnu99 part.
1208
1209
  CXXFLAGS="$CXXFLAGS ${GXX_WARNINGS}"
1210
  CFLAGS="$CFLAGS ${GCC_WARNINGS} "
53.2.1 by Monty Taylor
Added --disable-pedantic-warnings and --enable-fail.
1211
fi
1212
1 by brian
clean slate
1213
# Some usefull subst
1214
AC_SUBST(CC)
1215
AC_SUBST(GXX)
1216
1217
# Set configuration options for make_binary_distribution
1218
case $SYSTEM_TYPE in
1219
  *netware*)
1220
    MAKE_BINARY_DISTRIBUTION_OPTIONS="$MAKE_BINARY_DISTRIBUTION_OPTIONS --no-strip"
1221
    ;;
1222
  *)
1223
    : # no change for other platforms yet
1224
    ;;
1225
esac
1226
AC_SUBST(MAKE_BINARY_DISTRIBUTION_OPTIONS)
1227
28.1.2 by Monty Taylor
First stab at back porting libtool convenience lib patch from telco-6.2
1228
AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile mysys/tests/Makefile dnl
77.1.31 by Monty Taylor
Replaced regex lib with pcre. Reworked mysqltest to use it.
1229
 strings/Makefile strings/tests/Makefile storage/Makefile dnl
13 by brian
Incomming patch to clean up build.
1230
 vio/Makefile dnl
77.1.38 by Monty Taylor
Renamed more stuff to drizzle.
1231
 libdrizzle/Makefile client/Makefile dnl
54.1.3 by Stewart Smith
sql => server (initial patch)
1232
 server/Makefile server/share/Makefile dnl
77.1.52 by Monty Taylor
And reference to it in the configure script.
1233
 server/sql_builtin.cc dnl
51.3.26 by Jay Pipes
Final removal of DBUG library and cleanup of Makefiles
1234
 include/Makefile dnl
28.1.31 by Monty Taylor
Deleted tons of pointless garbage from scripts.
1235
 support-files/Makefile dnl
77.1.47 by Monty Taylor
Moved test to tests...
1236
 tests/Makefile tests/install_test_db dnl
77.1.39 by Monty Taylor
More mysql->drizzle renaming.
1237
 include/drizzle_version.h plugin/Makefile dnl
54.1.6 by Stewart Smith
merge mainline
1238
 server/drizzled_safe support-files/libdrizzle.pc dnl
77.1.38 by Monty Taylor
Renamed more stuff to drizzle.
1239
 support-files/drizzle.server support-files/drizzle-log-rotate)
1 by brian
clean slate
1240
1241
AC_CONFIG_COMMANDS([default], , test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h)
1242
1243
# Ensure that table handlers gets all modifications to CFLAGS/CXXFLAGS
1244
AC_CONFIG_COMMANDS_POST(ac_configure_args="$ac_configure_args CFLAGS='$CFLAGS' CXXFLAGS='$CXXFLAGS'")
1245
1246
AC_OUTPUT