Author: emaste
Date: Wed Apr 29 13:41:32 2020
New Revision: 360460
URL: https://svnweb.freebsd.org/changeset/base/360460

Log:
  liblua: ensure that "require" will fail in bootstrap flua
  
  We do not want to support bootstrapping lua modules, so ensure that
  require will fail by providing a nonexistent path.
  
  Reviewed by:  kevans
  MFC after:    1 week
  Sponsored by: The FreeBSD Foundation
  Differential Revision:        https://reviews.freebsd.org/D24610

Modified:
  head/lib/liblua/Makefile
  head/lib/liblua/luaconf.h

Modified: head/lib/liblua/Makefile
==============================================================================
--- head/lib/liblua/Makefile    Wed Apr 29 11:46:01 2020        (r360459)
+++ head/lib/liblua/Makefile    Wed Apr 29 13:41:32 2020        (r360460)
@@ -26,4 +26,9 @@ SRCS+=        lauxlib.c lbaselib.c lbitlib.c lcorolib.c ldbli
 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\""
+.endif
+
 .include <bsd.lib.mk>

Modified: head/lib/liblua/luaconf.h
==============================================================================
--- head/lib/liblua/luaconf.h   Wed Apr 29 11:46:01 2020        (r360459)
+++ head/lib/liblua/luaconf.h   Wed Apr 29 13:41:32 2020        (r360460)
@@ -208,12 +208,16 @@
 #define LUA_ROOT       "/usr/local/"
 #define LUA_LDIR       LUA_ROOT "share/lua/" LUA_VDIR "/"
 #define LUA_CDIR       LUA_ROOT "lib/lua/" LUA_VDIR "/"
+#if !defined(LUA_PATH_DEFAULT)
 #define LUA_PATH_DEFAULT  \
                LUA_LDIR"?.lua;"  LUA_LDIR"?/init.lua;" \
                LUA_CDIR"?.lua;"  LUA_CDIR"?/init.lua;" \
                "./?.lua;" "./?/init.lua"
+#endif
+#if !defined(LUA_CPATH_DEFAULT)
 #define LUA_CPATH_DEFAULT \
                LUA_CDIR"?.so;" LUA_CDIR"loadall.so;" "./?.so"
+#endif
 #endif                 /* } */
 
 
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to