ASF Bugzilla – Attachment 37379 Details for
Bug 64591
Failing to build mod_lua with Lua 5.4
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Lua54 diff
mod_lua-64591.diff (text/plain), 5.87 KB, created by
Giovanni Bechis
on 2020-08-01 14:51:58 UTC
(
hide
)
Description:
Lua54 diff
Filename:
MIME Type:
Creator:
Giovanni Bechis
Created:
2020-08-01 14:51:58 UTC
Size:
5.87 KB
patch
obsolete
>Index: modules/lua/config.m4 >=================================================================== >--- modules/lua/config.m4 (revision 1880501) >+++ modules/lua/config.m4 (working copy) >@@ -34,7 +34,7 @@ > fi > ]) > >-dnl Check for Lua 5.3/5.2/5.1 Libraries >+dnl Check for Lua 5.4/5.3/5.2/5.1 Libraries > dnl CHECK_LUA(ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]) > dnl Sets: > dnl LUA_CFLAGS >@@ -44,7 +44,7 @@ > > AC_ARG_WITH( > lua, >- [AC_HELP_STRING([--with-lua=PATH],[Path to the Lua 5.3/5.2/5.1 prefix])], >+ [AC_HELP_STRING([--with-lua=PATH],[Path to the Lua 5.4/5.3/5.2/5.1 prefix])], > lua_path="$withval", > :) > >@@ -55,7 +55,7 @@ > test_paths="${lua_path}" > fi > >-for pklua in lua lua5.3 lua5.2 lua5.1; do >+for pklua in lua lua5.4 lua5.3 lua5.2 lua5.1; do > if test -n "$PKGCONFIG" -a -z "$lua_path" \ > && $PKGCONFIG --atleast-version=5.1 $pklua; then > LUA_LIBS="`$PKGCONFIG --libs $pklua`" >@@ -70,6 +70,10 @@ > AC_CHECK_LIB(m, pow, lib_m="-lm") > AC_CHECK_LIB(m, sqrt, lib_m="-lm") > for x in $test_paths ; do >+ CHECK_LUA_PATH([${x}], [include/lua-5.4], [lib/lua-5.4], [lua-5.4]) >+ CHECK_LUA_PATH([${x}], [include/lua5.4], [lib], [lua5.4]) >+ CHECK_LUA_PATH([${x}], [include/lua54], [lib/lua54], [lua]) >+ > CHECK_LUA_PATH([${x}], [include/lua-5.3], [lib/lua-5.3], [lua-5.3]) > CHECK_LUA_PATH([${x}], [include/lua5.3], [lib], [lua5.3]) > CHECK_LUA_PATH([${x}], [include/lua53], [lib/lua53], [lua]) >@@ -90,13 +94,13 @@ > AC_SUBST(LUA_CFLAGS) > > if test -z "${LUA_LIBS}"; then >- AC_MSG_WARN([*** Lua 5.3 5.2 or 5.1 library not found.]) >+ AC_MSG_WARN([*** Lua 5.4 5.3 5.2 or 5.1 library not found.]) > ifelse([$2], , > enable_lua="no" > if test -z "${lua_path}"; then >- AC_MSG_WARN([Lua 5.3 5.2 or 5.1 library is required]) >+ AC_MSG_WARN([Lua 5.4 5.3 5.2 or 5.1 library is required]) > else >- AC_MSG_ERROR([Lua 5.3 5.2 or 5.1 library is required]) >+ AC_MSG_ERROR([Lua 5.4 5.3 5.2 or 5.1 library is required]) > fi, > $2) > else >Index: modules/lua/mod_lua.c >=================================================================== >--- modules/lua/mod_lua.c (revision 1880501) >+++ modules/lua/mod_lua.c (working copy) >@@ -349,7 +349,11 @@ > &lua_module); > const ap_lua_dir_cfg *cfg = ap_get_module_config(r->per_dir_config, > &lua_module); >- >+ >+#if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 504 >+ int nres; >+#endif >+ > ctx = apr_pcalloc(r->pool, sizeof(lua_filter_ctx)); > ctx->broken = 0; > *c = ctx; >@@ -410,7 +414,11 @@ > /* If a Lua filter is interested in filtering a request, it must first do a yield, > * otherwise we'll assume that it's not interested and pretend we didn't find it. > */ >+#if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 504 >+ rc = lua_resume(L, 1, &nres); >+#else > rc = lua_resume(L, 1); >+#endif > if (rc == LUA_YIELD) { > if (f->frec->providers == NULL) { > /* Not wired by mod_filter */ >@@ -438,7 +446,10 @@ > conn_rec *c = r->connection; > apr_bucket *pbktIn; > apr_status_t rv; >- >+ >+#if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 504 >+ int nres; >+#endif > /* Set up the initial filter context and acquire the function. > * The corresponding Lua function should yield here. > */ >@@ -490,9 +501,14 @@ > /* Push the bucket onto the Lua stack as a global var */ > lua_pushlstring(L, data, len); > lua_setglobal(L, "bucket"); >- >+ > /* If Lua yielded, it means we have something to pass on */ >- if (lua_resume(L, 0) == LUA_YIELD) { >+#if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 504 >+ rc = lua_resume(L, 0, &nres); >+#else >+ rc = lua_resume(L, 0); >+#endif >+ if (rc == LUA_YIELD) { > size_t olen; > const char* output = lua_tolstring(L, 1, &olen); > if (olen > 0) { >@@ -524,7 +540,12 @@ > apr_bucket *pbktEOS; > lua_pushnil(L); > lua_setglobal(L, "bucket"); >- if (lua_resume(L, 0) == LUA_YIELD) { >+#if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 504 >+ rc = lua_resume(L, 0, &nres); >+#else >+ rc = lua_resume(L, 0); >+#endif >+ if (rc == LUA_YIELD) { > apr_bucket *pbktOut; > size_t olen; > const char* output = lua_tolstring(L, 1, &olen); >@@ -563,7 +584,10 @@ > lua_filter_ctx* ctx; > conn_rec *c = r->connection; > apr_status_t ret; >- >+ >+#if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 504 >+ int nres; >+#endif > /* Set up the initial filter context and acquire the function. > * The corresponding Lua function should yield here. > */ >@@ -621,7 +645,12 @@ > lua_setglobal(L, "bucket"); > > /* If Lua yielded, it means we have something to pass on */ >- if (lua_resume(L, 0) == LUA_YIELD) { >+#if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 504 >+ rc = lua_resume(L, 0, &nres); >+#else >+ rc = lua_resume(L, 0); >+#endif >+ if (rc == LUA_YIELD) { > size_t olen; > const char* output = lua_tolstring(L, 1, &olen); > pbktOut = apr_bucket_heap_create(output, olen, 0, c->bucket_alloc); >@@ -643,7 +672,12 @@ > apr_bucket *pbktEOS = apr_bucket_eos_create(c->bucket_alloc); > lua_pushnil(L); > lua_setglobal(L, "bucket"); >- if (lua_resume(L, 0) == LUA_YIELD) { >+#if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 504 >+ rc = lua_resume(L, 0, &nres); >+#else >+ rc = lua_resume(L, 0); >+#endif >+ if (rc == LUA_YIELD) { > apr_bucket *pbktOut; > size_t olen; > const char* output = lua_tolstring(L, 1, &olen);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 64591
: 37379