[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC 10/20] depcomp: less duplication between AIX and Tru64 modes
From: |
Stefano Lattarini |
Subject: |
[RFC 10/20] depcomp: less duplication between AIX and Tru64 modes |
Date: |
Thu, 18 Oct 2012 22:40:44 +0200 |
* lib/depcomp (tru64, aix): In these entries of the big 'case'
switch, with the help of ...
(aix_post_process_depfile): ... this new function.
Signed-off-by: Stefano Lattarini <address@hidden>
---
lib/depcomp | 47 +++++++++++++++++++++++++++--------------------
1 file changed, 27 insertions(+), 20 deletions(-)
diff --git a/lib/depcomp b/lib/depcomp
index 7325cc9..f1ba7e5 100755
--- a/lib/depcomp
+++ b/lib/depcomp
@@ -74,6 +74,30 @@ set_base_from ()
base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
}
+# Factor out some common post-processing of the generated depfile.
+# Requires the auxiliary global variable '$tmpdepfile' to be set.
+aix_post_process_depfile ()
+{
+ # If the compiler actually managed to produce a dependency file,
+ # post-process it.
+ if test -f "$tmpdepfile"; then
+ # Each line is of the form 'foo.o: dependency.h'.
+ # Do two passes, one to just change these to
+ # $object: dependency.h
+ # and one to simply output
+ # dependency.h:
+ # which is needed to avoid the deleted-header problem.
+ { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
+ sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
+ } > "$depfile"
+ rm -f "$tmpdepfile"
+ else
+ # No dependency file was actually created by the compiler invocation.
+ # No real dependency information will be available.
+ echo "#dummy" > "$depfile"
+ fi
+}
+
# A tabulation character.
tab=' '
# A newline character.
@@ -291,19 +315,7 @@ aix)
do
test -f "$tmpdepfile" && break
done
- if test -f "$tmpdepfile"; then
- # 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,^.*\.[$lower]*:,$object:," < "$tmpdepfile" > "$depfile"
- sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" >>
"$depfile"
- else
- # The sourcefile does not contain any dependencies, so just
- # store a dummy comment line, to avoid errors with the Makefile
- # "include basename.Plo" scheme.
- echo "#dummy" > "$depfile"
- fi
- rm -f "$tmpdepfile"
+ aix_post_process_depfile
;;
icc)
@@ -517,13 +529,8 @@ tru64)
do
test -f "$tmpdepfile" && break
done
- if test -f "$tmpdepfile"; then
- sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" > "$depfile"
- sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" >>
"$depfile"
- else
- echo "#dummy" > "$depfile"
- fi
- rm -f "$tmpdepfile"
+ # Same post-processing that is required for AIX mode.
+ aix_post_process_depfile
;;
msvc7)
--
1.8.0.rc2.11.gd25c58c
- [RFC 02/20] depcomp: remove useless quoting in variable definitions, (continued)
- [RFC 02/20] depcomp: remove useless quoting in variable definitions, Stefano Lattarini, 2012/10/18
- [RFC 03/20] depcomp: use "rmdir", not "rm -rf", to remove the empty lock directory, Stefano Lattarini, 2012/10/18
- [RFC 04/20] depcomp: correctly propagate exit status in exit trap, Stefano Lattarini, 2012/10/18
- [RFC 05/20] depcomp: safer quoting in variable expansion, Stefano Lattarini, 2012/10/18
- [RFC 06/20] depcomp: cosmetic fixlets to a comment, Stefano Lattarini, 2012/10/18
- [RFC 07/20] depcomp: don't rely on character ranges working as in C locale, Stefano Lattarini, 2012/10/18
- [RFC 08/20] depcomp: reduce code duplication, Stefano Lattarini, 2012/10/18
- [RFC 09/20] depcomp: avoid an extra fork when possible, Stefano Lattarini, 2012/10/18
- [RFC 10/20] depcomp: less duplication between AIX and Tru64 modes,
Stefano Lattarini <=
- [RFC 11/20] depcomp: make some code more self-documenting, Stefano Lattarini, 2012/10/18
- [RFC 12/20] depcomp: shell code style changes, Stefano Lattarini, 2012/10/18
- [RFC 15/20] depcomp: remove an unused variable, Stefano Lattarini, 2012/10/18
- [RFC 14/20] depcomp: rewrite a sed invocation for less quoting, Stefano Lattarini, 2012/10/18
- [RFC 13/20] depcomp: whitespace fixes, Stefano Lattarini, 2012/10/18
- [RFC 17/20] depcomp: improve comments about tcc support, Stefano Lattarini, 2012/10/18
- [RFC 18/20] tests: fix spurious failures with tcc, Stefano Lattarini, 2012/10/18
- [RFC 16/20] depcomp: remove last relics of libtool 1.4 support, Stefano Lattarini, 2012/10/18
- [RFC 19/20] NEWS: update w.r.t. recent depcomp changes, Stefano Lattarini, 2012/10/18
- [RFC 20/20] depcomp: remove 'icc' depmode, add 'tcc' one, Stefano Lattarini, 2012/10/18