Skip to content

Commit

Permalink
refactor(core): Use autoconf var that doesn't conflate an env var
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed Jun 10, 2024
1 parent 1e5c40f commit ed67779
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -263,13 +263,13 @@ AC_SUBST([SILE_PATH])

# In order for our Rust CLI binary to use the same default package.path as the system Lua,
# we test the system Lua (required only at build not run time) for its current package.path.
adl_RECURSIVE_EVAL(["$(${LUA} -e 'print(package.path)')"], [LUA_PATH])
AC_DEFINE_UNQUOTED([LUA_PATH], ["${LUA_PATH}"],[System Lua package path])
AC_SUBST([LUA_PATH])
adl_RECURSIVE_EVAL(["$(${LUA} -e 'print(package.path)')"], [SYSTEM_LUA_PATH])
AC_DEFINE_UNQUOTED([SYSTEM_LUA_PATH], ["${SYSTEM_LUA_PATH}"],[System Lua package path])
AC_SUBST([SYSTEM_LUA_PATH])

adl_RECURSIVE_EVAL(["$(${LUA} -e 'print(package.cpath)')"], [LUA_CPATH])
AC_DEFINE_UNQUOTED([LUA_CPATH], ["${LUA_CPATH}"], [System Lua package cpath])
AC_SUBST([LUA_CPATH])
adl_RECURSIVE_EVAL(["$(${LUA} -e 'print(package.cpath)')"], [SYSTEM_LUA_CPATH])
AC_DEFINE_UNQUOTED([SYSTEM_LUA_CPATH], ["${SYSTEM_LUA_CPATH}"], [System Lua package cpath])
AC_SUBST([SYSTEM_LUA_CPATH])

adl_RECURSIVE_EVAL(["${libdir}/${TRANSFORMED_PACKAGE_NAME}"], [SILE_LIB_PATH])
AC_DEFINE_UNQUOTED([SILE_LIB_PATH],["${SILE_LIB_PATH}"], [Path for SILE libraries])
Expand Down
8 changes: 4 additions & 4 deletions core/pathsetup.lua.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- Allow autoconf to setup system lua paths at compile time, not run time (only used in developer mode)
if "@LUA_PATH@" ~= "" then
package.path = "@LUA_PATH@"
package.cpath = "@LUA_CPATH@"
-- Allow autoconf to setup system lua paths at compile time, not run time (only used in developer mode).
if "@SYSTEM_LUA_PATH@" ~= "" then
package.path = "@SYSTEM_LUA_PATH@"
package.cpath = "@SYSTEM_LUA_CPATH@"
end

-- In the event the user has exported Lua environment variables, use them like a system Lua VM would.
Expand Down

0 comments on commit ed67779

Please sign in to comment.