[git commit master] handle make ARCH= config

Bernhard Reutner-Fischer rep.dot.nop at gmail.com
Wed Sep 16 08:00:56 UTC 2009


commit: http://git.uclibc.org/uClibc/commit/?id=554b79bfb7f056636b65bca27c01d0ef669977f3
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop at gmail.com>
---
 Rules.mak               |   23 +++++++++++++----------
 extra/Configs/Config.in |   29 +++++++++++++++++++++++++++++
 2 files changed, 42 insertions(+), 10 deletions(-)

diff --git a/Rules.mak b/Rules.mak
index 37430bb..611eaa8 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -63,14 +63,6 @@ STRIP_FLAGS ?= -x -R .note -R .comment
 # Select the compiler needed to build binaries for your development system
 HOSTCC     = gcc
 BUILD_CFLAGS = -Os -Wall
-export ARCH := $(shell uname -m | $(SED) -e s/i.86/i386/ \
-				  -e s/sun.*/sparc/ -e s/sparc.*/sparc/ \
-				  -e s/arm.*/arm/ -e s/sa110/arm/ \
-				  -e s/sh.*/sh/ \
-				  -e s/s390x/s390/ -e s/parisc.*/hppa/ \
-				  -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
-				  -e s/xtensa.*/xtensa/ )
-
 
 #---------------------------------------------------------
 # Nothing beyond this point should ever be touched by mere
@@ -82,10 +74,21 @@ export ARCH := $(shell uname -m | $(SED) -e s/i.86/i386/ \
 ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
 -include $(top_builddir).config
 endif
+TARGET_ARCH:=$(strip $(subst ",, $(strip $(TARGET_ARCH))))
+ifeq ($(TARGET_ARCH),)
+ARCH ?= $(shell uname -m | $(SED) -e s/i.86/i386/ \
+				  -e s/sun.*/sparc/ -e s/sparc.*/sparc/ \
+				  -e s/arm.*/arm/ -e s/sa110/arm/ \
+				  -e s/sh.*/sh/ \
+				  -e s/s390x/s390/ -e s/parisc.*/hppa/ \
+				  -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
+				  -e s/xtensa.*/xtensa/ )
+else
+ARCH = $(TARGET_ARCH)
+endif
+export ARCH
 
 # Make certain these contain a final "/", but no "//"s.
-TARGET_ARCH:=$(shell grep -s '^TARGET_ARCH' $(top_builddir)/.config | $(SED) -e 's/^TARGET_ARCH=//' -e 's/"//g')
-TARGET_ARCH:=$(strip $(subst ",, $(strip $(TARGET_ARCH))))
 TARGET_SUBARCH:=$(shell grep -s '^TARGET_SUBARCH' $(top_builddir)/.config | $(SED) -e 's/^TARGET_SUBARCH=//' -e 's/"//g')
 TARGET_SUBARCH:=$(strip $(subst ",, $(strip $(TARGET_SUBARCH))))
 RUNTIME_PREFIX:=$(strip $(subst //,/, $(subst ,/, $(subst ",, $(strip $(RUNTIME_PREFIX))))))
diff --git a/extra/Configs/Config.in b/extra/Configs/Config.in
index a3f1910..0108cb0 100644
--- a/extra/Configs/Config.in
+++ b/extra/Configs/Config.in
@@ -5,8 +5,37 @@
 
 mainmenu "uClibc C Library Configuration"
 
+config DESIRED_TARGET_ARCH
+	string
+	option env="ARCH"
+
 choice
 	prompt "Target Architecture"
+	default TARGET_alpha if DESIRED_TARGET_ARCH = "alpha"
+	default TARGET_arm if DESIRED_TARGET_ARCH = "arm"
+	default TARGET_avr32 if DESIRED_TARGET_ARCH = "avr32"
+	default TARGET_bfin if DESIRED_TARGET_ARCH = "bfin"
+	default TARGET_cris if DESIRED_TARGET_ARCH = "cris"
+	default TARGET_e1 if DESIRED_TARGET_ARCH = "e1"
+	default TARGET_frv if DESIRED_TARGET_ARCH = "frv"
+	default TARGET_h8300 if DESIRED_TARGET_ARCH = "h8300"
+	default TARGET_hppa if DESIRED_TARGET_ARCH = "hppa"
+	default TARGET_i386 if DESIRED_TARGET_ARCH = "i386"
+	default TARGET_i960 if DESIRED_TARGET_ARCH = "i960"
+	default TARGET_ia64 if DESIRED_TARGET_ARCH = "ia64"
+	default TARGET_m68k if DESIRED_TARGET_ARCH = "m68k"
+	default TARGET_microblaze if DESIRED_TARGET_ARCH = "microblaze"
+	default TARGET_mips if DESIRED_TARGET_ARCH = "mips"
+	default TARGET_nios if DESIRED_TARGET_ARCH = "nios"
+	default TARGET_nios2 if DESIRED_TARGET_ARCH = "nios2"
+	default TARGET_powerpc if DESIRED_TARGET_ARCH = "powerpc"
+	default TARGET_sh if DESIRED_TARGET_ARCH = "sh"
+	default TARGET_sh64 if DESIRED_TARGET_ARCH = "sh64"
+	default TARGET_sparc if DESIRED_TARGET_ARCH = "sparc"
+	default TARGET_v850 if DESIRED_TARGET_ARCH = "v850"
+	default TARGET_vax if DESIRED_TARGET_ARCH = "vax"
+	default TARGET_x86_64 if DESIRED_TARGET_ARCH = "x86_64"
+	default TARGET_xtensa if DESIRED_TARGET_ARCH = "xtensa"
 	help
 	  The architecture of your target.
 
-- 
1.6.3.3



More information about the uClibc-cvs mailing list