flag-o-matic.eclass: fix probe when CC points to absolute path
authorSergei Trofimovich <slyfox@gentoo.org>
Sun, 26 Jan 2020 22:42:49 +0000 (22:42 +0000)
committerSergei Trofimovich <slyfox@gentoo.org>
Sun, 26 Jan 2020 22:47:07 +0000 (22:47 +0000)
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
eclass/flag-o-matic.eclass
eclass/tests/flag-o-matic.sh

index 0aec22c83f2c02b245a9faaa5daec3ddc7a2719e..ebfc49bf30b7268e0a71b7aa74f42db07eb2e3b3 100644 (file)
@@ -474,8 +474,8 @@ test-flag-PROG() {
                        cmdline_extra+=(-xc)
                        ;;
        esac
-       local test_in=${T}/test-flag-${comp}.${lang}
-       local test_out=${T}/test-flag-${comp}.exe
+       local test_in=${T}/test-flag.${lang}
+       local test_out=${T}/test-flag.exe
 
        printf "%s\n" "${in_src}" > "${test_in}" || return 1
 
index 90eaf3a6ffb08a05b8a78571055cfea59f049942..229dff52af945d6c4f7fc0b83571cf7b98067657 100755 (executable)
@@ -139,6 +139,12 @@ out=$(test-flags-CC -O3)
 [[ $? -eq 0 && ${out} == "-O3" ]]
 ftend
 
+tbegin "test-flags-CC (valid flags, absolute path)"
+absolute_CC=$(type -P $(tc-getCC))
+out=$(CC=${absolute_CC} test-flags-CC -O3)
+[[ $? -eq 0 && ${out} == "-O3" ]]
+ftend
+
 tbegin "test-flags-CC (invalid flags)"
 out=$(test-flags-CC -finvalid-flag)
 [[ $? -ne 0 && -z ${out} ]]