Skip to content

Commit 3a37c9c

Browse files
committed
bugfix: FFI availability feature test was broken on Windows.
bugfix: we now avoided passing -DLUA_DEFAULT_PATH=... and -DLUA_DEFAULT_CPATH=... options via CFLAGS. This is know to cause problems in some cases. openresty/openresty#587. bugfix: some LuaJIT related feature tests may cause unwanted C compiler errors due to `#endif;`.
1 parent 38f587a commit 3a37c9c

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

config

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,8 @@ ngx_feature_run=no
178178
ngx_feature_incs="#include <luajit.h>"
179179
ngx_feature_test="#if !defined(LUAJIT_VERSION_NUM) || LUAJIT_VERSION_NUM < 20000
180180
# error unsupported LuaJIT version
181-
#endif"
181+
#endif
182+
"
182183

183184
. auto/feature
184185

@@ -196,7 +197,8 @@ ngx_feature_run=no
196197
ngx_feature_incs="#include <lua.h>"
197198
ngx_feature_test="#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM != 501
198199
# error unsupported Lua language version
199-
#endif"
200+
#endif
201+
"
200202

201203
. auto/feature
202204

@@ -210,8 +212,8 @@ fi
210212
# ----------------------------------------
211213

212214
ngx_feature="LuaJIT has FFI"
213-
ngx_feature_libs="$LUAJIT_LIB/libluajit-5.1.a $luajit_ld_opt"
214-
ngx_feature_run=yes
215+
ngx_feature_libs="$ngx_module_libs"
216+
ngx_feature_run=no
215217
ngx_feature_incs="#include <lualib.h>
216218
#include <lauxlib.h>
217219
#include <assert.h>"
@@ -295,6 +297,7 @@ HTTP_LUA_SRCS=" \
295297

296298
HTTP_LUA_DEPS=" \
297299
$ngx_addon_dir/src/ddebug.h \
300+
$ngx_addon_dir/src/ngx_http_lua_autoconf.h \
298301
$ngx_addon_dir/src/ngx_http_lua_script.h \
299302
$ngx_addon_dir/src/ngx_http_lua_log.h \
300303
$ngx_addon_dir/src/ngx_http_lua_subrequest.h \
@@ -554,5 +557,5 @@ NGX_TAPSET_SRCS="$NGX_TAPSET_SRCS $ngx_addon_dir/tapset/ngx_lua.stp"
554557
CORE_INCS="$CORE_INCS $ngx_addon_dir/src/api"
555558

556559
CFLAGS="$CFLAGS -DNDK_SET_VAR"
557-
#CFLAGS=$"$CFLAGS -DLUA_DEFAULT_PATH='\"/usr/local/openresty/lualib/?.lua\"'"
558-
#CFLAGS=$"$CFLAGS -DLUA_DEFAULT_CPATH='\"/usr/local/openresty/lualib/?.so\"'"
560+
561+
echo "/* DO NOT EDIT! This file was automatically generated by config */" > "$ngx_addon_dir/src/ngx_http_lua_autoconf.h"

src/ngx_http_lua_common.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#define _NGX_HTTP_LUA_COMMON_H_INCLUDED_
1010

1111

12+
#include "ngx_http_lua_autoconf.h"
13+
1214
#include <nginx.h>
1315
#include <ngx_core.h>
1416
#include <ngx_http.h>

0 commit comments

Comments
 (0)