1
1
# Local macros for automake & autoconf
3
#---START: Used in for client configure
4
AC_DEFUN([DRIZZLE_TYPE_ACCEPT],
5
[ac_save_CXXFLAGS="$CXXFLAGS"
6
AC_CACHE_CHECK([base type of last arg to accept], mysql_cv_btype_last_arg_accept,
8
if test "$ac_cv_prog_gxx" = "yes"
10
# Add -Werror, remove -fbranch-probabilities (Bug #268)
11
CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed -e 's/-fbranch-probabilities//; s/-Wall//; s/-Wcheck//'`
13
mysql_cv_btype_last_arg_accept=none
14
[AC_TRY_COMPILE([#if defined(inline)
18
#include <sys/types.h>
19
#include <sys/socket.h>
21
[int a = accept(1, (struct sockaddr *) 0, (socklen_t *) 0); return (a != 0);],
22
mysql_cv_btype_last_arg_accept=socklen_t)]
23
if test "$mysql_cv_btype_last_arg_accept" = "none"; then
24
[AC_TRY_COMPILE([#if defined(inline)
28
#include <sys/types.h>
29
#include <sys/socket.h>
31
[int a = accept(1, (struct sockaddr *) 0, (size_t *) 0); return (a != 0);],
32
mysql_cv_btype_last_arg_accept=size_t)]
34
if test "$mysql_cv_btype_last_arg_accept" = "none"; then
35
mysql_cv_btype_last_arg_accept=int
38
AC_DEFINE_UNQUOTED([SOCKET_SIZE_TYPE], [$mysql_cv_btype_last_arg_accept],
39
[The base type of the last arg to accept])
40
CXXFLAGS="$ac_save_CXXFLAGS"
44
dnl Find type of qsort
45
AC_DEFUN([DRIZZLE_TYPE_QSORT],
46
[AC_CACHE_CHECK([return type of qsort], mysql_cv_type_qsort,
47
[AC_TRY_COMPILE([#include <stdlib.h>
51
void qsort(void *base, size_t nel, size_t width,
52
int (*compar) (const void *, const void *));
54
[int i;], mysql_cv_type_qsort=void, mysql_cv_type_qsort=int)])
55
AC_DEFINE_UNQUOTED([RETQSORTTYPE], [$mysql_cv_type_qsort],
56
[The return type of qsort (int or void).])
57
if test "$mysql_cv_type_qsort" = "void"
59
AC_DEFINE_UNQUOTED([QSORT_TYPE_IS_VOID], [1], [qsort returns void])
63
#---START: Figure out whether to use 'struct rlimit' or 'struct rlimit64'
64
AC_DEFUN([DRIZZLE_TYPE_STRUCT_RLIMIT],
65
[ac_save_CXXFLAGS="$CXXFLAGS"
66
AC_CACHE_CHECK([struct type to use with setrlimit], mysql_cv_btype_struct_rlimit,
68
if test "$ac_cv_prog_gxx" = "yes"
70
# Add -Werror, remove -fbranch-probabilities (Bug #268)
71
CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed -e 's/-fbranch-probabilities//; s/-Wall//; s/-Wcheck//'`
73
mysql_cv_btype_struct_rlimit=none
74
[AC_TRY_COMPILE([#if defined(inline)
78
#include <sys/resource.h>
80
[struct rlimit64 rl; setrlimit(RLIMIT_CORE, &rl);],
81
mysql_cv_btype_struct_rlimit="struct rlimit64")]
82
if test "$mysql_cv_btype_struct_rlimit" = "none"; then
83
mysql_cv_btype_struct_rlimit="struct rlimit"
86
AC_DEFINE_UNQUOTED([STRUCT_RLIMIT], [$mysql_cv_btype_struct_rlimit],
87
[The struct rlimit type to use with setrlimit])
88
CXXFLAGS="$ac_save_CXXFLAGS"
92
AC_DEFUN([DRIZZLE_TIMESPEC_TS],
93
[AC_CACHE_CHECK([if struct timespec has a ts_sec member], mysql_cv_timespec_ts,
94
[AC_TRY_COMPILE([#include <pthread.h>
99
[struct timespec abstime;
101
abstime.ts_sec = time(NULL)+1;
103
], mysql_cv_timespec_ts=yes, mysql_cv_timespec_ts=no)])
104
if test "$mysql_cv_timespec_ts" = "yes"
106
AC_DEFINE([HAVE_TIMESPEC_TS_SEC], [1],
107
[Timespec has a ts_sec instead of tv_sev])
111
AC_DEFUN([DRIZZLE_TZNAME],
112
[AC_CACHE_CHECK([if we have tzname variable], mysql_cv_tzname,
113
[AC_TRY_COMPILE([#include <time.h>
119
return tzname[0] != 0;
120
], mysql_cv_tzname=yes, mysql_cv_tzname=no)])
121
if test "$mysql_cv_tzname" = "yes"
123
AC_DEFINE([HAVE_TZNAME], [1], [Have the tzname variable])
128
4
AC_DEFUN([DRIZZLE_PTHREAD_YIELD],[
129
5
# Some OSes like Mac OS X have that as a replacement for pthread_yield()
228
# Orginal from bash-2.0 aclocal.m4, Changed to use termcap last by monty.
230
AC_DEFUN([DRIZZLE_CHECK_LIB_TERMCAP],
232
AC_CACHE_VAL(mysql_cv_termcap_lib,
233
[AC_CHECK_LIB(ncurses, tgetent, mysql_cv_termcap_lib=libncurses,
234
[AC_CHECK_LIB(curses, tgetent, mysql_cv_termcap_lib=libcurses,
235
[AC_CHECK_LIB(termcap, tgetent, mysql_cv_termcap_lib=libtermcap,
236
[AC_CHECK_LIB(tinfo, tgetent, mysql_cv_termcap_lib=libtinfo,
237
mysql_cv_termcap_lib=NOT_FOUND)])])])])
238
AC_MSG_CHECKING(for termcap functions library)
239
if test "$mysql_cv_termcap_lib" = "NOT_FOUND"; then
240
AC_MSG_ERROR([No curses/termcap library found])
241
elif test "$mysql_cv_termcap_lib" = "libtermcap"; then
242
TERMCAP_LIB=-ltermcap
243
elif test "$mysql_cv_termcap_lib" = "libncurses"; then
244
TERMCAP_LIB=-lncurses
245
elif test "$mysql_cv_termcap_lib" = "libtinfo"; then
250
AC_MSG_RESULT($TERMCAP_LIB)
253
105
dnl Check type of signal routines (posix, 4.2bsd, 4.1bsd or v7)
254
106
AC_DEFUN([DRIZZLE_SIGNAL_CHECK],
320
AC_DEFUN([DRIZZLE_HAVE_FIONREAD],
321
[AC_MSG_CHECKING(for FIONREAD in sys/ioctl.h)
322
AC_CACHE_VAL(mysql_cv_fionread_in_ioctl,
323
[AC_TRY_COMPILE([#include <sys/types.h>
324
#include <sys/ioctl.h>], [int x = FIONREAD;],
325
mysql_cv_fionread_in_ioctl=yes,mysql_cv_fionread_in_ioctl=no)])
326
AC_MSG_RESULT($mysql_cv_fionread_in_ioctl)
327
if test "$mysql_cv_fionread_in_ioctl" = "yes"; then
328
AC_DEFINE([FIONREAD_IN_SYS_IOCTL], [1], [Do we have FIONREAD])
332
172
AC_DEFUN([DRIZZLE_HAVE_TIOCSTAT],
333
173
[AC_MSG_CHECKING(for TIOCSTAT in sys/ioctl.h)
334
174
AC_CACHE_VAL(mysql_cv_tiocstat_in_ioctl,
345
AC_DEFUN([DRIZZLE_STRUCT_DIRENT_D_INO],
346
[AC_REQUIRE([AC_HEADER_DIRENT])
347
AC_MSG_CHECKING(if struct dirent has a d_ino member)
348
AC_CACHE_VAL(mysql_cv_dirent_has_dino,
351
#include <sys/types.h>
354
#endif /* HAVE_UNISTD_H */
355
#if defined(HAVE_DIRENT_H)
358
# define dirent direct
359
# ifdef HAVE_SYS_NDIR_H
360
# include <sys/ndir.h>
361
# endif /* SYSNDIR */
362
# ifdef HAVE_SYS_DIR_H
363
# include <sys/dir.h>
368
#endif /* HAVE_DIRENT_H */
370
struct dirent d; int z; z = d.d_ino;
371
], mysql_cv_dirent_has_dino=yes, mysql_cv_dirent_has_dino=no)])
372
AC_MSG_RESULT($mysql_cv_dirent_has_dino)
373
if test "$mysql_cv_dirent_has_dino" = "yes"; then
374
AC_DEFINE(STRUCT_DIRENT_HAS_D_INO, [1],
375
[d_ino member present in struct dirent])
379
AC_DEFUN([DRIZZLE_STRUCT_DIRENT_D_NAMLEN],
380
[AC_REQUIRE([AC_HEADER_DIRENT])
381
AC_MSG_CHECKING(if struct dirent has a d_namlen member)
382
AC_CACHE_VAL(mysql_cv_dirent_has_dnamlen,
385
#include <sys/types.h>
388
#endif /* HAVE_UNISTD_H */
389
#if defined(HAVE_DIRENT_H)
392
# define dirent direct
393
# ifdef HAVE_SYS_NDIR_H
394
# include <sys/ndir.h>
395
# endif /* SYSNDIR */
396
# ifdef HAVE_SYS_DIR_H
397
# include <sys/dir.h>
402
#endif /* HAVE_DIRENT_H */
404
struct dirent d; int z; z = (int)d.d_namlen;
405
], mysql_cv_dirent_has_dnamlen=yes, mysql_cv_dirent_has_dnamlen=no)])
406
AC_MSG_RESULT($mysql_cv_dirent_has_dnamlen)
407
if test "$mysql_cv_dirent_has_dnamlen" = "yes"; then
408
AC_DEFINE(STRUCT_DIRENT_HAS_D_NAMLEN, [1],
409
[d_namlen member present in struct dirent])
414
AC_DEFUN([DRIZZLE_TYPE_SIGHANDLER],
415
[AC_MSG_CHECKING([whether signal handlers are of type void])
416
AC_CACHE_VAL(mysql_cv_void_sighandler,
417
[AC_TRY_COMPILE([#include <sys/types.h>
425
void (*signal ()) ();],
426
[int i;], mysql_cv_void_sighandler=yes, mysql_cv_void_sighandler=no)])dnl
427
AC_MSG_RESULT($mysql_cv_void_sighandler)
428
if test "$mysql_cv_void_sighandler" = "yes"; then
429
AC_DEFINE(VOID_SIGHANDLER, [1], [sighandler type is void (*signal ()) ();])
433
AC_DEFUN([DRIZZLE_CXX_BOOL],
435
AC_REQUIRE([AC_PROG_CXX])
436
AC_MSG_CHECKING(if ${CXX} supports bool types)
437
AC_CACHE_VAL(mysql_cv_have_bool,
441
AC_TRY_COMPILE(,[bool b = true;],
442
mysql_cv_have_bool=yes,
443
mysql_cv_have_bool=no)
446
AC_MSG_RESULT($mysql_cv_have_bool)
447
if test "$mysql_cv_have_bool" = yes; then
448
AC_DEFINE([HAVE_BOOL], [1], [bool is not defined by all C++ compilators])
452
186
AC_DEFUN([DRIZZLE_STACK_DIRECTION],
453
187
[AC_CACHE_CHECK(stack direction for C alloca, ac_cv_c_stack_direction,
499
233
AC_MSG_RESULT($ac_cv_conv_longlong_to_float)
502
AC_DEFUN([DRIZZLE_CHECK_VIO], [
504
dnl we always use vio: no need for special defines
506
AC_DEFINE([HAVE_VIO_READ_BUFF], [1],
507
[Define to enable buffered read. This works only if syscalls
508
read/recv return as soon as there is some data in the kernel
509
buffer, no matter how big the given buffer is.])
512
# Local version of _AC_PROG_CXX_EXIT_DECLARATION that does not
513
# include #stdlib.h as default as this breaks things on Solaris
514
# (Conflicts with pthreads and big file handling)
516
m4_define([_AC_PROG_CXX_EXIT_DECLARATION],
517
[for ac_declaration in \
519
'extern "C" void std::exit (int) throw (); using std::exit;' \
520
'extern "C" void std::exit (int); using std::exit;' \
521
'extern "C" void exit (int) throw ();' \
522
'extern "C" void exit (int);' \
524
'#include <stdlib.h>'
526
_AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$ac_declaration
527
@%:@include <stdlib.h>],
531
_AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$ac_declaration],
536
if test -n "$ac_declaration"; then
537
echo '#ifdef __cplusplus' >>confdefs.h
538
echo $ac_declaration >>confdefs.h
539
echo '#endif' >>confdefs.h
541
])# _AC_PROG_CXX_EXIT_DECLARATION
543
dnl ---------------------------------------------------------------------------
546
dnl ---------------------------------------------------------------------------
547
dnl Macro: DRIZZLE_CHECK_BIG_TABLES
548
dnl Sets BIG_TABLES if --with-big-tables is used
549
dnl ---------------------------------------------------------------------------
550
AC_DEFUN([DRIZZLE_CHECK_BIG_TABLES], [
551
AC_ARG_WITH([big-tables],
552
AS_HELP_STRING([--with-big-tables],
553
[Support tables with more than 4 G rows even on 32 bit platforms]),
554
[bigtables="$withval"],
556
AC_MSG_CHECKING([for big tables support])
560
AC_DEFINE([BIG_TABLES], [1], [Support big tables])
569
dnl ---------------------------------------------------------------------------
570
dnl END OF DRIZZLE_CHECK_BIG_TABLES SECTION
571
dnl ---------------------------------------------------------------------------
574
237
dnl ---------------------------------------------------------------------------
575
238
dnl Macro: DRIZZLE_CHECK_MAX_INDEXES
590
253
dnl END OF DRIZZLE_CHECK_MAX_INDEXES SECTION
591
254
dnl ---------------------------------------------------------------------------
256
AC_DEFUN([DRIZZLE_CHECK_C_VERSION],[
258
dnl Print version of C compiler
259
AC_MSG_CHECKING("C Compiler version")
260
if test "$GCC" = "yes"
262
CC_VERSION=`$CC --version | sed 1q`
263
elif test "$SUNCC" = "yes"
265
CC_VERSION=`$CC -V 2>&1 | sed 1q`
269
AC_MSG_RESULT("$CC_VERSION")
594
274
AC_DEFUN([DRIZZLE_CHECK_CXX_VERSION], [
597
CXX_VERSION=`$CXX -version | grep -i version`
275
dnl Print version of CXX compiler
276
AC_MSG_CHECKING("C++ Compiler version")
277
if test "$GCC" = "yes"
600
279
CXX_VERSION=`$CXX --version | sed 1q`
601
if test $? -ne "0" -o -z "$CXX_VERSION"
603
CXX_VERSION=`$CXX -V 2>&1|sed 1q` # trying harder for Sun and SGI
605
if test $? -ne "0" -o -z "$CXX_VERSION"
607
CXX_VERSION=`$CXX -v 2>&1|sed 1q` # even harder for Alpha
609
if test $? -ne "0" -o -z "$CXX_VERSION"
614
if test "$CXX_VERSION"
616
AC_MSG_CHECKING("C++ compiler version")
617
AC_MSG_RESULT("$CXX $CXX_VERSION")
619
AC_SUBST(CXX_VERSION)
280
elif test "$SUNCC" = "yes"
282
CXX_VERSION=`$CXX -V 2>&1 | sed 1q`
286
AC_MSG_RESULT("$CXX_VERSION")
287
AC_SUBST(CXX_VERSION)
622
290
AC_DEFUN([DRIZZLE_PROG_AR], [