summaryrefslogtreecommitdiff
path: root/makefiles/Makefile.gcc
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2010-03-10 11:38:38 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2010-03-10 11:38:38 +0000
commitd6dcfb28dc8671918489e9fb268bc36b1ca2a12f (patch)
tree598a1ca99b6bce4bd31e6bb6ada3e3459e8a8492 /makefiles/Makefile.gcc
parent4fb5e74381515c01e164880e6023b08c40bb650a (diff)
downloadbuildsystem-d6dcfb28dc8671918489e9fb268bc36b1ca2a12f.tar.gz
buildsystem-d6dcfb28dc8671918489e9fb268bc36b1ca2a12f.tar.bz2
Make toolchain autodetection more robust.
svn path=/trunk/tools/buildsystem/; revision=10125
Diffstat (limited to 'makefiles/Makefile.gcc')
-rw-r--r--makefiles/Makefile.gcc24
1 files changed, 9 insertions, 15 deletions
diff --git a/makefiles/Makefile.gcc b/makefiles/Makefile.gcc
index fa2660b..3115889 100644
--- a/makefiles/Makefile.gcc
+++ b/makefiles/Makefile.gcc
@@ -62,20 +62,14 @@ endif
###############################################################################
# Determine if the compiler supports simultaneous build & dep.
-ccvsn := $(shell $(CC) --version)
-# "<binary name> (GCC) x.y.z (foo bar baz)"
-ifeq ($(word 2,$(ccvsn)),(GCC))
- # If the major version (x, above) is not 2, then assume build & dep.
- # This will break if using a version of GCC < 2, but that's unlikely.
- GCCVER := $(word 1,$(subst ., ,$(word 3, $(ccvsn))))
- ifneq ($(GCCVER),2)
- CC_CAN_BUILD_AND_DEP ?= yes
- endif
-else
- # Older versions of GCC just output the version number
- GCCVER := $(word 1,$(subst ., ,$(ccvsn)))
- ifneq ($(GCCVER),2)
- CC_CAN_BUILD_AND_DEP ?= yes
- endif
+ccvsn := $(shell $(CC) -dumpversion)
+# ccvsn = x.y.z
+GCCVER := $(word 1,$(subst ., ,$(ccvsn)))
+# GCCVER = x
+
+# If the major version (x, above) is not 2, then assume build & dep.
+# This will break if using a version of GCC < 2, but that's unlikely.
+ifneq ($(GCCVER),2)
+ CC_CAN_BUILD_AND_DEP ?= yes
endif