sys-devel/llvm: Improve cross-compiler support, #442958
authorMichał Górny <mgorny@gentoo.org>
Sun, 3 Jul 2016 07:34:43 +0000 (09:34 +0200)
committerMichał Górny <mgorny@gentoo.org>
Sun, 3 Jul 2016 08:19:07 +0000 (10:19 +0200)
sys-devel/llvm/llvm-3.8.0-r3.ebuild
sys-devel/llvm/llvm-9999.ebuild

index 31be20b9c065993472907f3635f8efacb353f3e3..98b01a89ef9f0f7933af34d83842e64e8f2421a6 100644 (file)
@@ -368,6 +368,23 @@ multilib_src_configure() {
                #filter-flags -msahf -frecord-gcc-switches
        fi
 
+       if tc-is-cross-compiler; then
+               [[ -x "/usr/bin/llvm-tblgen" ]] \
+                       || die "/usr/bin/llvm-tblgen not found or usable"
+               mycmakeargs+=(
+                       -DCMAKE_CROSSCOMPILING=ON
+                       -DLLVM_TABLEGEN=/usr/bin/llvm-tblgen
+               )
+
+               if use clang; then
+                       [[ -x "/usr/bin/clang-tblgen" ]] \
+                               || die "/usr/bin/clang-tblgen not found or usable"
+                       mycmakeargs+=(
+                               -DCLANG_TABLEGEN=/usr/bin/clang-tblgen
+                       )
+               fi
+       fi
+
        cmake-utils_src_configure
 }
 
index 745d373ecc3fb10ab08457d6694ab195699dd165..cb7781714431ff8aa686e6aba60d1e24439a790f 100644 (file)
@@ -343,6 +343,23 @@ multilib_src_configure() {
                #filter-flags -msahf -frecord-gcc-switches
        fi
 
+       if tc-is-cross-compiler; then
+               [[ -x "/usr/bin/llvm-tblgen" ]] \
+                       || die "/usr/bin/llvm-tblgen not found or usable"
+               mycmakeargs+=(
+                       -DCMAKE_CROSSCOMPILING=ON
+                       -DLLVM_TABLEGEN=/usr/bin/llvm-tblgen
+               )
+
+               if use clang; then
+                       [[ -x "/usr/bin/clang-tblgen" ]] \
+                               || die "/usr/bin/clang-tblgen not found or usable"
+                       mycmakeargs+=(
+                               -DCLANG_TABLEGEN=/usr/bin/clang-tblgen
+                       )
+               fi
+       fi
+
        cmake-utils_src_configure
 }