sys-libs/compiler-rt: Simplify -- use common nolib flag var
authorMichał Górny <mgorny@gentoo.org>
Sun, 9 Jul 2017 08:16:54 +0000 (10:16 +0200)
committerMichał Górny <mgorny@gentoo.org>
Sun, 9 Jul 2017 21:33:55 +0000 (23:33 +0200)
sys-libs/compiler-rt/compiler-rt-4.0.1.ebuild
sys-libs/compiler-rt/compiler-rt-9999.ebuild

index 00141f900ff286d0b8fbc61d2b3c486b51c898bd..98d9f66212bc9ee2f7690bd8e77c033ff97caaeb 100644 (file)
@@ -48,17 +48,17 @@ src_configure() {
        # pre-set since we need to pass it to cmake
        BUILD_DIR=${WORKDIR}/${P}_build
 
+       local nolib_flags=( -nodefaultlibs -lc )
        if use clang; then
                local -x CC=${CHOST}-clang
                local -x CXX=${CHOST}-clang++
                # ensure we can use clang before installing compiler-rt
-               local -x LDFLAGS="${LDFLAGS} -nodefaultlibs -lc"
+               local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}"
                strip-unsupported-flags
        elif ! test_compiler; then
-               local extra_flags=( -nodefaultlibs -lc )
-               if test_compiler "${extra_flags[@]}"; then
-                       local -x LDFLAGS="${LDFLAGS} ${extra_flags[*]}"
-                       ewarn "${CC} seems to lack runtime, trying with ${extra_flags[*]}"
+               if test_compiler "${nolib_flags[@]}"; then
+                       local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}"
+                       ewarn "${CC} seems to lack runtime, trying with ${nolib_flags[*]}"
                fi
        fi
 
index 4758eab553af9e599ebf69e6870e19f1918ee6fd..ffd1e9eddb3ffc0e3b01444b49285535f4fce34f 100644 (file)
@@ -49,17 +49,17 @@ src_configure() {
        # pre-set since we need to pass it to cmake
        BUILD_DIR=${WORKDIR}/${P}_build
 
+       local nolib_flags=( -nodefaultlibs -lc )
        if use clang; then
                local -x CC=${CHOST}-clang
                local -x CXX=${CHOST}-clang++
                # ensure we can use clang before installing compiler-rt
-               local -x LDFLAGS="${LDFLAGS} -nodefaultlibs -lc"
+               local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}"
                strip-unsupported-flags
        elif ! test_compiler; then
-               local extra_flags=( -nodefaultlibs -lc )
-               if test_compiler "${extra_flags[@]}"; then
-                       local -x LDFLAGS="${LDFLAGS} ${extra_flags[*]}"
-                       ewarn "${CC} seems to lack runtime, trying with ${extra_flags[*]}"
+               if test_compiler "${nolib_flags[@]}"; then
+                       local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}"
+                       ewarn "${CC} seems to lack runtime, trying with ${nolib_flags[*]}"
                fi
        fi