~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to m4/misc.m4

  • Committer: Brian Aker
  • Date: 2009-03-19 17:16:20 UTC
  • mfrom: (942.1.9 mordred)
  • Revision ID: brian@tangent.org-20090319171620-8gre04se5oodnuu8
Merge Monty

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# Local macros for automake & autoconf
2
2
 
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,
7
 
AC_LANG_PUSH(C++)
8
 
if test "$GXX" = "yes"
9
 
then
10
 
  # Add -Werror, remove -fbranch-probabilities (Bug #268)
11
 
  CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed -e 's/-fbranch-probabilities//; s/-Wall//; s/-Wcheck//'`
12
 
fi
13
 
mysql_cv_btype_last_arg_accept=none
14
 
[AC_TRY_COMPILE([#if defined(inline)
15
 
#undef inline
16
 
#endif
17
 
#include <stdlib.h>
18
 
#include <sys/types.h>
19
 
#include <sys/socket.h>
20
 
],
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)
25
 
#undef inline
26
 
#endif
27
 
#include <stdlib.h>
28
 
#include <sys/types.h>
29
 
#include <sys/socket.h>
30
 
],
31
 
[int a = accept(1, (struct sockaddr *) 0, (size_t *) 0); return (a != 0);],
32
 
mysql_cv_btype_last_arg_accept=size_t)]
33
 
fi
34
 
if test "$mysql_cv_btype_last_arg_accept" = "none"; then
35
 
mysql_cv_btype_last_arg_accept=int
36
 
fi)
37
 
AC_LANG_POP(C++)
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"
41
 
])
42
 
#---END:
43
 
 
44
 
 
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,
49
 
AC_LANG_PUSH(C++)
50
 
if test "$GXX" = "yes"
51
 
then
52
 
  # Add -Werror, remove -fbranch-probabilities (Bug #268)
53
 
  CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed -e 's/-fbranch-probabilities//; s/-Wall//; s/-Wcheck//'`
54
 
fi
55
 
mysql_cv_btype_struct_rlimit=none
56
 
[AC_TRY_COMPILE([#if defined(inline)
57
 
#undef inline
58
 
#endif
59
 
#include <stdlib.h>
60
 
#include <sys/resource.h>
61
 
],
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"
66
 
fi)
67
 
AC_LANG_POP(C++)
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"
71
 
])
72
 
#---END:
73
 
 
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>
77
 
#ifdef __cplusplus
78
 
extern "C"
79
 
#endif
80
 
],
81
 
[struct timespec abstime;
82
 
 
83
 
abstime.ts_sec = time(NULL)+1;
84
 
abstime.ts_nsec = 0;
85
 
], mysql_cv_timespec_ts=yes, mysql_cv_timespec_ts=no)])
86
 
if test "$mysql_cv_timespec_ts" = "yes"
87
 
then
88
 
  AC_DEFINE([HAVE_TIMESPEC_TS_SEC], [1],
89
 
            [Timespec has a ts_sec instead of tv_sev])
90
 
fi
91
 
])
92
 
 
93
 
AC_DEFUN([DRIZZLE_TZNAME],
94
 
[AC_CACHE_CHECK([if we have tzname variable], mysql_cv_tzname,
95
 
[AC_TRY_COMPILE([#include <time.h>
96
 
#ifdef __cplusplus
97
 
extern "C"
98
 
#endif
99
 
],
100
 
[ tzset();
101
 
  return tzname[0] != 0;
102
 
], mysql_cv_tzname=yes, mysql_cv_tzname=no)])
103
 
if test "$mysql_cv_tzname" = "yes"
104
 
then
105
 
  AC_DEFINE([HAVE_TZNAME], [1], [Have the tzname variable])
106
 
fi
107
 
])
108
 
 
109
3
 
110
4
AC_DEFUN([DRIZZLE_PTHREAD_YIELD],[
111
5
# Some OSes like Mac OS X have that as a replacement for pthread_yield()