From 3929d60744cb97bf516c2645be4cda0625572f33 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Mon, 26 Mar 2012 05:04:21 +0000 Subject: [PATCH] OS X: Fix more warnings. git-svn-id: https://svn.eduke32.com/eduke32@2537 1a8010ca-5511-0410-912e-c29ae57300e0 --- .../eduke32/Apple/StartupWinController.game.m | 4 ++-- polymer/eduke32/Makefile | 18 ++++++++++++++++-- polymer/eduke32/build/Makefile | 15 ++++++++++++--- polymer/eduke32/build/Makefile.shared | 3 +++ .../build/src/StartupWinController.editor.m | 4 ++-- polymer/eduke32/build/src/kplib.c | 2 +- polymer/eduke32/osxbuild.sh | 4 +++- 7 files changed, 39 insertions(+), 11 deletions(-) diff --git a/polymer/eduke32/Apple/StartupWinController.game.m b/polymer/eduke32/Apple/StartupWinController.game.m index fd58d6390..bed7be605 100644 --- a/polymer/eduke32/Apple/StartupWinController.game.m +++ b/polymer/eduke32/Apple/StartupWinController.game.m @@ -235,7 +235,7 @@ static struct soundQuality_t { // enable all the controls on the Configuration page NSEnumerator *enumerator = [[[[tabView tabViewItemAtIndex:0] view] subviews] objectEnumerator]; NSControl *control; - while (control = [enumerator nextObject]) [control setEnabled:true]; + while ((control = [enumerator nextObject])) [control setEnabled:true]; gamelistsrc = [[GameListSource alloc] init]; [[gameList documentView] setDataSource:gamelistsrc]; @@ -266,7 +266,7 @@ static struct soundQuality_t { // user can enable it if they want to while waiting for something else to happen NSEnumerator *enumerator = [[[[tabView tabViewItemAtIndex:0] view] subviews] objectEnumerator]; NSControl *control; - while (control = [enumerator nextObject]) { + while ((control = [enumerator nextObject])) { if (control == alwaysShowButton) continue; [control setEnabled:false]; } diff --git a/polymer/eduke32/Makefile b/polymer/eduke32/Makefile index ad1f0ba8e..25ffe7335 100644 --- a/polymer/eduke32/Makefile +++ b/polymer/eduke32/Makefile @@ -191,10 +191,22 @@ endif ifeq ($(PLATFORM),DARWIN) OURCFLAGS += -fno-pic -I$(abspath Apple) -I$(abspath Apple/include) + + ifneq ($(findstring x86_64,$(ARCH)),x86_64) + ifeq (,$(ARCH)) + ifneq ($(findstring x86_64,$(SYSARCH)),x86_64) + LIBS += -read_only_relocs suppress + endif + else + LIBS += -read_only_relocs suppress + endif + endif + ifeq (1,$(SDL_FRAMEWORK)) OURCFLAGS += -I$(APPLE_FRAMEWORKS)/SDL.framework/Headers \ -I$(APPLE_FRAMEWORKS)/SDL_mixer.framework/Headers - LIBS += -read_only_relocs suppress -LApple/lib -lvorbisfile -lvorbis -logg -lm \ + + LIBS += -LApple/lib -lvorbisfile -lvorbis -logg -lm \ -Wl,-framework,SDL -Wl,-framework,SDL_mixer Apple/lib/libSDLmain.a \ -Wl,-framework,Cocoa -Wl,-framework,Carbon -Wl,-framework,OpenGL \ -Wl,-framework,CoreMidi -Wl,-framework,AudioUnit \ @@ -206,16 +218,18 @@ ifeq ($(PLATFORM),DARWIN) GAMEOBJS+=$(OBJ)/SDLMain.$o else OURCFLAGS += -I$(SDLROOT)/include -I$(SDLROOT)/include/SDL - LIBS += -read_only_relocs suppress -lvorbisfile -lvorbis -logg -lm -lSDL_mixer \ + LIBS += -lvorbisfile -lvorbis -logg -lm -lSDL_mixer \ -Wl,-framework,Cocoa -Wl,-framework,Carbon -Wl,-framework,OpenGL \ -Wl,-framework,CoreMidi -Wl,-framework,AudioUnit \ -Wl,-framework,AudioToolbox -Wl,-framework,IOKit -Wl,-framework,AGL \ -Wl,-framework,QuickTime -lm endif + ifneq (0,$(OSX_STARTUPWINDOW)) # EDITOROBJS+=$(OBJ)/GrpFile.game.$o $(OBJ)/GameListSource.game.$o $(OBJ)/StartupWinController.game.$o GAMEOBJS+=$(OBJ)/GrpFile.game.$o $(OBJ)/GameListSource.game.$o $(OBJ)/StartupWinController.game.$o endif + OURASFLAGS += -f macho endif diff --git a/polymer/eduke32/build/Makefile b/polymer/eduke32/build/Makefile index 5facca72d..dcdac4eb4 100644 --- a/polymer/eduke32/build/Makefile +++ b/polymer/eduke32/build/Makefile @@ -141,14 +141,23 @@ ifeq ($(RENDERTYPE),SDL) ENGINEOBJS+= $(OBJ)/sdlayer.$o ifeq ($(PLATFORM),DARWIN) + ifneq ($(findstring x86_64,$(ARCH)),x86_64) + ifeq (,$(ARCH)) + ifneq ($(findstring x86_64,$(SYSARCH)),x86_64) + UTILLIBS += -read_only_relocs suppress + endif + else + UTILLIBS += -read_only_relocs suppress + endif + endif + ifeq (1,$(SDL_FRAMEWORK)) OURCFLAGS += -I$(APPLE_FRAMEWORKS)/SDL.framework/Headers \ -I$(APPLE_FRAMEWORKS)/SDL_mixer.framework/Headers - UTILLIBS += -read_only_relocs suppress \ - -Wl,-framework,SDL -Wl,-framework,SDL_mixer ../Apple/lib/libSDLmain.a + UTILLIBS += -Wl,-framework,SDL -Wl,-framework,SDL_mixer ../Apple/lib/libSDLmain.a else OURCFLAGS += -I$(SDLROOT)/include -I$(SDLROOT)/include/SDL - UTILLIBS += -read_only_relocs suppress -lSDL_mixer + UTILLIBS += -lSDL_mixer endif endif diff --git a/polymer/eduke32/build/Makefile.shared b/polymer/eduke32/build/Makefile.shared index 9f2976830..b6f075fe5 100644 --- a/polymer/eduke32/build/Makefile.shared +++ b/polymer/eduke32/build/Makefile.shared @@ -16,6 +16,9 @@ SDL_FRAMEWORK = 0 # Overridden for OSes that don't have the cutdown stdc++ that is supc++ STDCPPLIB=-lsupc++ +# Detect machine architecture +SYSARCH?=$(strip $(shell uname -m)) + # GCC version, for conditional selection of flags. # This is easier than trying to squeeze it out of gcc --version: GCC_MAJOR ?= 4 diff --git a/polymer/eduke32/build/src/StartupWinController.editor.m b/polymer/eduke32/build/src/StartupWinController.editor.m index 10e0c0422..f30009f09 100644 --- a/polymer/eduke32/build/src/StartupWinController.editor.m +++ b/polymer/eduke32/build/src/StartupWinController.editor.m @@ -57,7 +57,7 @@ static id nsapp; // enable all the controls on the Configuration page NSEnumerator *enumerator = [[[[tabView tabViewItemAtIndex:0] view] subviews] objectEnumerator]; NSControl *control; - while (control = [enumerator nextObject]) + while ((control = [enumerator nextObject])) [control setEnabled:true]; [cancelButton setEnabled:true]; @@ -74,7 +74,7 @@ static id nsapp; // user can enable it if they want to while waiting for something else to happen NSEnumerator *enumerator = [[[[tabView tabViewItemAtIndex:0] view] subviews] objectEnumerator]; NSControl *control; - while (control = [enumerator nextObject]) { + while ((control = [enumerator nextObject])) { if (control == alwaysShowButton) continue; [control setEnabled:false]; } diff --git a/polymer/eduke32/build/src/kplib.c b/polymer/eduke32/build/src/kplib.c index e07ad5d4a..a22da126f 100644 --- a/polymer/eduke32/build/src/kplib.c +++ b/polymer/eduke32/build/src/kplib.c @@ -1413,7 +1413,7 @@ static int32_t kpegrend(const char *kfilebuf, int32_t kfilength, intptr_t daframeplace, int32_t dabytesperline, int32_t daxres, int32_t dayres, int32_t daglobxoffs, int32_t daglobyoffs) { - int32_t i, j, v, leng, xdim = 0, ydim = 0, index, prec, restartcnt, restartinterval; + int32_t i, j, v, leng = 0, xdim = 0, ydim = 0, index, prec, restartcnt, restartinterval; int32_t x, y, z, xx, yy, zz, *dc = NULL, num, curbits, c, daval, dabits, *hqval, *hqbits, hqcnt, *quanptr = NULL; int32_t passcnt = 0, ghsampmax = 0, gvsampmax = 0, glhsampmax = 0, glvsampmax = 0, glhstep, glvstep; int32_t eobrun, Ss, Se, Ah, Al, Alut[2], dctx[12], dcty[12], ldctx[12], /* ldcty[12], */ lshx[4], lshy[4]; diff --git a/polymer/eduke32/osxbuild.sh b/polymer/eduke32/osxbuild.sh index 2dc063e91..28311a619 100755 --- a/polymer/eduke32/osxbuild.sh +++ b/polymer/eduke32/osxbuild.sh @@ -26,6 +26,8 @@ if [ `expr $darwinversion \< 9` == 1 ]; then fi if [ `expr $darwinversion \> 9` == 1 ]; then buildppc=0 + # PPC is disabled by default on Snow Leopard for ease of installation, but it is possible to override. + # PPC is disabled by default on Lion and up because support has been removed from the SDKs. fi @@ -158,7 +160,7 @@ if [ $buildtools -eq 1 ] && [ -d "build" ]; then fi echo buildtools: Creating fat binaries. - utils=`make printutils` `EXESUFFIX_OVERRIDE=.debug make printutils` + utils=`make printutils && EXESUFFIX_OVERRIDE=.debug make printutils` for i in $utils; do binaries= for j in ${i}.{x86,x64,ppc}; do