On Fri, Feb 23, 2018 at 09:23:50PM +0100, Yann Ylavic wrote:
> Though this is the "else" (legacy) branch.
> 
> $ pkg-config --list-all |grep ^lua
...
> lua51                          Lua - Lua language engine
> lua52                          Lua - Lua language engine
> lua5.2                         Lua - Lua language engine
> lua5.3                         Lua - Lua language engine
...

Should we use lua5.2 or lua-5.2 to use those then, can you work out? Or 
are these aliases for the same .pc file?  It should still be quite 
simple to handle these too, something like the attached.

Regards, Joe
Index: modules/lua/config.m4
===================================================================
--- modules/lua/config.m4       (revision 1825147)
+++ modules/lua/config.m4       (working copy)
@@ -55,13 +55,18 @@
     test_paths="${lua_path}"
 fi
 
-if test -n "$PKGCONFIG" -a -z "$lua_path" \
-   && $PKGCONFIG --atleast-version=5.1 lua; then
-  LUA_LIBS="`$PKGCONFIG --libs lua`"
-  LUA_CFLAGS="`$PKGCONFIG --cflags lua`"
-  LUA_VERSION="`$PKGCONFIG --modversion lua`"
-  AC_MSG_NOTICE([using Lua $LUA_VERSION configuration from pkg-config])
-else
+for pklua in lua lua-5.3 lua-5.2 lua-5.1; do
+  if test -n "$PKGCONFIG" -a -z "$lua_path" \
+     && $PKGCONFIG --atleast-version=5.1 $pklua; then
+    LUA_LIBS="`$PKGCONFIG --libs $pklua`"
+    LUA_CFLAGS="`$PKGCONFIG --cflags $pklua`"
+    LUA_VERSION="`$PKGCONFIG --modversion $pklua`"
+    AC_MSG_NOTICE([using Lua $LUA_VERSION configuration from pkg-config])
+    break
+  fi
+done
+
+if test -z "$LUA_VERSION"; then
   AC_CHECK_LIB(m, pow, lib_m="-lm")
   AC_CHECK_LIB(m, sqrt, lib_m="-lm")
   for x in $test_paths ; do

Reply via email to