summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2002-06-15 08:47:25 +0000
committerJim Meyering <jim@meyering.net>2002-06-15 08:47:25 +0000
commitef159d5cdbc09f14c118cd319ce36308e1413226 (patch)
tree4182ee7d6d444d85d749002ec8bb4026632df61e /config
parent58e6f3d386624b98595d582a8a7d54d1f587cf57 (diff)
downloadcoreutils-ef159d5cdbc09f14c118cd319ce36308e1413226.tar.xz
.
Diffstat (limited to 'config')
-rw-r--r--config/depcomp66
1 files changed, 61 insertions, 5 deletions
diff --git a/config/depcomp b/config/depcomp
index 340abb153..807b991f4 100644
--- a/config/depcomp
+++ b/config/depcomp
@@ -254,11 +254,40 @@ tru64)
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
- # always write the proprocessed file to stdout, regardless of -o,
- # because we must use -o when running libtool.
+ # always write the proprocessed file to stdout, regardless of -o.
"$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test $1 != '--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove `-o $object'. We will use -o /dev/null later,
+ # however we can't do the remplacement now because
+ # `-o $object' might simply not be used
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
test -z "$dashmflag" && dashmflag=-M
- "$@" $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
+ "$@" -o /dev/null $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
tr ' ' '
@@ -310,9 +339,36 @@ makedepend)
cpp)
# Important note: in order to support this mode, a compiler *must*
- # always write the proprocessed file to stdout, regardless of -o,
- # because we must use -o when running libtool.
+ # always write the proprocessed file to stdout.
"$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test $1 != '--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove `-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
"$@" -E |
sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
sed '$ s: \\$::' > "$tmpdepfile"