From 8e57167ba380d512a41f7b44e55c84a13932f00d Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Mon, 17 Feb 2020 15:40:37 +1100 Subject: [PATCH] Fix makefile for haiku OS and add direct compile instructions for haiku OS into readme --- readme.md | 14 +++++++++++--- src/Core.h | 1 + src/Makefile | 2 +- src/Platform.c | 2 +- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/readme.md b/readme.md index b8d4afb0f..37c603cd5 100644 --- a/readme.md +++ b/readme.md @@ -1,4 +1,4 @@ -ClassiCube is a custom Minecraft Classic and ClassiCube client written in C that works on Windows, OSX, Linux, BSD, Solaris, and in a browser. +ClassiCube is a custom Minecraft Classic and ClassiCube client written in C that works on Windows, OSX, Linux, BSD, Solaris, Haiku, and in a browser. **It is not affiliated with (or supported by) Mojang AB, Minecraft, or Microsoft in any way.** ![screenshot_n](http://i.imgur.com/FCiwl27.png) @@ -68,11 +68,11 @@ Although the regular linux compiliation flags will work fine, to take full advan ```gcc *.c -o ClassiCube -DCC_BUILD_RPI -lm -lpthread -lX11 -lEGL -lGLESv2 -lcurl -lopenal -ldl``` -#### Mac OSX (32 bit) +#### macOS (32 bit) ```gcc *.c -o ClassiCube -framework Carbon -framework AGL -framework OpenAL -framework OpenGL -lcurl``` -#### Mac OSX (64 bit) +#### macOS (64 bit) ```gcc *.c -o ClassiCube -framework Cocoa -framework OpenAL -framework OpenGL -lcurl -lobjc``` @@ -96,6 +96,14 @@ Install libexecinfo package if needed. NOTE: You have to change entry->d_type == DT_DIR to Directory_Exists(&path) (TODO do this automatically) +#### Haiku + +Install libsdl2_devel, openal_devel, and libexecinfo_devel package if needed. + +```gcc *.c -o ClassiCube -lm -lcurl -lexecinfo -lopenal -lGL -lnetwork -lSDL2``` + +NOTE: You have to change entry->d_type == DT_DIR to Directory_Exists(&path) (TODO do this automatically) + #### Web ```emcc *.c -s FETCH=1 -s ALLOW_MEMORY_GROWTH=1 --preload-file texpacks/default.zip``` diff --git a/src/Core.h b/src/Core.h index a9ab84070..427eb9bf5 100644 --- a/src/Core.h +++ b/src/Core.h @@ -214,6 +214,7 @@ typedef struct TextureRec_ { float U1, V1, U2, V2; } TextureRec; #define CC_BUILD_GL #define CC_BUILD_CURL #define CC_BUILD_OPENAL +#define CC_BUILD_SDL #elif defined __EMSCRIPTEN__ #define CC_BUILD_WEB #define CC_BUILD_POSIX diff --git a/src/Makefile b/src/Makefile index 8c3627b8d..02c4e212d 100644 --- a/src/Makefile +++ b/src/Makefile @@ -64,7 +64,7 @@ endif ifeq ($(PLAT),haiku) CFLAGS=-g -pipe LDFLAGS=-g -LIBS=-lcurl -lm -lexecinfo -lopenal -lGL -lnetwork +LIBS=-lcurl -lm -lexecinfo -lopenal -lGL -lnetwork -lSDL2 endif ifeq ($(OS),Windows_NT) diff --git a/src/Platform.c b/src/Platform.c index 3f9600a0d..f5ac69087 100644 --- a/src/Platform.c +++ b/src/Platform.c @@ -89,7 +89,7 @@ const cc_result ReturnCode_SocketWouldBlock = EWOULDBLOCK; #include #include #elif defined CC_BUILD_HAIKU -#define CC_BUILD_HAIKU +#define CC_BUILD_UNIX /* TODO: Use open instead of xdg-open */ #include #elif defined CC_BUILD_WEB