[PATCH] x86: introduce ARCH=i386,ARCH=x86_64 to select 32/64 bit

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: LKML <linux-kernel@...>
Cc: Sam Ravnborg <sam@...>
Date: Saturday, November 10, 2007 - 4:43 pm

Using the newly added infrastructure is is now simple
to add addition ARCH= symbols to select between 32 and 64 bit.
Do this for x86.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
---
 Makefile                 |   16 +++++++++++++---
 arch/x86/Makefile        |   10 +++++++---
 scripts/kconfig/Makefile |    2 +-
 3 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/Makefile b/Makefile
index 902082b..5efee80 100644
--- a/Makefile
+++ b/Makefile
@@ -165,8 +165,7 @@ export srctree objtree VPATH TOPDIR
 # then ARCH is assigned, getting whatever value it gets normally, and 
 # SUBARCH is subsequently ignored.
 
-SUBARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/        \
-				  -e s/sun4u/sparc64/                    \
+SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
 				  -e s/arm.*/arm/ -e s/sa110/arm/ \
 				  -e s/s390x/s390/ -e s/parisc64/parisc/ \
 				  -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
@@ -198,8 +197,19 @@ CROSS_COMPILE	?=
 UTS_MACHINE 	:= $(ARCH)
 SRCARCH 	:= $(ARCH)
 
+ifeq ($(ARCH),i386)
+        K64BIT := n
+        SRCARCH   := x86
+endif
+ifeq ($(ARCH),x86_64)
+        K64BIT := y
+        SRCARCH := x86
+endif
+export K64BIT
+
+
 # Sanity check the specified ARCH
-ifeq ($(wildcard $(srctree)/arch/$(ARCH)/Kconfig),)
+ifeq ($(wildcard $(srctree)/arch/$(SRCARCH)/Kconfig),)
         $(error "ERROR: ARCH ($(ARCH)) does not exist (for i386 and x86_64 use ARCH=x86)")
 endif
 
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index ee94224..feba761 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -1,9 +1,13 @@
 # Unified Makefile for i386 and x86_64
 
 # select i386 defconfig file as default config
-KBUILD_DEFCONFIG := i386_defconfig
-
-# # No need to remake these files
+ifeq ($(ARCH),x86)
+        KBUILD_DEFCONFIG := i386_defconfig
+else
+        KBUILD_DEFCONFIG := $(ARCH)_defconfig
+endif
+        
+# No need to remake these files
 $(srctree)/arch/x86/Makefile%: ;
 
 ifeq ($(CONFIG_X86_32),y)
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 3c9db07..1ad6f7f 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -4,7 +4,7 @@
 
 PHONY += oldconfig xconfig gconfig menuconfig config silentoldconfig update-po-config
 
-Kconfig := arch/$(ARCH)/Kconfig
+Kconfig := arch/$(SRCARCH)/Kconfig
 
 xconfig: $(obj)/qconf
 	$< $(Kconfig)
-- 
1.5.3.4.1157.g0e74-dirty

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] kconfig: factor out code in confdata.c, Sam Ravnborg, (Sat Nov 10, 4:43 pm)
[PATCH 3/3] use environment option, Roman Zippel, (Sun Jan 13, 11:51 pm)
[PATCH 2/3] environment symbol support, Roman Zippel, (Sun Jan 13, 11:50 pm)
[PATCH 1/3] explicitly introduce expression list, Roman Zippel, (Sun Jan 13, 11:50 pm)
Re: [PATCH] kconfig: use $K64BIT to set 64BIT with all*confi..., Guillaume Chazarain, (Sat Nov 10, 4:55 pm)
Re: [PATCH] kconfig: use $K64BIT to set 64BIT with all*confi..., Guillaume Chazarain, (Sun Nov 11, 8:43 am)
Re: [PATCH] kconfig: use $K64BIT to set 64BIT with all*confi..., Guillaume Chazarain, (Sun Nov 11, 10:59 am)
Re: [PATCH] kconfig: use $K64BIT to set 64BIT with all*confi..., Guillaume Chazarain, (Sun Nov 11, 11:55 am)
[PATCH] kconfig: document make K64BIT=y in README, Sam Ravnborg, (Sat Nov 10, 4:43 pm)
Re: [PATCH] kconfig: document make K64BIT=y in README, Randy Dunlap, (Sat Nov 10, 6:23 pm)
[PATCH] x86: introduce ARCH=i386,ARCH=x86_64 to select 32/64..., Sam Ravnborg, (Sat Nov 10, 4:43 pm)