summaryrefslogtreecommitdiff
blob: ca0850b225c3043d667fdf2bcaefce0857a278bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
--- bash-3.0/Makefile.in
+++ bash-3.0/Makefile.in
@@ -607,7 +607,11 @@
 
 ${LIBINTL_H}:	${INTL_LIBRARY}
 
-mksignames$(EXEEXT):	$(SUPPORT_SRC)mksignames.c
+$(SUPPORT_SRC)mksignames.h:	$(SUPPORT_SRC)mksignames.sh
+	CPP="$(CPP)" CPPFLAGS="$(CPPFLAGS)" /bin/sh $(SUPPORT_SRC)mksignames.sh
+	mv mksignames.h $(SUPPORT_SRC)mksignames.h
+
+mksignames$(EXEEXT):	$(SUPPORT_SRC)mksignames.c $(SUPPORT_SRC)mksignames.h
 	$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) -o $@ $(SUPPORT_SRC)mksignames.c
 
 mksyntax$(EXEEXT):	${srcdir}/mksyntax.c config.h syntax.h ${BASHINCDIR}/chartypes.h
--- bash-3.0/support/mksignames.c
+++ bash-3.0/support/mksignames.c
@@ -30,9 +30,7 @@
 #  include "ansi_stdlib.h"
 #endif /* HAVE_STDLIB_H */
 
-#if !defined (NSIG)
-#  define NSIG 64
-#endif
+#include "mksignames.h"
 
 /*
  * Special traps:
--- bash-3.0/support/mksignames.sh
+++ bash-3.0/support/mksignames.sh
@@ -0,0 +1,60 @@
+#!/bin/sh
+
+input_header=mksignames.input.h
+output_header=mksignames.h
+
+rm -f $input_header $output_header
+
+cat >> $input_header << _ACEOF
+#include <config.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <signal.h>
+#if defined (HAVE_STDLIB_H)
+#  include <stdlib.h>
+#else
+#  include "ansi_stdlib.h"
+#endif /* HAVE_STDLIB_H */
+
+#if !defined (NSIG)
+# define NSIG 64
+#endif
+
+_ACEOF
+
+deflist="NSIG SIGRTMAX SIGRTMIN SIGLOST SIGMSG SIGDANGER SIGMIGRATE SIGPRE 
+SIGVIRT SIGALRM1 SIGWAITING SIGGRANT SIGKAP SIGRETRACT SIGSOUND SIGSAK SIGLWP 
+SIGFREEZE SIGTHAW SIGCANCEL SIGDIL SIGCLD SIGPWR SIGPOLL SIGWINDOW SIGHUP 
+SIGINT SIGQUIT SIGILL SIGTRAP SIGIOT SIGABRT SIGEMT SIGFPE SIGKILL SIGBUS 
+SIGSEGV SIGSYS SIGPIPE SIGALRM SIGTERM SIGURG SIGSTOP SIGTSTP SIGCONT SIGCHLD 
+SIGTTIN SIGTTOU SIGIO SIGXCPU SIGXFSZ SIGVTALRM SIGPROF SIGWINCH SIGINFO 
+SIGUSR1 SIGUSR2 SIGKILLTHR"
+
+for def in $deflist ; do
+	echo "#undef $def" >> $output_header
+	cat >> $input_header << _ACEOF
+#if defined($def)
+MKSIGNAMES_$def $def
+#endif
+_ACEOF
+done
+
+if test "x${CPPFLAGS+set}" != "xset" ; then
+	if test -f "./mksignames.c" ; then
+		CPPFLAGS="-I.. -I../include"
+	else
+		CPPFLAGS="-I. -Iinclude"
+	fi
+fi
+if test "x${CPP+set}" != "xset" ; then
+	CPP="gcc -E"
+fi
+if test "x${EGREP+set}" != "xset" ; then
+	EGREP="grep"
+fi
+$CPP $CPPFLAGS $input_header \
+	| $EGREP '^MKSIGNAMES_' \
+	| sed 's/MKSIGNAMES_/#define /' \
+	>> $output_header
+echo "/* $CPP $CPPFLAGS */" >> $output_header
+rm -f $input_header