[libclc] r193220 - Make C++ compiler configurable

Tom Stellard thomas.stellard at amd.com
Tue Oct 22 19:49:28 PDT 2013


Author: tstellar
Date: Tue Oct 22 21:49:27 2013
New Revision: 193220

URL: http://llvm.org/viewvc/llvm-project?rev=193220&view=rev
Log:
Make C++ compiler configurable

The C++ compiler used to build prepare-builtins
may differ from the llvm/clang for which we are
building libclc.

Use 'clang++' as the default compiler.

Patch by: Jeroen Ketema

Modified:
    libclc/trunk/configure.py

Modified: libclc/trunk/configure.py
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/configure.py?rev=193220&r1=193219&r2=193220&view=diff
==============================================================================
--- libclc/trunk/configure.py (original)
+++ libclc/trunk/configure.py Tue Oct 22 21:49:27 2013
@@ -21,6 +21,8 @@ import metabuild
 p = OptionParser()
 p.add_option('--with-llvm-config', metavar='PATH',
              help='use given llvm-config script')
+p.add_option('--with-cxx-compiler', metavar='PATH',
+             help='use given C++ compiler')
 p.add_option('--prefix', metavar='PATH',
              help='install to given prefix')
 p.add_option('--libexecdir', metavar='PATH',
@@ -65,11 +67,14 @@ llvm_core_libs = llvm_config(['--libs',
                  llvm_config(['--ldflags'])
 llvm_cxxflags = llvm_config(['--cxxflags']) + ' -fno-exceptions -fno-rtti'
 
-llvm_clang_cxx = os.path.join(llvm_bindir, 'clang++')
 llvm_clang = os.path.join(llvm_bindir, 'clang')
 llvm_link = os.path.join(llvm_bindir, 'llvm-link')
 llvm_opt = os.path.join(llvm_bindir, 'opt')
 
+cxx_compiler = options.with_cxx_compiler
+if not cxx_compiler:
+  cxx_compiler = os.path.join(llvm_bindir, 'clang++')
+
 available_targets = {
   'r600--' : { 'devices' :
                [{'gpu' : 'cedar',   'aliases' : ['palm', 'sumo', 'sumo2', 'redwood', 'juniper']},
@@ -96,8 +101,8 @@ b.rule("LLVM_LINK", command = llvm_link
 b.rule("OPT", command = llvm_opt + " -O3 -o $out $in",
        description = 'OPT $out')
 
-c_compiler_rule(b, "LLVM_TOOL_CXX", 'LLVM-CXX', llvm_clang_cxx, llvm_cxxflags)
-b.rule("LLVM_TOOL_LINK", llvm_clang_cxx + " -o $out $in %s" % llvm_core_libs, 'LINK $out')
+c_compiler_rule(b, "LLVM_TOOL_CXX", 'CXX', cxx_compiler, llvm_cxxflags)
+b.rule("LLVM_TOOL_LINK", cxx_compiler + " -o $out $in %s" % llvm_core_libs, 'LINK $out')
 
 prepare_builtins = os.path.join('utils', 'prepare-builtins')
 b.build(os.path.join('utils', 'prepare-builtins.o'), "LLVM_TOOL_CXX",





More information about the cfe-commits mailing list