sys-libs/compiler-rt-sanitizers: Obtain version from llvm-config
authorMichał Górny <mgorny@gentoo.org>
Sat, 14 Jan 2017 14:51:21 +0000 (15:51 +0100)
committerMichał Górny <mgorny@gentoo.org>
Sat, 14 Jan 2017 18:12:33 +0000 (19:12 +0100)
Obtain the clang version that is used to build paths 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. It is fine to rely on llvm-config since we
need it for LLVM macros anyway.

sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-9999.ebuild

index 6b075cdac0230c4e1421ef80f4e2cd82c6112aa5..c933e533904465e57903fdea0e4922f2905c817a 100644 (file)
@@ -56,7 +56,8 @@ src_configure() {
        # pre-set since we need to pass it to cmake
        BUILD_DIR=${WORKDIR}/${P}_build
 
-       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=(
                # used to find cmake modules