commit: 6bd49af14a9b09c3b3043d3f67ca97913787699e
Author: James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Sat Jan 21 10:59:50 2023 +0000
Commit: James Le Cuirot <chewi <AT> gentoo <DOT> org>
CommitDate: Fri Jan 27 22:09:45 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6bd49af1
kernel-2.eclass: Make xmakeopts an array for spaces in toolchain vars
Variables like CC can have spaces for additional arguments. This is
particularly useful for reliably setting the sysroot.
Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>
eclass/kernel-2.eclass | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass
index 873d4a204669..f7fcf15743f0 100644
--- a/eclass/kernel-2.eclass
+++ b/eclass/kernel-2.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: kernel-2.eclass
@@ -756,13 +756,22 @@ env_setup_xmakeopts() {
# When cross-compiling, we need to set the ARCH/CROSS_COMPILE
# variables properly or bad things happen !
- xmakeopts="ARCH=${KARCH}"
+ xmakeopts=( ARCH="${KARCH}" )
if [[ ${CTARGET} != ${CHOST} ]] && ! cross_pre_c_headers; then
- xmakeopts="${xmakeopts} CROSS_COMPILE=${CTARGET}-"
+ xmakeopts+=( CROSS_COMPILE="${CTARGET}-" )
elif type -p ${CHOST}-ar >/dev/null; then
- xmakeopts="${xmakeopts} CROSS_COMPILE=${CHOST}-"
+ xmakeopts+=( CROSS_COMPILE="${CHOST}-" )
fi
- xmakeopts="${xmakeopts} HOSTCC=$(tc-getBUILD_CC) CC=$(tc-getCC)
LD=$(tc-getLD) AR=$(tc-getAR) NM=$(tc-getNM) OBJCOPY=$(tc-getOBJCOPY)
READELF=$(tc-getREADELF) STRIP=$(tc-getSTRIP)"
+ xmakeopts+=(
+ HOSTCC="$(tc-getBUILD_CC)"
+ CC="$(tc-getCC)"
+ LD="$(tc-getLD)"
+ AR="$(tc-getAR)"
+ NM="$(tc-getNM)"
+ OBJCOPY="$(tc-getOBJCOPY)"
+ READELF="$(tc-getREADELF)"
+ STRIP="$(tc-getSTRIP)"
+ )
export xmakeopts
}
@@ -850,7 +859,7 @@ install_headers() {
local ddir=$(kernel_header_destdir)
env_setup_xmakeopts
- emake headers_install INSTALL_HDR_PATH="${ED}"${ddir}/.. ${xmakeopts}
+ emake headers_install INSTALL_HDR_PATH="${ED}"${ddir}/..
"${xmakeopts[@]}"
# let other packages install some of these headers
rm -rf "${ED}"${ddir}/scsi || die #glibc/uclibc/etc...