aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 --------------------------------------------------