8
8
# error unsupported Lua language version
10
10
(void) luaL_newstate();"
12
14
if [ -n "$LUAJIT_INC" -o -n "$LUAJIT_LIB" ]; then
13
# explicitly set Lua lib path
14
ngx_feature="LuaJIT library in $LUAJIT_LIB and $LUAJIT_INC (specified by the LUAJIT_LIB and LUAJIT_INC env)"
15
# explicitly set LuaJIT paths
17
# attempt to link with -ldl, static linking on Linux requires it.
18
ngx_feature="LuaJIT library in $LUAJIT_LIB and $LUAJIT_INC (specified by the LUAJIT_LIB and LUAJIT_INC env, with -ldl)"
15
19
ngx_feature_path="$LUAJIT_INC"
20
ngx_lua_opt_I="-I$LUAJIT_INC"
21
ngx_lua_opt_L="-L$LUAJIT_LIB"
16
22
if [ $NGX_RPATH = YES ]; then
17
ngx_feature_libs="-R$LUAJIT_LIB -L$LUAJIT_LIB -lluajit-5.1 -lm"
23
ngx_feature_libs="-R$LUAJIT_LIB $ngx_lua_opt_L -lluajit-5.1 -lm -ldl"
19
ngx_feature_libs="-L$LUAJIT_LIB -lluajit-5.1 -lm"
25
ngx_feature_libs="$ngx_lua_opt_L -lluajit-5.1 -lm -ldl"
24
30
if [ $ngx_found = no ]; then
25
# retry with -ldl, static linking on Linux requires it.
26
ngx_feature="LuaJIT library in $LUAJIT_LIB and $LUAJIT_INC (specified by the LUAJIT_LIB and LUAJIT_INC env, with -ldl)"
32
ngx_feature="LuaJIT library in $LUAJIT_LIB and $LUAJIT_INC (specified by the LUAJIT_LIB and LUAJIT_INC env)"
27
33
ngx_feature_path="$LUAJIT_INC"
34
ngx_lua_opt_I="-I$LUAJIT_INC"
35
ngx_lua_opt_L="-L$LUAJIT_LIB"
28
36
if [ $NGX_RPATH = YES ]; then
29
ngx_feature_libs="-R$LUAJIT_LIB -L$LUAJIT_LIB -lluajit-5.1 -lm -ldl"
37
ngx_feature_libs="-R$LUAJIT_LIB $ngx_lua_opt_L -lluajit-5.1 -lm"
31
ngx_feature_libs="-L$LUAJIT_LIB -lluajit-5.1 -lm -ldl"
39
ngx_feature_libs="$ngx_lua_opt_L -lluajit-5.1 -lm"
61
69
if [ -n "$LUA_INC" -o -n "$LUA_LIB" ]; then
62
# explicitly set Lua lib path
70
# explicitly set Lua paths
63
71
ngx_feature="Lua library in $LUA_LIB and $LUA_INC (specified by the LUA_LIB and LUA_INC env)"
64
72
ngx_feature_path="$LUA_INC"
73
ngx_lua_opt_I="-I$LUA_INC"
74
ngx_lua_opt_L="-L$LUA_LIB"
65
75
if [ $NGX_RPATH = YES ]; then
66
ngx_feature_libs="-R$LUA_LIB -L$LUA_LIB -llua -lm"
76
ngx_feature_libs="-R$LUA_LIB $ngx_lua_opt_L -llua -lm -ldl"
68
ngx_feature_libs="-L$LUA_LIB -llua -lm"
78
ngx_feature_libs="$ngx_lua_opt_L -llua -lm -ldl"
73
83
if [ $ngx_found = no ]; then
86
ngx_feature_path="$LUA_INC"
87
ngx_lua_opt_I="-I$LUA_INC"
88
ngx_lua_opt_L="-L$LUA_LIB"
89
if [ $NGX_RPATH = YES ]; then
90
ngx_feature_libs="-R$LUA_LIB $ngx_lua_opt_L -llua -lm"
92
ngx_feature_libs="$ngx_lua_opt_L -llua -lm"
98
if [ $ngx_found = no ]; then
75
100
$0: error: ngx_http_lua_module requires the Lua or LuaJIT library and LUA_LIB is defined as $LUA_LIB and LUA_INC (path for lua.h) is $LUA_INC, but we cannot find standard Lua there.
169
194
if [ $ngx_found = no ]; then
170
# Gentoo with LuaJIT-2.0
195
# Gentoo with LuaJIT-2.0, try with -ldl
196
ngx_feature="LuaJIT library in /usr/"
197
ngx_feature_path="/usr/include/luajit-2.0"
198
if [ $NGX_RPATH = YES ]; then
199
ngx_feature_libs="-R/usr/lib -L/usr/lib -lm -lluajit-5.1 -ldl"
201
ngx_feature_libs="-L/usr/lib -lm -lluajit-5.1 -ldl"
206
if [ $ngx_found = no ]; then
207
# Gentoo with LuaJIT 2.0
171
208
ngx_feature="LuaJIT library in /usr/"
172
209
ngx_feature_path="/usr/include/luajit-2.0"
173
210
if [ $NGX_RPATH = YES ]; then
181
if [ $ngx_found = no ]; then
182
# Gentoo with LuaJIT-2.0, retry with -ldl
183
ngx_feature="LuaJIT library in /usr/"
184
ngx_feature_path="/usr/include/luajit-2.0"
185
if [ $NGX_RPATH = YES ]; then
186
ngx_feature_libs="-R/usr/lib -L/usr/lib -lm -lluajit-5.1 -ldl"
188
ngx_feature_libs="-L/usr/lib -lm -lluajit-5.1 -ldl"
195
220
if [ $ngx_found = yes ]; then
221
# this is a hack to persuade nginx's build system to favor
222
# the paths set by our user environments:
223
CFLAGS="$ngx_lua_opt_I $CFLAGS"
224
NGX_LD_OPT="$ngx_lua_opt_L $NGX_LD_OPT"
196
226
CORE_INCS="$CORE_INCS $ngx_feature_path"
197
227
CORE_LIBS="$CORE_LIBS $ngx_feature_libs"