diff options
author | Daniel Lange <DLange@git.local> | 2016-04-11 13:00:26 +0200 |
---|---|---|
committer | Daniel Lange <DLange@git.local> | 2016-04-11 13:00:26 +0200 |
commit | bea9b4798717b6f4e31085506dfc179eeb8dc17c (patch) | |
tree | e6b16257d9e7f8fb87b05dcdb8a0ba8bb3419eb7 /depcomp | |
parent | 1767b21eb219fb9ac332aca9f7c3abecd97b6b39 (diff) | |
download | debian_htop-bea9b4798717b6f4e31085506dfc179eeb8dc17c.tar.gz debian_htop-bea9b4798717b6f4e31085506dfc179eeb8dc17c.tar.bz2 debian_htop-bea9b4798717b6f4e31085506dfc179eeb8dc17c.zip |
Imported Upstream version 0.8.3upstream/0.8.3
Diffstat (limited to 'depcomp')
-rwxr-xr-x | depcomp | 33 |
1 files changed, 14 insertions, 19 deletions
@@ -1,9 +1,9 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2007-03-29.01 +scriptversion=2006-10-15.18 -# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software # Foundation, Inc. # This program is free software; you can redistribute it and/or modify @@ -215,39 +215,34 @@ aix) # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` + tmpdepfile="$stripped.u" if test "$libtool" = yes; then - tmpdepfile1=$dir$base.u - tmpdepfile2=$base.u - tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else - tmpdepfile1=$dir$base.u - tmpdepfile2=$dir$base.u - tmpdepfile3=$dir$base.u "$@" -M fi stat=$? + if test -f "$tmpdepfile"; then : + else + stripped=`echo "$stripped" | sed 's,^.*/,,'` + tmpdepfile="$stripped.u" + fi + if test $stat -eq 0; then : else - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + rm -f "$tmpdepfile" exit $stat fi - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - do - test -f "$tmpdepfile" && break - done if test -f "$tmpdepfile"; then + outname="$stripped.o" # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. - sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a tab and a space in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" + sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile |