[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC 20/20] depcomp: remove 'icc' depmode, add 'tcc' one
From: |
Stefano Lattarini |
Subject: |
[RFC 20/20] depcomp: remove 'icc' depmode, add 'tcc' one |
Date: |
Thu, 18 Oct 2012 22:40:54 +0200 |
According to the comments in the now-removed test 'depcomp5.test' (removed
by commit 'v1.11-1829-g5066c1b' of 2012-02-08, "tests: improve and rework
tests on dependency tracking") "icc 8.0 and greater understand gcc options,
so depmode is set to gcc". According to Wikipedia, the 8.0 version of the
Intel C compiler has been released in December 2003, that is, almost nine
yeas ago. So we can remove explicit support for icc 7.x from the depcomp
script.
Since our support for tcc has so far been relied on the icc depmode, we
must write a new explicit 'tcc' depmode. That is easy to do, since we can
rely on the simpler and better-specified format of tcc-specified makefiles;
for more info, see:
<http://lists.gnu.org/archive/html/automake/2012-10/msg00043.html>
* lib/depcomp (icc): Remove.
(tcc): New.
* NEWS: Update.
Signed-off-by: Stefano Lattarini <address@hidden>
---
NEWS | 7 +++++++
lib/depcomp | 62 +++++++++++++++++++++----------------------------------------
2 files changed, 28 insertions(+), 41 deletions(-)
diff --git a/NEWS b/NEWS
index 0057888..cf72f0c 100644
--- a/NEWS
+++ b/NEWS
@@ -69,6 +69,13 @@ New in 1.12.5:
but the chance for regression is there anyway, so please report any
unexpected or suspicious behaviour.
+ - Support for pre-8.0 versions of the Intel C Compiler has been dropped.
+ This should cause no problem, since icc 8.0 has been released in
+ December 2003 -- almost nine years ago.
+
+ - Support for tcc (the Tiny C Compiler) has been improved, and is now
+ handled through a dedicated 'tcc' mode.
+
Bugs fixed in 1.12.5:
* Long-standing bugs:
diff --git a/lib/depcomp b/lib/depcomp
index bfdf28f..e149347 100755
--- a/lib/depcomp
+++ b/lib/depcomp
@@ -318,32 +318,21 @@ aix)
aix_post_process_depfile
;;
-icc)
- # Intel's C compiler and tcc (Tiny C Compiler) understand '-MD -MF file'.
- # However on
- # $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c
- # ICC 7.0 will fill foo.d with something like
- # foo.o: sub/foo.c
- # foo.o: sub/foo.h
- # which is wrong. We want
- # sub/foo.o: sub/foo.c
- # sub/foo.o: sub/foo.h
- # sub/foo.c:
- # sub/foo.h:
- # ICC 7.1 will output
- # foo.o: sub/foo.c sub/foo.h
- # and will wrap long lines using '\':
- # foo.o: sub/foo.c ... \
- # sub/foo.h ... \
- # ...
- # tcc 0.9.26 (FIXME still under development at the moment of writing)
- # will emit a similar output, but also prepend the continuation lines
- # with horizontal tabulation characters.
- # Or at least, it did before its commit 0394caf7 "Emit spaces for -MD",
- # which, accordingly to the commit message, was written explicitly to
- # cater to limitations in the depcomp script. Limitations we had
- # removed with automake commit v1.11-768-gb96263 "depcomp: support tcc
- # (Tiny C Compiler)". Looks like we are chasing each other tail here ...
+tcc)
+ # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
+ # FIXME: That version still under development at the moment of writing.
+ # Make that this statement remains true also for stable, released
+ # versions.
+ # It will wrap lines (doesn't matter whether long or short) with a
+ # trailing '\', as in:
+ #
+ # foo.o : \
+ # foo.c \
+ # foo.h \
+ #
+ # It will put a trailing '\' even on the last line, and will use leading
+ # spaces rather than leading tabs (at least since its commit 0394caf7
+ # "Emit spaces for -MD").
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -ne 0; then
@@ -351,21 +340,12 @@ icc)
exit $stat
fi
rm -f "$depfile"
- # Each line is of the form 'foo.o: dependent.h',
- # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'.
- # Do two passes, one to just change these to
- # '$object: dependent.h' and one to simply 'dependent.h:'.
- sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \
- < "$tmpdepfile" > "$depfile"
- sed '
- s/[ '"$tab"'][ '"$tab"']*/ /g
- s/^ *//
- s/ *\\*$//
- s/^[^:]*: *//
- /^$/d
- /:$/d
- s/$/ :/
- ' < "$tmpdepfile" >> "$depfile"
+ # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
+ # We have to change lines of the first kind to '$object: \'.
+ sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
+ # And for each line of the second kind, we have to emit a 'dep.h:'
+ # dummy dependency, to avoid the deleted-header problem.
+ sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
rm -f "$tmpdepfile"
;;
--
1.8.0.rc2.11.gd25c58c
- [RFC 10/20] depcomp: less duplication between AIX and Tru64 modes, (continued)
- [RFC 10/20] depcomp: less duplication between AIX and Tru64 modes, Stefano Lattarini, 2012/10/18
- [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 <=