[Lldb-commits] [PATCH] Makefile.rules: Translate /usr/bin/cc to /usr/bin/c++

David Majnemer david.majnemer at gmail.com
Fri Jul 25 15:57:07 PDT 2014


Hi zturner, tfiala,

The Makefile.rules file contains logic to transform various C-compilers
to their respective C++-compiler.  Add additional logic to handle the
case where CC is /usr/bin/cc.

http://reviews.llvm.org/D4679

Files:
  test/make/Makefile.rules

Index: test/make/Makefile.rules
===================================================================
--- test/make/Makefile.rules
+++ test/make/Makefile.rules
@@ -111,11 +111,19 @@
 endif
 
 # Function that returns the counterpart C++ compiler, given $(CC) as arg.
-cxx_compiler_notdir = $(if $(findstring clang,$(1)), $(subst clang,clang++,$(1)), $(if $(findstring icc,$(1)), $(subst icc,icpc,$(1)), $(if $(findstring llvm-gcc,$(1)), $(subst llvm-gcc,llvm-g++,$(1)), $(subst gcc,g++,$(1)))))
+cxx_compiler_notdir = $(if $(findstring clang,$(1)), $(subst clang,clang++,$(1)), \
+  $(if $(findstring icc,$(1)), $(subst icc,icpc,$(1)), \
+    $(if $(findstring llvm-gcc,$(1)), $(subst llvm-gcc,llvm-g++,$(1)), \
+      $(if $(findstring gcc,$(1)), $(subst gcc,g++,$(1)), \
+        $(subst cc,c++,$(1))))))
 cxx_compiler = $(if $(findstring /,$(1)),$(join $(dir $(1)), $(call cxx_compiler_notdir,$(notdir $(1)))),$(call cxx_compiler_notdir,$(1)))
 
 # Function that returns the C++ linker, given $(CC) as arg.
-cxx_linker_notdir = $(if $(findstring clang,$(1)), $(subst clang,clang++,$(1)), $(if $(findstring icc,$(1)), $(subst icc,icpc,$(1)), $(if $(findstring llvm-gcc,$(1)), $(subst llvm-gcc,llvm-g++,$(1)), $(subst gcc,g++,$(1)))))
+cxx_linker_notdir = $(if $(findstring clang,$(1)), $(subst clang,clang++,$(1)), \
+  $(if $(findstring icc,$(1)), $(subst icc,icpc,$(1)), \
+    $(if $(findstring llvm-gcc,$(1)), $(subst llvm-gcc,llvm-g++,$(1)), \
+      $(if $(findstring gcc,$(1)), $(subst gcc,g++,$(1)), \
+        $(subst cc,c++,$(1))))))
 cxx_linker = $(if $(findstring /,$(1)),$(join $(dir $(1)), $(call cxx_linker_notdir,$(notdir $(1)))),$(call cxx_linker_notdir,$(1)))
 
 #----------------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4679.11902.patch
Type: text/x-patch
Size: 1752 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20140725/b2fbfdb6/attachment.bin>


More information about the lldb-commits mailing list