Require gl_SIGNAL_H_DEFAULTS.
[gnulib.git] / m4 / sigaction.m4
1 # sigaction.m4 serial 2
2 dnl Copyright (C) 2008 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
6
7 # Determine if sigaction interface is present.
8 AC_DEFUN([gl_SIGACTION],
9 [
10   AC_REQUIRE([gl_SIGNAL_H_DEFAULTS])
11   dnl Due to autoconf conventions, we can't tell if HAVE_SIGACTION
12   dnl means we have the type or means we have the function.  We assume
13   dnl that all implementations either have both or neither.
14   AC_REPLACE_FUNCS([sigaction])
15   if test $ac_cv_func_sigaction = no ; then
16     HAVE_SIGACTION=0
17     AC_SUBST([HAVE_SIGACTION])
18     gl_PREREQ_SIGACTION
19   fi
20 ])
21
22 # Prerequisites of the part of lib/signal.in.h and of lib/sigaction.c.
23 AC_DEFUN([gl_PREREQ_SIGACTION],
24 [
25   AC_REQUIRE([gl_SIGNAL_H_DEFAULTS])
26   AC_REQUIRE([AC_C_RESTRICT])
27   AC_REQUIRE([AC_TYPE_UID_T])
28   AC_CHECK_FUNCS_ONCE([sigaltstack siginterrupt])
29   AC_CHECK_TYPES([siginfo_t], [], [], [[
30 #include <signal.h>
31   ]])
32   if test $ac_cv_type_siginfo_t = no; then
33     HAVE_SIGINFO_T=0
34     AC_SUBST([HAVE_SIGINFO_T])
35   fi
36   gl_PREREQ_SIG_HANDLER_H
37 ])