Skip to content
Snippets Groups Projects
Commit 0491430a authored by Fons Rademakers's avatar Fons Rademakers
Browse files

add support for building clang/LLVM with an alternative gcc compiler.

This requires the setting of the --with-gcc-toolchain option in ./configure,
in addition to the --with-cc and --with-c++ options, which are then passed
to the clang/LLVM build procedure.


git-svn-id: http://root.cern.ch/svn/root/trunk@48841 27541ba8-7e3a-0410-8455-c3a389f83636
parent 7fb3fe72
No related branches found
No related tags found
No related merge requests found
......@@ -8,3 +8,4 @@ CC = @altcc@
CXX = @altcxx@
F77 = @altf77@
LD = @altld@
GCCTOOLCHAIN = @gcctoolchain@
......@@ -27,6 +27,7 @@ altcc=
altcxx=
altf77=
altld=
gcctoolchain=
host=
deprecated_options=" \
......@@ -1668,6 +1669,8 @@ with compiler options, prefix with --with-, overrides default value
cxx alternative C++ compiler and options to be used
f77 alternative Fortran compiler and options to be used
ld alternative Linker and options to be used
gcc-toolchain directory where gcc is installed (needed for compilation
of clang/LLVM in case not the default gcc is used)
clang use clang compiler instead of gcc (mutual exclusive with
the cc, cxx and ld options)
......@@ -2004,6 +2007,7 @@ if test $# -gt 0 ; then
--with-cxx=*) altcxx=$optarg ;;
--with-f77=*) altf77=$optarg ;;
--with-ld=*) altld=$optarg ;;
--with-gcc-toolchain=*) gcctoolchain=$optarg ;;
--with-clang) altcc=clang; altcxx=clang++; altld=clang++ ;;
--with-hostcc=*) hostcc=$optarg ;;
--with-hostcxx=*) hostcxx=$optarg ;;
......@@ -6848,6 +6852,7 @@ sed -e "s|@altcc@|$altcc|" \
-e "s|@altcxx@|$altcxx|" \
-e "s|@altf77@|$altf77|" \
-e "s|@altld@|$altld|" \
-e "s|@gcctoolchain@|$gcctoolchain|" \
< Makefile-comp.tmp > $MAKECOMPOUT
rm -f Makefile-comp.tmp
......
......@@ -147,6 +147,9 @@ $(LLVMDEPO): $(LLVMDEPS)
if [ "x$$LLVM_EXTRA_OPTIONS" = "x" ]; then \
LLVM_EXTRA_OPTIONS="--with-extra-options="; \
fi; \
if [ x$(GCCTOOLCHAIN) != "x" ]; then \
LLVM_GCC_TOOLCHAIN="--with-gcc-toolchain=$(GCCTOOLCHAIN)"; \
fi; \
echo "*** Configuring LLVM in $(dir $@) ..."; \
mkdir -p $(dir $@) && \
cd $(dir $@) && \
......@@ -162,6 +165,7 @@ $(LLVMDEPO): $(LLVMDEPS)
$(LLVMOPTFLAGS) \
--enable-targets=host \
"$$LLVM_EXTRA_OPTIONS" \
$$LLVM_GCC_TOOLCHAIN \
CC=$$LLVMCC CXX=$$LLVMCXX \
$$LLVM_BUILD_CC $$LLVM_BUILD_CXX \
CFLAGS="$$LLVM_CFLAGS" CXXFLAGS="$$LLVM_CFLAGS" )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment