aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Kopec <Matt.Kopec@intel.com>2013-07-24 21:39:24 +0000
committerMatt Kopec <Matt.Kopec@intel.com>2013-07-24 21:39:24 +0000
commit10c0722de53ac1cbeb032cbafef00fdbac522abd (patch)
tree8617280df3d22fb22805f9cf6df09132fd2e9aab
parent4edd4b4d295e07afc6a7c157f2693a110de49964 (diff)
downloadlldb-10c0722de53ac1cbeb032cbafef00fdbac522abd.tar.gz
Fix test suite make so that -std=c++11 gets set properly for supported compilers and -std=c++0x gets set only for gcc 4.6 versions. Previously, -std=c++0x was being set for all compilers.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@187080 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/make/Makefile.rules17
1 files changed, 11 insertions, 6 deletions
diff --git a/test/make/Makefile.rules b/test/make/Makefile.rules
index 7414f0468..d4a91450f 100644
--- a/test/make/Makefile.rules
+++ b/test/make/Makefile.rules
@@ -96,12 +96,6 @@ LDFLAGS += $(LD_EXTRAS)
OBJECTS =
EXE ?= a.out
-ifneq (,$(findstring g++,$(CXX)))
- # GCC 4.6 cannot handle -std=c++11, so replace it with -std=c++0x
- # instead. FIXME: remove once GCC version is upgraded.
- override CXXFLAGS := $(subst -std=c++11,-std=c++0x,$(CXXFLAGS))
-endif
-
ifneq "$(DYLIB_NAME)" ""
ifeq "$(OS)" "Darwin"
DYLIB_FILENAME = lib$(DYLIB_NAME).dylib
@@ -224,6 +218,17 @@ ifneq "$(strip $(ARCHIVE_OBJCXX_SOURCES))" ""
endif
endif
+#----------------------------------------------------------------------
+# Check if we are compiling with gcc 4.6
+#----------------------------------------------------------------------
+ifneq (,$(filter g++,$(CXX)))
+ CXXVERSION = $(shell g++ -dumpversion | cut -b 1-3)
+ ifeq "$(CXXVERSION)" "4.6"
+ # GCC 4.6 cannot handle -std=c++11, so replace it with -std=c++0x
+ # instead. FIXME: remove once GCC version is upgraded.
+ override CXXFLAGS := $(subst -std=c++11,-std=c++0x,$(CXXFLAGS))
+ endif
+endif
#----------------------------------------------------------------------
# DYLIB_ONLY variable can be used to skip the building of a.out.