summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2017-01-14 15:43:27 +0100
committerMichał Górny <mgorny@gentoo.org>2017-01-14 19:12:30 +0100
commiteb353cbfc1c15d198710cd7f27f63298e3b13e27 (patch)
treee966751564063dc2b4b59659ce0089dd7ac1a65b /sys-devel/clang
parentsys-devel/clang: Update SLOT for new scheme, use versionator (diff)
downloadgentoo-eb353cbfc1c15d198710cd7f27f63298e3b13e27.tar.gz
gentoo-eb353cbfc1c15d198710cd7f27f63298e3b13e27.tar.bz2
gentoo-eb353cbfc1c15d198710cd7f27f63298e3b13e27.zip
sys-devel/clang: Obtain version from llvm-config
Obtain the clang version that is used for paths and executable names from llvm-config, instead of hardcoding it in ebuild. This matches the method used in upstream code (obtaining it from CMake files), and works both for release and live ebuilds.
Diffstat (limited to 'sys-devel/clang')
-rw-r--r--sys-devel/clang/clang-9999.ebuild8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys-devel/clang/clang-9999.ebuild b/sys-devel/clang/clang-9999.ebuild
index 9baefac5751f..9e4abc9388ec 100644
--- a/sys-devel/clang/clang-9999.ebuild
+++ b/sys-devel/clang/clang-9999.ebuild
@@ -131,8 +131,8 @@ src_prepare() {
}
multilib_src_configure() {
- # TODO: read it?
- local clang_version=4.0.0
+ local llvm_version=$(llvm-config --version) || die
+ local clang_version=$(get_version_component_range 1-3 "${llvm_version}")
local libdir=$(get_libdir)
local mycmakeargs=(
-DLLVM_LIBDIR_SUFFIX=${libdir#lib}
@@ -222,7 +222,9 @@ src_install() {
mv "${ED}usr/include/clangrt" "${ED}usr/lib/clang" || die
# Apply CHOST and version suffix to clang tools
- local clang_version=4.0
+ # note: we use two version components here (vs 3 in runtime path)
+ local llvm_version=$(llvm-config --version) || die
+ local clang_version=$(get_version_component_range 1-2 "${llvm_version}")
local clang_tools=( clang clang++ clang-cl clang-cpp )
local abi i