diff options
Diffstat (limited to 'eclass/kernel-2.eclass')
-rw-r--r-- | eclass/kernel-2.eclass | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass index 873d4a204669..3c78aa5a8445 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 @@ -745,25 +745,35 @@ cross_pre_c_headers() { use headers-only && [[ ${CHOST} != ${CTARGET} ]] } -# @FUNCTION: env_setup_xmakeopts +# @FUNCTION: env_setup_kernel_makeopts # @USAGE: # @DESCRIPTION: -# set the ARCH/CROSS_COMPILE when cross compiling +# Set the toolchain variables, as well as ARCH and CROSS_COMPILE when +# cross-compiling. -env_setup_xmakeopts() { +env_setup_kernel_makeopts() { # Kernel ARCH != portage ARCH export KARCH=$(tc-arch-kernel) # When cross-compiling, we need to set the ARCH/CROSS_COMPILE # variables properly or bad things happen ! - xmakeopts="ARCH=${KARCH}" + KERNEL_MAKEOPTS=( ARCH="${KARCH}" ) if [[ ${CTARGET} != ${CHOST} ]] && ! cross_pre_c_headers; then - xmakeopts="${xmakeopts} CROSS_COMPILE=${CTARGET}-" + KERNEL_MAKEOPTS+=( CROSS_COMPILE="${CTARGET}-" ) elif type -p ${CHOST}-ar >/dev/null; then - xmakeopts="${xmakeopts} CROSS_COMPILE=${CHOST}-" + KERNEL_MAKEOPTS+=( 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)" - export xmakeopts + KERNEL_MAKEOPTS+=( + 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 KERNEL_MAKEOPTS } # @FUNCTION: universal_unpack @@ -849,8 +859,8 @@ install_universal() { install_headers() { local ddir=$(kernel_header_destdir) - env_setup_xmakeopts - emake headers_install INSTALL_HDR_PATH="${ED}"${ddir}/.. ${xmakeopts} + env_setup_kernel_makeopts + emake headers_install INSTALL_HDR_PATH="${ED}"${ddir}/.. "${KERNEL_MAKEOPTS[@]}" # let other packages install some of these headers rm -rf "${ED}"${ddir}/scsi || die #glibc/uclibc/etc... @@ -1416,8 +1426,8 @@ kernel-2_src_unpack() { [[ -z ${K_NOSETEXTRAVERSION} ]] && unpack_set_extraversion unpack_fix_install_path - # Setup xmakeopts and cd into sourcetree. - env_setup_xmakeopts + # Setup KERNEL_MAKEOPTS and cd into sourcetree. + env_setup_kernel_makeopts cd "${S}" || die if [[ ${K_DEBLOB_AVAILABLE} == 1 ]] && use deblob; then |