mirror of
https://github.com/flatcar/scripts.git
synced 2025-11-09 04:31:40 +01:00
fix(toolchain_util.sh): Replace TOOLCHAIN_BINONLY with a function.
The new function supports generating arguments for cross toolchain packages in addition to native ones.
This commit is contained in:
parent
d91e8d21c4
commit
a70da914ba
@ -10,10 +10,6 @@ TOOLCHAIN_PKGS=(
|
|||||||
sys-libs/glibc
|
sys-libs/glibc
|
||||||
)
|
)
|
||||||
|
|
||||||
# Portage arguments to enforce the toolchain to only use binpkgs.
|
|
||||||
TOOLCHAIN_BINONLY=( "${TOOLCHAIN_PKGS[@]/#/--useoldpkg-atoms=}"
|
|
||||||
"${TOOLCHAIN_PKGS[@]/#/--rebuild-exclude=}" )
|
|
||||||
|
|
||||||
# Portage profile to use for building out the cross compiler's SYSROOT.
|
# Portage profile to use for building out the cross compiler's SYSROOT.
|
||||||
# This is only used as an intermediate step to be able to use the cross
|
# This is only used as an intermediate step to be able to use the cross
|
||||||
# compiler to build a full native toolchain. Packages are not uploaded.
|
# compiler to build a full native toolchain. Packages are not uploaded.
|
||||||
@ -31,7 +27,6 @@ BOARD_NAMES=( "${!BOARD_CHOST[@]}" )
|
|||||||
# Declare the above globals as read-only to avoid accidental conflicts.
|
# Declare the above globals as read-only to avoid accidental conflicts.
|
||||||
declare -r \
|
declare -r \
|
||||||
TOOLCHAIN_PKGS \
|
TOOLCHAIN_PKGS \
|
||||||
TOOLCHAIN_BINONLY \
|
|
||||||
CROSS_PROFILES \
|
CROSS_PROFILES \
|
||||||
BOARD_CHOSTS \
|
BOARD_CHOSTS \
|
||||||
BOARD_NAMES \
|
BOARD_NAMES \
|
||||||
@ -118,6 +113,12 @@ get_cross_pkgs() {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Get portage arguments restricting toolchains to binary packages only.
|
||||||
|
get_binonly_args() {
|
||||||
|
local pkgs=( "${TOOLCHAIN_PKGS[@]}" $(get_cross_pkgs "$@") )
|
||||||
|
echo "${pkgs[@]/#/--useoldpkg-atoms=}" "${pkgs[@]/#/--rebuild-exclude=}"
|
||||||
|
}
|
||||||
|
|
||||||
### Toolchain building utilities ###
|
### Toolchain building utilities ###
|
||||||
|
|
||||||
# Ugly hack to get a dependency list of a set of packages.
|
# Ugly hack to get a dependency list of a set of packages.
|
||||||
|
|||||||
@ -95,7 +95,7 @@ if [ "${FLAGS_usepkg}" -eq "${FLAGS_TRUE}" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Only update toolchain when binpkgs are available.
|
# Only update toolchain when binpkgs are available.
|
||||||
EMERGE_FLAGS+=" ${TOOLCHAIN_BINONLY[*]}"
|
EMERGE_FLAGS+=" $(get_binonly_args $(get_chost_list))"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${FLAGS_jobs}" -ne -1 ]]; then
|
if [[ "${FLAGS_jobs}" -ne -1 ]]; then
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user