freebsd-src/lib/liblua/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

37 lines
1.1 KiB
Makefile

#! $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}\""
.if defined(BOOTSTRAPPING)
CFLAGS+= -DLUA_PATH_DEFAULT="\"/nonexistent/?.lua\""
CFLAGS+= -DLUA_CPATH_DEFAULT="\"/nonexistent/?.so\""
# We don't support dynamic libs on bootstrap builds.
CFLAGS+= -DBOOTSTRAPPING
.endif
.include <bsd.lib.mk>