2005-05-23 14:01:09 +02:00
|
|
|
#!/bin/sh
|
2006-06-23 17:05:39 +02:00
|
|
|
# $MirOS: src/bin/mksh/gensigs.sh,v 1.3 2006/06/23 15:05:39 tg Exp $
|
2005-05-23 14:01:09 +02:00
|
|
|
|
2006-06-23 17:05:39 +02:00
|
|
|
echo '#include <signal.h>' | $CC $CPPFLAGS -E -dD -D_ANSI_SOURCE - \
|
2005-05-23 14:01:09 +02:00
|
|
|
| grep '[ ]SIG[A-Z0-9]*[ ]' \
|
|
|
|
| sed 's/^\(.*[ ]SIG\)\([A-Z0-9]*\)\([ ].*\)$/\2/' \
|
|
|
|
| while read name; do
|
|
|
|
( echo '#include <signal.h>'; echo "__mksh_test: SIG$name" ) \
|
2006-06-23 17:05:39 +02:00
|
|
|
| $CC $CPPFLAGS -E - | fgrep __mksh_test: | sed \
|
2005-05-23 14:06:39 +02:00
|
|
|
's/^__mksh_test: \([0-9]*\).*$/ { \1, "'$name'" },/'
|
2005-05-23 14:01:09 +02:00
|
|
|
done | fgrep -v '{ ,' >signames.inc
|