git: d4c973fa1485 - main - Revert "flua: kick out the remaining builtin modules"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 04 Oct 2025 00:53:37 UTC
The branch main has been updated by kevans:
URL: https://cgit.FreeBSD.org/src/commit/?id=d4c973fa148544a0b949ceb1efb6c68096f02baf
commit d4c973fa148544a0b949ceb1efb6c68096f02baf
Author: Kyle Evans <kevans@FreeBSD.org>
AuthorDate: 2025-10-04 00:52:28 +0000
Commit: Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2025-10-04 00:53:28 +0000
Revert "flua: kick out the remaining builtin modules"
This reverts commit 80ada959004c4386880e47b11618f8abfc2d80e1, because
bootstrap flua is about to get backed out.
---
libexec/flua/Makefile | 4 +---
libexec/flua/lfbsd/Makefile | 5 -----
libexec/flua/lfbsd/Makefile.inc | 2 --
libexec/flua/lfs/Makefile | 5 -----
libexec/flua/lfs/Makefile.inc | 2 --
libexec/flua/libhash/lhash.c | 2 --
libexec/flua/linit_flua.c | 7 +++++++
libexec/flua/lposix/Makefile | 5 -----
libexec/flua/lposix/Makefile.inc | 2 --
libexec/flua/{lfbsd => modules}/lfbsd.c | 4 ----
libexec/flua/{lfbsd => modules}/lfbsd.h | 0
libexec/flua/{lfs => modules}/lfs.c | 7 +------
libexec/flua/{lfs => modules}/lfs.h | 0
libexec/flua/{lposix => modules}/lposix.c | 5 -----
libexec/flua/{lposix => modules}/lposix.h | 0
stand/liblua/Makefile | 2 +-
stand/loader.mk | 2 +-
17 files changed, 11 insertions(+), 43 deletions(-)
diff --git a/libexec/flua/Makefile b/libexec/flua/Makefile
index b43b31298205..231abe5dafa2 100644
--- a/libexec/flua/Makefile
+++ b/libexec/flua/Makefile
@@ -6,13 +6,10 @@
# 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
@@ -50,6 +47,7 @@ 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}\""
diff --git a/libexec/flua/lfbsd/Makefile b/libexec/flua/lfbsd/Makefile
deleted file mode 100644
index e2a4aae14bcd..000000000000
--- a/libexec/flua/lfbsd/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-SHLIB_NAME= fbsd.so
-WARNS?= 3
-
-.include "Makefile.inc"
-.include <bsd.lib.mk>
diff --git a/libexec/flua/lfbsd/Makefile.inc b/libexec/flua/lfbsd/Makefile.inc
deleted file mode 100644
index 7a78ef82e0fc..000000000000
--- a/libexec/flua/lfbsd/Makefile.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-.PATH: ${.PARSEDIR}
-SRCS+= lfbsd.c
diff --git a/libexec/flua/lfs/Makefile b/libexec/flua/lfs/Makefile
deleted file mode 100644
index 3df83d6d2fc1..000000000000
--- a/libexec/flua/lfs/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-SHLIB_NAME= lfs.so
-WARNS?= 3
-
-.include "Makefile.inc"
-.include <bsd.lib.mk>
diff --git a/libexec/flua/lfs/Makefile.inc b/libexec/flua/lfs/Makefile.inc
deleted file mode 100644
index 9d40c42dc0e6..000000000000
--- a/libexec/flua/lfs/Makefile.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-.PATH: ${.PARSEDIR}
-SRCS+= lfs.c
diff --git a/libexec/flua/libhash/lhash.c b/libexec/flua/libhash/lhash.c
index f455f006bf27..7127ddc1d530 100644
--- a/libexec/flua/libhash/lhash.c
+++ b/libexec/flua/libhash/lhash.c
@@ -178,6 +178,4 @@ luaopen_hash(lua_State *L)
return 1;
}
-#ifndef _STANDALONE
FLUA_MODULE(hash);
-#endif
diff --git a/libexec/flua/linit_flua.c b/libexec/flua/linit_flua.c
index 161f030923d3..027f1b305d09 100644
--- a/libexec/flua/linit_flua.c
+++ b/libexec/flua/linit_flua.c
@@ -33,6 +33,9 @@
#include "lualib.h"
#include "lauxlib.h"
+#include "lfs.h"
+#include "lposix.h"
+#include "lfbsd.h"
#include "bootstrap.h"
@@ -54,6 +57,10 @@ 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}
};
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/lfbsd/lfbsd.c b/libexec/flua/modules/lfbsd.c
similarity index 99%
rename from libexec/flua/lfbsd/lfbsd.c
rename to libexec/flua/modules/lfbsd.c
index 541b6c9611df..ef660ba9fd77 100644
--- a/libexec/flua/lfbsd/lfbsd.c
+++ b/libexec/flua/modules/lfbsd.c
@@ -40,8 +40,6 @@
#include "lauxlib.h"
#include "lfbsd.h"
-#include "bootstrap.h"
-
#define FBSD_PROCESSHANDLE "fbsd_process_t*"
struct fbsd_process {
@@ -285,5 +283,3 @@ luaopen_fbsd(lua_State *L)
return (1);
}
-
-FLUA_MODULE(fbsd);
diff --git a/libexec/flua/lfbsd/lfbsd.h b/libexec/flua/modules/lfbsd.h
similarity index 100%
rename from libexec/flua/lfbsd/lfbsd.h
rename to libexec/flua/modules/lfbsd.h
diff --git a/libexec/flua/lfs/lfs.c b/libexec/flua/modules/lfs.c
similarity index 99%
rename from libexec/flua/lfs/lfs.c
rename to libexec/flua/modules/lfs.c
index 517e16ae65c8..8cb8d6fc9fed 100644
--- a/libexec/flua/lfs/lfs.c
+++ b/libexec/flua/modules/lfs.c
@@ -66,9 +66,8 @@
#ifdef _STANDALONE
#include "lstd.h"
#include "lutils.h"
-#endif
-
#include "bootstrap.h"
+#endif
#ifndef nitems
#define nitems(x) (sizeof((x)) / sizeof((x)[0]))
@@ -447,7 +446,3 @@ luaopen_lfs(lua_State *L)
#endif
return 1;
}
-
-#ifndef _STANDALONE
-FLUA_MODULE(lfs);
-#endif
diff --git a/libexec/flua/lfs/lfs.h b/libexec/flua/modules/lfs.h
similarity index 100%
rename from libexec/flua/lfs/lfs.h
rename to libexec/flua/modules/lfs.h
diff --git a/libexec/flua/lposix/lposix.c b/libexec/flua/modules/lposix.c
similarity index 99%
rename from libexec/flua/lposix/lposix.c
rename to 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
similarity index 100%
rename from libexec/flua/lposix/lposix.h
rename to libexec/flua/modules/lposix.h
diff --git a/stand/liblua/Makefile b/stand/liblua/Makefile
index b1c34ec0a466..ce7eb89fe494 100644
--- a/stand/liblua/Makefile
+++ b/stand/liblua/Makefile
@@ -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}/lfs
+.PATH: ${FLUASRC}/modules
SRCS+= lfs.c
.PATH: ${FLUALIB}/libhash
SRCS+= lhash.c
diff --git a/stand/loader.mk b/stand/loader.mk
index e26ba1401912..4073e523e552 100644
--- a/stand/loader.mk
+++ b/stand/loader.mk
@@ -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}/lfs
+CFLAGS.interp_lua.c= -DLUA_PATH=\"${LUAPATH}\" -I${FLUASRC}/modules
.elif ${LOADER_INTERP} == "4th"
SRCS+= interp_forth.c
.include "${BOOTSRC}/ficl.mk"