X-Git-Url: https://perl5.git.perl.org/metaconfig.git/blobdiff_plain/30a44e63656bfd6419a675771dc4b050556b1485..8cfbfbfe9a5222b3c251a5be45366861e6516b30:/U/modified/Findhdr.U diff --git a/U/modified/Findhdr.U b/U/modified/Findhdr.U index 6cc2940..28e181d 100644 --- a/U/modified/Findhdr.U +++ b/U/modified/Findhdr.U @@ -28,7 +28,7 @@ ?X: empty string with an error status if the file could not be located. ?X: ?MAKE:Findhdr: grep test tr rm +usrinc awk cat startsh \ - cppstdin cppminus +cppflags + cppstdin cppminus +cppflags osname ?MAKE: -pick add $@ %< ?LINT:define fieldn ?S:fieldn: @@ -40,10 +40,14 @@ ?S:. ?V:fieldn ?F:./findhdr !fieldn -?T:cline pos wanted name awkprg usrincdir status cppfilter +?T:cline pos wanted name awkprg usrincdir status cppfilter testaccess : determine filename position in cpp output echo " " echo "Computing filename position in cpp output for #include directives..." >&4 +case "$osname" in +vos) testaccess=-e ;; +*) testaccess=-r ;; +esac echo '#include ' > foo.c $cat >fieldn < +os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \ +*) cppfilter='' ;; +esac ?X: To locate a header file, we cannot simply check for $usrinc/file.h, since ?X: some machine have the headers in weird places and our only hope is that ?X: the C pre-processor will know how to find those headers. Thank you NexT! @@ -91,12 +100,8 @@ do done awkprg='{ print \$$fieldn }' echo "#include <\$wanted>" > foo\$\$.c -case "$osname" in -vos) cppfilter="tr '\\\\>' '/'" ;; # path component separator is > -*) cppfilter="cat" ;; -esac $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \ -$cppfilter | $grep "^[ ]*#.*\$wanted" | \ +$cppfilter $grep "^[ ]*#.*\$wanted" | \ while read cline; do name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\` case "\$name" in