2023-09-07 08:44:33 -06:00
|
|
|
# shellcheck shell=bash
|
|
|
|
|
|
2025-05-27 17:49:38 -04:00
|
|
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
2023-09-07 08:44:33 -06:00
|
|
|
|
|
|
|
|
pick_host_compiler() {
|
2025-05-27 17:49:38 -04:00
|
|
|
local output
|
|
|
|
|
local status
|
2023-09-07 08:44:33 -06:00
|
|
|
|
2025-05-27 17:49:38 -04:00
|
|
|
output=$("${DIR}/find_compiler.py")
|
|
|
|
|
status=$?
|
2023-09-07 08:44:33 -06:00
|
|
|
|
2025-05-27 17:49:38 -04:00
|
|
|
if [[ ${status} -ne 0 ]] ; then
|
|
|
|
|
exit ${status}
|
2023-09-07 08:44:33 -06:00
|
|
|
fi
|
|
|
|
|
|
2025-05-27 17:49:38 -04:00
|
|
|
if [[ "${output}" != *"CC="* || "${output}" != *"CXX="* ]] ; then
|
|
|
|
|
echo "Unexpected output from find_compiler.py"
|
|
|
|
|
exit 1
|
2023-09-07 08:44:33 -06:00
|
|
|
fi
|
|
|
|
|
|
2025-05-27 17:49:38 -04:00
|
|
|
eval "${output}"
|
2023-09-07 08:44:33 -06:00
|
|
|
}
|