diff options
-rw-r--r-- | Makefile | 49 | ||||
-rwxr-xr-x | make-macosx-ub.sh | 32 | ||||
-rw-r--r-- | src/game/bg_local.h | 2 | ||||
-rw-r--r-- | src/game/bg_pmove.c | 2 | ||||
-rw-r--r-- | src/qcommon/net_ip.c | 2 | ||||
-rw-r--r-- | src/sdl/sdl_input.c | 2 |
6 files changed, 50 insertions, 39 deletions
@@ -279,45 +279,45 @@ ifeq ($(PLATFORM),darwin) CLIENT_LDFLAGS= 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 + ifeq ($(BUILD_MACOSX_UB),ppc) - CC=gcc-3.3 + CC=gcc-4.0 BASE_CFLAGS += -arch ppc -DSMP \ -DMAC_OS_X_VERSION_MIN_REQUIRED=1020 -nostdinc \ - -F/Developer/SDKs/MacOSX10.2.8.sdk/System/Library/Frameworks \ - -I/Developer/SDKs/MacOSX10.2.8.sdk/usr/include/gcc/darwin/3.3 \ - -isystem /Developer/SDKs/MacOSX10.2.8.sdk/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. + -F"$(MACOSX_SDK_DIR)"/System/Library/Frameworks \ + -I"$(MACOSX_SDK_DIR)"/usr/lib/gcc/i686-apple-darwin9/4.0.1/include \ + -isystem "$(MACOSX_SDK_DIR)"/usr/include LDFLAGS += -arch ppc \ - -L/Developer/SDKs/MacOSX10.2.8.sdk/usr/lib/gcc/darwin/3.3 \ - -F/Developer/SDKs/MacOSX10.2.8.sdk/System/Library/Frameworks \ - -Wl,-syslibroot,/Developer/SDKs/MacOSX10.2.8.sdk,-m + -L"$(MACOSX_SDK_DIR)"/usr/lib/gcc/darwin/4.0 \ + -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 +# 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 ifeq ($(BUILD_MACOSX_UB),x86) CC=gcc-4.0 BASE_CFLAGS += -arch i386 -DSMP \ -mmacosx-version-min=10.4 \ -DMAC_OS_X_VERSION_MIN_REQUIRED=1040 -nostdinc \ - -F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks \ - -I/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin8/4.0.1/include \ - -isystem /Developer/SDKs/MacOSX10.4u.sdk/usr/include + -F"$(MACOSX_SDK_DIR)"/System/Library/Frameworks \ + -I"$(MACOSX_SDK_DIR)"/usr/lib/gcc/i686-apple-darwin9/4.0.1/include \ + -isystem "$(MACOSX_SDK_DIR)"/usr/include LDFLAGS = -arch i386 -mmacosx-version-min=10.4 \ - -L/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin8/4.0.1 \ - -F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks \ - -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk + -L"$(MACOSX_SDK_DIR)"/usr/lib/gcc/i686-apple-darwin9/4.0.1 \ + -F"$(MACOSX_SDK_DIR)"/System/Library/Frameworks \ + -Wl,-syslibroot,"$(MACOSX_SDK_DIR)" ARCH=x86 - BUILD_SERVER=0 +# 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 @@ -339,9 +339,6 @@ ifeq ($(PLATFORM),darwin) 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) BASE_CFLAGS += -DUSE_OPENAL ifneq ($(USE_OPENAL_DLOPEN),1) diff --git a/make-macosx-ub.sh b/make-macosx-ub.sh index 424d5a7e..9584e299 100755 --- a/make-macosx-ub.sh +++ b/make-macosx-ub.sh @@ -1,10 +1,12 @@ #!/bin/sh APPBUNDLE=Tremulous.app BINARY=Tremulous.ub +DEDBIN=tremded.ub PKGINFO=APPLTREM ICNS=misc/Tremulous.icns DESTDIR=build/release-darwin-ub BASEDIR=base +SDKDIR="" Q3_VERSION=`grep "\#define Q3_VERSION" src/qcommon/q_shared.h | \ sed -e 's/.*".* \([^ ]*\)"/\1/'`; @@ -12,6 +14,10 @@ BIN_OBJ=" build/release-darwin-ppc/tremulous.ppc build/release-darwin-x86/tremulous.x86 " +BIN_DEDOBJ=" + build/release-darwin-ppc/ioq3ded.ppc + build/release-darwin-i386/ioq3ded.i386 +" BASE_OBJ=" build/release-darwin-ppc/$BASEDIR/cgameppc.dylib build/release-darwin-x86/$BASEDIR/cgamex86.dylib @@ -24,18 +30,23 @@ if [ ! -f Makefile ]; then echo "This script must be run from the Tremulous build directory"; fi -if [ ! -d /Developer/SDKs/MacOSX10.2.8.sdk ]; then - echo " -/Developer/SDKs/MacOSX10.2.8.sdk/ is missing, this doesn't install by default -with newer XCode releases, but the installers is included" - exit 1; -fi +# this is kind of a hack to find out the latest SDK to use. I assume that newer SDKs apear later in this for loop, +# thus the last valid one is the one we want. + +for availsdks in /Developer/SDKs/* +do + if [ -d $availsdks ] + then + SDKDIR="$availsdks" + fi +done -if [ ! -d /Developer/SDKs/MacOSX10.4u.sdk ]; then - echo " -/Developer/SDKs/MacOSX10.4u.sdk/ is missing. You must install XCode 2.2 or -newer in order to build Universal Binaries" +if [ -z $SDKDIR ] +then + echo "MacOSX SDK is missing. Please install a recent version of the MacOSX SDK." exit 1; +else + echo "Using $SDKDIR for compilation" fi (BUILD_MACOSX_UB=ppc make && BUILD_MACOSX_UB=x86 make) || exit 1; @@ -90,6 +101,7 @@ echo " " > $DESTDIR/$APPBUNDLE/Contents/Info.plist 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 src/libs/macosx/*.dylib $DESTDIR/$APPBUNDLE/Contents/MacOS/ diff --git a/src/game/bg_local.h b/src/game/bg_local.h index 354214c9..4c582266 100644 --- a/src/game/bg_local.h +++ b/src/game/bg_local.h @@ -86,3 +86,5 @@ qboolean PM_SlideMove( qboolean gravity ); void PM_StepEvent( vec3_t from, vec3_t to, vec3_t normal ); qboolean PM_StepSlideMove( qboolean gravity, qboolean predictive ); qboolean PM_PredictStepMove( void ); + +void PM_StartTorsoAnim( int anim ); diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c index 76ad71f3..78d22689 100644 --- a/src/game/bg_pmove.c +++ b/src/game/bg_pmove.c @@ -92,7 +92,7 @@ void PM_AddTouchEnt( int entityNum ) PM_StartTorsoAnim =================== */ -static void PM_StartTorsoAnim( int anim ) +void PM_StartTorsoAnim( int anim ) { if( pm->ps->pm_type >= PM_DEAD ) return; diff --git a/src/qcommon/net_ip.c b/src/qcommon/net_ip.c index abff7313..f44ff657 100644 --- a/src/qcommon/net_ip.c +++ b/src/qcommon/net_ip.c @@ -756,7 +756,7 @@ void NET_GetLocalAddress( void ) { if (sdl->sdl_type != IFT_LOOP) { // Get the local interface address strncpy(ifr.ifr_name, inetInterface->ifr_name, sizeof(ifr.ifr_name)); - if (ioctl(interfaceSocket, OSIOCGIFADDR, (caddr_t)&ifr) < 0) { + if (ioctl(interfaceSocket, SIOCGIFADDR, (caddr_t)&ifr) < 0) { Com_Printf("NET_GetLocalAddress: Unable to get local address " "for interface '%s', errno = %d\n", inetInterface->ifr_name, errno); } else { diff --git a/src/sdl/sdl_input.c b/src/sdl/sdl_input.c index d65c3504..ddff11b4 100644 --- a/src/sdl/sdl_input.c +++ b/src/sdl/sdl_input.c @@ -44,7 +44,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #ifdef MACOS_X_ACCELERATION_HACK #include <IOKit/hidsystem/IOHIDLib.h> #include <IOKit/hidsystem/IOHIDParameter.h> -#include <drivers/event_status_driver.h> +#include <IOKit/hidsystem/event_status_driver.h> #endif //#define KBD_DBG |