diff options
author | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2012-12-18 23:57:04 +0000 |
---|---|---|
committer | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2012-12-18 23:57:04 +0000 |
commit | 1e87acf195120e923780987e91cedf8dbe4bea43 (patch) | |
tree | ecc110f50588bee71865d9c389722b67b5c970ee | |
parent | c18bdce679a1bd2b81ee855a65dcf6953eeab93d (diff) |
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
-rwxr-xr-x | packages/linux_make/Makefile | 17 |
1 files changed, 17 insertions, 0 deletions
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 -------------------------------------------------- |