Add an internal liblua and use it in flua.

The new liblua will be used in a forthcoming import of kyua.

Reviewed by:	kevans
Obtained from:	CheriBSD
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D24090
This commit is contained in:
Brooks Davis 2020-03-17 17:28:12 +00:00
parent 5a2c0ab18b
commit 564b9ff2a7
6 changed files with 39 additions and 14 deletions

View File

@ -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

View File

@ -61,6 +61,7 @@ SUBDIR= ${SUBDIR_BOOTSTRAP} \
libjail \
libkiconv \
libkvm \
liblua \
liblzma \
libmemstat \
libmd \

29
lib/liblua/Makefile Normal file
View File

@ -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>

View File

@ -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>

View File

@ -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