Skip to content

Commit

Permalink
Fix Haiku support
Browse files Browse the repository at this point in the history
- contrib/curl: use linux config for Haiku
Like svr4 we don't have SIOCGIFADDR.

- Haiku is POSIX enough

- Add libs for Haiku
Not tested yet

- contrib: fix Haiku bootstrap

- Fix os.getversion() for Haiku

- Fix bootstrap on Haiku
  • Loading branch information
mmuman committed Sep 30, 2019
1 parent e5e4f38 commit fd8bfef
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 6 deletions.
10 changes: 10 additions & 0 deletions Bootstrap.mak
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,16 @@ solaris: $(SRC)
./build/bootstrap/premake_bootstrap --to=build/bootstrap gmake2
$(MAKE) -C build/bootstrap -j`getconf NPROCESSORS_ONLN` config=$(CONFIG)

haiku: $(SRC)
$(SILENT) rm -rf ./bin
$(SILENT) rm -rf ./build
$(SILENT) rm -rf ./obj
mkdir -p build/bootstrap
$(CC) -o build/bootstrap/premake_bootstrap -DPREMAKE_NO_BUILTIN_SCRIPTS -DLUA_USE_POSIX -DLUA_USE_DLOPEN -D_BSD_SOURCE -I"$(LUA_DIR)" -I"$(LUASHIM_DIR)" $? -lbsd
./build/bootstrap/premake_bootstrap embed
./build/bootstrap/premake_bootstrap --to=build/bootstrap gmake2
$(MAKE) -C build/bootstrap -j`getconf _NPROCESSORS_ONLN` config=$(CONFIG)

windows-base: $(SRC)
$(SILENT) if exist .\bin rmdir /s /q .\bin
$(SILENT) if exist .\build rmdir /s /q .\build
Expand Down
2 changes: 1 addition & 1 deletion contrib/curl/lib/curl_setup.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
# include "config-linux.h"
#endif

#if defined(__sun__) && defined(__svr4__)
#if defined(__sun__) && defined(__svr4__) || defined(__HAIKU__)
# include "config-linux.h"
# undef HAVE_IOCTL_SIOCGIFADDR
#endif
Expand Down
2 changes: 1 addition & 1 deletion contrib/libzip/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ project "zip-lib"
"**.c"
}

filter "system:linux or bsd or solaris"
filter "system:linux or bsd or solaris or haiku"
defines { "HAVE_SSIZE_T_LIBZIP", "HAVE_CONFIG_H" }

filter "system:windows"
Expand Down
2 changes: 1 addition & 1 deletion contrib/lua/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ project "lua-lib"
"etc/*.c"
}

filter "system:linux or bsd or hurd or aix or solaris"
filter "system:linux or bsd or hurd or aix or solaris or haiku"
defines { "LUA_USE_POSIX", "LUA_USE_DLOPEN" }

filter "system:macosx"
Expand Down
2 changes: 1 addition & 1 deletion contrib/luashim/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ project "luashim-lib"
"*.lua"
}

filter "system:linux or bsd or hurd or aix"
filter "system:linux or bsd or hurd or aix or haiku"
defines { "LUA_USE_POSIX", "LUA_USE_DLOPEN" }

filter "system:macosx"
Expand Down
4 changes: 4 additions & 0 deletions premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,10 @@
defines { "LUA_USE_POSIX", "LUA_USE_DLOPEN" }
links { "m" }

filter "system:haiku"
defines { "LUA_USE_POSIX", "LUA_USE_DLOPEN", "_BSD_SOURCE" }
links { "network", "bsd" }


-- optional 3rd party libraries
group "contrib"
Expand Down
2 changes: 1 addition & 1 deletion src/host/os_getversion.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ int getversion(struct OsVersionInfo* info)

/*************************************************************/

#elif defined(PLATFORM_BSD) || defined(PLATFORM_LINUX) || defined(PLATFORM_SOLARIS) || defined(PLATFORM_HURD)
#elif defined(PLATFORM_BSD) || defined(PLATFORM_LINUX) || defined(PLATFORM_SOLARIS) || defined(PLATFORM_HURD) || defined(PLATFORM_HAIKU)

#include <string.h>
#include <sys/utsname.h>
Expand Down
2 changes: 1 addition & 1 deletion src/host/premake.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#define PLATFORM_STRING "windows"
#endif

#define PLATFORM_POSIX (PLATFORM_LINUX || PLATFORM_BSD || PLATFORM_MACOSX || PLATFORM_SOLARIS)
#define PLATFORM_POSIX (PLATFORM_LINUX || PLATFORM_BSD || PLATFORM_MACOSX || PLATFORM_SOLARIS || PLATFORM_HAIKU)


/* Pull in platform-specific headers required by built-in functions */
Expand Down

0 comments on commit fd8bfef

Please sign in to comment.