Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Haiku fixes #1289

Merged
merged 1 commit into from
Oct 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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" }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

links { "network" } probably needs to go in the contrib/curl/premake5.lua under a haiku filter

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm Solaris links with libsocket… besides, it seems you're building cURL as a static lib anyway.

Copy link
Contributor

@ratzlaff ratzlaff Jun 3, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but if you build premake without those contribs, or if cURL ever gets made into a binmodule, this is not a requirement for building the executable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But for now cURL is used as a static lib, so you must link it here, since you can't link static libs to anything (it's just an archive).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is a good point, I had forgotten that detail about static libraries.

How about putting links { "network" } inside a if not _OPTIONS["no-curl"] then ... end check like on line 182?

Copy link
Contributor Author

@mmuman mmuman Jun 3, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't luasocket also need it?
Again, the Solaris libs also are linked without any test.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we're wildly inconsistent with these options. macOS probably only needs Security.framework when linking cURL too. I'll open an issue for this anyway since the other systems aren't handled properly either, it's up to you @mmuman if you want this done correctly now or likely done wrong later. I'll link to this discussion in the issue, but without a CI option for Haiku we can't make any guarantees. (If there is an option I'm happy to look at it though!)



-- 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)
samsinsane marked this conversation as resolved.
Show resolved Hide resolved


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