[Asterisk-code-review] pbx_lua: Add LUA_VERSIONS environment variable to ./configure. (asterisk[18])

Joshua Colp asteriskteam at digium.com
Wed Jan 6 11:58:46 CST 2021


Joshua Colp has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/15284 )

Change subject: pbx_lua:  Add LUA_VERSIONS environment variable to ./configure.
......................................................................

pbx_lua:  Add LUA_VERSIONS environment variable to ./configure.

On Gentoo it's possible to have multiple lua versions installed, all
with a path of /usr, so it's not possible to use the current --with-lua
option to determisticly pin to a specific version as is required by the
Gentoo PMS standards.

This environment variable allows to lock to specific versions,
unversioned check will be skipped if this variable is supplied.

Change-Id: I8c403eda05df25ee0193960262ce849c7d2fd088
Signed-off-by: Jaco Kroon <jaco at uls.co.za>
---
M configure
M configure.ac
2 files changed, 12 insertions(+), 3 deletions(-)

Approvals:
  George Joseph: Looks good to me, approved
  Joshua Colp: Approved for Submit



diff --git a/configure b/configure
index 98fb6cd..ec7d155 100755
--- a/configure
+++ b/configure
@@ -1051,6 +1051,7 @@
 MISDN_DIR
 MISDN_INCLUDE
 MISDN_LIB
+LUA_VERSIONS
 PBX_LUA
 LUA_DIR
 LUA_INCLUDE
@@ -1477,6 +1478,7 @@
 CXXCPP
 JANSSON_CONFIGURE_OPTS
 PJPROJECT_CONFIGURE_OPTS
+LUA_VERSIONS
 PKG_CONFIG
 PKG_CONFIG_PATH
 PKG_CONFIG_LIBDIR
@@ -2235,6 +2237,8 @@
               Additional configure options to pass to bundled jansson
   PJPROJECT_CONFIGURE_OPTS
               Additional configure options to pass to bundled pjproject
+  LUA_VERSIONS
+              A space separated list of target lua versions to test.
   PKG_CONFIG  path to pkg-config utility
   PKG_CONFIG_PATH
               directories to add to pkg-config's search path
@@ -29633,7 +29637,7 @@
 
 
 
-for ver in 5.4 5.3 5.2 5.1; do
+for ver in ${LUA_VERSIONS:-5.4 5.3 5.2 5.1}; do
 
 if test "x${PBX_LUA}" != "x1" -a "${USE_LUA}" != "no"; then
    pbxlibdir=""
@@ -29744,6 +29748,7 @@
 done
 
 # Some distributions (like openSUSE and NetBSD) remove the 5.x suffix.
+if test "x${LUA_VERSIONS}" = "x"; then
 
 if test "x${PBX_LUA}" != "x1" -a "${USE_LUA}" != "no"; then
    pbxlibdir=""
@@ -29840,6 +29845,7 @@
 fi
 
 
+fi
 
 # Accept either RADIUS client library, their APIs are fully compatible,
 # just different header filenames and different SONAMEs
diff --git a/configure.ac b/configure.ac
index e842a0c..c34638a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -511,6 +511,7 @@
 AST_EXT_LIB_SETUP([LIBXSLT], [LibXSLT], [libxslt])
 AST_EXT_LIB_SETUP_OPTIONAL([LIBXSLT_CLEANUP], [LibXSLT Library Cleanup Function], [LIBXSLT], [libxslt])
 AST_EXT_LIB_SETUP([LUA], [Lua], [lua])
+AC_ARG_VAR([LUA_VERSIONS],[A space separated list of target lua versions to test.])
 AST_EXT_LIB_SETUP([MISDN], [mISDN user], [misdn])
 AST_EXT_LIB_SETUP([MYSQLCLIENT], [MySQL client], [mysqlclient])
 AST_EXT_LIB_SETUP([NBS], [Network Broadcast Sound], [nbs])
@@ -2559,7 +2560,7 @@
 fi
 AST_EXT_LIB_CHECK([OPUSFILE], [opusfile], [op_open_callbacks], [opus/opusfile.h], [], [$__opus_include])
 
-for ver in 5.4 5.3 5.2 5.1; do
+for ver in ${LUA_VERSIONS:-5.4 5.3 5.2 5.1}; do
 	AST_EXT_LIB_CHECK([LUA], lua${ver}, [luaL_newstate], lua${ver}/lua.h, [-lm])
 	if test "x${PBX_LUA}" = "x1" ; then
 		if test x"${LUA_DIR}" = x; then
@@ -2572,7 +2573,9 @@
 done
 
 # Some distributions (like openSUSE and NetBSD) remove the 5.x suffix.
-AST_EXT_LIB_CHECK([LUA], [lua], [luaL_newstate], [lua.h], [-lm])
+if test "x${LUA_VERSIONS}" = "x"; then
+	AST_EXT_LIB_CHECK([LUA], [lua], [luaL_newstate], [lua.h], [-lm])
+fi
 
 # Accept either RADIUS client library, their APIs are fully compatible,
 # just different header filenames and different SONAMEs

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/15284
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 18
Gerrit-Change-Id: I8c403eda05df25ee0193960262ce849c7d2fd088
Gerrit-Change-Number: 15284
Gerrit-PatchSet: 3
Gerrit-Owner: Jaco Kroon <jaco at uls.co.za>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210106/21960a93/attachment.html>


More information about the asterisk-code-review mailing list