summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/makefile
diff options
context:
space:
mode:
authorSteven Noonan <steven@uplinklabs.net>2009-10-17 06:09:01 -0700
committerSteven Noonan <steven@uplinklabs.net>2009-10-17 06:09:01 -0700
commit63d477eda96b79577fb9b400eeebf8399958dc64 (patch)
tree4d4fdfd008c60d89767e6983f7ee683df66bd9d1 /crawl-ref/source/makefile
parenta56fa852ebf641176aa6d4811e22b0a787cad70c (diff)
downloadcrawl-ref-63d477eda96b79577fb9b400eeebf8399958dc64.tar.gz
crawl-ref-63d477eda96b79577fb9b400eeebf8399958dc64.zip
makefile: basic cross-compilation support
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
Diffstat (limited to 'crawl-ref/source/makefile')
-rw-r--r--crawl-ref/source/makefile13
1 files changed, 13 insertions, 0 deletions
diff --git a/crawl-ref/source/makefile b/crawl-ref/source/makefile
index e76f3aa166..f4565b3b55 100644
--- a/crawl-ref/source/makefile
+++ b/crawl-ref/source/makefile
@@ -38,12 +38,14 @@ MAKEFLAGS := --no-print-directory
# The GCC and GXX variables are set later.
#
AR = ar
+RANLIB = ranlib
CC = $(GCC)
CXX = $(GXX)
RM = rm -f
COPY = cp
export AR
+export RANLIB
export RM
export CC
export CXX
@@ -68,6 +70,10 @@ uname_R := $(shell sh -c 'uname -r 2>/dev/null || echo not')
uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not')
uname_V := $(shell sh -c 'uname -v 2>/dev/null || echo not')
+ifdef CROSSHOST
+ NO_PKGCONFIG = YesPlease
+ CONFIGURE_FLAGS += --host=$(CROSSHOST)
+endif
ifneq (,$(findstring MINGW,$(uname_S)))
GAME = crawl.exe
WIN32 = Yes
@@ -168,6 +174,7 @@ CXX = $(GXX) $(ARCHS) -isysroot $(SDKROOT) -mmacosx-version-min=$(SDK_VER)
endif # MacOS
+ifndef CROSSHOST
ifneq ($(GCC_VER),)
GCC := gcc-$(GCC_VER)
GXX := g++-$(GCC_VER)
@@ -175,6 +182,12 @@ else
GCC := gcc
GXX := g++
endif
+else
+GCC := $(CROSSHOST)-gcc
+GXX := $(CROSSHOST)-g++
+AR := $(CROSSHOST)-ar
+RANLIB := $(CROSSHOST)-ranlib
+endif
GCC_GTE_4_3_0 := $(shell util/gcc-gte.pl $(GCC) 4.3.0)
RLTILES = rltiles