Add support for running respack.lua with system Lua

This commit is contained in:
Thomas Goyne 2016-02-28 09:50:20 -08:00
parent 0ed6dd46fb
commit 4c15d0ba84
5 changed files with 13 additions and 3 deletions

View File

@ -135,4 +135,5 @@ BIN_MKDIR = mkdir
BIN_MKDIR_P = mkdir -p
BIN_ECHO = echo
BIN_TOUCH = touch
BIN_LUA = @LUA@
BIN_WX_CONFIG = @WX_CONFIG_PATH@

View File

@ -396,6 +396,7 @@ AS_IF([test x$with_system_luajit = xno], [],
with_system_luajit="no"])])
# Check if it's compiled in Lua 5.2 mode
# This check can be skipped by manually setting agi_cv_luajit_is_52
AS_IF([test x$with_system_luajit != xno], [
aegisub_save_LIBS="$LIBS"
aegisub_save_CPPFLAGS="$CPPFLAGS"
@ -428,6 +429,14 @@ AS_IF([test $with_system_luajit = no],
[AC_SUBST([LUAJIT_CFLAGS], ['-I$(TOP)vendor/luajit/include'])
AC_SUBST([LUAJIT_LIBS], ['$(TOP)vendor/luajit/src/libluajit.a'])])
# We also need a Lua binary to run part of the build system
# Which version doesn't matter as the scripts are portable between them
AC_CHECK_PROGS([LUA], [lua luajit lua5.3 lua-5.3 lua5.2 lua-5.2 lua5.1 lua-5.1])
# If the user doesn't have an installed copy of Lua, just use the one built
# as part of building LuaJIT
AS_IF([test -z $LUA], [LUA="$srcdir/vendor/luajit/src/host/minilua"])
######################################################
# Debugging support
######################################################

View File

@ -10,7 +10,7 @@ resrc_OBJ := \
$(resrc_OBJ): $(d)default_config.h $(d)bitmap.h $(d)default_config.cpp $(d)bitmap.cpp
RESPACK := cd $(TOP)src/libresrc; $(TOP)vendor/luajit/src/host/minilua $(TOP)tools/respack.lua
RESPACK := cd $(TOP)src/libresrc; $(BIN_LUA) $(TOP)tools/respack.lua
$(d)bitmap.cpp: $(d)bitmap.h
$(d)default_config.cpp: $(d)default_config.h

View File

@ -12,6 +12,6 @@ repack-thes-dict_CPPFLAGS := -I$(TOP) -I$(TOP)libaegisub/include $(CFLAGS_ICU)
PROGRAM += $(d)repack-thes-dict
$(TOP)tools/respack.lua: $(TOP)vendor/luajit/src/host/minilua
$(TOP)tools/respack.lua: $(shell command -v "$(BIN_LUA)")
include $(TOP)Makefile.target

View File

@ -1,4 +1,4 @@
#!../vendor/luajit/src/host/minilua
#!/usr/bin/env luajit
-- Copyright (c) 2014, Thomas Goyne <plorkyeran@aegisub.org>
--
-- Permission to use, copy, modify, and distribute this software for any