diff options
author | midipix <writeonce@midipix.org> | 2019-02-13 22:46:19 -0500 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2019-02-13 22:53:13 -0500 |
commit | fb505abfd94cb8d762f0d4f1e3de9b88b3043ebd (patch) | |
tree | a534635b90a9a8a12161d883f2500b90c0c671e5 /sofort | |
parent | 7a282224fa9b097071a560a570c7eebb8f61b832 (diff) | |
download | pemagine-fb505abfd94cb8d762f0d4f1e3de9b88b3043ebd.tar.bz2 pemagine-fb505abfd94cb8d762f0d4f1e3de9b88b3043ebd.tar.xz |
build system: ccenv_find_tool(): support an optional tool-compatibility test.
Diffstat (limited to 'sofort')
-rw-r--r-- | sofort/ccenv/ccenv.sh | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sofort/ccenv/ccenv.sh b/sofort/ccenv/ccenv.sh index 65a596a..04db31e 100644 --- a/sofort/ccenv/ccenv.sh +++ b/sofort/ccenv/ccenv.sh @@ -52,7 +52,14 @@ ccenv_find_tool() { if [ -z "$ccenv_prefixes" ]; then for ccenv_tool in $ccenv_candidates; do - command -v "$ccenv_tool" > /dev/null && return 0 + if [ -z ${@:-} ]; then + command -v "$ccenv_tool" > /dev/null && \ + return 0 + else + command -v "$ccenv_tool" > /dev/null && \ + "$ccenv_tool" $@ > /dev/null 2>&1 && \ + return 0 + fi done ccenv_tool=false @@ -273,7 +280,7 @@ ccenv_set_cc() { if [ -z "$ccenv_cc" ]; then ccenv_set_c_compiler_candidates - ccenv_find_tool + ccenv_find_tool -dumpmachine ccenv_cc="$ccenv_tool" fi |