diff --git a/CMakeLists.txt b/CMakeLists.txt index 5565bfdda..0ddc6f20b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -321,7 +321,7 @@ else() if ( UNIX ) include(CheckSymbolExists) - check_symbol_exists( "fts_set" "fts.h" HAVE_FTS ) + check_symbol_exists( "fts_set" "sys/types.h;sys/stat.h;fts.h" HAVE_FTS ) if ( NOT HAVE_FTS ) include ( FindPkgConfig ) pkg_check_modules( MUSL_FTS musl-fts ) @@ -343,7 +343,7 @@ else() # If we're compiling with a custom GCC on the Mac (which we know since g++-4.2 doesn't support C++11) statically link libgcc. set( ALL_C_FLAGS "-static-libgcc" ) endif() - elseif( NOT MINGW ) + elseif( NOT MINGW AND NOT HAIKU ) # Generic GCC/Clang requires position independent executable to be enabled explicitly set( ALL_C_FLAGS "${ALL_C_FLAGS} -fPIE" ) set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie" ) diff --git a/libraries/ZVulkan/CMakeLists.txt b/libraries/ZVulkan/CMakeLists.txt index 3b47b7b68..4cd713323 100644 --- a/libraries/ZVulkan/CMakeLists.txt +++ b/libraries/ZVulkan/CMakeLists.txt @@ -188,7 +188,11 @@ if(WIN32) add_definitions(-DUNICODE -D_UNICODE) else() set(ZVULKAN_SOURCES ${ZVULKAN_SOURCES} ${ZVULKAN_UNIX_SOURCES}) - set(ZVULKAN_LIBS ${CMAKE_DL_LIBS} -ldl) + if(NOT HAIKU) + set(ZVULKAN_LIBS ${CMAKE_DL_LIBS} -ldl) + else() + set(ZVULKAN_LIBS ${CMAKE_DL_LIBS}) + endif() add_definitions(-DUNIX -D_UNIX) add_link_options(-pthread) endif() diff --git a/libraries/ZWidget/CMakeLists.txt b/libraries/ZWidget/CMakeLists.txt index 68c048e22..329caf96e 100644 --- a/libraries/ZWidget/CMakeLists.txt +++ b/libraries/ZWidget/CMakeLists.txt @@ -130,7 +130,11 @@ elseif(APPLE) add_link_options(-pthread) else() set(ZWIDGET_SOURCES ${ZWIDGET_SOURCES} ${ZWIDGET_SDL2_SOURCES}) - set(ZWIDGET_LIBS ${CMAKE_DL_LIBS} -ldl) + if(NOT HAIKU) + set(ZWIDGET_LIBS ${CMAKE_DL_LIBS} -ldl) + else() + set(ZWIDGET_LIBS ${CMAKE_DL_LIBS}) + endif() add_definitions(-DUNIX -D_UNIX) add_link_options(-pthread) endif() diff --git a/source/common/engine/i_specialpaths.h b/source/common/engine/i_specialpaths.h index 01710b672..fb75230f5 100644 --- a/source/common/engine/i_specialpaths.h +++ b/source/common/engine/i_specialpaths.h @@ -2,7 +2,7 @@ #include "zstring.h" -#ifdef __unix__ +#if defined(__unix__) || defined(__HAIKU__) FString GetUserFile (const char *path); #endif FString M_GetAppDataPath(bool create); diff --git a/source/common/platform/posix/unix/i_specialpaths.cpp b/source/common/platform/posix/unix/i_specialpaths.cpp index 112e92ee7..fb4d4c7b1 100644 --- a/source/common/platform/posix/unix/i_specialpaths.cpp +++ b/source/common/platform/posix/unix/i_specialpaths.cpp @@ -112,7 +112,11 @@ FString M_GetAppDataPath(bool create) { // Don't use GAME_DIR and such so that ZDoom and its child ports can // share the node cache. - FString path = NicePath("$HOME/.config/" GAMENAMELOWERCASE); + #if defined(__HAIKU__) + FString path = NicePath("$HOME/config/settings/" GAMENAME); + #else + FString path = NicePath("$HOME/.config/" GAMENAMELOWERCASE); + #endif if (create) { CreatePath(path.GetChars()); diff --git a/source/common/rendering/gl_load/gl_load.c b/source/common/rendering/gl_load/gl_load.c index d5ba4e49f..bb2141e7c 100644 --- a/source/common/rendering/gl_load/gl_load.c +++ b/source/common/rendering/gl_load/gl_load.c @@ -134,7 +134,7 @@ static PROC WinGetProcAddress(const char *name) #if defined(__APPLE__) #define IntGetProcAddress(name) AppleGLGetProcAddress(name) #else - #if defined(__sgi) || defined(__sun) || defined(__unix__) + #if defined(__sgi) || defined(__sun) || defined(__unix__) || defined(__HAIKU__) void* SDL_GL_GetProcAddress(const char* proc); #define IntGetProcAddress(name) SDL_GL_GetProcAddress((const char*)name) //#define IntGetProcAddress(name) PosixGetProcAddress((const GLubyte*)name) diff --git a/source/core/version.h b/source/core/version.h index 5bbb693e3..440db965a 100644 --- a/source/core/version.h +++ b/source/core/version.h @@ -86,6 +86,8 @@ const char *GetVersionString(); #if defined(__APPLE__) || defined(_WIN32) #define GAME_DIR GAMENAMELOWERCASE +#elif defined(__HAIKU__) +#define GAME_DIR "config/settings/" GAMENAME #else #define GAME_DIR ".config/" GAMENAMELOWERCASE #endif