summaryrefslogtreecommitdiffhomepage
path: root/sofort
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2019-02-13 22:46:19 -0500
committermidipix <writeonce@midipix.org>2019-02-13 22:53:04 -0500
commitc37bf6aa72d25afced4a64aef26ed66d8efe5c81 (patch)
tree9eb868fdc3739be0aaab488015aae70ad1e51d19 /sofort
parent5e41e3d93ef2eb3eff1e9b6a92bd23f04aa4d487 (diff)
downloadapimagic-c37bf6aa72d25afced4a64aef26ed66d8efe5c81.tar.bz2
apimagic-c37bf6aa72d25afced4a64aef26ed66d8efe5c81.tar.xz
build system: ccenv_find_tool(): support an optional tool-compatibility test.
Diffstat (limited to 'sofort')
-rw-r--r--sofort/ccenv/ccenv.sh11
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