aboutsummaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2012-12-18 23:57:04 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2012-12-18 23:57:04 +0000
commit1e87acf195120e923780987e91cedf8dbe4bea43 (patch)
treeecc110f50588bee71865d9c389722b67b5c970ee /packages
parentc18bdce679a1bd2b81ee855a65dcf6953eeab93d (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
Diffstat (limited to 'packages')
-rwxr-xr-xpackages/linux_make/Makefile17
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 --------------------------------------------------