1set -e 2
| 1set -e 2
|
3# $FreeBSD: head/usr.bin/kdump/mkioctls 111922 2003-03-05 19:19:08Z peter $
| 3# $FreeBSD: head/usr.bin/kdump/mkioctls 126244 2004-02-25 21:45:41Z des $
|
4 5if [ "x$1" = "x-s" ]; then 6 use_switch=1 7 shift 8else 9 use_switch=0 10fi 11 12if [ -z "$1" ]; then 13 echo "usage: sh $0 [-s] include-dir" 14 exit 1 15fi 16 17LC_ALL=C; export LC_ALL 18 19# Build a list of headers that have ioctls in them. 20# XXX should we use an ANSI cpp? 21ioctl_includes=` 22 cd $1
| 4 5if [ "x$1" = "x-s" ]; then 6 use_switch=1 7 shift 8else 9 use_switch=0 10fi 11 12if [ -z "$1" ]; then 13 echo "usage: sh $0 [-s] include-dir" 14 exit 1 15fi 16 17LC_ALL=C; export LC_ALL 18 19# Build a list of headers that have ioctls in them. 20# XXX should we use an ANSI cpp? 21ioctl_includes=` 22 cd $1
|
23 find -s * -name '*.h' -follow |
| 23 find -H -s * -name '*.h' |
|
24 xargs egrep -l \ 25'^#[ ]*define[ ]+[A-Za-z_][A-Za-z0-9_]*[ ]+_IO[^a-z0-9_]' | 26 awk '{printf("#include <%s>\\\\n", $1)}' 27` 28 29awk -v x="$ioctl_includes" 'BEGIN {print x}' | 30 gcc -E -I$1 -dM - | 31 awk -v ioctl_includes="$ioctl_includes" -v use_switch="$use_switch" '
--- 58 unchanged lines hidden --- | 24 xargs egrep -l \ 25'^#[ ]*define[ ]+[A-Za-z_][A-Za-z0-9_]*[ ]+_IO[^a-z0-9_]' | 26 awk '{printf("#include <%s>\\\\n", $1)}' 27` 28 29awk -v x="$ioctl_includes" 'BEGIN {print x}' | 30 gcc -E -I$1 -dM - | 31 awk -v ioctl_includes="$ioctl_includes" -v use_switch="$use_switch" '
--- 58 unchanged lines hidden --- |