diff --git a/Bootstrap.mak b/Bootstrap.mak index d1eebf97..d089654b 100644 --- a/Bootstrap.mak +++ b/Bootstrap.mak @@ -65,6 +65,13 @@ linux: $(SRC) ./build/bootstrap/premake_bootstrap --to=build/bootstrap gmake $(MAKE) -C build/bootstrap -j`getconf _NPROCESSORS_ONLN` +bsd: $(SRC) + mkdir -p build/bootstrap + $(CC) -o build/bootstrap/premake_bootstrap -DPREMAKE_NO_BUILTIN_SCRIPTS -DLUA_USE_POSIX -DLUA_USE_DLOPEN -I"$(LUA_DIR)" $? -lm + ./build/bootstrap/premake_bootstrap embed + ./build/bootstrap/premake_bootstrap --to=build/bootstrap gmake + $(MAKE) -C build/bootstrap -j`getconf _NPROCESSORS_ONLN` + windows-base: $(SRC) if not exist build\bootstrap (mkdir build\bootstrap) cl /Fo.\build\bootstrap\ /Fe.\build\bootstrap\premake_bootstrap.exe /DPREMAKE_NO_BUILTIN_SCRIPTS /I"$(LUA_DIR)" user32.lib ole32.lib advapi32.lib $** diff --git a/contrib/curl/lib/curl_setup.h b/contrib/curl/lib/curl_setup.h index 93a59ab2..19db0aea 100644 --- a/contrib/curl/lib/curl_setup.h +++ b/contrib/curl/lib/curl_setup.h @@ -82,6 +82,10 @@ # include "config-linux.h" #endif +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) +# include "config-linux.h" +#endif + #ifdef __APPLE__ && __MACH__ # include "config-osx.h" #endif diff --git a/contrib/curl/premake5.lua b/contrib/curl/premake5.lua index 77be654d..ef03af83 100644 --- a/contrib/curl/premake5.lua +++ b/contrib/curl/premake5.lua @@ -15,7 +15,7 @@ project "curl-lib" "**.h", "**.c" } - + filter { "system:windows" } defines { "USE_SCHANNEL", "USE_WINDOWS_SSPI" } @@ -25,7 +25,7 @@ project "curl-lib" filter { "system:not windows", "system:not macosx" } defines { "USE_MBEDTLS" } - filter { "system:linux" } + filter { "system:linux or bsd" } defines { "CURL_HIDDEN_SYMBOLS" } -- find the location of the ca bundle @@ -35,6 +35,7 @@ project "curl-lib" "/etc/pki/tls/certs/ca-bundle.crt", "/usr/share/ssl/certs/ca-bundle.crt", "/usr/local/share/certs/ca-root.crt", + "/usr/local/share/certs/ca-root-nss.crt", "/etc/ssl/cert.pem" } do if os.isfile(f) then ca = f diff --git a/contrib/libzip/premake5.lua b/contrib/libzip/premake5.lua index d8b67b55..62163c81 100644 --- a/contrib/libzip/premake5.lua +++ b/contrib/libzip/premake5.lua @@ -11,7 +11,7 @@ project "zip-lib" "**.c" } - filter "system:linux" + filter "system:linux or bsd" defines { "HAVE_SSIZE_T_LIBZIP", "HAVE_CONFIG_H" } filter "system:windows" diff --git a/src/host/premake.c b/src/host/premake.c index 63e21583..8b03b2f0 100644 --- a/src/host/premake.c +++ b/src/host/premake.c @@ -13,6 +13,10 @@ #include #endif +#if PLATFORM_BSD +#include +#include +#endif #define ERROR_MESSAGE "Error: %s\n" @@ -262,6 +266,17 @@ int premake_locate_executable(lua_State* L, const char* argv0) int len = readlink("/proc/curproc/file", buffer, PATH_MAX - 1); if (len < 0) len = readlink("/proc/curproc/exe", buffer, PATH_MAX - 1); + if (len < 0) + { + int mib[4]; + mib[0] = CTL_KERN; + mib[1] = KERN_PROC; + mib[2] = KERN_PROC_PATHNAME; + mib[3] = -1; + size_t cb = sizeof(buffer); + sysctl(mib, 4, buffer, &cb, NULL, 0); + len = (int)cb; + } if (len > 0) { buffer[len] = 0;