public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kbuild: honor the ARCH setting of the existing configuration
@ 2011-07-31 19:44 Aunt Tillie
  2011-07-31 20:20 ` David Woodhouse
  0 siblings, 1 reply; 8+ messages in thread
From: Aunt Tillie @ 2011-07-31 19:44 UTC (permalink / raw)
  To: Michal Marek; +Cc: linux-kernel, linux-kbuild, David Woodhouse, Aunt Tillie

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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-08-01 17:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-31 19:44 [PATCH] kbuild: honor the ARCH setting of the existing configuration Aunt Tillie
2011-07-31 20:20 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox