]> git.cworth.org Git - gzip/blobdiff - depcomp
Imported Debian patch 1.3.5-10
[gzip] / depcomp
diff --git a/depcomp b/depcomp
index 65899658ee7fe8de71d8f8fbcd869440f173ed5d..368e3be93e0b80b87f428763574b9d099bd38bfd 100755 (executable)
--- a/depcomp
+++ b/depcomp
@@ -31,7 +31,16 @@ if test -z "$depmode" || test -z "$source" || test -z "$object"; then
 fi
 # `libtool' can also be set to `yes' or `no'.
 
-depfile=${depfile-`echo "$object" | sed 's,\([^/]*\)$,.deps/\1,;s/\.\([^.]*\)$/.P\1/'`}
+if test -z "$depfile"; then
+   base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'`
+   dir=`echo "$object" | sed 's,/.*$,/,'`
+   if test "$dir" = "$object"; then
+      dir=
+   fi
+   # FIXME: should be _deps on DOS.
+   depfile="$dir.deps/$base"
+fi
+
 tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
 
 rm -f "$tmpdepfile"
@@ -204,8 +213,9 @@ tru64)
    # dependencies in `foo.d' instead, so we check for that too.
    # Subdirectories are respected.
 
-   tmpdepfile1="$object.d"
-   tmpdepfile2=`echo "$object" | sed -e 's/.o$/.d/'` 
+   base=`echo "$object" | sed -e 's/\.o$/.d/' -e 's/\.lo$/.d/'`
+   tmpdepfile1="$base.o.d"
+   tmpdepfile2="$base.d"
    if test "$libtool" = yes; then
       "$@" -Wc,-MD
    else
@@ -314,7 +324,7 @@ makedepend)
   if test "$stat" != 0; then exit $stat; fi
   rm -f "$depfile"
   cat < "$tmpdepfile" > "$depfile"
-  tail +3 "$tmpdepfile" | tr ' ' '
+  sed '1,2d' "$tmpdepfile" | tr ' ' '
 ' | \
 ## Some versions of the HPUX 10.20 sed can't process this invocation
 ## correctly.  Breaking it into two sed invocations is a workaround.
@@ -382,6 +392,21 @@ msvisualcpp)
       done
       ;;
     esac
+    for arg
+    do
+      case "$arg" in
+      "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+       set fnord "$@"
+       shift
+       shift
+       ;;
+      *)
+       set fnord "$@" "$arg"
+       shift
+       shift
+       ;;
+      esac
+    done
     "$@" -E |
     sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
   ) &