summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2019-02-14 03:46:19 (GMT)
committermidipix <writeonce@midipix.org>2019-02-14 03:53:13 (GMT)
commitc42cf958577f82e96f4694e3c8596e863487f3d0 (patch)
tree5aa57ba8e44d1b1e914d8bf287d28340c8000a9e
parente4cf2fe534802950e0e6a540f1eb6289c5de24a9 (diff)
downloadperk-c42cf958577f82e96f4694e3c8596e863487f3d0.tar.bz2
perk-c42cf958577f82e96f4694e3c8596e863487f3d0.tar.xz
build system: ccenv_find_tool(): support an optional tool-compatibility test.
-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