aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.inc13
-rw-r--r--lib/Makefile1
-rw-r--r--lib/liblua/Makefile29
-rw-r--r--lib/liblua/luaconf.h (renamed from libexec/flua/luaconf.h)0
-rw-r--r--libexec/flua/Makefile15
-rw-r--r--share/mk/src.libnames.mk5
6 files changed, 39 insertions, 14 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1
index 037c562f7cba..08eaa8999c09 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -2165,7 +2165,8 @@ ${_bt}-lib/libdwarf: ${_bt_m4_depend}
# 13.0-CURRENT cycle, thus needs to be built on -older releases and stable
# branches.
.if ${BOOTSTRAPPING} < 1300059
-_flua= libexec/flua
+${_bt}-libexec/flua: ${_bt}-lib/liblua
+_flua= lib/liblua libexec/flua
.endif
# r245440 mtree -N support added
diff --git a/lib/Makefile b/lib/Makefile
index 14f9e4715020..ca881d6b0688 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -61,6 +61,7 @@ SUBDIR= ${SUBDIR_BOOTSTRAP} \
libjail \
libkiconv \
libkvm \
+ liblua \
liblzma \
libmemstat \
libmd \
diff --git a/lib/liblua/Makefile b/lib/liblua/Makefile
new file mode 100644
index 000000000000..40d9c5c924b0
--- /dev/null
+++ b/lib/liblua/Makefile
@@ -0,0 +1,29 @@
+#! $FreeBSD$
+
+LUASRC?= ${SRCTOP}/contrib/lua/src
+.PATH: ${LUASRC}
+
+LIB= lua
+INTERNALLIB=
+WARNS?= 2
+MAN= # No manpage; this is internal.
+
+CWARNFLAGS.gcc+= -Wno-format-nonliteral
+
+LIBADD= m
+
+# Core functions
+SRCS= lapi.c lcode.c lctype.c ldebug.c ldo.c ldump.c lfunc.c lgc.c linit.c \
+ llex.c lmem.c lobject.c lopcodes.c lparser.c lstate.c lstring.c \
+ ltable.c ltm.c lundump.c lvm.c lzio.c
+
+# Library functions; any change to these likely needs an accompanying change
+# in our custom linit_flua.c. We use our custom linit.c to make it easier to
+# support bootstrap flua that may not have supporting local libraries.
+SRCS+= lauxlib.c lbaselib.c lbitlib.c lcorolib.c ldblib.c liolib.c \
+ lmathlib.c loslib.c lstrlib.c ltablib.c lutf8lib.c loadlib.c
+
+CFLAGS+= -I${.CURDIR} -I${.CURDIR}/modules -I${LUASRC}
+CFLAGS+= -DLUA_PROGNAME="\"${PROG}\""
+
+.include <bsd.lib.mk>
diff --git a/libexec/flua/luaconf.h b/lib/liblua/luaconf.h
index f06cba31741c..f06cba31741c 100644
--- a/libexec/flua/luaconf.h
+++ b/lib/liblua/luaconf.h
diff --git a/libexec/flua/Makefile b/libexec/flua/Makefile
index 1d424ed44da6..a3652088b3b5 100644
--- a/libexec/flua/Makefile
+++ b/libexec/flua/Makefile
@@ -11,18 +11,7 @@ MAN= # No manpage; this is internal.
CWARNFLAGS.gcc+= -Wno-format-nonliteral
-LIBADD= m
-
-# Core functions
-SRCS= lapi.c lcode.c lctype.c ldebug.c ldo.c ldump.c lfunc.c lgc.c llex.c \
- lmem.c lobject.c lopcodes.c lparser.c lstate.c lstring.c ltable.c \
- ltm.c lundump.c lvm.c lzio.c
-
-# Library functions; any change to these likely needs an accompanying change
-# in our custom linit_flua.c. We use our custom linit.c to make it easier to
-# support bootstrap flua that may not have supporting local libraries.
-SRCS+= lauxlib.c lbaselib.c lbitlib.c lcorolib.c ldblib.c liolib.c \
- lmathlib.c loslib.c lstrlib.c ltablib.c lutf8lib.c loadlib.c
+LIBADD= lua
# Entry point
SRCS+= lua.c
@@ -32,7 +21,7 @@ SRCS+= lua.c
SRCS+= linit_flua.c
SRCS+= lfs.c lposix.c
-CFLAGS+= -I${.CURDIR} -I${.CURDIR}/modules -I${LUASRC}
+CFLAGS+= -I${SRCTOP}/lib/liblua -I${.CURDIR}/modules -I${LUASRC}
CFLAGS+= -DLUA_PROGNAME="\"${PROG}\""
.include <bsd.prog.mk>
diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk
index ff0e1f5c765d..bc9431f19db9 100644
--- a/share/mk/src.libnames.mk
+++ b/share/mk/src.libnames.mk
@@ -41,6 +41,7 @@ _INTERNALLIBS= \
ifconfig \
ipf \
lpr \
+ lua \
netbsd \
ntp \
ntpevent \
@@ -293,6 +294,7 @@ _DP_memstat= kvm
_DP_magic= z
_DP_mt= sbuf bsdxml
_DP_ldns= ssl crypto
+_DP_lua= m
.if ${MK_OPENSSL} != "no"
_DP_fetch= ssl crypto
.else
@@ -468,6 +470,9 @@ _LIB_OBJTOP?= ${OBJTOP}
LIBELFTCDIR= ${_LIB_OBJTOP}/lib/libelftc
LIBELFTC?= ${LIBELFTCDIR}/libelftc${PIE_SUFFIX}.a
+LIBLUADIR= ${_LIB_OBJTOP}/lib/liblua
+LIBLUA?= ${LIBLUADIR}/liblua${PIE_SUFFIX}.a
+
LIBPEDIR= ${_LIB_OBJTOP}/lib/libpe
LIBPE?= ${LIBPEDIR}/libpe${PIE_SUFFIX}.a