mirror of
https://git.freebsd.org/src.git
synced 2026-01-16 23:02:24 +00:00
flua: kick out the remaining builtin modules
Bootstrap flua has some magic now to handle modules by building them in and discovering them via linker sets. This is slightly cleaner than always building them in and baking them into loadedlibs for both bootstrap and system flua. Adjust the stand build now that these three libs have their own new homes. Reviewed by: bapt, emaste Differential Revision: https://reviews.freebsd.org/D51891
This commit is contained in:
parent
1953a12ee2
commit
80ada95900
17 changed files with 43 additions and 11 deletions
|
|
@ -6,10 +6,13 @@
|
|||
# than mucking about with the infrastructure to make them linkable -- thus, why
|
||||
# these are all structured to have a Makefile that describes what we want
|
||||
# *installed*, and a Makefile.inc that describes what we need to *build*.
|
||||
FLUA_MODULES+= lfbsd
|
||||
FLUA_MODULES+= lfs
|
||||
FLUA_MODULES+= libhash
|
||||
FLUA_MODULES+= libjail
|
||||
FLUA_MODULES+= libucl
|
||||
FLUA_MODULES+= liblyaml
|
||||
FLUA_MODULES+= lposix
|
||||
|
||||
.ifdef BOOTSTRAPPING
|
||||
FLUA_MODULES+= libfreebsd/sys/linker
|
||||
|
|
@ -47,7 +50,6 @@ SRCS+= lua.c
|
|||
# FreeBSD Extensions
|
||||
.PATH: ${.CURDIR}/modules
|
||||
SRCS+= linit_flua.c
|
||||
SRCS+= lfs.c lposix.c lfbsd.c
|
||||
|
||||
CFLAGS+= -I${SRCTOP}/lib/liblua -I${.CURDIR}/modules -I${LUASRC}
|
||||
CFLAGS+= -DLUA_PROGNAME="\"${PROG}\""
|
||||
|
|
|
|||
5
libexec/flua/lfbsd/Makefile
Normal file
5
libexec/flua/lfbsd/Makefile
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
SHLIB_NAME= fbsd.so
|
||||
WARNS?= 3
|
||||
|
||||
.include "Makefile.inc"
|
||||
.include <bsd.lib.mk>
|
||||
2
libexec/flua/lfbsd/Makefile.inc
Normal file
2
libexec/flua/lfbsd/Makefile.inc
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
.PATH: ${.PARSEDIR}
|
||||
SRCS+= lfbsd.c
|
||||
|
|
@ -40,6 +40,8 @@
|
|||
#include "lauxlib.h"
|
||||
#include "lfbsd.h"
|
||||
|
||||
#include "bootstrap.h"
|
||||
|
||||
#define FBSD_PROCESSHANDLE "fbsd_process_t*"
|
||||
|
||||
struct fbsd_process {
|
||||
|
|
@ -283,3 +285,5 @@ luaopen_fbsd(lua_State *L)
|
|||
|
||||
return (1);
|
||||
}
|
||||
|
||||
FLUA_MODULE(fbsd);
|
||||
5
libexec/flua/lfs/Makefile
Normal file
5
libexec/flua/lfs/Makefile
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
SHLIB_NAME= lfs.so
|
||||
WARNS?= 3
|
||||
|
||||
.include "Makefile.inc"
|
||||
.include <bsd.lib.mk>
|
||||
2
libexec/flua/lfs/Makefile.inc
Normal file
2
libexec/flua/lfs/Makefile.inc
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
.PATH: ${.PARSEDIR}
|
||||
SRCS+= lfs.c
|
||||
|
|
@ -66,9 +66,10 @@
|
|||
#ifdef _STANDALONE
|
||||
#include "lstd.h"
|
||||
#include "lutils.h"
|
||||
#include "bootstrap.h"
|
||||
#endif
|
||||
|
||||
#include "bootstrap.h"
|
||||
|
||||
#ifndef nitems
|
||||
#define nitems(x) (sizeof((x)) / sizeof((x)[0]))
|
||||
#endif
|
||||
|
|
@ -446,3 +447,7 @@ luaopen_lfs(lua_State *L)
|
|||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifndef _STANDALONE
|
||||
FLUA_MODULE(lfs);
|
||||
#endif
|
||||
|
|
@ -178,4 +178,6 @@ luaopen_hash(lua_State *L)
|
|||
return 1;
|
||||
}
|
||||
|
||||
#ifndef _STANDALONE
|
||||
FLUA_MODULE(hash);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -33,9 +33,6 @@
|
|||
|
||||
#include "lualib.h"
|
||||
#include "lauxlib.h"
|
||||
#include "lfs.h"
|
||||
#include "lposix.h"
|
||||
#include "lfbsd.h"
|
||||
|
||||
#include "bootstrap.h"
|
||||
|
||||
|
|
@ -57,10 +54,6 @@ static const luaL_Reg loadedlibs[] = {
|
|||
#if defined(LUA_COMPAT_BITLIB)
|
||||
{LUA_BITLIBNAME, luaopen_bit32},
|
||||
#endif
|
||||
/* FreeBSD Extensions */
|
||||
{"lfs", luaopen_lfs},
|
||||
{"posix", luaopen_posix},
|
||||
{"fbsd", luaopen_fbsd},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
|
|
|
|||
5
libexec/flua/lposix/Makefile
Normal file
5
libexec/flua/lposix/Makefile
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
SHLIB_NAME= posix.so
|
||||
WARNS?= 3
|
||||
|
||||
.include "Makefile.inc"
|
||||
.include <bsd.lib.mk>
|
||||
2
libexec/flua/lposix/Makefile.inc
Normal file
2
libexec/flua/lposix/Makefile.inc
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
.PATH: ${.PARSEDIR}
|
||||
SRCS+= lposix.c
|
||||
|
|
@ -21,6 +21,8 @@
|
|||
#include "lauxlib.h"
|
||||
#include "lposix.h"
|
||||
|
||||
#include "bootstrap.h"
|
||||
|
||||
static void
|
||||
enforce_max_args(lua_State *L, int max)
|
||||
{
|
||||
|
|
@ -697,3 +699,6 @@ luaopen_posix(lua_State *L)
|
|||
|
||||
return (1);
|
||||
}
|
||||
|
||||
/* Only this one needed in our bootstrap set, it will load the others. */
|
||||
FLUA_MODULE(posix);
|
||||
|
|
@ -24,7 +24,7 @@ SRCS+= lauxlib.c lbaselib.c lstrlib.c loadlib.c
|
|||
SRCS+= lerrno.c lpager.c lstd.c lutils.c
|
||||
SRCS+= gfx_utils.c
|
||||
|
||||
.PATH: ${FLUASRC}/modules
|
||||
.PATH: ${FLUASRC}/lfs
|
||||
SRCS+= lfs.c
|
||||
.PATH: ${FLUALIB}/libhash
|
||||
SRCS+= lhash.c
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ SRCS+= interp_lua.c
|
|||
.include "${BOOTSRC}/lua.mk"
|
||||
LDR_INTERP= ${LIBLUA}
|
||||
LDR_INTERP32= ${LIBLUA32}
|
||||
CFLAGS.interp_lua.c= -DLUA_PATH=\"${LUAPATH}\" -I${FLUASRC}/modules
|
||||
CFLAGS.interp_lua.c= -DLUA_PATH=\"${LUAPATH}\" -I${FLUASRC}/lfs
|
||||
.elif ${LOADER_INTERP} == "4th"
|
||||
SRCS+= interp_forth.c
|
||||
.include "${BOOTSRC}/ficl.mk"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue