summaryrefslogtreecommitdiff
path: root/lib/depcomp
diff options
context:
space:
mode:
authorPeter Rosin <peda@lysator.liu.se>2011-09-05 16:35:54 +0200
committerPeter Rosin <peda@lysator.liu.se>2011-09-05 16:35:54 +0200
commitb07777bd6da63018e845e18ce96c4168343b47b6 (patch)
tree93fe5ffcb8595359ad59ca8e6a396403ff5b514f /lib/depcomp
parent38846c5f1cb8ad3745bc9a37816fb1cb7d75b399 (diff)
parent3c99e9dca034ba5cbe3848af024aea5b4fc19b6c (diff)
downloadautomake-b07777bd6da63018e845e18ce96c4168343b47b6.tar.gz
Merge branch 'maint' into msvc
Diffstat (limited to 'lib/depcomp')
-rwxr-xr-xlib/depcomp16
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/depcomp b/lib/depcomp
index c3163befc..9825d56d7 100755
--- a/lib/depcomp
+++ b/lib/depcomp
@@ -1,10 +1,10 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
-scriptversion=2010-10-07.20; # UTC
+scriptversion=2011-04-16.09; # UTC
-# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010
-# Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010,
+# 2011 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -166,10 +166,12 @@ gcc)
' < "$tmpdepfile" |
## Some versions of gcc put a space before the `:'. On the theory
## that the space means something, we add a space to the output as
-## well.
+## well. hp depmode also adds that space, but also prefixes the VPATH
+## to the object. Take care to not repeat it in the output.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
- sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
+ | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
@@ -557,7 +559,9 @@ makedepend)
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
- cat < "$tmpdepfile" > "$depfile"
+ # makedepend may prepend the VPATH from the source file name to the object.
+ # No need to regex-escape $object, excess matching of '.' is harmless.
+ sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
sed '1,2d' "$tmpdepfile" | tr ' ' '
' | \
## Some versions of the HPUX 10.20 sed can't process this invocation