diff --git a/GNUmakefile b/GNUmakefile index 5336b7c7..172a6a5b 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,12 +1,12 @@ include $(GNUSTEP_MAKEFILES)/common.make CP = cp BUILD_WITH_DEBUG_FUNCTIONALITY = yes -vpath %.m src/SDL:src/Core:src/Core/Entities:src/Core/Materials:src/Core/Scripting:src/Core/OXPVerifier -vpath %.h src/SDL:src/Core:src/Core/Entities:src/Core/Materials:src/Core/Scripting:src/Core/OXPVerifier -vpath %.c src/SDL:src/Core:src/BSDCompat +vpath %.m src/SDL:src/Core:src/Core/Entities:src/Core/Materials:src/Core/Scripting:src/Core/OXPVerifier:src/Core/Debug +vpath %.h src/SDL:src/Core:src/Core/Entities:src/Core/Materials:src/Core/Scripting:src/Core/OXPVerifier:src/Core/Debug +vpath %.c src/SDL:src/Core:src/BSDCompat:src/Core/Debug GNUSTEP_INSTALLATION_DIR = $(GNUSTEP_USER_ROOT) ifeq ($(GNUSTEP_HOST_OS),mingw32) - ADDITIONAL_INCLUDE_DIRS = -Ideps/Windows-x86-deps/include -Isrc/SDL -Isrc/Core -Isrc/Core/Scripting -Isrc/Core/Materials -Isrc/Core/Entities -Isrc/Core/OXPVerifier -Isrc/Debug + ADDITIONAL_INCLUDE_DIRS = -Ideps/Windows-x86-deps/include -Isrc/SDL -Isrc/Core -Isrc/Core/Scripting -Isrc/Core/Materials -Isrc/Core/Entities -Isrc/Core/OXPVerifier -Isrc/Core/Debug ADDITIONAL_OBJC_LIBS = -lglu32 -lopengl32 -lpng13 -lmingw32 -lSDLmain -lSDL -lSDL_mixer -lgnustep-base -ljs32 ADDITIONAL_CFLAGS = -DLINUX -DWIN32 -DNEED_STRLCPY `sdl-config --cflags` # note the vpath stuff above isn't working for me, so adding src/SDL and src/Core explicitly @@ -17,7 +17,7 @@ ifeq ($(BUILD_WITH_DEBUG_FUNCTIONALITY),no) endif oolite_LIB_DIRS += -L/usr/local/lib -L$(GNUSTEP_LOCAL_ROOT)/lib -Ldeps/Windows-x86-deps/lib else - ADDITIONAL_INCLUDE_DIRS = -I/usr/include/mozjs -Isrc/SDL -Isrc/Core -Isrc/BSDCompat -Isrc/Core/Scripting -Isrc/Core/Materials -Isrc/Core/Entities -Isrc/Core/OXPVerifier -Isrc/Debug + ADDITIONAL_INCLUDE_DIRS = -I/usr/include/mozjs -Isrc/SDL -Isrc/Core -Isrc/BSDCompat -Isrc/Core/Scripting -Isrc/Core/Materials -Isrc/Core/Entities -Isrc/Core/OXPVerifier -Isrc/Core/Debug ADDITIONAL_OBJC_LIBS = -lpng -ljs -lGLU -lGL -lSDL -lpthread -lSDL_mixer -lgnustep-base ADDITIONAL_CFLAGS = -DLINUX -DNEED_STRLCPY `sdl-config --cflags` ADDITIONAL_OBJCFLAGS = -DLOADSAVEGUI -DLINUX -DXP_UNIX -Wno-import `sdl-config --cflags` @@ -25,8 +25,8 @@ else endif OBJC_PROGRAM_NAME = oolite -oolite_C_FILES = legacy_random.c strlcpy.c -oolite_OBJC_FILES = Comparison.m AI.m DustEntity.m Entity.m GameController.m GuiDisplayGen.m HeadUpDisplay.m main.m MyOpenGLView.m OpenGLSprite.m ParticleEntity.m PlanetEntity.m PlayerEntityLegacyScriptEngine.m PlayerEntityContracts.m PlayerEntityControls.m PlayerEntityLoadSave.m PlayerEntitySound.m PlayerEntity.m ResourceManager.m RingEntity.m ShipEntityAI.m ShipEntity.m SkyEntity.m StationEntity.m Universe.m OOSound.m SDLMusic.m NSFileManagerOOExtensions.m JoystickHandler.m PlayerEntityStickMapper.m OOBasicSoundReferencePoint.m OOBasicSoundSource.m OOCharacter.m OOTrumble.m WormholeEntity.m NSScannerOOExtensions.m OOXMLExtensions.m NSMutableDictionaryOOExtensions.m Geometry.m Octree.m CollisionRegion.m OOColor.m OOLogging.m OOCacheManager.m OOCache.m OOStringParsing.m OOCollectionExtractors.m OOVector.m OOMatrix.m OOQuaternion.m OOVoxel.m OOTriangle.m OOPListParsing.m OOFastArithmetic.m OOTextureScaling.m OOConstToString.m OOScript.m OOJSScript.m OOJavaScriptEngine.m OOPListScript.m NSStringOOExtensions.m PlayerEntityScriptMethods.m OOWeakReference.m OOJSEntity.m EntityOOJavaScriptExtensions.m OOJSQuaternion.m OOMaterial.m OOShaderMaterial.m OOShaderProgram.m OOShaderUniform.m OOTexture.m OOTextureLoader.m OOPNGTextureLoader.m OOOpenGLExtensionManager.m OOBasicMaterial.m OOSingleTextureMaterial.m OOCPUInfo.m OOSelfDrawingEntity.m OOEntityWithDrawable.m OODrawable.m OOJSVector.m OOMesh.m OOOpenGL.m OOGraphicsResetManager.m OOProbabilisticTextureManager.m OODebugGLDrawing.m OOShaderUniformMethodType.m OOAsyncQueue.m TextureStore.m OOOXPVerifier.m OOOXPVerifierStage.m OOFileScannerVerifierStage.m OOCheckRequiresPListVerifierStage.m OOCheckDemoShipsPListVerifierStage.m OOCheckEquipmentPListVerifierStage.m OOTextureVerifierStage.m OOModelVerifierStage.m OOCheckShipDataPListVerifierStage.m OOPListSchemaVerifier.m OOJSShip.m OOJSPlayer.m OOJSCall.m OOJSStation.m OOJSSystem.m OOLegacyEventHandlerScript.m OOJSOolite.m OORoleSet.m OOJSGlobal.m OOJSMissionVariables.m OOJSMission.m OOPriorityQueue.m OOScriptTimer.m OOJSTimer.m OOJSClock.m OODebugSupport.m OODebugMonitor.m OOJSConsole.m OODebugTCPConsoleClient.m OOTCPStreamDecoder.c OOTCPStreamDecoderAbstractionLayer.m +oolite_C_FILES = legacy_random.c strlcpy.c OOTCPStreamDecoder.c +oolite_OBJC_FILES = Comparison.m AI.m DustEntity.m Entity.m GameController.m GuiDisplayGen.m HeadUpDisplay.m main.m MyOpenGLView.m OpenGLSprite.m ParticleEntity.m PlanetEntity.m PlayerEntityLegacyScriptEngine.m PlayerEntityContracts.m PlayerEntityControls.m PlayerEntityLoadSave.m PlayerEntitySound.m PlayerEntity.m ResourceManager.m RingEntity.m ShipEntityAI.m ShipEntity.m SkyEntity.m StationEntity.m Universe.m OOSound.m SDLMusic.m NSFileManagerOOExtensions.m JoystickHandler.m PlayerEntityStickMapper.m OOBasicSoundReferencePoint.m OOBasicSoundSource.m OOCharacter.m OOTrumble.m WormholeEntity.m NSScannerOOExtensions.m OOXMLExtensions.m NSMutableDictionaryOOExtensions.m Geometry.m Octree.m CollisionRegion.m OOColor.m OOLogging.m OOCacheManager.m OOCache.m OOStringParsing.m OOCollectionExtractors.m OOVector.m OOMatrix.m OOQuaternion.m OOVoxel.m OOTriangle.m OOPListParsing.m OOFastArithmetic.m OOTextureScaling.m OOConstToString.m OOScript.m OOJSScript.m OOJavaScriptEngine.m OOPListScript.m NSStringOOExtensions.m PlayerEntityScriptMethods.m OOWeakReference.m OOJSEntity.m EntityOOJavaScriptExtensions.m OOJSQuaternion.m OOMaterial.m OOShaderMaterial.m OOShaderProgram.m OOShaderUniform.m OOTexture.m OOTextureLoader.m OOPNGTextureLoader.m OOOpenGLExtensionManager.m OOBasicMaterial.m OOSingleTextureMaterial.m OOCPUInfo.m OOSelfDrawingEntity.m OOEntityWithDrawable.m OODrawable.m OOJSVector.m OOMesh.m OOOpenGL.m OOGraphicsResetManager.m OOProbabilisticTextureManager.m OODebugGLDrawing.m OOShaderUniformMethodType.m OOAsyncQueue.m TextureStore.m OOOXPVerifier.m OOOXPVerifierStage.m OOFileScannerVerifierStage.m OOCheckRequiresPListVerifierStage.m OOCheckDemoShipsPListVerifierStage.m OOCheckEquipmentPListVerifierStage.m OOTextureVerifierStage.m OOModelVerifierStage.m OOCheckShipDataPListVerifierStage.m OOPListSchemaVerifier.m OOJSShip.m OOJSPlayer.m OOJSCall.m OOJSStation.m OOJSSystem.m OOLegacyEventHandlerScript.m OOJSOolite.m OORoleSet.m OOJSGlobal.m OOJSMissionVariables.m OOJSMission.m OOPriorityQueue.m OOScriptTimer.m OOJSTimer.m OOJSClock.m OODebugSupport.m OODebugMonitor.m OOJSConsole.m OODebugTCPConsoleClient.m OOTCPStreamDecoderAbstractionLayer.m include $(GNUSTEP_MAKEFILES)/objc.make include GNUmakefile.postamble diff --git a/src/Core/Debug/OODebugMonitor.m b/src/Core/Debug/OODebugMonitor.m index a2b8d967..1fe2dd5d 100644 --- a/src/Core/Debug/OODebugMonitor.m +++ b/src/Core/Debug/OODebugMonitor.m @@ -70,6 +70,11 @@ static OODebugMonitor *sSingleton = nil; NSUserDefaults *defaults = nil; NSDictionary *jsProps = nil; NSDictionary *config = nil; + // The line below has been copied from gnustep-gui's externs.m source file. Pasted here so that we will not + // have to link against gnustep-gui.dll just for this one definition. +#if OOLITE_GNUSTEP + NSString *NSApplicationWillTerminateNotification = @"ApplicationWillTerminate"; +#endif self = [super init]; if (self != nil) diff --git a/src/Core/Debug/OODebugSupport.m b/src/Core/Debug/OODebugSupport.m index 4f8920f9..ddbfe8c5 100644 --- a/src/Core/Debug/OODebugSupport.m +++ b/src/Core/Debug/OODebugSupport.m @@ -75,7 +75,7 @@ void OOInitDebugSupport(void) id plugInController = nil; NSDictionary *debugSettings = nil; NSString *consoleHost = nil; - unsigned short consolePort = nil; + unsigned short consolePort = 0; id debugger = nil; // Check that the debug OXP is installed. If not, we don't enable debug support. diff --git a/src/Core/Debug/OODebugTCPConsoleClient.h b/src/Core/Debug/OODebugTCPConsoleClient.h index 998e679c..7bdf6a76 100644 --- a/src/Core/Debug/OODebugTCPConsoleClient.h +++ b/src/Core/Debug/OODebugTCPConsoleClient.h @@ -27,8 +27,7 @@ SOFTWARE. */ - -#import +#import "OOCocoa.h" #import "OODebuggerInterface.h" @class OODebugMonitor; diff --git a/src/Core/Debug/OODebugTCPConsoleClient.m b/src/Core/Debug/OODebugTCPConsoleClient.m index 6d5fc5c0..c1179e59 100644 --- a/src/Core/Debug/OODebugTCPConsoleClient.m +++ b/src/Core/Debug/OODebugTCPConsoleClient.m @@ -36,7 +36,13 @@ SOFTWARE. #import "OOFunctionAttributes.h" #import "OOLogging.h" #import + +#if OOLITE_WINDOWS +#import +#else #import // For htonl +#endif + #import "OOCollectionExtractors.h" #import "OOTCPStreamDecoder.h" diff --git a/src/Core/Debug/OODebugTCPConsoleProtocol.h b/src/Core/Debug/OODebugTCPConsoleProtocol.h index 61da8354..481ad9b0 100644 --- a/src/Core/Debug/OODebugTCPConsoleProtocol.h +++ b/src/Core/Debug/OODebugTCPConsoleProtocol.h @@ -33,6 +33,8 @@ SOFTWARE. #ifdef __OBJC__ #import #define OOSTR(x) @""x +#elif (defined GNUSTEP) +#define OOSTR(x) (x) #else #include #define OOSTR(x) CFSTR(x) diff --git a/src/Core/Debug/OOTCPStreamDecoder.c b/src/Core/Debug/OOTCPStreamDecoder.c index ed160c88..d8cb32ba 100755 --- a/src/Core/Debug/OOTCPStreamDecoder.c +++ b/src/Core/Debug/OOTCPStreamDecoder.c @@ -52,6 +52,7 @@ SOFTWARE. #include "OOTCPStreamDecoder.h" #include #include +#include #include "OODebugTCPConsoleProtocol.h" @@ -136,7 +137,7 @@ void OOTCPStreamDecoderReceiveBytes(OOTCPStreamDecoderRef decoder, const void *i if (bytes == NULL && remaining != 0) { - Error(decoder, FALSE, OOALSTR("Invalid data -- NULL bytes but %u byte count."), remaining); + Error(decoder, OOALSTR("Invalid data -- NULL bytes but %u byte count."), remaining); return; }