1
# Local macros for automake & autoconf
4
AC_DEFUN([DRIZZLE_PTHREAD_YIELD],[
5
# Some OSes like Mac OS X have that as a replacement for pthread_yield()
6
AC_CHECK_FUNCS(pthread_yield_np, AC_DEFINE([HAVE_PTHREAD_YIELD_NP],[],[Define if you have pthread_yield_np]))
7
AC_CACHE_CHECK([if pthread_yield takes zero arguments], ac_cv_pthread_yield_zero_arg,
8
[AC_TRY_LINK([#define _GNU_SOURCE
16
], ac_cv_pthread_yield_zero_arg=yes, ac_cv_pthread_yield_zero_arg=yeso)])
17
if test "$ac_cv_pthread_yield_zero_arg" = "yes"
19
AC_DEFINE([HAVE_PTHREAD_YIELD_ZERO_ARG], [1],
20
[pthread_yield that doesn't take any arguments])
22
AC_CACHE_CHECK([if pthread_yield takes 1 argument], ac_cv_pthread_yield_one_arg,
23
[AC_TRY_LINK([#define _GNU_SOURCE
31
], ac_cv_pthread_yield_one_arg=yes, ac_cv_pthread_yield_one_arg=no)])
32
if test "$ac_cv_pthread_yield_one_arg" = "yes"
34
AC_DEFINE([HAVE_PTHREAD_YIELD_ONE_ARG], [1],
35
[pthread_yield function with one argument])
44
AC_DEFUN([DRIZZLE_HAVE_TIOCGWINSZ],
45
[AC_MSG_CHECKING(for TIOCGWINSZ in sys/ioctl.h)
46
AC_CACHE_VAL(mysql_cv_tiocgwinsz_in_ioctl,
47
[AC_TRY_COMPILE([#include <sys/types.h>
48
#include <sys/ioctl.h>], [int x = TIOCGWINSZ;],
49
mysql_cv_tiocgwinsz_in_ioctl=yes,mysql_cv_tiocgwinsz_in_ioctl=no)])
50
AC_MSG_RESULT($mysql_cv_tiocgwinsz_in_ioctl)
51
if test "$mysql_cv_tiocgwinsz_in_ioctl" = "yes"; then
52
AC_DEFINE([GWINSZ_IN_SYS_IOCTL], [1],
53
[READLINE: your system defines TIOCGWINSZ in sys/ioctl.h.])
57
AC_DEFUN([DRIZZLE_HAVE_TIOCSTAT],
58
[AC_MSG_CHECKING(for TIOCSTAT in sys/ioctl.h)
59
AC_CACHE_VAL(mysql_cv_tiocstat_in_ioctl,
60
[AC_TRY_COMPILE([#include <sys/types.h>
61
#include <sys/ioctl.h>], [int x = TIOCSTAT;],
62
mysql_cv_tiocstat_in_ioctl=yes,mysql_cv_tiocstat_in_ioctl=no)])
63
AC_MSG_RESULT($mysql_cv_tiocstat_in_ioctl)
64
if test "$mysql_cv_tiocstat_in_ioctl" = "yes"; then
65
AC_DEFINE(TIOCSTAT_IN_SYS_IOCTL, [1],
66
[declaration of TIOCSTAT in sys/ioctl.h])
71
AC_DEFUN([DRIZZLE_STACK_DIRECTION],
72
[AC_CACHE_CHECK(stack direction for C alloca, ac_cv_c_stack_direction,
73
[AC_TRY_RUN([#include <stdlib.h>
74
int find_stack_direction ()
76
static char *addr = 0;
81
return find_stack_direction ();
84
return (&dummy > addr) ? 1 : -1;
88
exit (find_stack_direction() < 0);
89
}], ac_cv_c_stack_direction=1, ac_cv_c_stack_direction=-1,
90
ac_cv_c_stack_direction=)])
91
AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction)
95
dnl ---------------------------------------------------------------------------
96
dnl Macro: DRIZZLE_CHECK_MAX_INDEXES
98
dnl ---------------------------------------------------------------------------
99
AC_DEFUN([DRIZZLE_CHECK_MAX_INDEXES], [
100
AC_ARG_WITH([max-indexes],
101
AS_HELP_STRING([--with-max-indexes=N],
102
[Sets the maximum number of indexes per table, default 64]),
103
[max_indexes="$withval"],
105
AC_MSG_CHECKING([max indexes per table])
106
AC_DEFINE_UNQUOTED([MAX_INDEXES], [$max_indexes],
107
[Maximum number of indexes per table])
108
AC_MSG_RESULT([$max_indexes])
110
dnl ---------------------------------------------------------------------------
111
dnl END OF DRIZZLE_CHECK_MAX_INDEXES SECTION
112
dnl ---------------------------------------------------------------------------
117
dnl Macro to check time_t range: according to C standard
118
dnl array index must be greater than 0 => if time_t is signed,
119
dnl the code in the macros below won't compile.
122
AC_DEFUN([DRIZZLE_CHECK_TIME_T],[
123
AC_MSG_CHECKING(if time_t is unsigned)
124
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
129
int array[(((time_t)-1) > 0) ? 1 : -1];
132
AC_DEFINE([TIME_T_UNSIGNED], 1, [Define to 1 if time_t is unsigned])