From: Aunt Tillie <lacombar@gmail.com>
To: Michal Marek <mmarek@suse.cz>
Cc: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org,
David Woodhouse <dwmw2@infradead.org>,
Aunt Tillie <lacombar@gmail.com>
Subject: [PATCH] kbuild: honor the ARCH setting of the existing configuration
Date: Sun, 31 Jul 2011 15:44:57 -0400 [thread overview]
Message-ID: <1312141497-13854-1-git-send-email-lacombar@gmail.com> (raw)
This change make Kbuild honor the ARCH setting of the existing configuration, if
any .config is present so that it does not get reset if there is a conflict
with the default ARCH for the platform and the current setting.
Signed-off-by: Arnaud Lacombe aka. Aunt Tillie <lacombar@gmail.com>
---
Makefile | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/Makefile b/Makefile
index f676d15..bb2f1fc 100644
--- a/Makefile
+++ b/Makefile
@@ -192,7 +192,12 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
# Default value for CROSS_COMPILE is not to prefix executables
# Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile
export KBUILD_BUILDHOST := $(SUBARCH)
-ARCH ?= $(SUBARCH)
+ifeq ($(shell test -e .config && echo y),y)
+ARCH ?= $(shell sed '/^\# Linux\/\(.*\) .* Kernel Configuration/!d; s//\1/' .config)
+endif
+ifeq ($(ARCH),)
+ARCH := $(SUBARCH)
+endif
CROSS_COMPILE ?= $(CONFIG_CROSS_COMPILE:"%"=%)
# Architecture as present in compile.h
--
1.7.6.153.g78432
next reply other threads:[~2011-07-31 19:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-31 19:44 Aunt Tillie [this message]
2011-07-31 20:20 ` [PATCH] kbuild: honor the ARCH setting of the existing configuration David Woodhouse
2011-07-31 22:07 ` Arnaud Lacombe
2011-07-31 22:34 ` David Woodhouse
2011-07-31 23:20 ` Arnaud Lacombe
2011-08-01 2:05 ` Randy Dunlap
2011-08-01 8:42 ` David Woodhouse
2011-08-01 17:33 ` Arnaud Lacombe
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=1312141497-13854-1-git-send-email-lacombar@gmail.com \
--to=lacombar@gmail.com \
--cc=dwmw2@infradead.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mmarek@suse.cz \
/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