diff options
author | Richard Allen <ra@ra.is> | 2012-12-31 01:32:15 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-12 21:32:37 +0000 |
commit | dc4dfc501ca90ae777ec27ca1e3df7931fd4eeca (patch) | |
tree | 46504d7434d46e8f83dbd647c02d3b143b7bb823 | |
parent | 76de8f54bd19b323229d02f27f38e49e92638c7e (diff) |
More fixes to the macosx buildsystem. This removes the SDL Framework and makes use of a SDL library that is position independant. This also brings back PPC builds into the UB and also as a standa alone build choice.
-rw-r--r-- | Makefile | 6 | ||||
-rwxr-xr-x | make-macosx-ub.sh | 48 | ||||
-rwxr-xr-x | make-macosx.sh | 62 | ||||
-rw-r--r-- | src/libs/macosx/SDL-1.2.15.framework.zip | bin | 1309261 -> 0 bytes | |||
-rwxr-xr-x | src/libs/macosx/libSDL-1.2.0.dylib | bin | 1844452 -> 1844612 bytes | |||
-rw-r--r-- | src/libs/macosx/libSDLmain.a | bin | 123204 -> 123212 bytes |
6 files changed, 66 insertions, 50 deletions
@@ -389,7 +389,7 @@ else # ifeq Linux ifeq ($(PLATFORM),darwin) HAVE_VM_COMPILED=true - LIBS = -framework Cocoa -framework SDL + LIBS = -framework Cocoa CLIENT_LIBS= RENDERER_LIBS= OPTIMIZEVM= @@ -446,8 +446,8 @@ ifeq ($(PLATFORM),darwin) LIBSDLMAIN=$(B)/libSDLmain.a LIBSDLMAINSRC=$(LIBSDIR)/macosx/libSDLmain.a CLIENT_LIBS += -framework IOKit \ - -framework SDL - RENDERER_LIBS += -framework OpenGL -framework SDL + $(LIBSDIR)/macosx/libSDL-1.2.0.dylib + RENDERER_LIBS += -framework OpenGL $(LIBSDIR)/macosx/libSDL-1.2.0.dylib OPTIMIZEVM += -falign-loops=16 OPTIMIZE = $(OPTIMIZEVM) -ffast-math diff --git a/make-macosx-ub.sh b/make-macosx-ub.sh index 9f650717..515bb03e 100755 --- a/make-macosx-ub.sh +++ b/make-macosx-ub.sh @@ -11,28 +11,37 @@ BASEDIR=base BIN_OBJ=" build/release-darwin-x86_64/tremulous.x86_64 build/release-darwin-x86/tremulous.x86 + build/release-darwin-ppc/tremulous.ppc " BIN_DEDOBJ=" build/release-darwin-x86_64/tremded.x86_64 build/release-darwin-x86/tremded.x86 + build/release-darwin-ppc/tremded.ppc " BASE_OBJ=" build/release-darwin-x86_64/$BASEDIR/cgamex86_64.dylib build/release-darwin-x86/$BASEDIR/cgamex86.dylib + build/release-darwin-ppc/$BASEDIR/cgameppc.dylib build/release-darwin-x86_64/$BASEDIR/uix86_64.dylib build/release-darwin-x86/$BASEDIR/uix86.dylib + build/release-darwin-ppc/$BASEDIR/uippc.dylib build/release-darwin-x86_64/$BASEDIR/gamex86_64.dylib build/release-darwin-x86/$BASEDIR/gamex86.dylib + build/release-darwin-ppc/$BASEDIR/gameppc.dylib " RENDER_OBJ=" build/release-darwin-x86_64/renderer_opengl1_smp_x86_64.dylib build/release-darwin-x86/renderer_opengl1_smp_x86.dylib + build/release-darwin-ppc/renderer_opengl1_smp_ppc.dylib build/release-darwin-x86_64/renderer_opengl1_x86_64.dylib build/release-darwin-x86/renderer_opengl1_x86.dylib + build/release-darwin-ppc/renderer_opengl1_ppc.dylib build/release-darwin-x86_64/renderer_rend2_smp_x86_64.dylib build/release-darwin-x86/renderer_rend2_smp_x86.dylib + build/release-darwin-ppc/renderer_rend2_smp_ppc.dylib build/release-darwin-x86_64/renderer_rend2_x86_64.dylib build/release-darwin-x86/renderer_rend2_x86.dylib + build/release-darwin-ppc/renderer_rend2_ppc.dylib " cd `dirname $0` @@ -51,6 +60,7 @@ TIGERHOST=`uname -r |perl -w -p -e 's/\A(\d+)\..*\Z/$1/; $_ = (($_ >= 8) ? "1" : # can not build 64bit binaries, making 10.5 the minimum version. This has been tested # with xcode 3.1 (xcode31_2199_developerdvd.dmg). It contains the 10.5 SDK and a decent # enough gcc to actually compile ioquake3 +# For PPC macs, G4's or better are required to run ioquake3. unset X86_64_SDK unset X86_64_CFLAGS @@ -58,6 +68,9 @@ unset X86_64_LDFLAGS unset X86_SDK unset X86_CFLAGS unset X86_LDFLAGS +unset PPC_64_SDK +unset PPC_CFLAGS +unset PPC_LDFLAGS if [ -d /Developer/SDKs/MacOSX10.5.sdk ]; then X86_64_SDK=/Developer/SDKs/MacOSX10.5.sdk @@ -69,9 +82,14 @@ if [ -d /Developer/SDKs/MacOSX10.5.sdk ]; then X86_CFLAGS="-arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk \ -DMAC_OS_X_VERSION_MIN_REQUIRED=1050" X86_LDFLAGS=" -mmacosx-version-min=10.5" + + PPC_SDK=/Developer/SDKs/MacOSX10.5.sdk + PPC_CFLAGS="-arch ppc -isysroot /Developer/SDKs/MacOSX10.5.sdk \ + -DMAC_OS_X_VERSION_MIN_REQUIRED=1050" + PPC_LDFLAGS=" -mmacosx-version-min=10.5" fi -if [ -z $X86_64_SDK ] || [ -z $X86_SDK ]; then +if [ -z $X86_64_SDK ] || [ -z $X86_SDK ] || [ -z $PPC_SDK ]; then echo "\ ERROR: This script is for building a Universal Binary. You cannot build for a different architecture unless you have the proper Mac OS X SDKs @@ -82,6 +100,7 @@ fi echo "Building X86_64 Client/Dedicated Server against \"$X86_64_SDK\"" echo "Building X86 Client/Dedicated Server against \"$X86_SDK\"" +echo "Building PPC Client/Dedicated Server against \"$PPC_SDK\"" echo if [ "$X86_64_SDK" != "/Developer/SDKs/MacOSX10.5.sdk" ] || \ @@ -114,6 +133,16 @@ if [ -d build/release-darwin-x86 ]; then fi (ARCH=x86 CC=gcc-4.0 CFLAGS=$X86_CFLAGS LDFLAGS=$X86_LDFLAGS make -j$NCPU) || exit 1; +echo;echo + +# PPC client and server +if [ -d build/release-darwin-ppc ]; then + rm -r build/release-darwin-ppc +fi +(ARCH=ppc CC=gcc-4.0 CFLAGS=$PPC_CFLAGS LDFLAGS=$PPC_LDFLAGS make -j$NCPU) || exit 1; + +echo;echo + echo "Creating .app bundle $DESTDIR/$APPBUNDLE" if [ ! -d $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR ]; then mkdir -p $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR || exit 1; @@ -163,25 +192,10 @@ echo " </plist> " > $DESTDIR/$APPBUNDLE/Contents/Info.plist -# Change the path of the SDL Framework in both arches for the executables and renderer dylib's -# This removes the need for players to have the SDL.Framework installed on their machines. -for i in $BIN_OBJ $BIN_DEDOBJ $RENDER_OBJ -do - install_name_tool -change "@rpath/SDL.framework/Versions/A/SDL" "@executable_path/../Frameworks/SDL.framework/Versions/A/SDL" $i -done - -# Make UB's from previous builds of 1386 and x86_64 binaries +# Make UB's from previous builds of i386, x86_64 and ppc binaries lipo -create -o $DESTDIR/$APPBUNDLE/Contents/MacOS/$BINARY $BIN_OBJ lipo -create -o $DESTDIR/$APPBUNDLE/Contents/MacOS/$DEDBIN $BIN_DEDOBJ -# Embed the SDL framework into the .app so players done need to install it on their systems. -mkdir $DESTDIR/$APPBUNDLE/Contents/Frameworks -unzip -d $DESTDIR/$APPBUNDLE/Contents/Frameworks code/libs/macosx/SDL-1.2.15.framework.zip - -# Change the path in the UB, just in case -install_name_tool -change "@rpath/SDL.framework/Versions/A/SDL" "@executable_path/../Frameworks/SDL.framework/Versions/A/SDL" $DESTDIR/$APPBUNDLE/Contents/MacOS/$BINARY -install_name_tool -change "@rpath/SDL.framework/Versions/A/SDL" "@executable_path/../Frameworks/SDL.framework/Versions/A/SDL" $DESTDIR/$APPBUNDLE/Contents/MacOS/$DEDBIN - cp $RENDER_OBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/ cp $BASE_OBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR/ cp src/libs/macosx/*.dylib $DESTDIR/$APPBUNDLE/Contents/MacOS/ diff --git a/make-macosx.sh b/make-macosx.sh index 2a09ea1f..ebc56c90 100755 --- a/make-macosx.sh +++ b/make-macosx.sh @@ -1,35 +1,39 @@ #!/bin/sh +# +# BUILDARCH can be set to either i386, x86_64 or ppc +BUILDARCH=x86_64 + CC=gcc-4.0 APPBUNDLE=ioquake3.app -BINARY=ioquake3.x86_64 -DEDBIN=ioq3ded.x86_64 +BINARY=ioquake3.${BUILDARCH} +DEDBIN=ioq3ded.${BUILDARCH} PKGINFO=APPLIOQ3 ICNS=misc/quake3.icns -DESTDIR=build/release-darwin-x86_64 +DESTDIR=build/release-darwin-${BUILDARCH} BASEDIR=baseq3 MPACKDIR=missionpack BIN_OBJ=" - build/release-darwin-x86_64/ioquake3.x86_64 + build/release-darwin-${BUILDARCH}/ioquake3.${BUILDARCH} " BIN_DEDOBJ=" - build/release-darwin-x86_64/ioq3ded.x86_64 + build/release-darwin-${BUILDARCH}/ioq3ded.${BUILDARCH} " BASE_OBJ=" - build/release-darwin-x86_64/$BASEDIR/cgamex86_64.dylib - build/release-darwin-x86_64/$BASEDIR/uix86_64.dylib - build/release-darwin-x86_64/$BASEDIR/qagamex86_64.dylib + build/release-darwin-${BUILDARCH}/$BASEDIR/cgame${BUILDARCH}.dylib + build/release-darwin-${BUILDARCH}/$BASEDIR/ui${BUILDARCH}.dylib + build/release-darwin-${BUILDARCH}/$BASEDIR/qagame${BUILDARCH}.dylib " MPACK_OBJ=" - build/release-darwin-x86_64/$MPACKDIR/cgamex86_64.dylib - build/release-darwin-x86_64/$MPACKDIR/uix86_64.dylib - build/release-darwin-x86_64/$MPACKDIR/qagamex86_64.dylib + build/release-darwin-${BUILDARCH}/$MPACKDIR/cgame${BUILDARCH}.dylib + build/release-darwin-${BUILDARCH}/$MPACKDIR/ui${BUILDARCH}.dylib + build/release-darwin-${BUILDARCH}/$MPACKDIR/qagame${BUILDARCH}.dylib " RENDER_OBJ=" - build/release-darwin-x86_64/renderer_opengl1_smp_x86_64.dylib - build/release-darwin-x86_64/renderer_opengl1_x86_64.dylib - build/release-darwin-x86_64/renderer_rend2_smp_x86_64.dylib - build/release-darwin-x86_64/renderer_rend2_x86_64.dylib + build/release-darwin-${BUILDARCH}/renderer_opengl1_smp_${BUILDARCH}.dylib + build/release-darwin-${BUILDARCH}/renderer_opengl1_${BUILDARCH}.dylib + build/release-darwin-${BUILDARCH}/renderer_rend2_smp_${BUILDARCH}.dylib + build/release-darwin-${BUILDARCH}/renderer_rend2_${BUILDARCH}.dylib " cd `dirname $0` @@ -48,19 +52,21 @@ TIGERHOST=`uname -r |perl -w -p -e 's/\A(\d+)\..*\Z/$1/; $_ = (($_ >= 8) ? "1" : # can not build 64bit binaries, making 10.5 the minimum version. This has been tested # with xcode 3.1 (xcode31_2199_developerdvd.dmg). It contains the 10.5 SDK and a decent # enough gcc to actually compile ioquake3 +# For PPC macs, G4's or better are required to run ioquake3. + +unset ARCH_SDK +unset ARCH_CFLAGS +unset ARCH_LDFLAGS -unset X86_SDK -unset X86_CFLAGS -unset X86_LDFLAGS if [ -d /Developer/SDKs/MacOSX10.5.sdk ]; then - X86_SDK=/Developer/SDKs/MacOSX10.5.sdk - X86_CFLAGS="-arch x86_64 -isysroot /Developer/SDKs/MacOSX10.5.sdk \ + ARCH_SDK=/Developer/SDKs/MacOSX10.5.sdk + ARCH_CFLAGS="-arch ${BUILDARCH} -isysroot /Developer/SDKs/MacOSX10.5.sdk \ -DMAC_OS_X_VERSION_MIN_REQUIRED=1050" - X86_LDFLAGS=" -mmacosx-version-min=10.5" + ARCH_LDFLAGS=" -mmacosx-version-min=10.5" fi -echo "Building X86 Client/Dedicated Server against \"$X86_SDK\"" +echo "Building ${BUILDARCH} Client/Dedicated Server against \"$ARCH_SDK\"" sleep 3 if [ ! -d $DESTDIR ]; then @@ -72,10 +78,10 @@ NCPU=`sysctl -n hw.ncpu` # intel client and server -if [ -d build/release-darwin-x86_64 ]; then - rm -r build/release-darwin-x86_64 +if [ -d build/release-darwin-${BUILDARCH} ]; then + rm -r build/release-darwin-${BUILDARCH} fi -(ARCH=x86_64 CFLAGS=$X86_CFLAGS LDFLAGS=$X86_LDFLAGS make -j$NCPU) || exit 1; +(ARCH=${BUILDARCH} CFLAGS=$ARCH_CFLAGS LDFLAGS=$ARCH_LDFLAGS make -j$NCPU) || exit 1; echo "Creating .app bundle $DESTDIR/$APPBUNDLE" if [ ! -d $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR ]; then @@ -126,11 +132,6 @@ echo " </plist> " > $DESTDIR/$APPBUNDLE/Contents/Info.plist -for i in $BIN_OBJ $BIN_DEDOBJ $RENDER_OBJ -do - install_name_tool -change "@rpath/SDL.framework/Versions/A/SDL" "@executable_path/../Frameworks/SDL.framework/Versions/A/SDL" $i -done - cp $BIN_OBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/$BINARY cp $BIN_DEDOBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/$DEDBIN @@ -138,4 +139,5 @@ cp $RENDER_OBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/ cp $BASE_OBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR/ cp $MPACK_OBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/$MPACKDIR/ cp code/libs/macosx/*.dylib $DESTDIR/$APPBUNDLE/Contents/MacOS/ +cp code/libs/macosx/*.dylib $DESTDIR diff --git a/src/libs/macosx/SDL-1.2.15.framework.zip b/src/libs/macosx/SDL-1.2.15.framework.zip Binary files differdeleted file mode 100644 index ec32e38f..00000000 --- a/src/libs/macosx/SDL-1.2.15.framework.zip +++ /dev/null diff --git a/src/libs/macosx/libSDL-1.2.0.dylib b/src/libs/macosx/libSDL-1.2.0.dylib Binary files differindex e3ea15fa..686a5405 100755 --- a/src/libs/macosx/libSDL-1.2.0.dylib +++ b/src/libs/macosx/libSDL-1.2.0.dylib diff --git a/src/libs/macosx/libSDLmain.a b/src/libs/macosx/libSDLmain.a Binary files differindex 3bd7a293..d39e7a35 100644 --- a/src/libs/macosx/libSDLmain.a +++ b/src/libs/macosx/libSDLmain.a |