From 078ff407c4b50309c65c7c8eb61d6b08f4d2577e Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Sat, 27 Oct 2012 11:12:59 +0200 Subject: [PATCH] depcomp: improve comments about the 'gcc' depmode It is not only needed by obsolescent gcc compilers (pre-3.x), but also by modern compiler like IBM C/C++. State that ... * lib/depcomp: ... here... * gen-testsuite-part: ... and here, where we generate the 'depcomp*.tap' tests. Signed-off-by: Stefano Lattarini --- gen-testsuite-part | 7 +++++-- lib/depcomp | 6 +++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/gen-testsuite-part b/gen-testsuite-part index 6ed1931..96f43cc 100755 --- a/gen-testsuite-part +++ b/gen-testsuite-part @@ -340,8 +340,11 @@ my %depmodes = makedepend => ["cc", "makedepend"], dashmstdout => ["gcc"], cpp => ["gcc"], -# This is for older (pre-3.x) GCC versions. Newer versions -# have depmode "gcc3". +# This was for older (pre-3.x) GCC versions (newer versions +# have depmode "gcc3"). But other compilers use this depmode +# as well (for example, the IMB xlc/xlC compilers, and the HP +# C compiler, see 'lib/depcomp' for more info), so it's not +# obsolete, and it's worth giving it some coverage. gcc => ["gcc"], # This is for older (pre-7) msvc versions. Newer versions # have depmodes "msvc7" and "msvc7msys". diff --git a/lib/depcomp b/lib/depcomp index ee84bf2..693fe04 100755 --- a/lib/depcomp +++ b/lib/depcomp @@ -142,13 +142,17 @@ gcc3) ;; gcc) +## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. +## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. +## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like -## -MM, not -M (despite what the docs say). +## -MM, not -M (despite what the docs say). Also, it might not be +## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then -- 2.7.4