mirror of
https://github.com/UberGames/ioef.git
synced 2024-11-24 05:01:40 +00:00
Fix building on MacOSX.
This commit is contained in:
parent
662b67c733
commit
3648af78dc
3 changed files with 47 additions and 37 deletions
50
Makefile
50
Makefile
|
@ -283,45 +283,46 @@ ifeq ($(PLATFORM),darwin)
|
||||||
CLIENT_LDFLAGS=
|
CLIENT_LDFLAGS=
|
||||||
LDFLAGS=
|
LDFLAGS=
|
||||||
OPTIMIZE=
|
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
|
||||||
|
|
||||||
ifeq ($(BUILD_MACOSX_UB),ppc)
|
ifeq ($(BUILD_MACOSX_UB),ppc)
|
||||||
CC=gcc-3.3
|
CC=gcc-4.0
|
||||||
BASE_CFLAGS += -arch ppc -DSMP \
|
BASE_CFLAGS += -arch ppc -DSMP \
|
||||||
-DMAC_OS_X_VERSION_MIN_REQUIRED=1020 -nostdinc \
|
-DMAC_OS_X_VERSION_MIN_REQUIRED=1020 -nostdinc \
|
||||||
-F/Developer/SDKs/MacOSX10.2.8.sdk/System/Library/Frameworks \
|
-F"$(MACOSX_SDK_DIR)"/System/Library/Frameworks \
|
||||||
-I/Developer/SDKs/MacOSX10.2.8.sdk/usr/include/gcc/darwin/3.3 \
|
-I"$(MACOSX_SDK_DIR)"/usr/lib/gcc/i686-apple-darwin9/4.0.1/include \
|
||||||
-isystem /Developer/SDKs/MacOSX10.2.8.sdk/usr/include
|
-isystem "$(MACOSX_SDK_DIR)"/usr/include
|
||||||
# when using the 10.2 SDK we are not allowed the two-level namespace so
|
|
||||||
# in order to get the OpenAL dlopen() stuff to work without major
|
|
||||||
# modifications, the controversial -m linker flag must be used. this
|
|
||||||
# throws a ton of multiply defined errors which cannot be suppressed.
|
|
||||||
LDFLAGS += -arch ppc \
|
LDFLAGS += -arch ppc \
|
||||||
-L/Developer/SDKs/MacOSX10.2.8.sdk/usr/lib/gcc/darwin/3.3 \
|
-L"$(MACOSX_SDK_DIR)"/usr/lib/gcc/darwin/4.0 \
|
||||||
-F/Developer/SDKs/MacOSX10.2.8.sdk/System/Library/Frameworks \
|
-F"$(MACOSX_SDK_DIR)"/System/Library/Frameworks \
|
||||||
-Wl,-syslibroot,/Developer/SDKs/MacOSX10.2.8.sdk,-m
|
-Wl,-syslibroot,"$(MACOSX_SDK_DIR)"
|
||||||
ARCH=ppc
|
ARCH=ppc
|
||||||
|
|
||||||
# OS X 10.2 sdk lacks dlopen() so ded would need libSDL anyway
|
# OS X 10.2 sdk lacks dlopen() so ded would need libSDL anyway
|
||||||
BUILD_SERVER=0
|
# BUILD_SERVER=0
|
||||||
|
|
||||||
# because of a problem with linking on 10.2 this will generate multiply
|
|
||||||
# defined symbol errors. The errors can be turned into warnings with
|
|
||||||
# the -m linker flag, but you can't shut up the warnings
|
|
||||||
USE_OPENAL_DLOPEN=1
|
|
||||||
else
|
else
|
||||||
|
|
||||||
ifeq ($(BUILD_MACOSX_UB),i386)
|
ifeq ($(BUILD_MACOSX_UB),i386)
|
||||||
CC=gcc-4.0
|
CC=gcc-4.0
|
||||||
BASE_CFLAGS += -arch i386 -DSMP \
|
BASE_CFLAGS += -arch i386 -DSMP \
|
||||||
-mmacosx-version-min=10.4 \
|
-mmacosx-version-min=10.4 \
|
||||||
-DMAC_OS_X_VERSION_MIN_REQUIRED=1040 -nostdinc \
|
-DMAC_OS_X_VERSION_MIN_REQUIRED=1040 -nostdinc \
|
||||||
-F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks \
|
-F"$(MACOSX_SDK_DIR)"/System/Library/Frameworks \
|
||||||
-I/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin8/4.0.1/include \
|
-I"$(MACOSX_SDK_DIR)"/usr/lib/gcc/i686-apple-darwin9/4.0.1/include \
|
||||||
-isystem /Developer/SDKs/MacOSX10.4u.sdk/usr/include
|
-isystem "$(MACOSX_SDK_DIR)"/usr/include
|
||||||
LDFLAGS = -arch i386 -mmacosx-version-min=10.4 \
|
LDFLAGS = -arch i386 -mmacosx-version-min=10.4 \
|
||||||
-L/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin8/4.0.1 \
|
-L"$(MACOSX_SDK_DIR)"/usr/lib/gcc/i686-apple-darwin9/4.0.1 \
|
||||||
-F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks \
|
-F"$(MACOSX_SDK_DIR)"/System/Library/Frameworks \
|
||||||
-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk
|
-Wl,-syslibroot,"$(MACOSX_SDK_DIR)"
|
||||||
ARCH=i386
|
ARCH=i386
|
||||||
BUILD_SERVER=0
|
# BUILD_SERVER=0
|
||||||
else
|
else
|
||||||
# for whatever reason using the headers in the MacOSX SDKs tend to throw
|
# 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
|
# errors even though they are identical to the system ones which don't
|
||||||
|
@ -343,9 +344,6 @@ ifeq ($(PLATFORM),darwin)
|
||||||
|
|
||||||
BASE_CFLAGS += -fno-strict-aliasing -DMACOS_X -fno-common -pipe
|
BASE_CFLAGS += -fno-strict-aliasing -DMACOS_X -fno-common -pipe
|
||||||
|
|
||||||
# Always include debug symbols...you can strip the binary later...
|
|
||||||
BASE_CFLAGS += -gfull
|
|
||||||
|
|
||||||
ifeq ($(USE_OPENAL),1)
|
ifeq ($(USE_OPENAL),1)
|
||||||
BASE_CFLAGS += -DUSE_OPENAL
|
BASE_CFLAGS += -DUSE_OPENAL
|
||||||
ifneq ($(USE_OPENAL_DLOPEN),1)
|
ifneq ($(USE_OPENAL_DLOPEN),1)
|
||||||
|
|
|
@ -44,7 +44,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
#ifdef MACOS_X_ACCELERATION_HACK
|
#ifdef MACOS_X_ACCELERATION_HACK
|
||||||
#include <IOKit/hidsystem/IOHIDLib.h>
|
#include <IOKit/hidsystem/IOHIDLib.h>
|
||||||
#include <IOKit/hidsystem/IOHIDParameter.h>
|
#include <IOKit/hidsystem/IOHIDParameter.h>
|
||||||
#include <drivers/event_status_driver.h>
|
#include <IOKit/hidsystem/event_status_driver.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//#define KBD_DBG
|
//#define KBD_DBG
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
APPBUNDLE=ioquake3.app
|
APPBUNDLE=ioquake3.app
|
||||||
BINARY=ioquake3.ub
|
BINARY=ioquake3.ub
|
||||||
|
DEDBIN=ioq3ded.ub
|
||||||
PKGINFO=APPLIOQ3
|
PKGINFO=APPLIOQ3
|
||||||
ICNS=misc/quake3.icns
|
ICNS=misc/quake3.icns
|
||||||
DESTDIR=build/release-darwin-ub
|
DESTDIR=build/release-darwin-ub
|
||||||
BASEDIR=baseq3
|
BASEDIR=baseq3
|
||||||
|
SDKDIR=""
|
||||||
MPACKDIR=missionpack
|
MPACKDIR=missionpack
|
||||||
Q3_VERSION=`grep "\#define Q3_VERSION" code/qcommon/q_shared.h | \
|
Q3_VERSION=`grep "\#define Q3_VERSION" code/qcommon/q_shared.h | \
|
||||||
sed -e 's/.*".* \([^ ]*\)"/\1/'`;
|
sed -e 's/.*".* \([^ ]*\)"/\1/'`;
|
||||||
|
@ -13,6 +15,10 @@ BIN_OBJ="
|
||||||
build/release-darwin-ppc/ioquake3.ppc
|
build/release-darwin-ppc/ioquake3.ppc
|
||||||
build/release-darwin-i386/ioquake3.i386
|
build/release-darwin-i386/ioquake3.i386
|
||||||
"
|
"
|
||||||
|
BIN_DEDOBJ="
|
||||||
|
build/release-darwin-ppc/ioq3ded.ppc
|
||||||
|
build/release-darwin-i386/ioq3ded.i386
|
||||||
|
"
|
||||||
BASE_OBJ="
|
BASE_OBJ="
|
||||||
build/release-darwin-ppc/$BASEDIR/cgameppc.dylib
|
build/release-darwin-ppc/$BASEDIR/cgameppc.dylib
|
||||||
build/release-darwin-i386/$BASEDIR/cgamei386.dylib
|
build/release-darwin-i386/$BASEDIR/cgamei386.dylib
|
||||||
|
@ -33,18 +39,23 @@ if [ ! -f Makefile ]; then
|
||||||
echo "This script must be run from the ioquake3 build directory";
|
echo "This script must be run from the ioquake3 build directory";
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -d /Developer/SDKs/MacOSX10.2.8.sdk ]; then
|
# 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,
|
||||||
echo "
|
# thus the last valid one is the one we want.
|
||||||
/Developer/SDKs/MacOSX10.2.8.sdk/ is missing.
|
|
||||||
The installer for this SDK is included with XCode 2.2 or newer"
|
|
||||||
exit 1;
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -d /Developer/SDKs/MacOSX10.4u.sdk ]; then
|
for availsdks in /Developer/SDKs/*
|
||||||
echo "
|
do
|
||||||
/Developer/SDKs/MacOSX10.4u.sdk/ is missing.
|
if [ -d $availsdks ]
|
||||||
The installer for this SDK is included with XCode 2.2 or newer"
|
then
|
||||||
|
SDKDIR="$availsdks"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ -z $SDKDIR ]
|
||||||
|
then
|
||||||
|
echo "MacOSX SDK is missing. Please install a recent version of the MacOSX SDK."
|
||||||
exit 1;
|
exit 1;
|
||||||
|
else
|
||||||
|
echo "Using $SDKDIR for compilation"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
(BUILD_MACOSX_UB=ppc make && BUILD_MACOSX_UB=i386 make) || exit 1;
|
(BUILD_MACOSX_UB=ppc make && BUILD_MACOSX_UB=i386 make) || exit 1;
|
||||||
|
@ -99,6 +110,7 @@ echo "
|
||||||
" > $DESTDIR/$APPBUNDLE/Contents/Info.plist
|
" > $DESTDIR/$APPBUNDLE/Contents/Info.plist
|
||||||
|
|
||||||
lipo -create -o $DESTDIR/$APPBUNDLE/Contents/MacOS/$BINARY $BIN_OBJ
|
lipo -create -o $DESTDIR/$APPBUNDLE/Contents/MacOS/$BINARY $BIN_OBJ
|
||||||
|
lipo -create -o $DESTDIR/$APPBUNDLE/Contents/MacOS/$DEDBIN $BIN_DEDOBJ
|
||||||
cp $BASE_OBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR/
|
cp $BASE_OBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR/
|
||||||
cp $MPACK_OBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/$MPACKDIR/
|
cp $MPACK_OBJ $DESTDIR/$APPBUNDLE/Contents/MacOS/$MPACKDIR/
|
||||||
cp code/libs/macosx/*.dylib $DESTDIR/$APPBUNDLE/Contents/MacOS/
|
cp code/libs/macosx/*.dylib $DESTDIR/$APPBUNDLE/Contents/MacOS/
|
||||||
|
|
Loading…
Reference in a new issue