From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id C9B49138359 for ; Thu, 16 Jul 2020 15:03:30 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DA960E085A; Thu, 16 Jul 2020 15:03:28 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B4C41E085A for ; Thu, 16 Jul 2020 15:03:28 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id B244034F1ED for ; Thu, 16 Jul 2020 15:03:27 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 573D12EC for ; Thu, 16 Jul 2020 15:03:22 +0000 (UTC) From: "Thomas Deutschmann" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Thomas Deutschmann" Message-ID: <1594909756.cc875f5163a6e79110e4afcabe07acdacd369bf5.whissi@gentoo> Subject: [gentoo-commits] proj/genkernel:master commit in: defaults/, / X-VCS-Repository: proj/genkernel X-VCS-Files: defaults/config.sh gen_determineargs.sh X-VCS-Directories: / defaults/ X-VCS-Committer: whissi X-VCS-Committer-Name: Thomas Deutschmann X-VCS-Revision: cc875f5163a6e79110e4afcabe07acdacd369bf5 X-VCS-Branch: master Date: Thu, 16 Jul 2020 15:03:22 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: c6a00336-7344-4ff5-92b2-d4b6d9c54259 X-Archives-Hash: 542931575d72411937b856db2b0ef97a commit: cc875f5163a6e79110e4afcabe07acdacd369bf5 Author: Thomas Deutschmann gentoo org> AuthorDate: Tue Jul 14 15:00:21 2020 +0000 Commit: Thomas Deutschmann gentoo org> CommitDate: Thu Jul 16 14:29:16 2020 +0000 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=cc875f51 gen_determineargs.sh: determine_real_args(): Don't call gcc directly Set $CHOST variable via config so that we no longer need to call gcc directly to determine CHOST value. Signed-off-by: Thomas Deutschmann gentoo.org> defaults/config.sh | 3 +++ gen_determineargs.sh | 13 ++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/defaults/config.sh b/defaults/config.sh index bab7b7e..f8cb311 100644 --- a/defaults/config.sh +++ b/defaults/config.sh @@ -49,3 +49,6 @@ DEFAULT_UTILS_CC=gcc DEFAULT_UTILS_CXX=g++ DEFAULT_UTILS_AS=as DEFAULT_UTILS_LD=ld + +PORTAGE_CHOST="$(portageq envvar CHOST)" +DEFAULT_CHOST="${PORTAGE_CHOST:-$(${DEFAULT_UTILS_CC} -dumpmachine 2>/dev/null)}" diff --git a/gen_determineargs.sh b/gen_determineargs.sh index 956e3bf..b464505 100755 --- a/gen_determineargs.sh +++ b/gen_determineargs.sh @@ -300,6 +300,7 @@ determine_real_args() { set_config_with_override STRING COMPRESS_INITRD CMD_COMPRESS_INITRD "${DEFAULT_COMPRESS_INITRD}" set_config_with_override STRING COMPRESS_INITRD_TYPE CMD_COMPRESS_INITRD_TYPE "${DEFAULT_COMPRESS_INITRD_TYPE}" + set_config_with_override STRING CHOST CMD_CHOST "${DEFAULT_CHOST}" set_config_with_override STRING MAKEOPTS CMD_MAKEOPTS "${DEFAULT_MAKEOPTS}" set_config_with_override STRING NICE CMD_NICE "10" set_config_with_override STRING KERNEL_MAKE CMD_KERNEL_MAKE "${DEFAULT_KERNEL_MAKE}" @@ -563,17 +564,15 @@ determine_real_args() { ARCH_CONFIG="${GK_SHARE}/arch/${ARCH}/config.sh" [ -f "${ARCH_CONFIG}" ] || gen_die "${ARCH} not yet supported by genkernel. Please add the arch-specific config file '${ARCH_CONFIG}'!" - # set CBUILD and CHOST - local build_cc=$(tc-getBUILD_CC) - CBUILD=$(${build_cc} -dumpmachine 2>/dev/null) - if [ -z "${CBUILD}" ] + # Set CBUILD and CHOST + if ! isTrue "$(is_valid_triplet "${CHOST}")" then - gen_die "Failed to determine CBUILD using '${build_cc} -dumpmachine' command!" + gen_die "Set CHOST '${CHOST}' does NOT represent a valid triplet!" else + # Initialize CBUILD with CHOST value + CBUILD=${CHOST} print_info 5 "CBUILD set to '${CBUILD}' ..." - CHOST="${CBUILD}" fi - unset build_cc if [ -n "${CMD_CROSS_COMPILE}" ] then