diff options
author | tnn <tnn@pkgsrc.org> | 2008-05-24 04:29:06 +0000 |
---|---|---|
committer | tnn <tnn@pkgsrc.org> | 2008-05-24 04:29:06 +0000 |
commit | a80e5534790a35d061df83e34961997046e301c0 (patch) | |
tree | 25543591d351f3f62a0fad952c107473f9c2afad | |
parent | 0223d43765e0e99ed7868c8674a68862db9ef31f (diff) | |
download | pkgsrc-a80e5534790a35d061df83e34961997046e301c0.tar.gz |
minor nits and comments
-rwxr-xr-x | pkgtools/compat_headers/files/mkhdr.sh | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/pkgtools/compat_headers/files/mkhdr.sh b/pkgtools/compat_headers/files/mkhdr.sh index 07fc3351476..a432065c452 100755 --- a/pkgtools/compat_headers/files/mkhdr.sh +++ b/pkgtools/compat_headers/files/mkhdr.sh @@ -1,18 +1,21 @@ #! /bin/sh # -# $NetBSD: mkhdr.sh,v 1.1.1.1 2008/05/24 03:35:42 tnn Exp $ +# $NetBSD: mkhdr.sh,v 1.2 2008/05/24 04:29:06 tnn Exp $ # [ "${CC}" = "" ] && CC="cc" -CPP="${CC} -E -" +CPP="${CC} -E" # Prints the full absolute pathname to the file that is included by doing # #include <file.h>. real_header() { - echo "#include <$1>" | $CPP - 2> /dev/null |\ - awk -F\" '/^\# 1 "\// {if(!done){print $2;done=1;}}' + echo "#include <$1>" | ${CPP} - 2> /dev/null |\ + awk -F\" '/^\# 1 "\// {if (!done) {print $2; done=1; }}' } +# Find the real header path real_hdr="`real_header $1`" [ "${real_hdr}" = "" ] && real_hdr="stdio.h" -${CPP} | sed -e "s,@real_header@,${real_hdr}," -e 's/^#.*//' -e 's/^@/#/' | grep -v '^$' +# Preprocess the input header. Substitute the real header location and +# remove empty lines afterwards. +${CPP} - | sed -e "s,@real_header@,${real_hdr}," -e 's/^#.*//' -e 's/^@/#/' | grep -v '^$' |