Skip to content
Snippets Groups Projects
Commit 29305817 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Initial Haiku support.

CMake only, has issues.
parent 639781e2
No related branches found
No related tags found
No related merge requests found
Pipeline #6815 passed
......@@ -8,7 +8,8 @@ include(CheckCCompilerFlag)
include(TestBigEndian)
find_program(PATCH_BIN patch REQUIRED)
find_program(PERL_BIN perl REQUIRED)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
# Really, this is "GNU patch?"
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Haiku")
find_program(DOS2UNIX_BIN dos2unix REQUIRED)
endif()
......@@ -102,6 +103,7 @@ set(PATCHES
cl-fix-cpuid-order.patch
cl-fix-cbli-incompatible.patch
cl-mingw64-unicode-gibble.patch
cl-haiku-build.patch
)
set(SOURCE
......@@ -435,7 +437,7 @@ else()
endif()
set(LAST_PATCH "")
# Linux patch -l won't deal with line ending differences. :(
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
if(DEFINED DOS2UNIX_BIN)
add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/dos2unix.done
COMMAND ${DOS2UNIX_BIN} ${CMAKE_CURRENT_SOURCE_DIR}/* ${CMAKE_CURRENT_SOURCE_DIR}/*/*
COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_SOURCE_DIR}/dos2unix.done
......
......@@ -76,6 +76,7 @@ set(PATCHES
${CMAKE_CURRENT_SOURCE_DIR}/cl-fix-cpuid-order.patch
${CMAKE_CURRENT_SOURCE_DIR}/cl-fix-cbli-incompatible.patch
${CMAKE_CURRENT_SOURCE_DIR}/cl-mingw64-unicode-gibble.patch
${CMAKE_CURRENT_SOURCE_DIR}/cl-haiku-build.patch
)
FetchContent_Declare(CryptLib
......
--- crypt/osconfig.h.orig 2024-10-13 06:57:14.810287104 +0000
+++ crypt/osconfig.h 2024-10-13 06:58:42.890503168 +0000
@@ -96,7 +96,7 @@
identical, even if they differ at a higher level */
#if defined( __FreeBSD__ ) || defined( __bsdi__ ) || \
defined( __OpenBSD__ ) || defined( __NetBSD__ ) || \
- defined( __linux__ )
+ defined( __linux__ ) || defined(__HAIKU__)
#if defined( __x86_64__ ) || defined( __amd64__ )
/* 64-bit x86 has both 'long' and 'long long' as 64 bits. In addition
we use DES_INT since int's are 64-bit. We have to check for the
--- io/file.c.orig 2024-10-13 07:30:37.232521728 +0000
+++ io/file.c 2024-10-13 07:53:48.930349056 +0000
@@ -4417,7 +4417,7 @@
#if defined( __FreeBSD__ )
struct timeval timeVals[ 2 ];
#elif !( defined( __APPLE__ ) || defined( __FreeBSD__ ) || \
- defined( __linux__ ) )
+ defined( __linux__ ) || defined( __HAIKU__ ) )
struct utimbuf timeStamp;
#endif /* OS-specific variable declarations */
#endif /* USE_EMBEDDED_OS */
@@ -4480,7 +4480,7 @@
generic DoS that they could perform anyway if they have the user's
rights */
#ifndef USE_EMBEDDED_OS /* Embedded systems have no file timestamps */
- #if defined( __Android__ )
+ #if defined( __Android__ ) || defined( __HAIKU__ )
sFileClose( &stream );
utimes( fileName, NULL ); /* Android's Linux doesn't have futimes() */
#elif defined( __APPLE__ )
--- kernel/thread.h.orig 2024-10-13 07:55:48.750518272 +0000
+++ kernel/thread.h 2024-10-13 07:57:17.796131328 +0000
@@ -3135,7 +3135,8 @@
#endif /* Slowaris 5.7 / 7.x or newer */
#elif defined( _AIX ) || defined( __Android__ ) || defined( __CYGWIN__ ) || \
( defined( __hpux ) && ( OSVERSION >= 11 ) ) || \
- defined( __NetBSD__ ) || defined( __QNX__ ) || defined( __UCLIBC__ )
+ defined( __NetBSD__ ) || defined( __QNX__ ) || \
+ defined( __UCLIBC__ ) || defined( __HAIKU__ )
#define THREAD_YIELD() sched_yield()
#elif defined( __XMK__ )
/* The XMK underlying scheduling object is the process context, for which
--- random/unix.c.orig 2024-10-13 07:30:33.515375104 +0000
+++ random/unix.c 2024-10-13 08:15:32.121110528 +0000
@@ -66,7 +66,8 @@
memory-based polling with a stub the prints an error message for the
caller */
-#if defined( __Android__ ) || ( defined( __QNX__ ) && OSVERSION <= 4 )
+#if defined( __Android__ ) || ( defined( __QNX__ ) && OSVERSION <= 4 ) || \
+ defined( __HAIKU__ )
#define NO_SYSV_SHAREDMEM
#endif /* Android || QNX <= 4.x */
@@ -80,7 +81,9 @@
#include <fcntl.h>
#include <pwd.h>
#if !( defined( __QNX__ ) || defined( __MVS__ ) )
- #include <sys/errno.h>
+ #if !(defined( __HAIKU__) )
+ #include <sys/errno.h>
+ #endif
#include <sys/ipc.h>
#endif /* !( QNX || MVS ) */
#include <sys/time.h> /* SCO and SunOS need this before resource.h */
@@ -118,7 +121,7 @@
#include <sys/sem.h>
#include <sys/shm.h>
#endif /* CYGWIN */
-#if !( defined( __Android__ ) || defined( __CYGWIN__ ) || defined( __QNX__ ) )
+#if !( defined( __Android__ ) || defined( __CYGWIN__ ) || defined( __QNX__ ) || defined( __HAIKU__) )
#include <sys/shm.h>
#endif /* !( __Android__ || Cygwin || QNX ) */
#if defined( __linux__ ) && ( defined(__i386__) || defined(__x86_64__) )
@@ -1948,7 +1951,12 @@
* *
****************************************************************************/
-#ifndef NO_SYSV_SHAREDMEM
+#ifdef NO_SYSV_SHAREDMEM
+#ifdef USE_THREADS
+ static pthread_mutex_t gathererMutex; /* Mutex to protect the polling */
+#endif /* USE_THREADS */
+static pid_t gathererProcess = 0;/* The child process that fills the buffer */
+#else
/* The structure containing information on random-data sources. Each record
contains the source and a relative estimate of its usefulness (weighting)
......@@ -154,6 +154,9 @@ endif()
if(NOT WITHOUT_SDL)
if(SDL2_FOUND)
if(CMAKE_SYSTEM_NAME STREQUAL "Haiku")
target_link_options(ciolib INTERFACE LINKER:-rpath,/system/develop/lib)
endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
target_compile_definitions(ciolib PUBLIC STATIC_SDL)
target_link_libraries(ciolib SDL2::SDL2)
......
Version 1.2rc3
--------------
Get Haiku support building again
Version 1.2rc2
--------------
Start UIFC in insert mode, and use block cursor for overwrite mode
......
......@@ -103,6 +103,8 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
target_link_libraries(syncterm ${FOUNDATION_LIBRARY})
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
target_link_libraries(syncterm util)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Haiku")
target_link_libraries(syncterm network bsd)
endif()
install(TARGETS syncterm DESTINATION bin)
......
......@@ -62,6 +62,9 @@
#ifndef CMIN
#define CMIN 1
#endif
#ifndef CSWTCH
#define CSWTCH 0
#endif
#ifndef CQUIT
#define CQUIT 034 /* FS, ^\ */
#endif
......
......@@ -134,7 +134,8 @@ if(WIN32)
target_compile_definitions(xpdev PUBLIC _WIN32 _WIN32_WINNT=0x0501 WINVER=0x0501 MSVCRT_VERSION=0x0501 _WIN32_IE=0x0500)
target_link_libraries(xpdev iphlpapi ws2_32 winmm netapi32)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Haiku")
target_link_libraries(xpdev network m)
target_compile_definitions(xpdev PUBLIC __unix__ USE_SNPRINTF)
target_link_libraries(xpdev m network)
elseif(CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
target_link_libraries(xpdev m)
if(NOT WITHOUT_OSS)
......
......@@ -82,7 +82,7 @@ bool xpms_add(struct xpms_set *xpms_set, int domain, int type,
#ifdef SUN_LEN
dummy.ai_addrlen = SUN_LEN(&un_addr);
#else
dummy.ai_addrlen = offsetof(struct sockaddr_un, un_addr.sun_path) + strlen(addr) + 1;
dummy.ai_addrlen = offsetof(struct sockaddr_un, sun_path) + strlen(addr) + 1;
#endif
if(fexist(addr))
unlink(addr);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment