neutrino: add luajit

Luajit is a dynamic scripting language completely compatible to lua 5.1. the whole VM has been rewritten from the ground up
and is relentlessly optimized for performance. It combines a high-speed interpreter, written in assembler, with a state-of-the-art JIT compiler.
A substantial reduction of the overhead associated with dynamic languages allows it to break into the performance range traditionally reserved for offline,
static language compilers.

https://luajit.org/luajit.html
https://github.com/LuaJIT/LuaJIT/tree/master

There was additional code needed to enable neutrino to compile against lua 5.1. This was mostly taken from the luaposix compat-headers.
There are still some minor issue that will be easy to fix but it's up and running so damn fast!

Signed-off-by: Markus Volk <f_l_k@t-online.de>
This commit is contained in:
Markus Volk
2020-09-17 12:12:15 +02:00
parent 74fb6d953d
commit 11ae2fa699
5 changed files with 82 additions and 10 deletions

View File

@@ -261,19 +261,20 @@ AC_ARG_ENABLE(lua,
if test "$enable_lua" = "yes"; then
AC_DEFINE(ENABLE_LUA, 1, [include Lua support])
PKG_CHECK_MODULES([LUA], [lua >= 5.2], [
echo "lua >= 5.2 found"
], [
PKG_CHECK_MODULES([LUA], [lua5.2 >= 5.2], [
echo "lua5.2 found"
], [
PKG_CHECK_MODULES(LUA, lua, LLUA="yes", LLUA="no")
PKG_CHECK_MODULES(luajit, luajit, LLUAJIT="yes", LLUAJIT="no")
if test "x$LLUAJIT" = "xyes"; then
LUA_LIBS="-lluajit-5.1"
AC_DEFINE(LUA_COMPAT_5_2, 1, [needed for build with lua 5.1])
elif test "x$LLUA" = "xyes"; then
LUA_LIBS="-llua"
AC_DEFINE(LUA_COMPAT_5_2, 0, [needed for build with lua 5.1])
else
echo "lualib not found, assuming static lua in linker path..."
LUA_LIBS="-llua -ldl"
AC_DEFINE(STATIC_LUAPOSIX, 1, [Define to 1 for static lua build.])
])
])
# hack...
AC_DEFINE(LUA_COMPAT_5_2, 1, [does not really belong in config.h, but is needed for build with lua 5.3+])
AC_DEFINE(LUA_COMPAT_5_2, 0, [needed for build with lua 5.1])
fi
fi
AM_CONDITIONAL(ENABLE_LUA, test "$enable_lua" = "yes")