1
by brian
clean slate |
1 |
# Local macros for automake & autoconf |
2 |
||
3 |
#---START: Used in for client configure |
|
319.1.1
by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_ |
4 |
AC_DEFUN([DRIZZLE_TYPE_ACCEPT], |
1
by brian
clean slate |
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++) |
|
779.2.11
by Monty Taylor
General build cleanup - removed cruft, removed depreated checks. |
8 |
if test "$GXX" = "yes" |
1
by brian
clean slate |
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' |
|
319.1.1
by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_ |
46 |
AC_DEFUN([DRIZZLE_TYPE_STRUCT_RLIMIT], |
1
by brian
clean slate |
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++) |
|
779.2.11
by Monty Taylor
General build cleanup - removed cruft, removed depreated checks. |
50 |
if test "$GXX" = "yes" |
1
by brian
clean slate |
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 |
||
236.1.24
by Monty Taylor
Renamed MYSQL_TIME to DRIZZLE_TIME. |
74 |
AC_DEFUN([DRIZZLE_TIMESPEC_TS], |
1
by brian
clean slate |
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 |
||
319.1.1
by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_ |
93 |
AC_DEFUN([DRIZZLE_TZNAME], |
1
by brian
clean slate |
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 |
||
319.1.1
by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_ |
110 |
AC_DEFUN([DRIZZLE_PTHREAD_YIELD],[ |
1
by brian
clean slate |
111 |
# Some OSes like Mac OS X have that as a replacement for pthread_yield()
|
112 |
AC_CHECK_FUNCS(pthread_yield_np, AC_DEFINE([HAVE_PTHREAD_YIELD_NP],[],[Define if you have pthread_yield_np])) |
|
113 |
AC_CACHE_CHECK([if pthread_yield takes zero arguments], ac_cv_pthread_yield_zero_arg, |
|
114 |
[AC_TRY_LINK([#define _GNU_SOURCE |
|
115 |
#include <pthread.h>
|
|
116 |
#ifdef __cplusplus
|
|
117 |
extern "C"
|
|
118 |
#endif
|
|
119 |
], |
|
120 |
[
|
|
121 |
pthread_yield();
|
|
122 |
], ac_cv_pthread_yield_zero_arg=yes, ac_cv_pthread_yield_zero_arg=yeso)]) |
|
123 |
if test "$ac_cv_pthread_yield_zero_arg" = "yes" |
|
124 |
then
|
|
125 |
AC_DEFINE([HAVE_PTHREAD_YIELD_ZERO_ARG], [1], |
|
126 |
[pthread_yield that doesn't take any arguments]) |
|
127 |
fi
|
|
128 |
AC_CACHE_CHECK([if pthread_yield takes 1 argument], ac_cv_pthread_yield_one_arg, |
|
129 |
[AC_TRY_LINK([#define _GNU_SOURCE |
|
130 |
#include <pthread.h>
|
|
131 |
#ifdef __cplusplus
|
|
132 |
extern "C"
|
|
133 |
#endif
|
|
134 |
], |
|
135 |
[
|
|
136 |
pthread_yield(0);
|
|
137 |
], ac_cv_pthread_yield_one_arg=yes, ac_cv_pthread_yield_one_arg=no)]) |
|
138 |
if test "$ac_cv_pthread_yield_one_arg" = "yes" |
|
139 |
then
|
|
140 |
AC_DEFINE([HAVE_PTHREAD_YIELD_ONE_ARG], [1], |
|
141 |
[pthread_yield function with one argument]) |
|
142 |
fi
|
|
143 |
]
|
|
144 |
)
|
|
145 |
||
146 |
#---END: |
|
147 |
||
148 |
# From fileutils-3.14/aclocal.m4 |
|
149 |
||
150 |
# @defmac AC_PROG_CC_STDC |
|
151 |
# @maindex PROG_CC_STDC |
|
152 |
# @ovindex CC |
|
153 |
# If the C compiler in not in ANSI C mode by default, try to add an option |
|
154 |
# to output variable @code{CC} to make it so. This macro tries various |
|
155 |
# options that select ANSI C on some system or another. It considers the |
|
156 |
# compiler to be in ANSI C mode if it defines @code{__STDC__} to 1 and |
|
157 |
# handles function prototypes correctly. |
|
158 |
#
|
|
159 |
# Patched by monty to only check if __STDC__ is defined. With the original |
|
160 |
# check it's impossible to get things to work with the Sunpro compiler from |
|
161 |
# Workshop 4.2
|
|
162 |
#
|
|
163 |
# If you use this macro, you should check after calling it whether the C
|
|
164 |
# compiler has been set to accept ANSI C; if not, the shell variable
|
|
165 |
# @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
|
|
166 |
# code in ANSI C, you can make an un-ANSIfied copy of it by using the
|
|
167 |
# program @code{ansi2knr}, which comes with Ghostscript.
|
|
168 |
# @end defmac
|
|
169 |
||
170 |
AC_DEFUN([AM_PROG_CC_STDC],
|
|
171 |
[AC_REQUIRE([AC_PROG_CC])
|
|
172 |
AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
|
|
173 |
AC_CACHE_VAL(am_cv_prog_cc_stdc,
|
|
174 |
[am_cv_prog_cc_stdc=no
|
|
175 |
ac_save_CC="$CC"
|
|
176 |
# Don't try gcc -ansi; that turns off useful extensions and |
|
177 |
# breaks some systems' header files. |
|
178 |
# AIX -qlanglvl=ansi
|
|
179 |
# Ultrix and OSF/1 -std1
|
|
180 |
# HP-UX -Aa -D_HPUX_SOURCE
|
|
181 |
# SVR4 -Xc -D__EXTENSIONS__
|
|
182 |
# removed "-Xc -D__EXTENSIONS__" beacause sun c++ does not like it.
|
|
183 |
for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE"
|
|
184 |
do
|
|
185 |
CC="$ac_save_CC $ac_arg"
|
|
186 |
AC_TRY_COMPILE(
|
|
187 |
[#if !defined(__STDC__)
|
|
188 |
choke me
|
|
189 |
#endif
|
|
190 |
/* DYNIX/ptx V4.1.3 can't compile sys/stat.h with -Xc -D__EXTENSIONS__. */ |
|
191 |
#ifdef _SEQUENT_ |
|
192 |
# include <sys/types.h> |
|
193 |
# include <sys/stat.h> |
|
194 |
#endif
|
|
195 |
], [ |
|
196 |
int test (int i, double x);
|
|
197 |
struct s1 {int (*f) (int a);};
|
|
198 |
struct s2 {int (*f) (double a);};], |
|
199 |
[am_cv_prog_cc_stdc="$ac_arg"; break]) |
|
200 |
done
|
|
201 |
CC="$ac_save_CC" |
|
202 |
]) |
|
203 |
AC_MSG_RESULT($am_cv_prog_cc_stdc) |
|
204 |
case "x$am_cv_prog_cc_stdc" in |
|
205 |
x|xno) ;; |
|
206 |
*) CC="$CC $am_cv_prog_cc_stdc" ;; |
|
207 |
esac
|
|
208 |
]) |
|
209 |
||
210 |
||
211 |
dnl Check type of signal routines (posix, 4.2bsd, 4.1bsd or v7) |
|
319.1.1
by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_ |
212 |
AC_DEFUN([DRIZZLE_SIGNAL_CHECK], |
1
by brian
clean slate |
213 |
[AC_REQUIRE([AC_TYPE_SIGNAL]) |
214 |
AC_MSG_CHECKING(for type of signal functions) |
|
215 |
AC_CACHE_VAL(mysql_cv_signal_vintage, |
|
216 |
[
|
|
217 |
AC_TRY_LINK([#include <signal.h>],[ |
|
218 |
sigset_t ss;
|
|
219 |
struct sigaction sa;
|
|
220 |
sigemptyset(&ss); sigsuspend(&ss);
|
|
221 |
sigaction(SIGINT, &sa, (struct sigaction *) 0);
|
|
222 |
sigprocmask(SIG_BLOCK, &ss, (sigset_t *) 0);
|
|
223 |
], mysql_cv_signal_vintage=posix, |
|
224 |
[ |
|
225 |
AC_TRY_LINK([#include <signal.h>], [ |
|
226 |
int mask = sigmask(SIGINT);
|
|
227 |
sigsetmask(mask); sigblock(mask); sigpause(mask);
|
|
228 |
], mysql_cv_signal_vintage=4.2bsd, |
|
229 |
[ |
|
230 |
AC_TRY_LINK([
|
|
231 |
#include <signal.h>
|
|
779.2.11
by Monty Taylor
General build cleanup - removed cruft, removed depreated checks. |
232 |
void foo() { }], [ |
1
by brian
clean slate |
233 |
int mask = sigmask(SIGINT);
|
234 |
sigset(SIGINT, foo); sigrelse(SIGINT);
|
|
235 |
sighold(SIGINT); sigpause(SIGINT);
|
|
236 |
], mysql_cv_signal_vintage=svr3, mysql_cv_signal_vintage=v7 |
|
237 |
)] |
|
238 |
)] |
|
239 |
)
|
|
240 |
]) |
|
241 |
AC_MSG_RESULT($mysql_cv_signal_vintage) |
|
242 |
if test "$mysql_cv_signal_vintage" = posix; then |
|
243 |
AC_DEFINE(HAVE_POSIX_SIGNALS, [1], |
|
244 |
[Signal handling is POSIX (sigset/sighold, etc)]) |
|
245 |
elif test "$mysql_cv_signal_vintage" = "4.2bsd"; then |
|
246 |
AC_DEFINE([HAVE_BSD_SIGNALS], [1], [BSD style signals]) |
|
247 |
elif test "$mysql_cv_signal_vintage" = svr3; then |
|
248 |
AC_DEFINE(HAVE_USG_SIGHOLD, [1], [sighold() is present and usable]) |
|
249 |
fi
|
|
250 |
]) |
|
251 |
||
319.1.1
by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_ |
252 |
AC_DEFUN([DRIZZLE_CHECK_GETPW_FUNCS], |
1
by brian
clean slate |
253 |
[AC_MSG_CHECKING(whether programs are able to redeclare getpw functions) |
254 |
AC_CACHE_VAL(mysql_cv_can_redecl_getpw,
|
|
255 |
[AC_TRY_COMPILE([#include <sys/types.h>
|
|
256 |
#include <pwd.h>
|
|
257 |
extern struct passwd *getpwent();], [struct passwd *z; z = getpwent();], |
|
258 |
mysql_cv_can_redecl_getpw=yes,mysql_cv_can_redecl_getpw=no)]) |
|
259 |
AC_MSG_RESULT($mysql_cv_can_redecl_getpw) |
|
260 |
if test "$mysql_cv_can_redecl_getpw" = "no"; then |
|
261 |
AC_DEFINE(HAVE_GETPW_DECLS, [1], [getpwent() declaration present]) |
|
262 |
fi
|
|
263 |
]) |
|
264 |
||
319.1.1
by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_ |
265 |
AC_DEFUN([DRIZZLE_HAVE_TIOCGWINSZ], |
1
by brian
clean slate |
266 |
[AC_MSG_CHECKING(for TIOCGWINSZ in sys/ioctl.h) |
267 |
AC_CACHE_VAL(mysql_cv_tiocgwinsz_in_ioctl,
|
|
268 |
[AC_TRY_COMPILE([#include <sys/types.h>
|
|
269 |
#include <sys/ioctl.h>], [int x = TIOCGWINSZ;], |
|
270 |
mysql_cv_tiocgwinsz_in_ioctl=yes,mysql_cv_tiocgwinsz_in_ioctl=no)]) |
|
271 |
AC_MSG_RESULT($mysql_cv_tiocgwinsz_in_ioctl) |
|
272 |
if test "$mysql_cv_tiocgwinsz_in_ioctl" = "yes"; then |
|
273 |
AC_DEFINE([GWINSZ_IN_SYS_IOCTL], [1], |
|
274 |
[READLINE: your system defines TIOCGWINSZ in sys/ioctl.h.]) |
|
275 |
fi
|
|
276 |
]) |
|
277 |
||
319.1.1
by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_ |
278 |
AC_DEFUN([DRIZZLE_HAVE_TIOCSTAT], |
1
by brian
clean slate |
279 |
[AC_MSG_CHECKING(for TIOCSTAT in sys/ioctl.h) |
280 |
AC_CACHE_VAL(mysql_cv_tiocstat_in_ioctl,
|
|
281 |
[AC_TRY_COMPILE([#include <sys/types.h>
|
|
282 |
#include <sys/ioctl.h>], [int x = TIOCSTAT;], |
|
283 |
mysql_cv_tiocstat_in_ioctl=yes,mysql_cv_tiocstat_in_ioctl=no)]) |
|
284 |
AC_MSG_RESULT($mysql_cv_tiocstat_in_ioctl) |
|
285 |
if test "$mysql_cv_tiocstat_in_ioctl" = "yes"; then |
|
286 |
AC_DEFINE(TIOCSTAT_IN_SYS_IOCTL, [1], |
|
287 |
[declaration of TIOCSTAT in sys/ioctl.h]) |
|
288 |
fi
|
|
289 |
]) |
|
290 |
||
291 |
||
319.1.1
by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_ |
292 |
AC_DEFUN([DRIZZLE_STACK_DIRECTION], |
1
by brian
clean slate |
293 |
[AC_CACHE_CHECK(stack direction for C alloca, ac_cv_c_stack_direction, |
294 |
[AC_TRY_RUN([#include <stdlib.h>
|
|
295 |
int find_stack_direction ()
|
|
296 |
{
|
|
297 |
static char *addr = 0;
|
|
298 |
auto char dummy;
|
|
299 |
if (addr == 0)
|
|
300 |
{
|
|
301 |
addr = &dummy;
|
|
302 |
return find_stack_direction ();
|
|
303 |
}
|
|
304 |
else
|
|
305 |
return (&dummy > addr) ? 1 : -1;
|
|
306 |
}
|
|
307 |
int main ()
|
|
308 |
{
|
|
309 |
exit (find_stack_direction() < 0);
|
|
310 |
}], ac_cv_c_stack_direction=1, ac_cv_c_stack_direction=-1, |
|
311 |
ac_cv_c_stack_direction=)]) |
|
312 |
AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction) |
|
313 |
])dnl |
|
314 |
||
319.1.1
by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_ |
315 |
AC_DEFUN([DRIZZLE_CHECK_LONGLONG_TO_FLOAT], |
1
by brian
clean slate |
316 |
[
|
481.1.3
by Monty Taylor
Replaced long long with int64_t. |
317 |
AC_MSG_CHECKING(if conversion of int64_t to float works)
|
1
by brian
clean slate |
318 |
AC_CACHE_VAL(ac_cv_conv_longlong_to_float,
|
319 |
[AC_TRY_RUN([#include <stdio.h>
|
|
481.1.8
by Monty Taylor
Fixed partial longlong->int64 prob. |
320 |
#include <stdint.h>
|
1
by brian
clean slate |
321 |
int main()
|
322 |
{
|
|
481.1.3
by Monty Taylor
Replaced long long with int64_t. |
323 |
int64_t ll=1;
|
1
by brian
clean slate |
324 |
float f;
|
325 |
FILE *file=fopen("conftestval", "w");
|
|
326 |
f = (float) ll;
|
|
327 |
fprintf(file,"%g\n",f);
|
|
328 |
fclose(file);
|
|
329 |
return (0);
|
|
330 |
}], ac_cv_conv_longlong_to_float=`cat conftestval`, |
|
331 |
ac_cv_conv_longlong_to_float=0, |
|
332 |
ac_cv_conv_longlong_to_float="yes")])dnl # Cross compiling, assume can convert |
|
333 |
if test "$ac_cv_conv_longlong_to_float" = "1" -o "$ac_cv_conv_longlong_to_float" = "yes" |
|
334 |
then
|
|
335 |
ac_cv_conv_longlong_to_float=yes |
|
336 |
else
|
|
337 |
ac_cv_conv_longlong_to_float=no |
|
338 |
fi
|
|
339 |
AC_MSG_RESULT($ac_cv_conv_longlong_to_float) |
|
340 |
]) |
|
341 |
||
319.1.1
by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_ |
342 |
AC_DEFUN([DRIZZLE_CHECK_VIO], [ |
1
by brian
clean slate |
343 |
dnl
|
344 |
dnl we always use vio: no need for special defines
|
|
345 |
dnl
|
|
346 |
AC_DEFINE([HAVE_VIO_READ_BUFF], [1], |
|
347 |
[Define to enable buffered read. This works only if syscalls |
|
348 |
read/recv return as soon as there is some data in the kernel
|
|
349 |
buffer, no matter how big the given buffer is.]) |
|
350 |
]) |
|
351 |
||
352 |
# Local version of _AC_PROG_CXX_EXIT_DECLARATION that does not |
|
353 |
# include #stdlib.h as default as this breaks things on Solaris |
|
354 |
# (Conflicts with pthreads and big file handling) |
|
355 |
||
356 |
m4_define([_AC_PROG_CXX_EXIT_DECLARATION], |
|
357 |
[for ac_declaration in \ |
|
358 |
''\
|
|
359 |
'extern "C" void std::exit (int) throw (); using std::exit;' \
|
|
360 |
'extern "C" void std::exit (int); using std::exit;' \
|
|
361 |
'extern "C" void exit (int) throw ();' \
|
|
362 |
'extern "C" void exit (int);' \
|
|
363 |
'void exit (int);' \
|
|
364 |
'#include <stdlib.h>'
|
|
365 |
do
|
|
366 |
_AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$ac_declaration
|
|
367 |
@%:@include <stdlib.h>], |
|
368 |
[exit (42);])], |
|
369 |
[], |
|
370 |
[continue]) |
|
371 |
_AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$ac_declaration], |
|
372 |
[exit (42);])], |
|
373 |
[break]) |
|
374 |
done
|
|
375 |
rm -f conftest* |
|
376 |
if test -n "$ac_declaration"; then |
|
377 |
echo '#ifdef __cplusplus' >>confdefs.h |
|
378 |
echo $ac_declaration >>confdefs.h |
|
379 |
echo '#endif' >>confdefs.h |
|
380 |
fi
|
|
381 |
])# _AC_PROG_CXX_EXIT_DECLARATION |
|
382 |
||
383 |
dnl --------------------------------------------------------------------------- |
|
384 |
||
385 |
||
386 |
dnl --------------------------------------------------------------------------- |
|
319.1.1
by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_ |
387 |
dnl Macro: DRIZZLE_CHECK_MAX_INDEXES |
1
by brian
clean slate |
388 |
dnl Sets MAX_INDEXES |
389 |
dnl --------------------------------------------------------------------------- |
|
319.1.1
by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_ |
390 |
AC_DEFUN([DRIZZLE_CHECK_MAX_INDEXES], [ |
1
by brian
clean slate |
391 |
AC_ARG_WITH([max-indexes], |
392 |
AS_HELP_STRING([--with-max-indexes=N], |
|
393 |
[Sets the maximum number of indexes per table, default 64]), |
|
394 |
[max_indexes="$withval"], |
|
395 |
[max_indexes=64]) |
|
396 |
AC_MSG_CHECKING([max indexes per table]) |
|
397 |
AC_DEFINE_UNQUOTED([MAX_INDEXES], [$max_indexes], |
|
398 |
[Maximum number of indexes per table]) |
|
399 |
AC_MSG_RESULT([$max_indexes]) |
|
400 |
]) |
|
401 |
dnl --------------------------------------------------------------------------- |
|
319.1.1
by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_ |
402 |
dnl END OF DRIZZLE_CHECK_MAX_INDEXES SECTION |
1
by brian
clean slate |
403 |
dnl --------------------------------------------------------------------------- |
404 |
||
520.4.41
by mordred
Fixed configure.ac to work cleanly on Solaris - and define some good compile flags. |
405 |
AC_DEFUN([DRIZZLE_CHECK_C_VERSION],[ |
406 |
||
407 |
dnl Print version of C compiler
|
|
408 |
AC_MSG_CHECKING("C Compiler version")
|
|
409 |
if test "$GCC" = "yes"
|
|
410 |
then
|
|
411 |
CC_VERSION=`$CC --version | sed 1q`
|
|
412 |
elif test "$SUNCC" = "yes"
|
|
413 |
then
|
|
632.1.21
by Monty Taylor
Cleaned up compiler version checking. |
414 |
CC_VERSION=`$CC -V 2>&1 | sed 1q`
|
520.4.41
by mordred
Fixed configure.ac to work cleanly on Solaris - and define some good compile flags. |
415 |
else
|
416 |
CC_VERSION=""
|
|
417 |
fi
|
|
632.1.23
by Monty Taylor
One more version string cleanup. |
418 |
AC_MSG_RESULT("$CC_VERSION")
|
520.4.41
by mordred
Fixed configure.ac to work cleanly on Solaris - and define some good compile flags. |
419 |
AC_SUBST(CC_VERSION)
|
420 |
]) |
|
421 |
||
1
by brian
clean slate |
422 |
|
319.1.1
by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_ |
423 |
AC_DEFUN([DRIZZLE_CHECK_CXX_VERSION], [ |
520.4.41
by mordred
Fixed configure.ac to work cleanly on Solaris - and define some good compile flags. |
424 |
dnl Print version of CXX compiler
|
425 |
AC_MSG_CHECKING("C++ Compiler version")
|
|
426 |
if test "$GCC" = "yes"
|
|
427 |
then
|
|
1
by brian
clean slate |
428 |
CXX_VERSION=`$CXX --version | sed 1q`
|
520.4.41
by mordred
Fixed configure.ac to work cleanly on Solaris - and define some good compile flags. |
429 |
elif test "$SUNCC" = "yes"
|
430 |
then
|
|
632.1.21
by Monty Taylor
Cleaned up compiler version checking. |
431 |
CXX_VERSION=`$CXX -V 2>&1 | sed 1q`
|
520.4.41
by mordred
Fixed configure.ac to work cleanly on Solaris - and define some good compile flags. |
432 |
else
|
433 |
CXX_VERSION=""
|
|
434 |
fi
|
|
632.1.23
by Monty Taylor
One more version string cleanup. |
435 |
AC_MSG_RESULT("$CXX_VERSION")
|
520.4.41
by mordred
Fixed configure.ac to work cleanly on Solaris - and define some good compile flags. |
436 |
AC_SUBST(CXX_VERSION)
|
1
by brian
clean slate |
437 |
]) |
438 |
||
319.1.1
by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_ |
439 |
AC_DEFUN([DRIZZLE_PROG_AR], [ |
1
by brian
clean slate |
440 |
case $CXX_VERSION in
|
441 |
MIPSpro*)
|
|
442 |
AR=$CXX
|
|
443 |
ARFLAGS="-ar -o"
|
|
444 |
;;
|
|
445 |
*Forte*)
|
|
446 |
AR=$CXX
|
|
447 |
ARFLAGS="-xar -o"
|
|
448 |
;;
|
|
449 |
*)
|
|
450 |
AC_CHECK_PROG([AR], [ar], [ar]) |
|
451 |
if test -z "$AR" || test "$AR" = "false" |
|
452 |
then |
|
453 |
AC_MSG_ERROR([You need ar to build the library]) |
|
454 |
fi |
|
455 |
if test -z "$ARFLAGS" |
|
456 |
then |
|
457 |
ARFLAGS="cru" |
|
458 |
fi |
|
459 |
esac
|
|
460 |
AC_SUBST(AR) |
|
461 |
AC_SUBST(ARFLAGS) |
|
462 |
]) |
|
463 |
||
464 |
dnl
|
|
465 |
dnl Macro to check time_t range: according to C standard |
|
466 |
dnl array index must be greater than 0 => if time_t is signed, |
|
467 |
dnl the code in the macros below won't compile. |
|
468 |
dnl
|
|
469 |
||
319.1.1
by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_ |
470 |
AC_DEFUN([DRIZZLE_CHECK_TIME_T],[ |
1
by brian
clean slate |
471 |
AC_MSG_CHECKING(if time_t is unsigned)
|
472 |
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
|
|
473 |
[[
|
|
474 |
#include <time.h>
|
|
475 |
]], |
|
476 |
[[ |
|
477 |
int array[(((time_t)-1) > 0) ? 1 : -1]; |
|
478 |
]] ) |
|
479 |
], [ |
|
480 |
AC_DEFINE([TIME_T_UNSIGNED], 1, [Define to 1 if time_t is unsigned]) |
|
481 |
AC_MSG_RESULT(yes) |
|
482 |
], |
|
483 |
[AC_MSG_RESULT(no)] |
|
484 |
) |
|
485 |
]) |
|
486 |