开发者

How to configure mod_lua (apache) to use LuaJIT?

开发者 https://www.devze.com 2023-03-07 19:09 出处:网络
How do I configure mod_lua to use LuaJIT, instead of just plain 开发者_JAVA百科Lua?I was able to compile Apache 2.3 and link mod_lua against LuaJIT 2.0b6 like this:

How do I configure mod_lua to use LuaJIT, instead of just plain 开发者_JAVA百科Lua?


I was able to compile Apache 2.3 and link mod_lua against LuaJIT 2.0b6 like this:

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, even though there's an --enable-luajit configuration flag, the mod_lua config.m4 script only looks for lua libraries by default.

If you built LuaJIT as a dynamic library as well as a static library, you may want to explicitly link it statically:

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

(You may have to change the paths depending on which version of LuaJIT you have installed, and where. Caveat lector: I didn't actually install and test the results of this.)

0

精彩评论

暂无评论...
验证码 换一张
取 消