Cross compiling for OS X

This commit is contained in:
Tim Angus 2013-03-25 22:41:15 +00:00
parent 01efc26654
commit 352cd151e0

View file

@ -425,6 +425,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)
@ -466,8 +482,6 @@ ifeq ($(PLATFORM),darwin)
NOTSHLIBCFLAGS=-mdynamic-no-pic
TOOLS_CFLAGS += -DMACOS_X
else # ifeq darwin
@ -835,6 +849,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
@ -1969,7 +1991,7 @@ ifneq ($(strip $(LIBSDLMAIN)),)
ifneq ($(strip $(LIBSDLMAINSRC)),)
$(LIBSDLMAIN) : $(LIBSDLMAINSRC)
cp $< $@
ranlib $@
$(RANLIB) $@
endif
endif