Permalink
Browse files

Build: Fix various modules and Jamfiles for a FreeBSD build

  • Loading branch information...
jjensen committed Jun 2, 2018
1 parent 93534f3 commit 04cbbdab7f0afa1c09830dc0ed6b4a18e3666d5d
@@ -39,7 +39,7 @@ NotFile download ;
rule LuaPlusDefines TARGET
{
if $(OS) = LINUX
if $(OS) in LINUX FREEBSD
{
C.Defines $(TARGET) : LUA_USE_LINUX ;
}
@@ -95,7 +95,7 @@ rule LuaPlus.CModule TARGET : OUTPUT_NAME : SOURCES : MODULES_SUBDIR {
LuaPlusDefines $(TARGET) ;
C.IncludeDirectories $(TARGET) : $(LUAPLUS_INCLUDE_DIRECTORIES) ;
if $(OS) != MACOSX && $(OS) != LINUX {
if ! $(OS) in MACOSX LINUX FREEBSD {
C.LinkLibraries $(TARGET) : $(LUA_VERSION) ;
}
@@ -138,7 +138,7 @@ rule Lua.CModule TARGET : OUTPUT_NAME : SOURCES : MODULES_SUBDIR {
LuaPlusDefines $(TARGET) ;
C.IncludeDirectories $(TARGET) : $(LUAPLUS_INCLUDE_DIRECTORIES) ;
if $(OS) != MACOSX && $(OS) != LINUX {
if ! $(OS) in MACOSX LINUX FREEBSD {
C.LinkLibraries $(TARGET) : $(LUA_VERSION) ;
}
@@ -74,9 +74,18 @@ rule LuaApplication TARGET : OPTIONS
}
C.IncludeDirectories : $(LUAPLUS_INCLUDE_DIRECTORIES) ;
C.LinkLibraries : $(LUA_VERSION) ;
if $(OS) = LINUX
if $(OS) in LINUX FREEBSD
{
C.LinkFlags : -Wl,-E -lreadline ;
if $(OS) = LINUX
{
C.LinkFlags : -Wl,-E -lreadline ;
}
else if $(OS) = FREEBSD
{
C.IncludeDirectories : /usr/local/include ;
C.LinkDirectories : /usr/local/lib ;
C.LinkPrebuiltLibraries : readline ;
}
C.LinkFlags : -Wl,--rpath=\\$ORIGIN -z origin ;
}
else if $(OS) in MACOS MACOSX
@@ -24,7 +24,9 @@ rule LuaSharedLibrary TARGET : LUA_SOURCES : OUTPUT_NAME {
}
C.OutputName : $(OUTPUT_NAME) ;
} else if $(UNIX) {
C.LinkPrebuiltLibraries : dl ;
if ! $(OS) in FREEBSD {
C.LinkPrebuiltLibraries : dl ;
}
if ! $(OS) in MACOS MACOSX {
C.LinkFlags : -Wl,-soname,lib$(OUTPUT_NAME).so ;
}
@@ -125,6 +125,9 @@ static lua_CFunction lsys_sym (lua_State *L, void *lib, const char *sym);
#if LUAPLUS_EXTENSIONS
#define __USE_GNU
#define _DARWIN_C_SOURCE
#if !defined(__BSD_VISIBLE)
#define __BSD_VISIBLE 1
#endif
#include <dlfcn.h>
#include <sys/param.h>
#include <unistd.h>
@@ -40,7 +40,7 @@ THE SOFTWARE.
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#if !defined(__APPLE__)
#if !defined(__APPLE__) && !defined(__FreeBSD__)
#include <malloc.h>
#endif
@@ -40,7 +40,7 @@ THE SOFTWARE.
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#if !defined(__APPLE__)
#if !defined(__APPLE__) && !defined(__FreeBSD__)
#include <malloc.h>
#endif
@@ -13,7 +13,7 @@
#elif defined(macintosh) || defined(__APPLE__)
#define PLATFORM_MAC
#define MISC_CDECL
#elif defined(linux)
#elif defined(linux) || defined(__FreeBSD__)
#define PLATFORM_LINUX
#define MISC_CDECL
#endif
@@ -21,6 +21,10 @@ if ! $(foundUuid) {
C.LinkPrebuiltLibraries uuid : rpcrt4 ;
} else if $(OS) = LINUX {
C.LinkPrebuiltLibraries uuid : uuid ;
} else if $(OS) = FREEBSD {
C.IncludeDirectories uuid : /usr/local/include ;
C.LinkDirectories uuid : /usr/local/lib ;
C.LinkPrebuiltLibraries uuid : uuid ;
}
Lua.CModule uuid : : $(SRCS) ;

0 comments on commit 04cbbda

Please sign in to comment.