697 |
} |
} |
698 |
|
|
699 |
|
|
700 |
|
check_HAVE_SIGREG() { |
701 |
|
get_fortran_c_namemangling |
702 |
|
cat <<EOF > genmake_tc_1.c |
703 |
|
$FC_NAMEMANGLE |
704 |
|
#include <stdlib.h> |
705 |
|
#include <stdio.h> |
706 |
|
#include <signal.h> |
707 |
|
#include <errno.h> |
708 |
|
#include <ucontext.h> |
709 |
|
|
710 |
|
int * ip; |
711 |
|
|
712 |
|
static void killhandler( |
713 |
|
unsigned int sn, siginfo_t si, struct ucontext *sc ) |
714 |
|
{ |
715 |
|
*ip = *ip + 1; |
716 |
|
return; |
717 |
|
} |
718 |
|
|
719 |
|
void FC_NAMEMANGLE(sigreg) (int * aip) |
720 |
|
{ |
721 |
|
struct sigaction s; |
722 |
|
ip = aip; |
723 |
|
s.sa_flags = SA_SIGINFO; |
724 |
|
s.sa_sigaction = (void *)killhandler; |
725 |
|
if(sigaction (SIGTERM,&s,(struct sigaction *)NULL)) { |
726 |
|
printf("Sigaction returned error = %d\n", errno); |
727 |
|
exit(0); |
728 |
|
} |
729 |
|
return; |
730 |
|
} |
731 |
|
EOF |
732 |
|
make genmake_tc_1.o >> genmake_warnings 2>&1 |
733 |
|
RET_C=$? |
734 |
|
cat <<EOF > genmake_tc_2.$FS |
735 |
|
program hello |
736 |
|
integer anint |
737 |
|
common /iv/ anint |
738 |
|
external sigreg |
739 |
|
call sigreg(anint) |
740 |
|
end |
741 |
|
EOF |
742 |
|
echo >> genmake_warnings |
743 |
|
echo "running: check_HAVE_SIGREG()" >> genmake_warnings |
744 |
|
cat genmake_tc_2.$FS >> genmake_warnings |
745 |
|
COMM="$FC $FFLAGS -o genmake_tc genmake_tc_2.$FS genmake_tc_1.o" |
746 |
|
echo $COMM >> genmake_warnings |
747 |
|
$COMM >> genmake_warnings 2>&1 |
748 |
|
RETVAL=$? |
749 |
|
if test "x$RETVAL" = x0 ; then |
750 |
|
HAVE_SIGREG=t |
751 |
|
DEFINES="$DEFINES -DHAVE_SIGREG" |
752 |
|
fi |
753 |
|
rm -f genmake_tc* |
754 |
|
} |
755 |
|
|
756 |
|
|
757 |
check_HAVE_SETRLSTK() { |
check_HAVE_SETRLSTK() { |
758 |
get_fortran_c_namemangling |
get_fortran_c_namemangling |
759 |
cat <<EOF > genmake_tc_1.c |
cat <<EOF > genmake_tc_1.c |
1512 |
echo "yes" |
echo "yes" |
1513 |
else |
else |
1514 |
echo "no" |
echo "no" |
1515 |
|
fi |
1516 |
|
rm -f genmake_t* |
1517 |
|
|
1518 |
|
printf " Can we register a signal handler using $FC... " |
1519 |
|
check_HAVE_SIGREG |
1520 |
|
if test "x$HAVE_SIGREG" != x ; then |
1521 |
|
echo "yes" |
1522 |
|
else |
1523 |
|
echo "no" |
1524 |
fi |
fi |
1525 |
rm -f genmake_t* |
rm -f genmake_t* |
1526 |
|
|