From patchwork Sun Jul 31 19:44:57 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Lacombe X-Patchwork-Id: 1024602 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p6VJj7ok028876 for ; Sun, 31 Jul 2011 19:45:07 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751802Ab1GaTpG (ORCPT ); Sun, 31 Jul 2011 15:45:06 -0400 Received: from mail-iy0-f174.google.com ([209.85.210.174]:50327 "EHLO mail-iy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751212Ab1GaTpG (ORCPT ); Sun, 31 Jul 2011 15:45:06 -0400 Received: by iyb12 with SMTP id 12so6059172iyb.19 for ; Sun, 31 Jul 2011 12:45:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; bh=3aqO36NnWnRA05WdKXoJ50Z3eP5Be41W0oc3q8V/QL4=; b=k5wEQnZP7Ps/tSyAi4+O+GAoTMjWdhI9pvxd/P+EWwrO/daBsHIMTHtA2W617nqBsi 7l3LlBK9LCR18xh3g8iqyRyvlISqzflaUC4HVEn71wqz4lvVzgDVVSkmLp1yZ6skPFxv PA509MiolTFCmBxH3/IffmSp+cdX8QF620INc= Received: by 10.231.148.131 with SMTP id p3mr305743ibv.157.1312141504652; Sun, 31 Jul 2011 12:45:04 -0700 (PDT) Received: from localhost.localdomain (69-165-143-95.dsl.teksavvy.com [69.165.143.95]) by mx.google.com with ESMTPS id t2sm267742ibc.46.2011.07.31.12.45.03 (version=SSLv3 cipher=OTHER); Sun, 31 Jul 2011 12:45:03 -0700 (PDT) From: Aunt Tillie To: Michal Marek Cc: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, David Woodhouse , Aunt Tillie Subject: [PATCH] kbuild: honor the ARCH setting of the existing configuration Date: Sun, 31 Jul 2011 15:44:57 -0400 Message-Id: <1312141497-13854-1-git-send-email-lacombar@gmail.com> X-Mailer: git-send-email 1.7.6.153.g78432 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Sun, 31 Jul 2011 19:45:07 +0000 (UTC) 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 --- 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