summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2013-03-25 22:41:15 +0000
committerTim Angus <tim@ngus.net>2013-03-25 23:29:17 +0000
commit341bb2b785049a543fb3346545efc65a30778c92 (patch)
tree700ae4c4c9a0530a152db3ffbcb7d60d1639d750 /Makefile
parentb4b2484e16ae7e6d2b7a9f215c678d71c343b917 (diff)
Cross compiling for OS X
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile28
1 files changed, 25 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 93e1cfa3..f80c9dd7 100644
--- a/Makefile
+++ b/Makefile
@@ -413,6 +413,22 @@ ifeq ($(PLATFORM),darwin)
OPTIMIZEVM += -arch x86_64 -mfpmath=sse
endif
+ ifeq ($(CROSS_COMPILING),1)
+ ifeq ($(ARCH),ppc)
+ CC=powerpc-apple-darwin10-gcc
+ RANLIB=powerpc-apple-darwin10-ranlib
+ else
+ ifeq ($(ARCH),x86)
+ CC=i686-apple-darwin10-gcc
+ RANLIB=i686-apple-darwin10-ranlib
+ else
+ $(error Architecture $(ARCH) is not supported when cross compiling)
+ endif
+ endif
+ else
+ TOOLS_CFLAGS += -DMACOS_X
+ endif
+
BASE_CFLAGS += -fno-strict-aliasing -DMACOS_X -fno-common -pipe
ifeq ($(USE_OPENAL),1)
@@ -454,8 +470,6 @@ ifeq ($(PLATFORM),darwin)
NOTSHLIBCFLAGS=-mdynamic-no-pic
- TOOLS_CFLAGS += -DMACOS_X
-
else # ifeq darwin
@@ -823,6 +837,14 @@ endif #NetBSD
endif #IRIX
endif #SunOS
+ifndef CC
+ CC=gcc
+endif
+
+ifndef RANLIB
+ RANLIB=gcc
+endif
+
ifneq ($(HAVE_VM_COMPILED),true)
BASE_CFLAGS += -DNO_VM_COMPILED
BUILD_GAME_QVM=0
@@ -1864,7 +1886,7 @@ ifneq ($(strip $(LIBSDLMAIN)),)
ifneq ($(strip $(LIBSDLMAINSRC)),)
$(LIBSDLMAIN) : $(LIBSDLMAINSRC)
cp $< $@
- ranlib $@
+ $(RANLIB) $@
endif
endif