mksh/gensigs.sh

12 lines
484 B
Bash
Raw Normal View History

#!/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 $
2006-06-23 17:05:39 +02:00
echo '#include <signal.h>' | $CC $CPPFLAGS -E -dD -D_ANSI_SOURCE - \
| 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'" },/'
done | fgrep -v '{ ,' >signames.inc