How to configure mod_lua (apache) to use LuaJIT?

How to configure mod_lua to use LuaJIT and not just Lua ?

+3
source share
1 answer

I was able to compile Apache 2.3 and bundle mod_lua with LuaJIT 2.0b6 as follows:

LUA_LIBS="-L/usr/local/lib -lluajit-51 -lm" \
LUA_CFLAGS="-I/usr/local/include/luajit-2.0" \
./configure --prefix=/usr/local \
    --enable-lua --with-lua=/dev/null --enable-luajit
make

As far as I can tell, although there is a configuration flag --enable-luajit, the mod_lua config.m4 script is looking for lua libraries by default.

If you created LuaJIT both a dynamic library and a static library, you can explicitly link it statically:

LUA_LIBS="/usr/local/lib/libluajit-5.1.a -lm"

(, , LuaJIT , . Caveat lector: .)

+3

All Articles