1#!/bin/sh 2#
| 1#!/bin/sh 2#
|
3# $FreeBSD: head/usr.bin/kdump/mkioctls 192768 2009-05-25 20:07:41Z ed $
| 3# $FreeBSD: head/usr.bin/kdump/mkioctls 192901 2009-05-27 16:16:56Z thompsa $
|
4 5set -e 6 7if [ "x$1" = "x-s" ]; then 8 use_switch=1 9 shift 10else 11 use_switch=0 12fi 13 14if [ -z "$1" ]; then 15 echo "usage: sh $0 [-s] include-dir" 16 exit 1 17fi 18 19LC_ALL=C; export LC_ALL 20
| 4 5set -e 6 7if [ "x$1" = "x-s" ]; then 8 use_switch=1 9 shift 10else 11 use_switch=0 12fi 13 14if [ -z "$1" ]; then 15 echo "usage: sh $0 [-s] include-dir" 16 exit 1 17fi 18 19LC_ALL=C; export LC_ALL 20
|
21# include subdirs to exclude from the search 22exclude="^legacy/.*" 23
| |
24# Build a list of headers that have ioctls in them. 25# XXX should we use an ANSI cpp? 26ioctl_includes=` 27 cd $1
| 21# Build a list of headers that have ioctls in them. 22# XXX should we use an ANSI cpp? 23ioctl_includes=` 24 cd $1
|
28 find -H -s * -name '*.h' \! -regex $exclude |
| 25 find -H -s * -name '*.h' |
|
29 xargs egrep -l \ 30'^#[ ]*define[ ]+[A-Za-z_][A-Za-z0-9_]*[ ]+_IO[^a-z0-9_]' | 31 awk '{printf("#include <%s>\\\\n", $1)}' 32` 33 34awk -v x="$ioctl_includes" 'BEGIN {print x}' | 35 gcc -E -I$1 -dM -DCOMPAT_43TTY - | 36 awk -v ioctl_includes="$ioctl_includes" -v use_switch="$use_switch" '
--- 57 unchanged lines hidden --- | 26 xargs egrep -l \ 27'^#[ ]*define[ ]+[A-Za-z_][A-Za-z0-9_]*[ ]+_IO[^a-z0-9_]' | 28 awk '{printf("#include <%s>\\\\n", $1)}' 29` 30 31awk -v x="$ioctl_includes" 'BEGIN {print x}' | 32 gcc -E -I$1 -dM -DCOMPAT_43TTY - | 33 awk -v ioctl_includes="$ioctl_includes" -v use_switch="$use_switch" '
--- 57 unchanged lines hidden --- |