pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/compat_headers/files minor nits and comments



details:   https://anonhg.NetBSD.org/pkgsrc/rev/604cf09a95ed
branches:  trunk
changeset: 542638:604cf09a95ed
user:      tnn <tnn%pkgsrc.org@localhost>
date:      Sat May 24 04:29:06 2008 +0000

description:
minor nits and comments

diffstat:

 pkgtools/compat_headers/files/mkhdr.sh |  13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diffs (30 lines):

diff -r 5a27f78be9ab -r 604cf09a95ed pkgtools/compat_headers/files/mkhdr.sh
--- a/pkgtools/compat_headers/files/mkhdr.sh    Sat May 24 04:19:48 2008 +0000
+++ b/pkgtools/compat_headers/files/mkhdr.sh    Sat May 24 04:29:06 2008 +0000
@@ -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 '^$'



Home | Main Index | Thread Index | Old Index