[Libclc-dev] [PATCH 1/2] Make C++ compiler configurable
Tom Stellard
tom at stellard.net
Wed Oct 16 10:35:44 PDT 2013
On Fri, Sep 06, 2013 at 11:37:27PM +0100, Jeroen Ketema wrote:
> The C++ compiler used to build prepare-builtins
> may differ from the llvm/clang for which we are
> building libclc.
>
> Use 'c++' as the default compiler.
Sorry, this patch was dropped.
I think the default compiler should be clang++ in order to preserve
the existing behavior. If you agree, I will make this change before I
push. (I will push your other patch too).
-Tom
> ---
> configure.py | 11 ++++++++---
> 1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/configure.py b/configure.py
> index 1a98647..5d06a97 100755
> --- a/configure.py
> +++ b/configure.py
> @@ -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',
> @@ -51,6 +53,10 @@ pkgconfigdir = options.pkgconfigdir
> if not pkgconfigdir:
> pkgconfigdir = os.path.join(prefix, 'share/pkgconfig')
>
> +cxx_compiler = options.with_cxx_compiler
> +if not cxx_compiler:
> + cxx_compiler = 'c++'
> +
> def llvm_config(args):
> try:
> proc = Popen([llvm_config_exe] + args, stdout=PIPE)
> @@ -65,7 +71,6 @@ llvm_core_libs = llvm_config(['--libs', 'core', 'bitreader', 'bitwriter']) + ' '
> 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')
> @@ -96,8 +101,8 @@ b.rule("LLVM_LINK", command = llvm_link + " -o $out $in",
> 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",
> --
> 1.7.12.4 (Apple Git-37)
>
>
> _______________________________________________
> Libclc-dev mailing list
> Libclc-dev at pcc.me.uk
> http://www.pcc.me.uk/cgi-bin/mailman/listinfo/libclc-dev
More information about the Libclc-dev
mailing list