42
# From fileutils-3.14/aclocal.m4
44
# @defmac AC_PROG_CC_STDC
45
# @maindex PROG_CC_STDC
47
# If the C compiler in not in ANSI C mode by default, try to add an option
48
# to output variable @code{CC} to make it so. This macro tries various
49
# options that select ANSI C on some system or another. It considers the
50
# compiler to be in ANSI C mode if it defines @code{__STDC__} to 1 and
51
# handles function prototypes correctly.
53
# Patched by monty to only check if __STDC__ is defined. With the original
54
# check it's impossible to get things to work with the Sunpro compiler from
57
# If you use this macro, you should check after calling it whether the C
58
# compiler has been set to accept ANSI C; if not, the shell variable
59
# @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
60
# code in ANSI C, you can make an un-ANSIfied copy of it by using the
61
# program @code{ansi2knr}, which comes with Ghostscript.
64
AC_DEFUN([AM_PROG_CC_STDC],
65
[AC_REQUIRE([AC_PROG_CC])
66
AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
67
AC_CACHE_VAL(am_cv_prog_cc_stdc,
68
[am_cv_prog_cc_stdc=no
70
# Don't try gcc -ansi; that turns off useful extensions and
71
# breaks some systems' header files.
73
# Ultrix and OSF/1 -std1
74
# HP-UX -Aa -D_HPUX_SOURCE
75
# SVR4 -Xc -D__EXTENSIONS__
76
# removed "-Xc -D__EXTENSIONS__" beacause sun c++ does not like it.
77
for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE"
79
CC="$ac_save_CC $ac_arg"
81
[#if !defined(__STDC__)
84
/* DYNIX/ptx V4.1.3 can't compile sys/stat.h with -Xc -D__EXTENSIONS__. */
86
# include <sys/types.h>
87
# include <sys/stat.h>
90
int test (int i, double x);
91
struct s1 {int (*f) (int a);};
92
struct s2 {int (*f) (double a);};],
93
[am_cv_prog_cc_stdc="$ac_arg"; break])
97
AC_MSG_RESULT($am_cv_prog_cc_stdc)
98
case "x$am_cv_prog_cc_stdc" in
100
*) CC="$CC $am_cv_prog_cc_stdc" ;;
105
dnl Check type of signal routines (posix, 4.2bsd, 4.1bsd or v7)
106
AC_DEFUN([DRIZZLE_SIGNAL_CHECK],
107
[AC_REQUIRE([AC_TYPE_SIGNAL])
108
AC_MSG_CHECKING(for type of signal functions)
109
AC_CACHE_VAL(mysql_cv_signal_vintage,
111
AC_TRY_LINK([#include <signal.h>],[
114
sigemptyset(&ss); sigsuspend(&ss);
115
sigaction(SIGINT, &sa, (struct sigaction *) 0);
116
sigprocmask(SIG_BLOCK, &ss, (sigset_t *) 0);
117
], mysql_cv_signal_vintage=posix,
119
AC_TRY_LINK([#include <signal.h>], [
120
int mask = sigmask(SIGINT);
121
sigsetmask(mask); sigblock(mask); sigpause(mask);
122
], mysql_cv_signal_vintage=4.2bsd,
127
int mask = sigmask(SIGINT);
128
sigset(SIGINT, foo); sigrelse(SIGINT);
129
sighold(SIGINT); sigpause(SIGINT);
130
], mysql_cv_signal_vintage=svr3, mysql_cv_signal_vintage=v7
135
AC_MSG_RESULT($mysql_cv_signal_vintage)
136
if test "$mysql_cv_signal_vintage" = posix; then
137
AC_DEFINE(HAVE_POSIX_SIGNALS, [1],
138
[Signal handling is POSIX (sigset/sighold, etc)])
139
elif test "$mysql_cv_signal_vintage" = "4.2bsd"; then
140
AC_DEFINE([HAVE_BSD_SIGNALS], [1], [BSD style signals])
141
elif test "$mysql_cv_signal_vintage" = svr3; then
142
AC_DEFINE(HAVE_USG_SIGHOLD, [1], [sighold() is present and usable])
146
AC_DEFUN([DRIZZLE_CHECK_GETPW_FUNCS],
147
[AC_MSG_CHECKING(whether programs are able to redeclare getpw functions)
148
AC_CACHE_VAL(mysql_cv_can_redecl_getpw,
149
[AC_TRY_COMPILE([#include <sys/types.h>
151
extern struct passwd *getpwent();], [struct passwd *z; z = getpwent();],
152
mysql_cv_can_redecl_getpw=yes,mysql_cv_can_redecl_getpw=no)])
153
AC_MSG_RESULT($mysql_cv_can_redecl_getpw)
154
if test "$mysql_cv_can_redecl_getpw" = "no"; then
155
AC_DEFINE(HAVE_GETPW_DECLS, [1], [getpwent() declaration present])
159
44
AC_DEFUN([DRIZZLE_HAVE_TIOCGWINSZ],
160
45
[AC_MSG_CHECKING(for TIOCGWINSZ in sys/ioctl.h)
206
91
AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction)
209
AC_DEFUN([DRIZZLE_CHECK_LONGLONG_TO_FLOAT],
211
AC_MSG_CHECKING(if conversion of int64_t to float works)
212
AC_CACHE_VAL(ac_cv_conv_longlong_to_float,
213
[AC_TRY_RUN([#include <stdio.h>
219
FILE *file=fopen("conftestval", "w");
221
fprintf(file,"%g\n",f);
224
}], ac_cv_conv_longlong_to_float=`cat conftestval`,
225
ac_cv_conv_longlong_to_float=0,
226
ac_cv_conv_longlong_to_float="yes")])dnl # Cross compiling, assume can convert
227
if test "$ac_cv_conv_longlong_to_float" = "1" -o "$ac_cv_conv_longlong_to_float" = "yes"
229
ac_cv_conv_longlong_to_float=yes
231
ac_cv_conv_longlong_to_float=no
233
AC_MSG_RESULT($ac_cv_conv_longlong_to_float)
237
95
dnl ---------------------------------------------------------------------------
238
96
dnl Macro: DRIZZLE_CHECK_MAX_INDEXES