diff mbox

[1/2] add host arch detection and Kconfig (BR2_HOSTARCH)

Message ID 1334675140-20303-1-git-send-email-plagnioj@jcrosoft.com
State Superseded
Headers show

Commit Message

Jean-Christophe PLAGNIOL-VILLARD April 17, 2012, 3:05 p.m. UTC
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>
---
 Config.in |    4 ++++
 Makefile  |   10 ++++++++++
 2 files changed, 14 insertions(+), 0 deletions(-)

Comments

Arnout Vandecappelle April 28, 2012, 3:38 p.m. UTC | #1
On Tuesday 17 April 2012 17:05:39 Jean-Christophe PLAGNIOL-VILLARD wrote:
> 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>
> ---
>  Config.in |    4 ++++
>  Makefile  |   10 ++++++++++
>  2 files changed, 14 insertions(+), 0 deletions(-)
> 
> diff --git a/Config.in b/Config.in
> index 68abb9b..be424b7 100644
> --- 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"
> diff --git a/Makefile b/Makefile
> index 3a09417..b14940b 100644
> --- 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/)

 If it's going to be any use, I guess we still need to be able to
distinguish arm/armeb and sh/sh64.  But I don't know how these look
in the uname. 

> +
>  # This top-level Makefile can *not* be executed in parallel
>  .NOTPARALLEL:


 Regards,
 Arnout
Jean-Christophe PLAGNIOL-VILLARD April 30, 2012, 10:29 a.m. UTC | #2
On 17:38 Sat 28 Apr     , Arnout Vandecappelle wrote:
> On Tuesday 17 April 2012 17:05:39 Jean-Christophe PLAGNIOL-VILLARD wrote:
> > 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>
> > ---
> >  Config.in |    4 ++++
> >  Makefile  |   10 ++++++++++
> >  2 files changed, 14 insertions(+), 0 deletions(-)
> > 
> > diff --git a/Config.in b/Config.in
> > index 68abb9b..be424b7 100644
> > --- 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"
> > diff --git a/Makefile b/Makefile
> > index 3a09417..b14940b 100644
> > --- 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/)
> 
>  If it's going to be any use, I guess we still need to be able to
> distinguish arm/armeb and sh/sh64.  But I don't know how these look
> in the uname. 

If you can found one sh64 board good luck I may have one somewhere but not
even sure I can still found a sh64

for arme if you can found a board with enough power power to build something on it
as big as buildroot

today the Cortex A15 and A9 are little endian

Best Regards,
J.
diff mbox

Patch

diff --git a/Config.in b/Config.in
index 68abb9b..be424b7 100644
--- 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"
diff --git a/Makefile b/Makefile
index 3a09417..b14940b 100644
--- 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: