summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2013-07-05 11:32:49 +0200
committerPhilipp Gesang <phg42.2a@gmail.com>2013-07-05 11:32:49 +0200
commit566c10a7197c4977cc698ed230ac2ac09260f329 (patch)
tree6fb1cbe9d66736e74445f030a278d7b0b47ffb04
parent4bfa9bd8a45f244272910772b147d7caa50b4bc1 (diff)
downloadluaotfload-566c10a7197c4977cc698ed230ac2ac09260f329.tar.gz
add detection for luajittex interpreter
-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