Tidy PerlIO::Via
[p5sagit/p5-mst-13.2.git] / makedepend.SH
index 19c90d6..5894995 100755 (executable)
@@ -18,10 +18,6 @@ case "$0" in
 */*) cd `expr X$0 : 'X\(.*\)/'` ;;
 esac
 
-case "$osname" in
-amigaos) cat=/bin/cat ;; # must be absolute
-esac
-
 echo "Extracting makedepend (with variable substitutions)"
 rm -f makedepend
 $spitshell >makedepend <<!GROK!THIS!
@@ -33,6 +29,13 @@ trnl='$trnl'
 !GROK!THIS!
 $spitshell >>makedepend <<'!NO!SUBS!'
 
+if test -d .depending; then
+       echo "$0: Already running, exiting."
+       exit 0
+fi
+
+mkdir .depending
+
 # This script should be called with 
 #     sh ./makedepend MAKE=$(MAKE)
 case "$1" in 
@@ -62,6 +65,10 @@ esac
 PATH=".$path_sep..$path_sep$PATH"
 export PATH
 
+case "$osname" in
+amigaos) cat=/bin/cat ;; # must be absolute
+esac
+
 $cat /dev/null >.deptmp
 $rm -f *.c.c c/*.c.c
 if test -f Makefile; then
@@ -130,9 +137,6 @@ for file in `$cat .clist`; do
        -e p \
        -e '}' ) >UU/$file.c
     if [ "$osname" = os390 ]; then
-        if [ "$file" = perly.c ]; then
-            $echo '#endif' >>UU/$file.c
-        fi
         $cppstdin $finc -I. $cppflags $cppminus <UU/$file.c |
         $sed \
            -e '/^#.*<stdin>/d' \
@@ -151,6 +155,7 @@ for file in `$cat .clist`; do
            -e '1d' \
            -e '/^#.*<stdin>/d' \
             -e '/^#.*<builtin>/d' \
+            -e '/^#.*<built-in>/d' \
             -e '/^#.*<command line>/d' \
            -e '/^#.*"-"/d' \
            -e '/: file path prefix .* never used$/d' \
@@ -226,6 +231,7 @@ $cp $mf.new $mf
 $rm $mf.new
 $echo "# WARNING: Put nothing here or make depend will gobble it up!" >> $mf
 $rm -rf .deptmp UU .shlist .clist .hlist .hsed
+rmdir .depending
 
 !NO!SUBS!
 $eunicefix makedepend