[Lldb-commits] [lldb] r238603 - Improve test for g++ 4.6

Ed Maste emaste at freebsd.org
Fri May 29 12:52:02 PDT 2015

Author: emaste
Date: Fri May 29 14:52:02 2015
New Revision: 238603

URL: http://llvm.org/viewvc/llvm-project?rev=238603&view=rev
Improve test for g++ 4.6

Skip the g++ 4.6 test if we're not going to build any C++ source.
If a test has C++ source files we automatically determine which C++
compiler to use based on $CC (for example, clang++ if CC=clang).
However, this is not done for tests without C++ source and CXX will
be GNU make's default of g++.  This produces suprious "g++: not found"
errors in testrun output on systems without a gcc/g++.

Differential Revision:	http://reviews.llvm.org/D10122


Modified: lldb/trunk/test/make/Makefile.rules
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/make/Makefile.rules?rev=238603&r1=238602&r2=238603&view=diff
--- lldb/trunk/test/make/Makefile.rules (original)
+++ lldb/trunk/test/make/Makefile.rules Fri May 29 14:52:02 2015
@@ -342,14 +342,16 @@ endif
 # Check if we are compiling with gcc 4.6
-ifneq (,$(filter g++,$(CXX)))
-	CXXVERSION = $(shell g++ -dumpversion | cut -b 1-3)
+ifneq "$(strip $(CXX_SOURCES) $(OBJCXX_SOURCES))" ""
+ifneq "$(filter g++,$(CXX))" ""
+	CXXVERSION = $(shell $(CXX) -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))
 # DYLIB_ONLY variable can be used to skip the building of a.out.

More information about the lldb-commits mailing list