signal_h.m4 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. # signal_h.m4 serial 12
  2. dnl Copyright (C) 2007-2011 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. AC_DEFUN([gl_SIGNAL_H],
  7. [
  8. AC_REQUIRE([gl_SIGNAL_H_DEFAULTS])
  9. gl_NEXT_HEADERS([signal.h])
  10. # AIX declares sig_atomic_t to already include volatile, and C89 compilers
  11. # then choke on 'volatile sig_atomic_t'. C99 requires that it compile.
  12. AC_CHECK_TYPE([volatile sig_atomic_t], [],
  13. [HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=0], [[
  14. #include <signal.h>
  15. ]])
  16. AC_REQUIRE([AC_TYPE_UID_T])
  17. dnl Persuade glibc <signal.h> to define sighandler_t.
  18. AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
  19. AC_CHECK_TYPE([sighandler_t], [], [HAVE_SIGHANDLER_T=0], [[
  20. #include <signal.h>
  21. ]])
  22. dnl Check for declarations of anything we want to poison if the
  23. dnl corresponding gnulib module is not in use.
  24. gl_WARN_ON_USE_PREPARE([[#include <signal.h>
  25. ]], [sigaction sigaddset sigdelset sigemptyset sigfillset sigismember
  26. sigpending sigprocmask])
  27. ])
  28. AC_DEFUN([gl_SIGNAL_MODULE_INDICATOR],
  29. [
  30. dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
  31. AC_REQUIRE([gl_SIGNAL_H_DEFAULTS])
  32. gl_MODULE_INDICATOR_SET_VARIABLE([$1])
  33. dnl Define it also as a C macro, for the benefit of the unit tests.
  34. gl_MODULE_INDICATOR_FOR_TESTS([$1])
  35. ])
  36. AC_DEFUN([gl_SIGNAL_H_DEFAULTS],
  37. [
  38. GNULIB_SIGNAL_H_SIGPIPE=0; AC_SUBST([GNULIB_SIGNAL_H_SIGPIPE])
  39. GNULIB_SIGPROCMASK=0; AC_SUBST([GNULIB_SIGPROCMASK])
  40. GNULIB_SIGACTION=0; AC_SUBST([GNULIB_SIGACTION])
  41. dnl Assume proper GNU behavior unless another module says otherwise.
  42. HAVE_POSIX_SIGNALBLOCKING=1; AC_SUBST([HAVE_POSIX_SIGNALBLOCKING])
  43. HAVE_SIGSET_T=1; AC_SUBST([HAVE_SIGSET_T])
  44. HAVE_SIGINFO_T=1; AC_SUBST([HAVE_SIGINFO_T])
  45. HAVE_SIGACTION=1; AC_SUBST([HAVE_SIGACTION])
  46. HAVE_STRUCT_SIGACTION_SA_SIGACTION=1;
  47. AC_SUBST([HAVE_STRUCT_SIGACTION_SA_SIGACTION])
  48. HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=1;
  49. AC_SUBST([HAVE_TYPE_VOLATILE_SIG_ATOMIC_T])
  50. HAVE_SIGHANDLER_T=1; AC_SUBST([HAVE_SIGHANDLER_T])
  51. ])