diff options
| author | Thijs Schreijer <thijs@thijsschreijer.nl> | 2013-05-02 10:08:24 +0200 |
|---|---|---|
| committer | Thijs Schreijer <thijs@thijsschreijer.nl> | 2013-05-02 10:08:24 +0200 |
| commit | 5d6292787b62bdb47516a50f2a983a631ccd08c1 (patch) | |
| tree | e984e3e90ff1192045fbc64687e31001509d7099 | |
| parent | 95233053d0fefc1234541f94a99e6c3ce1d807b5 (diff) | |
| download | luarocks-5d6292787b62bdb47516a50f2a983a631ccd08c1.tar.gz luarocks-5d6292787b62bdb47516a50f2a983a631ccd08c1.tar.bz2 luarocks-5d6292787b62bdb47516a50f2a983a631ccd08c1.zip | |
fix: if interpreter has no runtime, check link library for runtime used.
| -rw-r--r-- | install.bat | 24 |
1 files 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) | |||
| 264 | return false | 264 | return false |
| 265 | end | 265 | end |
| 266 | 266 | ||
| 267 | local function get_runtime() | 267 | local function get_file_runtime(p,f) -- path, filename |
| 268 | local infile = vars.LUA_BINDIR .."\\"..vars.LUA_INTERPRETER | 268 | local infile = p.."\\"..f |
| 269 | local outfile = "output.txt" | 269 | local outfile = "output.txt" |
| 270 | local content | 270 | local content |
| 271 | -- analyze binary | 271 | -- analyze binary |
| @@ -279,7 +279,7 @@ local function get_runtime() | |||
| 279 | os.remove(outfile) | 279 | os.remove(outfile) |
| 280 | if not content then | 280 | if not content then |
| 281 | print(" Failed to analyze "..infile.." for the runtime used") | 281 | print(" Failed to analyze "..infile.." for the runtime used") |
| 282 | return false | 282 | return nil |
| 283 | end | 283 | end |
| 284 | 284 | ||
| 285 | -- lookup | 285 | -- lookup |
| @@ -290,11 +290,21 @@ local function get_runtime() | |||
| 290 | end | 290 | end |
| 291 | 291 | ||
| 292 | if result then | 292 | if result then |
| 293 | vars.LUA_RUNTIME = result | 293 | print(" "..f.." uses "..tostring(result)..".DLL as runtime") |
| 294 | print(" "..vars.LUA_INTERPRETER.." uses "..tostring(result)..".DLL as runtime") | 294 | else |
| 295 | return true | 295 | print(" No runtime found for "..f) |
| 296 | end | 296 | end |
| 297 | return false | 297 | return result |
| 298 | end | ||
| 299 | |||
| 300 | local function get_runtime() | ||
| 301 | -- first check interpreter | ||
| 302 | vars.LUA_RUNTIME = get_file_runtime(vars.LUA_BINDIR, vars.LUA_INTERPRETER) | ||
| 303 | if not vars.LUA_RUNTIME then | ||
| 304 | -- not found, check link library | ||
| 305 | vars.LUA_RUNTIME = get_file_runtime(vars.LUA_LIBDIR, vars.LUA_LIBNAME) | ||
| 306 | end | ||
| 307 | return (vars.LUA_RUNTIME ~= nil) | ||
| 298 | end | 308 | end |
| 299 | 309 | ||
| 300 | local function look_for_lua_install () | 310 | local function look_for_lua_install () |
