[Buildroot] [PATCH 1/6] core: export a variable with the host's bitness

Yann E. MORIN yann.morin.1998 at free.fr
Mon Nov 7 21:23:35 UTC 2016


Some host packages (e.g. host-pseudo) wants to know the host bitness,
and they can fail to detect it in some corner cases (as reported by a
few users on IRC).

Export a variable with the bitness of the host, so that those packages
can be made to behave.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998 at free.fr>
Cc: Gaël PORTAY <gael.portay at savoirfairelinux.com>
Cc: Patrick Keroulas <patrick.keroulas at savoirfairelinux.com>
Cc: Erico Nunes <nunes.erico at gmail.com>
Cc: Julien BOIBESSOT <julien.boibessot at free.fr>
---
 Makefile | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Makefile b/Makefile
index 4ea64b3..78f72bc 100644
--- a/Makefile
+++ b/Makefile
@@ -340,6 +340,12 @@ export HOSTARCH := $(shell LC_ALL=C $(HOSTCC_NOCCACHE) -v 2>&1 | \
 	    -e 's/macppc/powerpc/' \
 	    -e 's/sh.*/sh/' )
 
+ifeq ($(filter %64,$(HOSTARCH)),)
+HOSTARCH_BITS := 32
+else
+HOSTARCH_BITS := 64
+endif
+
 HOSTCC_VERSION := $(shell $(HOSTCC_NOCCACHE) --version | \
 	sed -n -r 's/^.* ([0-9]*)\.([0-9]*)\.([0-9]*)[ ]*.*/\1 \2/p')
 
-- 
2.7.4



More information about the buildroot mailing list