Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 May 2020 00:25:44 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r360677 - stable/12/lib/liblua
Message-ID:  <202005060025.0460PinQ017456@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: emaste
Date: Wed May  6 00:25:43 2020
New Revision: 360677
URL: https://svnweb.freebsd.org/changeset/base/360677

Log:
  MFC r360460: 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.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  stable/12/lib/liblua/Makefile
  stable/12/lib/liblua/luaconf.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/lib/liblua/Makefile
==============================================================================
--- stable/12/lib/liblua/Makefile	Tue May  5 21:50:52 2020	(r360676)
+++ stable/12/lib/liblua/Makefile	Wed May  6 00:25:43 2020	(r360677)
@@ -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: stable/12/lib/liblua/luaconf.h
==============================================================================
--- stable/12/lib/liblua/luaconf.h	Tue May  5 21:50:52 2020	(r360676)
+++ stable/12/lib/liblua/luaconf.h	Wed May  6 00:25:43 2020	(r360677)
@@ -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			/* } */
 
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202005060025.0460PinQ017456>