summaryrefslogtreecommitdiff
path: root/luaotfload-tool.lua
diff options
context:
space:
mode:
Diffstat (limited to 'luaotfload-tool.lua')
-rwxr-xr-xluaotfload-tool.lua16
1 files 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