diff options
author | Yang Tse <yangsita@gmail.com> | 2006-11-22 18:41:35 +0000 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2006-11-22 18:41:35 +0000 |
commit | 7f7d2ad5c69b1feca96ab68e18a635079d190d0b (patch) | |
tree | b6a5a43ab88df69156fb811aec94344d054c35ee /acinclude.m4 | |
parent | 4a23aef23c1cc3f958b381bac54c31d67744e8e6 (diff) | |
download | c-ares-7f7d2ad5c69b1feca96ab68e18a635079d190d0b.tar.gz c-ares-7f7d2ad5c69b1feca96ab68e18a635079d190d0b.tar.bz2 c-ares-7f7d2ad5c69b1feca96ab68e18a635079d190d0b.zip |
Added a check in configure that verifies if <signal.h> is available,
defining HAVE_SIGNAL_H if the header is available.
Added a check in configure that tests if the sig_atomic_t type is
available, defining HAVE_SIG_ATOMIC_T if it is available. Providing
a suitable default in setup_once.h if not available.
Added a check in configure that tests if the sig_atomic_t type is
already defined as volatile, defining HAVE_SIG_ATOMIC_T_VOLATILE
if it is available and already defined as volatile.
Diffstat (limited to 'acinclude.m4')
-rw-r--r-- | acinclude.m4 | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/acinclude.m4 b/acinclude.m4 index 9a28404..7cfaec4 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1013,6 +1013,48 @@ AC_DEFUN([CURL_CHECK_STRUCT_TIMEVAL], [ ]) # AC_DEFUN +dnl TYPE_SIG_ATOMIC_T +dnl ------------------------------------------------- +dnl Check if the sig_atomic_t type is available, and +dnl verify if it is already defined as volatile. + +AC_DEFUN([TYPE_SIG_ATOMIC_T], [ + AC_CHECK_HEADERS(signal.h) + AC_CHECK_TYPE([sig_atomic_t],[ + AC_DEFINE(HAVE_SIG_ATOMIC_T, 1, + [Define to 1 if sig_atomic_t is an available typedef.]) + ], ,[ +#ifdef HAVE_SIGNAL_H +#include <signal.h> +#endif + ]) + case "$ac_cv_type_sig_atomic_t" in + yes) + # + AC_MSG_CHECKING([if sig_atomic_t is already defined as volatile]) + AC_TRY_LINK([ +#ifdef HAVE_SIGNAL_H +#include <signal.h> +#endif + ],[ + static volatile sig_atomic_t dummy = 0; + ],[ + AC_MSG_RESULT([no]) + ac_cv_sig_atomic_t_volatile="no" + ],[ + AC_MSG_RESULT([yes]) + ac_cv_sig_atomic_t_volatile="yes" + ]) + # + if test "$ac_cv_sig_atomic_t_volatile" = "yes"; then + AC_DEFINE(HAVE_SIG_ATOMIC_T_VOLATILE, 1, + [Define to 1 if sig_atomic_t is already defined as volatile.]) + fi + ;; + esac +]) # AC_DEFUN + + dnl CURL_CHECK_NONBLOCKING_SOCKET dnl ------------------------------------------------- dnl Check for how to set a socket to non-blocking state. There seems to exist |