Handle WITH/WITHOUT_PF in libsysdecode

Only filter out the PF ioctls if we're building without pf support.
Until now those were always filtered out, so truss did not show symbolic
names for pf ioctls.

Differential Revision:	https://reviews.freebsd.org/D11629
This commit is contained in:
Kristof Provost 2017-07-22 12:51:19 +00:00
parent 03f9f6aa0d
commit a342f43571
2 changed files with 8 additions and 2 deletions

View File

@ -122,7 +122,7 @@ tables.h: mktables
ioctl.c: .PHONY ioctl.c: .PHONY
.endif .endif
ioctl.c: mkioctls .META ioctl.c: mkioctls .META
env CPP="${CPP}" \ env CPP="${CPP}" MK_PF="${MK_PF}" \
/bin/sh ${.CURDIR}/mkioctls ${SYSROOT:U${DESTDIR}}${INCLUDEDIR} > ${.TARGET} /bin/sh ${.CURDIR}/mkioctls ${SYSROOT:U${DESTDIR}}${INCLUDEDIR} > ${.TARGET}
beforedepend: ioctl.c tables.h beforedepend: ioctl.c tables.h

View File

@ -17,8 +17,14 @@ LC_ALL=C; export LC_ALL
# XXX should we use an ANSI cpp? # XXX should we use an ANSI cpp?
ioctl_includes=$( ioctl_includes=$(
cd $includedir cd $includedir
filter='tee'
if [ "${MK_PF}" == "no" ]; then
filter='egrep -v (net/pfvar|net/if_pfsync)\.h'
fi
find -H -s * -name '*.h' | \ find -H -s * -name '*.h' | \
egrep -v '(net/pfvar|net/if_pfsync)\.h' | \ $filter | \
xargs egrep -l \ xargs egrep -l \
'^#[ ]*define[ ]+[A-Za-z_][A-Za-z0-9_]*[ ]+_IO[^a-z0-9_]' | '^#[ ]*define[ ]+[A-Za-z_][A-Za-z0-9_]*[ ]+_IO[^a-z0-9_]' |
awk '{printf("#include <%s>\\n", $1)}' awk '{printf("#include <%s>\\n", $1)}'