From 63d477eda96b79577fb9b400eeebf8399958dc64 Mon Sep 17 00:00:00 2001 From: Steven Noonan Date: Sat, 17 Oct 2009 06:09:01 -0700 Subject: makefile: basic cross-compilation support Signed-off-by: Steven Noonan --- crawl-ref/source/makefile | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'crawl-ref/source/makefile') 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 -- cgit v1.2.3-54-g00ecf