public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Thomas Deutschmann" <whissi@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/genkernel:master commit in: defaults/, /
Date: Thu, 16 Jul 2020 15:03:22 +0000 (UTC)	[thread overview]
Message-ID: <1594909756.cc875f5163a6e79110e4afcabe07acdacd369bf5.whissi@gentoo> (raw)

commit:     cc875f5163a6e79110e4afcabe07acdacd369bf5
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 14 15:00:21 2020 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> 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 <whissi <AT> 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


             reply	other threads:[~2020-07-16 15:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-16 15:03 Thomas Deutschmann [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-08-28 20:18 [gentoo-commits] proj/genkernel:master commit in: defaults/, / Thomas Deutschmann
2020-08-28 20:18 Thomas Deutschmann
2020-08-01 21:41 Thomas Deutschmann
2020-07-23 23:57 Thomas Deutschmann
2020-01-12 14:59 Thomas Deutschmann
2019-11-24 20:00 Thomas Deutschmann
2017-01-02 20:14 Matt Thode
2016-01-05 18:51 Richard Farina
2015-04-12 21:04 Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1594909756.cc875f5163a6e79110e4afcabe07acdacd369bf5.whissi@gentoo \
    --to=whissi@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox