From d37b1574fe65025cc50ed00530caa4dbb660c97f Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Wed, 17 Sep 2014 11:00:28 +0000 Subject: [PATCH] Makefile.darwin: target 10.5 when building for x86 against SDL2. build_cross_osx-sdl2.sh: new script for me to cross-build on my linux. git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1034 af15c1b1-3010-417e-b628-4374ebc0bcbd --- Quake/Makefile.darwin | 7 ++++++ Quake/build_cross_osx-sdl2.sh | 41 +++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100755 Quake/build_cross_osx-sdl2.sh diff --git a/Quake/Makefile.darwin b/Quake/Makefile.darwin index ac6fc580..067132bd 100644 --- a/Quake/Makefile.darwin +++ b/Quake/Makefile.darwin @@ -60,6 +60,13 @@ ifeq ($(MACH_TYPE),ppc64) CFLAGS +=-mmacosx-version-min=10.5 LDFLAGS +=-mmacosx-version-min=10.5 endif +ifeq ($(USE_SDL2),1) +# sdl2 needs targetting 10.5+ +ifeq ($(MACH_TYPE),x86) +CFLAGS +=-mmacosx-version-min=10.5 +LDFLAGS +=-mmacosx-version-min=10.5 +endif +endif ifeq ($(MACH_TYPE),x86_64) # require 10.6 for amd64 builds, not 10.5 (SDL's requirement.) # bundle1.o is needed for dyld_stub_binding_helper diff --git a/Quake/build_cross_osx-sdl2.sh b/Quake/build_cross_osx-sdl2.sh new file mode 100755 index 00000000..5d791c76 --- /dev/null +++ b/Quake/build_cross_osx-sdl2.sh @@ -0,0 +1,41 @@ +#!/bin/sh + +rm -f quakespasm.x86 quakespasm.x86_64 QuakeSpasm +make clean + +OLDPATH=$PATH +MAKE_CMD=make + +OSXBUILD=1 +export OSXBUILD +STRIP=/bin/true +export STRIP + +# x86 +PATH=/opt/cross_osx-x86.5/usr/bin:$OLDPATH +CC=i686-apple-darwin9-gcc +AS=i686-apple-darwin9-as +AR=i686-apple-darwin9-ar +RANLIB=i686-apple-darwin9-ranlib +LIPO=i686-apple-darwin9-lipo +export PATH CC AS AR RANLIB LIPO +$MAKE_CMD MACH_TYPE=x86 USE_SDL2=1 -f Makefile.darwin $* || exit 1 +i686-apple-darwin9-strip -S quakespasm || exit 1 +mv quakespasm quakespasm.x86 || exit 1 +$MAKE_CMD clean + +# x86_64 +PATH=/opt/cross_osx-x86_64/usr/bin:$OLDPATH +CC=x86_64-apple-darwin9-gcc +AS=x86_64-apple-darwin9-as +AR=x86_64-apple-darwin9-ar +RANLIB=x86_64-apple-darwin9-ranlib +LIPO=x86_64-apple-darwin9-lipo +export PATH CC AS AR RANLIB LIPO +$MAKE_CMD MACH_TYPE=x86_64 USE_SDL2=1 -f Makefile.darwin $* || exit 1 +x86_64-apple-darwin9-strip -S quakespasm || exit 1 +mv quakespasm quakespasm.x86_64 || exit 1 +$MAKE_CMD clean + +$LIPO -create -o QuakeSpasm quakespasm.x86 quakespasm.x86_64 || exit 1 +