diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2010-03-10 11:38:38 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2010-03-10 11:38:38 +0000 |
commit | d6dcfb28dc8671918489e9fb268bc36b1ca2a12f (patch) | |
tree | 598a1ca99b6bce4bd31e6bb6ada3e3459e8a8492 /makefiles/Makefile.tools | |
parent | 4fb5e74381515c01e164880e6023b08c40bb650a (diff) | |
download | buildsystem-d6dcfb28dc8671918489e9fb268bc36b1ca2a12f.tar.gz buildsystem-d6dcfb28dc8671918489e9fb268bc36b1ca2a12f.tar.bz2 |
Make toolchain autodetection more robust.
svn path=/trunk/tools/buildsystem/; revision=10125
Diffstat (limited to 'makefiles/Makefile.tools')
-rw-r--r-- | makefiles/Makefile.tools | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/makefiles/Makefile.tools b/makefiles/Makefile.tools index db5d7cb..72d6262 100644 --- a/makefiles/Makefile.tools +++ b/makefiles/Makefile.tools @@ -287,29 +287,27 @@ endif # Auto-detect the toolchain ############################################################################### +# Check for GCC first, as that's most likely # TODO: Using shell redirection like this probably hurts portability -ccvsn := $(shell $(CC) --version 2>&1) -ifeq ($(ccvsn),) - # Version string is blank - ifeq ($(HOST),riscos) - # For some reason we never see the output of SCL apps, so assume Norcroft. - ccvsn := Norcroft - endif -endif - -# "<binary name> (GCC) x.y.z (foo bar baz)" -ifeq ($(word 2,$(ccvsn)),(GCC)) +ccspecs := $(shell $(CC) -dumpspecs 2>&1) +ifeq ($(findstring libgcc,$(ccspecs)),libgcc) + # Looks like GCC toolchain := gcc else - # Older versions of GCC just output the version number, so examine the - # binary name in the hope of detecting more GCC. - ifeq ($(findstring gcc,$(CC)),gcc) - toolchain := gcc + # Not GCC, so enquire further + ccvsn := $(shell $(CC) --version 2>&1) + ifeq ($(ccvsn),) + # Version string is blank + ifeq ($(HOST),riscos) + # For some reason we never see the output of SCL apps, so assume Norcroft. + ccvsn := Norcroft + endif + endif + + # "Norcroft ..." + ifeq ($(word 1,$(ccvsn)),Norcroft) + toolchain := norcroft endif -endif -# "Norcroft ..." -ifeq ($(word 1,$(ccvsn)),Norcroft) - toolchain := norcroft endif ifeq ($(toolchain),) |