~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to m4/misc.m4

  • Committer: Brian Aker
  • Date: 2009-01-10 22:27:38 UTC
  • mfrom: (779.1.8 devel)
  • Revision ID: brian@tangent.org-20090110222738-zx4zzq9lsa3othvn
Merge for Monty

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
[ac_save_CXXFLAGS="$CXXFLAGS"
6
6
AC_CACHE_CHECK([base type of last arg to accept], mysql_cv_btype_last_arg_accept,
7
7
AC_LANG_PUSH(C++)
8
 
if test "$ac_cv_prog_gxx" = "yes"
 
8
if test "$GXX" = "yes"
9
9
then
10
10
  # Add -Werror, remove -fbranch-probabilities (Bug #268)
11
11
  CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed -e 's/-fbranch-probabilities//; s/-Wall//; s/-Wcheck//'`
41
41
])
42
42
#---END:
43
43
 
44
 
dnl Find type of qsort
45
 
AC_DEFUN([DRIZZLE_TYPE_QSORT],
46
 
[AC_CACHE_CHECK([return type of qsort], mysql_cv_type_qsort,
47
 
[AC_TRY_COMPILE([#include <stdlib.h>
48
 
#ifdef __cplusplus
49
 
extern "C"
50
 
#endif
51
 
void qsort(void *base, size_t nel, size_t width,
52
 
 int (*compar) (const void *, const void *));
53
 
],
54
 
[int i;], mysql_cv_type_qsort=void, mysql_cv_type_qsort=int)])
55
 
AC_DEFINE_UNQUOTED([RETQSORTTYPE], [$mysql_cv_type_qsort],
56
 
                   [The return type of qsort (int or void).])
57
 
if test "$mysql_cv_type_qsort" = "void"
58
 
then
59
 
 AC_DEFINE_UNQUOTED([QSORT_TYPE_IS_VOID], [1], [qsort returns void])
60
 
fi
61
 
])
62
44
 
63
45
#---START: Figure out whether to use 'struct rlimit' or 'struct rlimit64'
64
46
AC_DEFUN([DRIZZLE_TYPE_STRUCT_RLIMIT],
65
47
[ac_save_CXXFLAGS="$CXXFLAGS"
66
48
AC_CACHE_CHECK([struct type to use with setrlimit], mysql_cv_btype_struct_rlimit,
67
49
AC_LANG_PUSH(C++)
68
 
if test "$ac_cv_prog_gxx" = "yes"
 
50
if test "$GXX" = "yes"
69
51
then
70
52
  # Add -Werror, remove -fbranch-probabilities (Bug #268)
71
53
  CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed -e 's/-fbranch-probabilities//; s/-Wall//; s/-Wcheck//'`
225
207
esac
226
208
])
227
209
 
228
 
# Orginal from bash-2.0 aclocal.m4, Changed to use termcap last by monty.
229
 
 
230
 
AC_DEFUN([DRIZZLE_CHECK_LIB_TERMCAP],
231
 
[
232
 
AC_CACHE_VAL(mysql_cv_termcap_lib,
233
 
[AC_CHECK_LIB(ncurses, tgetent, mysql_cv_termcap_lib=libncurses,
234
 
    [AC_CHECK_LIB(curses, tgetent, mysql_cv_termcap_lib=libcurses,
235
 
        [AC_CHECK_LIB(termcap, tgetent, mysql_cv_termcap_lib=libtermcap,
236
 
          [AC_CHECK_LIB(tinfo, tgetent, mysql_cv_termcap_lib=libtinfo,
237
 
            mysql_cv_termcap_lib=NOT_FOUND)])])])])
238
 
AC_MSG_CHECKING(for termcap functions library)
239
 
if test "$mysql_cv_termcap_lib" = "NOT_FOUND"; then
240
 
AC_MSG_ERROR([No curses/termcap library found])
241
 
elif test "$mysql_cv_termcap_lib" = "libtermcap"; then
242
 
TERMCAP_LIB=-ltermcap
243
 
elif test "$mysql_cv_termcap_lib" = "libncurses"; then
244
 
TERMCAP_LIB=-lncurses
245
 
elif test "$mysql_cv_termcap_lib" = "libtinfo"; then
246
 
TERMCAP_LIB=-ltinfo
247
 
else
248
 
TERMCAP_LIB=-lcurses
249
 
fi
250
 
AC_MSG_RESULT($TERMCAP_LIB)
251
 
])
252
210
 
253
211
dnl Check type of signal routines (posix, 4.2bsd, 4.1bsd or v7)
254
212
AC_DEFUN([DRIZZLE_SIGNAL_CHECK],
271
229
    [
272
230
      AC_TRY_LINK([
273
231
        #include <signal.h>
274
 
        RETSIGTYPE foo() { }], [
 
232
        void foo() { }], [
275
233
                int mask = sigmask(SIGINT);
276
234
                sigset(SIGINT, foo); sigrelse(SIGINT);
277
235
                sighold(SIGINT); sigpause(SIGINT);
330
288
fi
331
289
])
332
290
 
333
 
AC_DEFUN([DRIZZLE_TYPE_SIGHANDLER],
334
 
[AC_MSG_CHECKING([whether signal handlers are of type void])
335
 
AC_CACHE_VAL(mysql_cv_void_sighandler,
336
 
[AC_TRY_COMPILE([#include <sys/types.h>
337
 
#include <signal.h>
338
 
#ifdef signal
339
 
#undef signal
340
 
#endif
341
 
#ifdef __cplusplus
342
 
extern "C"
343
 
#endif
344
 
void (*signal ()) ();],
345
 
[int i;], mysql_cv_void_sighandler=yes, mysql_cv_void_sighandler=no)])dnl
346
 
AC_MSG_RESULT($mysql_cv_void_sighandler)
347
 
if test "$mysql_cv_void_sighandler" = "yes"; then
348
 
AC_DEFINE(VOID_SIGHANDLER, [1], [sighandler type is void (*signal ()) ();])
349
 
fi
350
 
])
351
291
 
352
292
AC_DEFUN([DRIZZLE_STACK_DIRECTION],
353
293
 [AC_CACHE_CHECK(stack direction for C alloca, ac_cv_c_stack_direction,