Files
OpenTTD/os/macosx/Makefile.setup
bjarni 10936e7034 (svn r4074) -Feature: [Makefile] the makefile can now detect if iconv is present in the system
if detected, WITH_ICONV will be defined in the C code
	WITH_ICONV is also added to Makefile.config
	OSX do not use this flag setting in Makefile.config, as it is set at compile time based on target OS version
	the actual C code is not changed as the current iconv code is hardcoded for OSX and would break if any other OS got iconv
	This detection system is by request of Darkvater
2006-03-23 23:54:43 +00:00

94 lines
2.5 KiB
Makefile

# $Id: Makefile 3214 2005-11-17 19:43:37Z bjarni $
# This makefile is not a standalone makefile, but is called from the general one
# it contains code specific to MacOS X
ifdef RELEASE
ifndef STATIC
# all OSX releases needs to be static
# end users don't tend to have the dynamic libs installed
$(warning Compiling a dynamic release. It should be static unless you really know what you are doing!!!)
endif
endif
ifdef RELEASE
ifndef UNIVERSAL_BINARY
$(warning Compiling a release build, that is not a universal binary)
endif
endif
ifdef TRIPLE_BINARY
ifdef DEBUG
$(error no G5 optimisation is made in debug builds, so tripple binaries aren't possible. Use UNIVERSAL_BINARY instead if you really want a universal debug build)
endif
UNIVERSAL_BINARY:=1
endif
ifdef UNIVERSAL_BINARY
ifndef STATIC
$(warning Compiling a universal binary, that is not static. Adding static flag)
STATIC:=1
endif
endif
ifdef RELEASE
ifdef DEBUG
$(warning Compiling a release build, that is a debug build)
endif
endif
# setup flags if none are defined
ifndef CFLAGS_JAGUAR
CFLAGS_JAGUAR:= -isysroot /Developer/SDKs/MacOSX10.2.8.sdk
endif
ifndef LDFLAGS_JAGUAR
LDFLAGS_JAGUAR:= -Wl,-syslibroot,/Developer/SDKs/MacOSX10.2.8.sdk
endif
ifndef CFLAGS_UNIVERSAL
CFLAGS_UNIVERSAL:= -isysroot /Developer/SDKs/MacOSX10.4u.sdk
endif
ifndef LDFLAGS_UNIVERSAL
LDFLAGS_UNIVERSAL:= -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk
endif
ifdef JAGUAR
CFLAGS:= $(CFLAGS_JAGUAR) -arch ppc
LDFLAGS:= $(LDFLAGS_JAGUAR)
endif
ifndef G5_FLAGS
G5_FLAGS := -mtune=970 -mcpu=970 -mpowerpc-gpopt
endif
ifdef UNIVERSAL_BINARY
TARGET_CPU_FLAGS:= -arch ppc -arch i386
LDFLAGS := $(LDFLAGS_UNIVERSAL) -arch ppc -arch i386
CFLAGS += $(CFLAGS_UNIVERSAL)
ifdef TRIPLE_BINARY
LDFLAGS += -arch ppc970
endif
endif
# setting up flags to make a binary, that fits the system it builds on
ifndef UNIVERSAL_BINARY
ifndef JAGUAR
ifeq ($(shell uname), Darwin)
# it's a hardware mac, not crosscompiling
# the next line fails if it got whitespace in front of it
$(shell $(CC) os/macosx/G5_detector.c -o os/macosx/G5_detector)
IS_G5:=$(shell os/macosx/G5_detector)
ifeq ($(shell uname -r), 6.8)
# OSX 10.2.8 uses Darwin 6.8, so we better set JAGUAR so we avoid the stuff that was added in 10.3 or later
JAGUAR:=1
endif
endif
endif
endif
# the OSX port need Apple's modified iconv to use the charset UTF-8-MAC. This was added by default in 10.3, but is not present in earlier versions
ifdef JAGUAR
WITH_ICONV:=
else
WITH_ICONV:=1
endif