From 85f1080071d1ac15b383b7df0cac609c1dd75696 Mon Sep 17 00:00:00 2001 From: vsc Date: Tue, 28 May 2002 16:23:53 +0000 Subject: [PATCH] check for SA_SIGINFO git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@497 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- C/sysbits.c | 4 ++++ config.h.in | 1 + configure | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++ configure.in | 18 +++++++++++++++ 4 files changed, 86 insertions(+) diff --git a/C/sysbits.c b/C/sysbits.c index 60cada900..ca83ba5be 100644 --- a/C/sysbits.c +++ b/C/sysbits.c @@ -1028,7 +1028,11 @@ my_signal_info(int sig, void (*handler)(int)) sigact.sa_handler = handler; sigemptyset(&sigact.sa_mask); +#if HAVE_SIGINFO sigact.sa_flags = SA_SIGINFO; +#else + sigact.sa_flags = 0; +#endif sigaction(sig,&sigact,NULL); } diff --git a/config.h.in b/config.h.in index 8542fd4fe..8aaf215f4 100644 --- a/config.h.in +++ b/config.h.in @@ -217,6 +217,7 @@ #undef HAVE_WAITPID #undef HAVE_MPZ_XOR +#undef HAVE_SIGINFO #undef HAVE_SIGSEGV #undef HAVE_ENVIRON diff --git a/configure b/configure index 5b23d77ae..64d8aa4d5 100755 --- a/configure +++ b/configure @@ -9468,6 +9468,69 @@ _ACEOF fi +echo "$as_me:$LINENO: checking for siginfo" >&5 +echo $ECHO_N "checking for siginfo... $ECHO_C" >&6 +if test "${yap_siginfo+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include + #include + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +printf("SIGINFO value is %d\n", SA_SIGINFO); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + yap_siginfo=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +yap_siginfo=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi + +echo "$as_me:$LINENO: result: $yap_siginfo" >&5 +echo "${ECHO_T}$yap_siginfo" >&6 +if test $yap_siginfo = yes +then +cat >>confdefs.h <<\_ACEOF +#define HAVE_SIGINFO 1 +_ACEOF + +else +cat >>confdefs.h <<\_ACEOF +#define HAVE_SIGINFO 0 +_ACEOF + +fi + echo "$as_me:$LINENO: checking union wait" >&5 echo $ECHO_N "checking union wait... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF diff --git a/configure.in b/configure.in index b5bbb3196..7e5a1dbc2 100644 --- a/configure.in +++ b/configure.in @@ -722,6 +722,24 @@ else AC_DEFINE(HAVE_SIGSEGV,0) fi +dnl check for siginfo +AC_MSG_CHECKING(for siginfo) +AC_CACHE_VAL(yap_siginfo,[ +AC_TRY_COMPILE( + #include + #include + , + printf("SIGINFO value is %d\n", SA_SIGINFO); + , + yap_siginfo=yes,yap_siginfo=no)]) +AC_MSG_RESULT($yap_siginfo) +if test $yap_siginfo = yes +then +AC_DEFINE(HAVE_SIGINFO,1) +else +AC_DEFINE(HAVE_SIGINFO,0) +fi + dnl this is copied from the Tcl code dnl this code checks whether the system defines an union wait AC_MSG_CHECKING([union wait])