This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
slightly more for Exporter.pm
[perl5.git] / makedepend.SH
index 9a6f4c1..0355810 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-case $CONFIGDOTSH in
+case $PERL_CONFIG_SH in
 '')
        if test -f config.sh; then TOP=.;
        elif test -f ../config.sh; then TOP=..;
@@ -18,6 +18,10 @@ 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!
@@ -37,7 +41,7 @@ esac
 
 export PATH || (echo "OOPS, this isn't sh.  Desperation time.  I will feed myself to sh."; sh \$0; kill \$\$)
 
-case $CONFIGDOTSH in
+case $PERL_CONFIG_SH in
 '')
        if test -f config.sh; then TOP=.;
        elif test -f ../config.sh; then TOP=..;
@@ -108,7 +112,11 @@ for file in `$cat .clist`; do
                        if [ "$archname" = cygwin ]; then
                                uwinfix="-e s,\\\\\\\\,/,g"
                        else
-                               uwinfix=
+                               if [ "$osname" = posix-bc ]; then
+                                       uwinfix="-e s/\\*POSIX(\\(.*\\))/\\1/"
+                               else
+                                       uwinfix=
+                               fi
                        fi
                fi
        fi
@@ -147,11 +155,14 @@ for file in `$cat .clist`; do
            -e 's|\.c\.c|.c|' $uwinfix | \
         $uniq | $sort | $uniq >> .deptmp
     else
-        $cppstdin $finc -I. $cppflags $cppminus <UU/$file.c |
+        $cppstdin $finc -I. $cppflags $cppminus <UU/$file.c 2>&1 |
         $sed \
            -e '1d' \
            -e '/^#.*<stdin>/d' \
+            -e '/^#.*<builtin>/d' \
+            -e '/^#.*<command line>/d' \
            -e '/^#.*"-"/d' \
+           -e '/: file path prefix .* never used$/d' \
            -e 's#\.[0-9][0-9]*\.c#'"$file.c#" \
            -e 's/^[     ]*#[    ]*line/#/' \
            -e '/^# *[0-9][0-9]* *[".\/]/!d' \