From 566c10a7197c4977cc698ed230ac2ac09260f329 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Fri, 5 Jul 2013 11:32:49 +0200 Subject: add detection for luajittex interpreter --- luaotfload-tool.lua | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/luaotfload-tool.lua b/luaotfload-tool.lua index 83fb3e0..4d3b411 100755 --- a/luaotfload-tool.lua +++ b/luaotfload-tool.lua @@ -36,11 +36,19 @@ see the luaotfload documentation for more info. Report bugs to --doc]]-- -kpse.set_program_name"luatex" +kpse.set_program_name "luatex" -if _G.getfenv then - local oldscript = kpse.find_file "luaotfload-legacy-tool.lua" - return require(oldscript) +local runtime +if _G.getfenv ~= nil then -- 5.1 or LJ + if _G.jit ~= nil then + runtime = { "jit", jit.version } + else + runtime = { "stock", _VERSION } + local oldscript = kpse.find_file "luaotfload-legacy-tool.lua" + return require (oldscript) + end +else -- 5.2 + runtime = { "stock", _VERSION } end local stringexplode = string.explode -- cgit v1.2.3