Merge pull request #4906 from mglae/le10_check_toolchain

buildsystem: check wrong toolchain configuration
This commit is contained in:
CvH 2021-01-18 20:00:56 +01:00 committed by GitHub
commit d858872f27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 0 deletions

View File

@ -207,6 +207,25 @@ setup_pkg_config_host() {
unset PKG_CONFIG_ALLOW_SYSTEM_LIBS unset PKG_CONFIG_ALLOW_SYSTEM_LIBS
} }
check_toolchain_config() {
local target=${1^^}
local toolchain=${2^^}
local var
if [ "${toolchain}" == "AUTOTOOLS" ]; then
toolchain="CONFIGURE"
fi
for var in "${!PKG_@}"; do
if [[ "${var}" =~ INSTALL_OPTS_ || "${var}" =~ _MAKE_OPTS ]]; then
continue
fi
if [[ "${var}" =~ _OPTS_${target}$ \
&& ! "${var}" =~ _${toolchain}_OPTS_${target}$
|| "${var}" =~ _OPTS$ && ! "${var}" =~ _${toolchain}_OPTS$ ]]; then
die "ERROR: using $2 toolchain but ${var} is configured."
fi
done
}
setup_toolchain() { setup_toolchain() {
local have_gold="no" local have_gold="no"
if [ "$LTO_SUPPORT" = "yes" ]; then if [ "$LTO_SUPPORT" = "yes" ]; then

View File

@ -114,6 +114,9 @@ if ! listcontains "meson cmake cmake-make configure ninja make autotools manual"
fi fi
build_msg "CLR_TOOLCHAIN" "TOOLCHAIN" "${PKG_TOOLCHAIN}${_auto_toolchain}" build_msg "CLR_TOOLCHAIN" "TOOLCHAIN" "${PKG_TOOLCHAIN}${_auto_toolchain}"
# check wrong toolchain configuration
check_toolchain_config ${TARGET} ${PKG_TOOLCHAIN}
# setup toolchain # setup toolchain
setup_toolchain ${TARGET} ${PKG_TOOLCHAIN} setup_toolchain ${TARGET} ${PKG_TOOLCHAIN}