This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
explicitely => explicitly
[metaconfig.git] / U / compline / abortsig.U
1 ?RCS: $Id: abortsig.U,v 3.0.1.1 1994/10/29 16:02:19 ram Exp $
2 ?RCS:
3 ?RCS: Copyright (c) 1991-1993, Raphael Manfredi
4 ?RCS: 
5 ?RCS: You may redistribute only under the terms of the Artistic Licence,
6 ?RCS: as specified in the README file that comes with the distribution.
7 ?RCS: You may reuse parts of this distribution only within the terms of
8 ?RCS: that same Artistic Licence; a copy of which may be found at the root
9 ?RCS: of the source tree for dist 3.0.
10 ?RCS:
11 ?RCS: $Log: abortsig.U,v $
12 ?RCS: Revision 3.0.1.1  1994/10/29  16:02:19  ram
13 ?RCS: patch36: call ./usg explicitly instead of relying on PATH
14 ?RCS:
15 ?RCS: Revision 3.0  1993/08/18  12:05:20  ram
16 ?RCS: Baseline for dist 3.0 netwide release.
17 ?RCS:
18 ?MAKE:abortsig: Myread Oldconfig Guess cat Compile rm
19 ?MAKE:  -pick add $@ %<
20 ?S:abortsig:
21 ?S:     This variable holds the name of the signal used by the abort() call.
22 ?S:.
23 ?C:ABORTSIG:
24 ?C:     This symbol holds the signal number (symbol) used by the abort() call. To
25 ?C:     actually define the signal symbol, <signal.h> should be included.
26 ?C:.
27 ?H:#define ABORTSIG $abortsig           /**/
28 ?H:.
29 ?T:signal
30 : which signal is sent by abort ?
31 echo " "
32 case "$abortsig" in
33 '')
34         echo "Checking to see which signal is sent to the process by abort()..." >&4
35         echo "abort" > abort.sh
36         chmod +x abort.sh
37 ?X: SIGABRT should replace SIGIOT on USG machines in a near future (1991).
38         for signal in SIGIOT SIGILL SIGABRT; do
39                 case "$abortsig" in
40                 '') $cat >abort.c <<EOP
41 #include <signal.h>
42 caught() { exit(0); }
43 int main()
44 {
45 #ifdef $signal
46         signal($signal, caught);
47 #endif
48         if (-1 == abort())
49                 exit(1);
50         exit(1);
51 }
52 EOP
53 ?X: We have to use the abort.sh script otherwise sh behaves strangely on AIX.
54                         set abort
55                         if eval $compile; then
56                                 (./abort.sh) >/dev/null 2>&1
57                                 case $? in
58                                 0) abortsig="$signal";;
59                                 esac
60                         fi
61                         ;;
62                 esac
63         done
64         ;;
65 esac
66 case "$abortsig" in
67 '') echo "(I wasn't able to compute the signal name--guessing)"
68         if ./usg; then
69                 dflt="SIGIOT"
70         else
71                 dflt="SIGILL"
72         fi;;
73 *)  dflt="$abortsig"
74         ;;
75 esac
76 rp="Which signal does abort() send to the process (signal name)?"
77 . ./myread
78 abortsig="$ans"
79 $rm -f core abort.sh abort abort.c
80