diff --git a/Makefile b/Makefile index a10eb5214..c706d429c 100644 --- a/Makefile +++ b/Makefile @@ -65,6 +65,15 @@ ifeq ($(PLAT),sunos) BUILD_DIR = build-solaris endif +ifeq ($(PLAT),hp-ux) + CC = gcc + CFLAGS = -DCC_BUILD_ICON + LDFLAGS = + LIBS = -lm -lX11 -lXi -L/opt/graphics/OpenGL/lib -lGL + BUILD_DIR = build-hpux + TRACK_DEPENDENCIES=0 +endif + ifeq ($(PLAT),darwin) OBJECTS += $(BUILD_DIR)/Window_cocoa.o CFLAGS += -DCC_BUILD_ICON @@ -175,6 +184,8 @@ mingw: $(MAKE) $(TARGET) PLAT=mingw sunos: $(MAKE) $(TARGET) PLAT=sunos +hp-ux: + $(MAKE) $(TARGET) PLAT=hp-ux darwin: $(MAKE) $(TARGET) PLAT=darwin freebsd: diff --git a/src/Core.h b/src/Core.h index e342c64f8..b56bdb171 100644 --- a/src/Core.h +++ b/src/Core.h @@ -265,6 +265,13 @@ typedef cc_uint8 cc_bool; #define DEFAULT_AUD_BACKEND CC_AUD_BACKEND_OPENAL #define DEFAULT_GFX_BACKEND CC_GFX_BACKEND_GL1 #define DEFAULT_WIN_BACKEND CC_WIN_BACKEND_X11 +#elif defined __hpux + #define CC_BUILD_HPUX + #define CC_BUILD_POSIX + #define DEFAULT_NET_BACKEND CC_NET_BACKEND_LIBCURL + #define DEFAULT_AUD_BACKEND CC_AUD_BACKEND_OPENAL + #define DEFAULT_GFX_BACKEND CC_GFX_BACKEND_GL1 + #define DEFAULT_WIN_BACKEND CC_WIN_BACKEND_X11 #elif defined __FreeBSD__ || defined __DragonFly__ #define CC_BUILD_FREEBSD #define CC_BUILD_POSIX diff --git a/src/Platform_Posix.c b/src/Platform_Posix.c index c89afc402..fa7b6b3f3 100644 --- a/src/Platform_Posix.c +++ b/src/Platform_Posix.c @@ -175,7 +175,7 @@ cc_uint64 Stopwatch_ElapsedMicroseconds(cc_uint64 beg, cc_uint64 end) { /* "... These functions are part of the Timers option and need not be available on all implementations..." */ cc_uint64 Stopwatch_Measure(void) { struct timespec t; - #ifdef CC_BUILD_IRIX + #if defined CC_BUILD_IRIX || defined CC_BUILD_HPUX clock_gettime(CLOCK_REALTIME, &t); #else /* TODO: CLOCK_MONOTONIC_RAW ?? */ @@ -247,7 +247,7 @@ cc_result Directory_Enum(const cc_string* dirPath, void* obj, Directory_EnumCall len = String_Length(src); String_AppendUtf8(&path, src, len); -#if defined CC_BUILD_HAIKU || defined CC_BUILD_SOLARIS || defined CC_BUILD_IRIX || defined CC_BUILD_BEOS +#if defined CC_BUILD_HAIKU || defined CC_BUILD_SOLARIS || defined CC_BUILD_HPUX || defined CC_BUILD_IRIX || defined CC_BUILD_BEOS { char full_path[NATIVE_STR_LEN]; struct stat sb; @@ -996,7 +996,7 @@ static cc_result Process_RawGetExePath(char* path, int* len) { Mem_Copy(path, info.name, *len); return 0; } -#elif defined CC_BUILD_IRIX +#elif defined CC_BUILD_IRIX || defined CC_BUILD_HPUX static cc_result Process_RawGetExePath(char* path, int* len) { static cc_string file = String_FromConst("ClassiCube"); @@ -1235,7 +1235,7 @@ static void Platform_InitPosix(void) { } void Platform_Free(void) { } -#ifdef CC_BUILD_IRIX +#if defined CC_BUILD_IRIX || defined CC_BUILD_HPUX cc_bool Platform_DescribeError(cc_result res, cc_string* dst) { const char* err = strerror(res); if (!err || res >= 1000) return false; diff --git a/src/Window_X11.c b/src/Window_X11.c index 3ab1edd3e..6a270e1fe 100644 --- a/src/Window_X11.c +++ b/src/Window_X11.c @@ -54,6 +54,9 @@ /* XIM support based off details described in */ /* https://tedyin.com/posts/a-brief-intro-to-linux-input-method-framework/ */ #endif +#ifdef CC_BUILD_HPUX +#undef CC_BUILD_XIM +#endif #define _NET_WM_STATE_REMOVE 0 #define _NET_WM_STATE_ADD 1