]> rtime.felk.cvut.cz Git - coffee/buildroot.git/commitdiff
add host arch detection and Kconfig BR2_HOSTARCH
authorFrancois Perrad <fperrad@gmail.com>
Wed, 18 Jul 2012 13:59:09 +0000 (15:59 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Wed, 18 Jul 2012 17:33:29 +0000 (19:33 +0200)
This will allow to install binary package only if they are supported by the
host. As example Atmel SAM-BA (x86 only).

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Config.in
Makefile

index 925c2474cb8b1cf10f3441121049a7cd93448b01..c182f7044d73744a6aae6d1cd3a6507e2d19cc59 100644 (file)
--- a/Config.in
+++ b/Config.in
@@ -10,6 +10,10 @@ config BR2_VERSION
        string
        option env="BR2_VERSION_FULL"
 
+config BR2_HOSTARCH
+       string
+       option env="HOSTARCH"
+
 source "target/Config.in.arch"
 
 menu "Build options"
index d55b136a86da5f2afcf4f6ade72868794a26de3a..639fdaa1f8429a686dc410c04d06150be0b4c31c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -32,6 +32,16 @@ ifneq ($(firstword $(sort $(MAKE_VERSION) $(MIN_MAKE_VERSION))),$(MIN_MAKE_VERSI
 $(error You have make '$(MAKE_VERSION)' installed. GNU make >= $(MIN_MAKE_VERSION) is required)
 endif
 
+export HOSTARCH := $(shell uname -m | \
+       sed -e s/i.86/x86/ \
+           -e s/sun4u/sparc64/ \
+           -e s/arm.*/arm/ \
+           -e s/sa110/arm/ \
+           -e s/ppc64/powerpc/ \
+           -e s/ppc/powerpc/ \
+           -e s/macppc/powerpc/\
+           -e s/sh.*/sh/)
+
 # This top-level Makefile can *not* be executed in parallel
 .NOTPARALLEL: