summaryrefslogtreecommitdiffstats
path: root/lib/buildsystem.sh
diff options
context:
space:
mode:
Diffstat (limited to 'lib/buildsystem.sh')
-rw-r--r--lib/buildsystem.sh27
1 files changed, 19 insertions, 8 deletions
diff --git a/lib/buildsystem.sh b/lib/buildsystem.sh
index 5c9579a..37f6ac1 100644
--- a/lib/buildsystem.sh
+++ b/lib/buildsystem.sh
@@ -81,10 +81,11 @@ oh_set_buildsystem_option()
oh_buildsystem_do()
{
- _oh_local _ohbsd_step _ohbsd_bs
+ _oh_local _ohbsd_test_step _ohbsd_step _ohbsd_bs
if [ ${#} -ge 1 ]; then
- _ohbsd_step="${1}"
+ _ohbsd_test_step="${1%%:*}"
+ _ohbsd_step="${1#*:}"
shift 1
else
_oh_return 125
@@ -92,14 +93,14 @@ oh_buildsystem_do()
fi
if [ -n "${_OH_BUILDSYSTEM_SYSTEM}" ]; then
- if "_oh_${_OH_BUILDSYSTEM_SYSTEM}_can_${_ohbsd_step}"; then
+ if "_oh_${_OH_BUILDSYSTEM_SYSTEM}_can_${_ohbsd_test_step}"; then
"_oh_${_OH_BUILDSYSTEM_SYSTEM}_${_ohbsd_step}" "${@}"
_oh_return ${?}
return ${?}
fi
else
for _ohbsd_bs in ${_OH_BUILDSYSTEMS}; do
- if "_oh_${_ohbsd_bs}_can_${_ohbsd_step}"; then
+ if "_oh_${_ohbsd_bs}_can_${_ohbsd_test_step}"; then
"_oh_${_ohbsd_bs}_${_ohbsd_step}" "${@}"
_oh_return ${?}
return ${?}
@@ -114,15 +115,25 @@ oh_buildsystem_do()
oh_buildsystem_arch()
{
- _oh_local _ohbsa_arch _ohbsa_system
+ _oh_local _ohbsa_arch _ohbsa_bs_arch
- if [ ${#} -eq 2 ]; then
+ if [ ${#} -eq 1 ]; then
_ohbsa_arch="${1}"
- _ohbsa_system="${2}"
else
_oh_return 125
return ${?}
fi
- cat '@@ARCHTAB@@/'"${_ohbsa_arch}/${_ohbsa_system}"
+ # Try to find a suitable build system host arch.
+ for _ohbsa_bs_arch in $(cat '@@ARCHTAB@@/'"${_ohbsa_arch}/${_ohbsa_system}")
+ do
+ if ob_buildsystem_do 'configure:testarch'; then
+ _oh_return 0
+ return ${?}
+ fi
+ done
+
+ ob_warn "$(ob_get_msg 'no_capable_host_arch')"
+ _oh_return 1
+ return ${?}
}