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,
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"
45
#---START: Figure out whether to use 'struct rlimit' or 'struct rlimit64'
46
AC_DEFUN([DRIZZLE_TYPE_STRUCT_RLIMIT],
47
[ac_save_CXXFLAGS="$CXXFLAGS"
48
AC_CACHE_CHECK([struct type to use with setrlimit], mysql_cv_btype_struct_rlimit,
50
if test "$GXX" = "yes"
52
# Add -Werror, remove -fbranch-probabilities (Bug #268)
53
CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed -e 's/-fbranch-probabilities//; s/-Wall//; s/-Wcheck//'`
55
mysql_cv_btype_struct_rlimit=none
56
[AC_TRY_COMPILE([#if defined(inline)
60
#include <sys/resource.h>
62
[struct rlimit64 rl; setrlimit(RLIMIT_CORE, &rl);],
63
mysql_cv_btype_struct_rlimit="struct rlimit64")]
64
if test "$mysql_cv_btype_struct_rlimit" = "none"; then
65
mysql_cv_btype_struct_rlimit="struct rlimit"
68
AC_DEFINE_UNQUOTED([STRUCT_RLIMIT], [$mysql_cv_btype_struct_rlimit],
69
[The struct rlimit type to use with setrlimit])
70
CXXFLAGS="$ac_save_CXXFLAGS"
74
AC_DEFUN([DRIZZLE_TIMESPEC_TS],
75
[AC_CACHE_CHECK([if struct timespec has a ts_sec member], mysql_cv_timespec_ts,
76
[AC_TRY_COMPILE([#include <pthread.h>
81
[struct timespec abstime;
83
abstime.ts_sec = time(NULL)+1;
85
], mysql_cv_timespec_ts=yes, mysql_cv_timespec_ts=no)])
86
if test "$mysql_cv_timespec_ts" = "yes"
88
AC_DEFINE([HAVE_TIMESPEC_TS_SEC], [1],
89
[Timespec has a ts_sec instead of tv_sev])
93
AC_DEFUN([DRIZZLE_TZNAME],
94
[AC_CACHE_CHECK([if we have tzname variable], mysql_cv_tzname,
95
[AC_TRY_COMPILE([#include <time.h>
101
return tzname[0] != 0;
102
], mysql_cv_tzname=yes, mysql_cv_tzname=no)])
103
if test "$mysql_cv_tzname" = "yes"
105
AC_DEFINE([HAVE_TZNAME], [1], [Have the tzname variable])
110
4
AC_DEFUN([DRIZZLE_PTHREAD_YIELD],[
111
5
# Some OSes like Mac OS X have that as a replacement for pthread_yield()