From 5d6292787b62bdb47516a50f2a983a631ccd08c1 Mon Sep 17 00:00:00 2001 From: Thijs Schreijer Date: Thu, 2 May 2013 10:08:24 +0200 Subject: fix: if interpreter has no runtime, check link library for runtime used. --- install.bat | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/install.bat b/install.bat index 28236707..5bed6bbd 100644 --- a/install.bat +++ b/install.bat @@ -264,8 +264,8 @@ local function look_for_headers (directory) return false end -local function get_runtime() - local infile = vars.LUA_BINDIR .."\\"..vars.LUA_INTERPRETER +local function get_file_runtime(p,f) -- path, filename + local infile = p.."\\"..f local outfile = "output.txt" local content -- analyze binary @@ -279,7 +279,7 @@ local function get_runtime() os.remove(outfile) if not content then print(" Failed to analyze "..infile.." for the runtime used") - return false + return nil end -- lookup @@ -290,11 +290,21 @@ local function get_runtime() end if result then - vars.LUA_RUNTIME = result - print(" "..vars.LUA_INTERPRETER.." uses "..tostring(result)..".DLL as runtime") - return true + print(" "..f.." uses "..tostring(result)..".DLL as runtime") + else + print(" No runtime found for "..f) end - return false + return result +end + +local function get_runtime() + -- first check interpreter + vars.LUA_RUNTIME = get_file_runtime(vars.LUA_BINDIR, vars.LUA_INTERPRETER) + if not vars.LUA_RUNTIME then + -- not found, check link library + vars.LUA_RUNTIME = get_file_runtime(vars.LUA_LIBDIR, vars.LUA_LIBNAME) + end + return (vars.LUA_RUNTIME ~= nil) end local function look_for_lua_install () -- cgit v1.2.3-55-g6feb