From 1e87acf195120e923780987e91cedf8dbe4bea43 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Tue, 18 Dec 2012 23:57:04 +0000 Subject: try to make CPU arch detection less error prone... ('uname -m' sometimes gives the parent arch when used in dchroot) svn path=/trunk/; revision=16693 --- packages/linux_make/Makefile | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'packages/linux_make') diff --git a/packages/linux_make/Makefile b/packages/linux_make/Makefile index 869f8619..f427aa23 100755 --- a/packages/linux_make/Makefile +++ b/packages/linux_make/Makefile @@ -35,7 +35,23 @@ STRIP = echo DEBUG_CFLAGS = -g -fno-inline-functions -fno-omit-frame-pointer -DDEBUG_SOUNDFILE -Wstrict-aliasing=2 OPT_CFLAGS = +# bash's HOSTTYPE env var seems more reliable in chroots, use it if its set +ifeq ($(HOSTTYPE),) TARGET_PLATFORM := $(shell uname -m) +else +TARGET_PLATFORM := $(HOSTTYPE) +endif + +ifeq ($(TARGET_PLATFORM),i386) +TARGET_PLATFORM := i686 +endif +ifeq ($(TARGET_PLATFORM),i486) +TARGET_PLATFORM := i686 +endif +ifeq ($(TARGET_PLATFORM),i586) +TARGET_PLATFORM := i686 +endif + ifeq ($(TARGET_PLATFORM),i686) # Generic x86 (tune for Pentium III, since that's more common these days) OPT_CFLAGS += -mtune=i686 -march=i386 @@ -271,6 +287,7 @@ test_locations: @echo "HELPDIR $(helpdir)" @echo "MANUALSDIR $(manualsdir)" @echo "EXAMPLESDIR $(examplesdir)" + @echo "HOSTTYPE: $(HOSTTYPE)" @echo "TARGET_PLATFORM: $(TARGET_PLATFORM)" @echo "OPT_CFLAGS: $(OPT_CFLAGS)" @echo -------------------------------------------------- -- cgit v1.2.1