1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-17 10:26:15 +00:00
freebsd/libexec/flua/Makefile
Kyle Evans 967fbfd9e2 Properly disable LUA_USE_DLOPEN for bootstrap flua
flua does have some specific bits that will include luaconf.h, but the
definition of LUA_USE_DLOPEN for those won't matter. This belongs in liblua
instead.

To expand on my previous commit, which was a little sparse with details,
it's not really safe to allow LUA_USE_DLOPEN with host lib paths being used.
The host system could have an entirely different lua version and this could
cause us to crash and burn.

If we want to revive this later, we need to make sure to define c module
paths inside OBJDIR that are compiled against whatever version we've
bootstrapped.

Pointy hat:	kevans
2020-08-14 02:40:17 +00:00

43 lines
880 B
Makefile

#! $FreeBSD$
.include <src.lua.mk>
LUASRC?= ${SRCTOP}/contrib/lua/src
.PATH: ${LUASRC}
PROG= flua
WARNS?= 2
MAN= # No manpage; this is internal.
CWARNFLAGS.gcc+= -Wno-format-nonliteral
LIBADD= lua
# Entry point
SRCS+= lua.c
# FreeBSD Extensions
.PATH: ${.CURDIR}/modules
SRCS+= linit_flua.c
SRCS+= lfs.c lposix.c
CFLAGS+= -I${SRCTOP}/lib/liblua -I${.CURDIR}/modules -I${LUASRC}
CFLAGS+= -DLUA_PROGNAME="\"${PROG}\""
# readline bits; these aren't needed if we're building a bootstrap flua, as we
# don't expect that one to see any REPL usage.
.if !defined(BOOTSTRAPPING)
CFLAGS+= -DLUA_USE_READLINE
CFLAGS+= -I${SRCTOP}/lib/libedit -I${SRCTOP}/contrib/libedit
LIBADD+= edit
LDFLAGS+= -Wl,-E
.endif
UCLSRC?= ${SRCTOP}/contrib/libucl
.PATH: ${UCLSRC}/lua
SRCS+= lua_ucl.c
CFLAGS+= -I${UCLSRC}/include -I${UCLSRC}/src -I${UCLSRC}/uthash
LIBADD+= ucl
.include <bsd.prog.mk>