diff options
Diffstat (limited to 'libexec/flua')
-rw-r--r-- | libexec/flua/Makefile | 7 | ||||
-rw-r--r-- | libexec/flua/bootstrap.h | 6 | ||||
-rw-r--r-- | libexec/flua/linit_flua.c | 5 | ||||
-rw-r--r-- | libexec/flua/lposix/Makefile | 5 | ||||
-rw-r--r-- | libexec/flua/lposix/Makefile.inc | 2 | ||||
-rw-r--r-- | libexec/flua/modules/lposix.c (renamed from libexec/flua/lposix/lposix.c) | 5 | ||||
-rw-r--r-- | libexec/flua/modules/lposix.h (renamed from libexec/flua/lposix/lposix.h) | 0 |
7 files changed, 12 insertions, 18 deletions
diff --git a/libexec/flua/Makefile b/libexec/flua/Makefile index 0d1841f8c3bd..23de404710d0 100644 --- a/libexec/flua/Makefile +++ b/libexec/flua/Makefile @@ -16,11 +16,11 @@ FLUA_MODULES+= libjail .endif FLUA_MODULES+= libucl FLUA_MODULES+= liblyaml -FLUA_MODULES+= lposix .ifdef BOOTSTRAPPING -FLUA_MODULES+= libfreebsd/sys/linker -FLUA_MODULES+= libfreebsd/kenv +# libfreebsd is generally omitted from the bootstrap flua because its +# functionality largely assumes a FreeBSD kernel/system headers, so it doesn't +# really offer functionality that we can use in bootstrap. CFLAGS+= -I${.CURDIR} -DBOOTSTRAPPING SHAREDIR= ${WORLDTMP}/legacy/usr/share/flua @@ -54,6 +54,7 @@ SRCS+= lua.c # FreeBSD Extensions .PATH: ${.CURDIR}/modules SRCS+= linit_flua.c +SRCS+= lposix.c CFLAGS+= -I${SRCTOP}/lib/liblua -I${.CURDIR}/modules -I${LUASRC} CFLAGS+= -DLUA_PROGNAME="\"${PROG}\"" diff --git a/libexec/flua/bootstrap.h b/libexec/flua/bootstrap.h index 74356d8677b3..caf00518c1e0 100644 --- a/libexec/flua/bootstrap.h +++ b/libexec/flua/bootstrap.h @@ -12,10 +12,12 @@ #include <lauxlib.h> -SET_DECLARE(flua_module_set, const luaL_Reg); +#define FLUA_MODULE_SETNAME flua_modules + +SET_DECLARE(FLUA_MODULE_SETNAME, const luaL_Reg); #define FLUA_MODULE_DEF(ident, modname, openfn) \ static const luaL_Reg ident = { modname, openfn }; \ - DATA_SET(flua_module_set, ident) + DATA_SET(FLUA_MODULE_SETNAME, ident) #define FLUA_MODULE_NAMED(mod, name) \ FLUA_MODULE_DEF(module_ ## mod, name, luaopen_ ## mod) diff --git a/libexec/flua/linit_flua.c b/libexec/flua/linit_flua.c index 161f030923d3..65356c938671 100644 --- a/libexec/flua/linit_flua.c +++ b/libexec/flua/linit_flua.c @@ -33,6 +33,7 @@ #include "lualib.h" #include "lauxlib.h" +#include "lposix.h" #include "bootstrap.h" @@ -54,6 +55,8 @@ static const luaL_Reg loadedlibs[] = { #if defined(LUA_COMPAT_BITLIB) {LUA_BITLIBNAME, luaopen_bit32}, #endif + /* FreeBSD Extensions */ + {"posix", luaopen_posix}, {NULL, NULL} }; @@ -72,7 +75,7 @@ static void __attribute__((constructor)) flua_init_env(void) { static void flua_setup_mods (lua_State *L) { const luaL_Reg **flib; - SET_FOREACH(flib, flua_module_set) { + SET_FOREACH(flib, FLUA_MODULE_SETNAME) { luaL_requiref(L, (*flib)->name, (*flib)->func, 1); lua_pop(L, 1); /* remove lib */ } diff --git a/libexec/flua/lposix/Makefile b/libexec/flua/lposix/Makefile deleted file mode 100644 index 92321d51be9a..000000000000 --- a/libexec/flua/lposix/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -SHLIB_NAME= posix.so -WARNS?= 3 - -.include "Makefile.inc" -.include <bsd.lib.mk> diff --git a/libexec/flua/lposix/Makefile.inc b/libexec/flua/lposix/Makefile.inc deleted file mode 100644 index 499e6779e84d..000000000000 --- a/libexec/flua/lposix/Makefile.inc +++ /dev/null @@ -1,2 +0,0 @@ -.PATH: ${.PARSEDIR} -SRCS+= lposix.c diff --git a/libexec/flua/lposix/lposix.c b/libexec/flua/modules/lposix.c index 430bb6f28baf..75cdd345aeaa 100644 --- a/libexec/flua/lposix/lposix.c +++ b/libexec/flua/modules/lposix.c @@ -21,8 +21,6 @@ #include "lauxlib.h" #include "lposix.h" -#include "bootstrap.h" - static void enforce_max_args(lua_State *L, int max) { @@ -699,6 +697,3 @@ luaopen_posix(lua_State *L) return (1); } - -/* Only this one needed in our bootstrap set, it will load the others. */ -FLUA_MODULE(posix); diff --git a/libexec/flua/lposix/lposix.h b/libexec/flua/modules/lposix.h index 1aa33f042571..1aa33f042571 100644 --- a/libexec/flua/lposix/lposix.h +++ b/libexec/flua/modules/lposix.h |