diff options
author | tjw <tjw@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2007-12-31 03:47:36 +0000 |
---|---|---|
committer | tjw <tjw@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2007-12-31 03:47:36 +0000 |
commit | 751919dbe323dfa9d7b7f89cf0f23258ee14f0c6 (patch) | |
tree | 312bd4a15ebb1b9956878e0032ad007c8e3c45f7 | |
parent | d007d5fde43e99e1c550e636f4243ad6a82da0ae (diff) | |
download | ioquake3-aero-751919dbe323dfa9d7b7f89cf0f23258ee14f0c6.tar.gz ioquake3-aero-751919dbe323dfa9d7b7f89cf0f23258ee14f0c6.zip |
* Improved Mac OS X build support.
* Dropped support for Mac OS X 10.2 to simplify things. If anyone still
needs this version supported let me know.
git-svn-id: svn://svn.icculus.org/quake3/trunk@1243 edf5b092-35ff-0310-97b2-ce42778d08ea
-rw-r--r-- | Makefile | 17 | ||||
-rw-r--r-- | README | 4 | ||||
-rwxr-xr-x | make-macosx-ub.sh | 81 |
3 files changed, 73 insertions, 29 deletions
@@ -284,10 +284,6 @@ ifeq ($(PLATFORM),darwin) LDFLAGS= OPTIMIZE= - ifndef MACOSX_SDK_DIR - MACOSX_SDK_DIR="/Developer/SDKs/MacOSX10.5.sdk" - endif - # building the QVMs on MacOSX is broken, atm. BUILD_GAME_QVM=0 @@ -296,33 +292,28 @@ ifeq ($(PLATFORM),darwin) BASE_CFLAGS += -arch ppc -DSMP \ -DMAC_OS_X_VERSION_MIN_REQUIRED=1020 -nostdinc \ -F"$(MACOSX_SDK_DIR)"/System/Library/Frameworks \ - -I"$(MACOSX_SDK_DIR)"/usr/lib/gcc/i686-apple-darwin9/4.0.1/include \ + -I"$(MACOSX_SDK_DIR)"/"$(MACOSX_SDK_INC)" \ -isystem "$(MACOSX_SDK_DIR)"/usr/include LDFLAGS += -arch ppc \ - -L"$(MACOSX_SDK_DIR)"/usr/lib/gcc/darwin/4.0 \ + -L"$(MACOSX_SDK_DIR)"/"$(MACOSX_SDK_LIB)" \ -F"$(MACOSX_SDK_DIR)"/System/Library/Frameworks \ -Wl,-syslibroot,"$(MACOSX_SDK_DIR)" ARCH=ppc - # OS X 10.2 sdk lacks dlopen() so ded would need libSDL anyway -# BUILD_SERVER=0 - else - ifeq ($(BUILD_MACOSX_UB),i386) CC=gcc-4.0 BASE_CFLAGS += -arch i386 -DSMP \ -mmacosx-version-min=10.4 \ -DMAC_OS_X_VERSION_MIN_REQUIRED=1040 -nostdinc \ -F"$(MACOSX_SDK_DIR)"/System/Library/Frameworks \ - -I"$(MACOSX_SDK_DIR)"/usr/lib/gcc/i686-apple-darwin9/4.0.1/include \ + -I"$(MACOSX_SDK_DIR)"/"$(MACOSX_SDK_INC)" \ -isystem "$(MACOSX_SDK_DIR)"/usr/include LDFLAGS = -arch i386 -mmacosx-version-min=10.4 \ - -L"$(MACOSX_SDK_DIR)"/usr/lib/gcc/i686-apple-darwin9/4.0.1 \ + -L"$(MACOSX_SDK_DIR)"/"$(MACOSX_SDK_LIB)" \ -F"$(MACOSX_SDK_DIR)"/System/Library/Frameworks \ -Wl,-syslibroot,"$(MACOSX_SDK_DIR)" ARCH=i386 -# BUILD_SERVER=0 else # for whatever reason using the headers in the MacOSX SDKs tend to throw # errors even though they are identical to the system ones which don't @@ -48,7 +48,9 @@ For Windows, using MinGW 2. Open an MSys terminal, and follow the instructions for compiling on *nix. For Mac OS X, building a Universal Binary - 1. Install the MacOSX10.5.sdk + 1. Install MacOSX SDK packages from XCode. For maximum compatibility, + be sure to install MacOSX10.3.9.sdk and MacOSX10.4u.sdk. + (MacOSX10.2.8.sdk no longer supported) 2. Change to the directory containing this README file. 3. Run './make-macosx-ub.sh' 4. Copy the resulting ioquake3.app in /build/release-darwin-ub to your diff --git a/make-macosx-ub.sh b/make-macosx-ub.sh index 6758e1e..44485cd 100755 --- a/make-macosx-ub.sh +++ b/make-macosx-ub.sh @@ -6,7 +6,6 @@ PKGINFO=APPLIOQ3 ICNS=misc/quake3.icns DESTDIR=build/release-darwin-ub BASEDIR=baseq3 -SDKDIR="" MPACKDIR=missionpack Q3_VERSION=`grep "\#define Q3_VERSION" code/qcommon/q_shared.h | \ sed -e 's/.*".* \([^ ]*\)"/\1/'`; @@ -39,26 +38,78 @@ if [ ! -f Makefile ]; then echo "This script must be run from the ioquake3 build directory"; fi -# this is kind of a hack to find out the latest SDK to use. I assume that newer SDKs appear later in this for loop, -# thus the last valid one is the one we want. - -for availsdks in /Developer/SDKs/* +# we want to use the oldest available SDK for max compatiblity +unset PPC_SDK_DIR +unset X86_SDK_DIR +unset PPC_SDK_INC +unset X86_SDK_INC +unset PPC_SDK_LIB +unset X86_SDK_LIB +unset PPC_SDK_OPENAL_DLOPEN +for availsdks in $(find /Developer/SDKs -type d -maxdepth 1 -mindepth 1 -name "MacOSX*" -exec basename {} \; | sort -r) do - if [ -d $availsdks ] - then - SDKDIR="$availsdks" - fi + case "$availsdks" in + 'MacOSX10.5u.sdk') + PPC_SDK_DIR=/Developer/SDKs/MacOSX10.5u.sdk + X86_SDK_DIR=/Developer/SDKs/MacOSX10.5u.sdk + PPC_SDK_INC=usr/lib/gcc/powerpc-apple-darwin9/4.0.1/include + X86_SDK_INC=usr/lib/gcc/i686-apple-darwin9/4.0.1/include + PPC_SDK_LIB=usr/lib/gcc/powerpc-apple-darwin9/4.0.1 + X86_SDK_LIB=usr/lib/gcc/i686-apple-darwin9/4.0.1 + PPC_SDK_OPENAL_DLOPEN=0 + ;; + 'MacOSX10.4u.sdk') + PPC_SDK_DIR=/Developer/SDKs/MacOSX10.4u.sdk + X86_SDK_DIR=/Developer/SDKs/MacOSX10.4u.sdk + PPC_SDK_INC=usr/lib/gcc/powerpc-apple-darwin8/4.0.1/include + X86_SDK_INC=usr/lib/gcc/i686-apple-darwin8/4.0.1/include + PPC_SDK_LIB=usr/lib/gcc/powerpc-apple-darwin8/4.0.1 + X86_SDK_LIB=usr/lib/gcc/i686-apple-darwin8/4.0.1 + PPC_SDK_OPENAL_DLOPEN=0 + ;; + 'MacOSX10.3.9.sdk') + PPC_SDK_DIR=/Developer/SDKs/MacOSX10.3.9.sdk + PPC_SDK_INC=usr/lib/gcc/powerpc-apple-darwin7/4.0.1/include + PPC_SDK_LIB=usr/lib/gcc/powerpc-apple-darwin7/4.0.1 + PPC_SDK_OPENAL_DLOPEN=1 + ;; + 'MacOSX10.2.8.sdk') + # no longer supported due to lack of dlfcn.h + #PPC_SDK_DIR=/Developer/SDKs/MacOSX10.2.8.sdk + #PPC_SDK_INC=usr/include/gcc/darwin/3.3 + #PPC_SDK_LIB=usr/lib/gcc/darwin/3.3 + #PPC_SDK_OPENAL_DLOPEN=1 + ;; + *) + echo "WARNING: detected unknown MacOSX SDK ($availsdks)" + esac done -if [ -z $SDKDIR ] -then - echo "MacOSX SDK is missing. Please install a recent version of the MacOSX SDK." +if [ -z $PPC_SDK_DIR ] || [ -z $X86_SDK_DIR ]; then + echo "Error detecting compatible Mac OS X SDK." exit 1; -else - echo "Using $SDKDIR for compilation" fi -(BUILD_MACOSX_UB=ppc make && BUILD_MACOSX_UB=i386 make) || exit 1; +if [ $PPC_SDK_DIR != "/Developer/SDKs/MacOSX10.3.9.sdk" ]; then + echo "WARNING: missing MacOS10.3.9.sdk. Resulting binary may not be compatible with Mac OS X 10.3" + sleep 1 +fi +if [ $X86_SDK_DIR != "/Developer/SDKs/MacOSX10.4u.sdk" ]; then + echo "WARNING: missing MacOS10.4u.sdk. Resulting binary may not be compatible with Mac OS X 10.4" + sleep 1 +fi + +echo "Using $PPC_SDK_DIR for PowerPC" +echo "Using $X86_SDK_DIR for Intel" + +(USE_OPENAL_DLOPEN=$PPC_SDK_OPENAL_DLOPEN \ + MACOSX_SDK_DIR=$PPC_SDK_DIR \ + MACOSX_SDK_INC=$PPC_SDK_INC \ + MACOSX_SDK_LIB=$PPC_SDK_LIB BUILD_MACOSX_UB=ppc make \ +&& + MACOSX_SDK_DIR=$X86_SDK_DIR \ + MACOSX_SDK_INC=$X86_SDK_INC \ + MACOSX_SDK_LIB=$X86_SDK_LIB BUILD_MACOSX_UB=i386 make ) || exit 1 echo "Creating .app bundle $DESTDIR/$APPBUNDLE" if [ ! -d $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR ]; then |