From a2478718a9960f7844eee45e6b140fd071447428 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sun, 26 Jan 2020 22:42:49 +0000 Subject: flag-o-matic.eclass: fix probe when CC points to absolute path Signed-off-by: Sergei Trofimovich --- eclass/flag-o-matic.eclass | 4 ++-- eclass/tests/flag-o-matic.sh | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'eclass') diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass index 0aec22c83f2c..ebfc49bf30b7 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 90eaf3a6ffb0..229dff52af94 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} ]] -- cgit v1.2.3-65-gdbad