commit:     a2478718a9960f7844eee45e6b140fd071447428
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 26 22:42:49 2020 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Sun Jan 26 22:47:07 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a2478718

flag-o-matic.eclass: fix probe when CC points to absolute path

Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 eclass/flag-o-matic.eclass   | 4 ++--
 eclass/tests/flag-o-matic.sh | 6 ++++++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass
index 0aec22c83f2..ebfc49bf30b 100644
--- a/eclass/flag-o-matic.eclass
+++ b/eclass/flag-o-matic.eclass
@@ -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
 

diff --git a/eclass/tests/flag-o-matic.sh b/eclass/tests/flag-o-matic.sh
index 90eaf3a6ffb..229dff52af9 100755
--- a/eclass/tests/flag-o-matic.sh
+++ b/eclass/tests/flag-o-matic.sh
@@ -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} ]]

Reply via email to