Added BSD support

This commit is contained in:
Sam Surtees 2017-04-14 03:07:20 +10:00
parent 957287643d
commit 7b55321473
5 changed files with 30 additions and 3 deletions

View File

@ -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 $**

View File

@ -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

View File

@ -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

View File

@ -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"

View File

@ -13,6 +13,10 @@
#include <CoreFoundation/CFBundle.h>
#endif
#if PLATFORM_BSD
#include <sys/types.h>
#include <sys/sysctl.h>
#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;