aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss.ws@gmail.com>2015-06-05 22:04:29 -0400
committerAlexis La Goutte <alexis.lagoutte@gmail.com>2015-06-08 08:13:09 +0000
commit032ad5a7aa4e807f6389713f4339eddac2e254fa (patch)
treee31b7fcf348bb20f31102227672d1fe037c9a4e6
parentda1766e9871ba1eb4156ebd05c819eee9d91c10f (diff)
Update how we search for Lua with pkg-config.
First, search for packages with the version number without the period (bug 11219). Second, don't look for Lua 5.3 because we don't work with it. If what we find (without pkg-config's help) is Lua 5.3, disable Lua support (bug 10881). Cmake support by Peter Wu (originally Ie73e5b53640f10432881a9671c0a605f7f027ed8): Note the check for "lua<=5.2.99" instead of "lua<5.3" since cmake does not support the latter syntax. Tested with lua5.2, lua5.1 and lua (5.3) installed. Bug: 11219 Ping-Bug: 10881 Change-Id: I382d07ca00eafc6111cd4e9faa2b66f6b8f95b6e Reviewed-on: https://code.wireshark.org/review/8783 Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
-rw-r--r--acinclude.m444
-rw-r--r--cmake/modules/FindLUA.cmake5
2 files changed, 30 insertions, 19 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index c79c42741f..7b3026f2da 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -808,22 +808,23 @@ AC_DEFUN([AC_WIRESHARK_LIBLUA_CHECK],[
# The user didn't tell us where to find Lua. Let's go look for it.
# First, try the standard (pkg-config) way.
- PKG_CHECK_MODULES(LUA, lua, [have_lua=yes], [true])
-
# Unfortunately Lua's pkg-config file isn't standardly named.
- # Apparently Debian, in particular, allows installation of multiple
- # versions of Lua at the same time (thus each version has its own
- # package name).
- for ver in 5.2 -5.2 5.1 -5.1 5.0 -5.0
+ # Some distributions allow installation of multiple versions of
+ # Lua at the same time. On such systems each version has its
+ # own package name.
+ #
+ # We use a for loop instead of giving all the package names to
+ # PKG_CHECK_MODULES because doing the latter doesn't appear to
+ # work reliably (some package names are not searched for).
+ for pkg in lua5.2 lua-5.2 lua52 lua5.1 lua-5.1 lua51 lua5.0 lua-5.0 lua50 "lua < 5.3"
do
+ PKG_CHECK_MODULES(LUA, $pkg, [have_lua=yes], [true])
+
if test "x$have_lua" = "xyes"
then
break
fi
-
- PKG_CHECK_MODULES(LUA, lua$ver, [have_lua=yes], [true])
done
-
fi
if test "x$have_lua" != "xyes"
@@ -868,17 +869,24 @@ AC_DEFUN([AC_WIRESHARK_LIBLUA_CHECK],[
AC_MSG_CHECKING(the Lua version)
lua_ver=`$AWK AS_ESCAPE('/LUA_VERSION_NUM/ { print $NF; }' $header_dir/lua.h | sed 's/0/./')`
- AC_MSG_RESULT($lua_ver)
- wireshark_save_CPPFLAGS="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS -I$header_dir"
- AC_CHECK_HEADERS(lua.h lualib.h lauxlib.h, ,
- [
+ if test "x$lua_ver" = "x5.3"
+ then
+ # Wireshark doesn't compile with Lua 5.3 today
+ AC_MSG_RESULT($lua_ver - disabling Lua support)
have_lua=no
- # Restore our CPPFLAGS
- CPPFLAGS="$wireshark_save_CPPFLAGS"
- break
- ])
+ else
+ AC_MSG_RESULT($lua_ver)
+
+ wireshark_save_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS -I$header_dir"
+ AC_CHECK_HEADERS(lua.h lualib.h lauxlib.h, ,
+ [
+ have_lua=no
+ # Restore our CPPFLAGS
+ CPPFLAGS="$wireshark_save_CPPFLAGS"
+ ])
+ fi
if test "x$have_lua" = "x"
then
diff --git a/cmake/modules/FindLUA.cmake b/cmake/modules/FindLUA.cmake
index 68ee4c975b..195b2f86da 100644
--- a/cmake/modules/FindLUA.cmake
+++ b/cmake/modules/FindLUA.cmake
@@ -18,7 +18,10 @@ INCLUDE(FindWSWinLibs)
FindWSWinLibs("lua5*" "LUA_HINTS")
find_package(PkgConfig)
-pkg_search_module(LUA lua)
+pkg_search_module(LUA lua5.2 lua-5.2 lua52 lua5.1 lua-5.1 lua51 lua5.0 lua-5.0 lua50)
+if(NOT LUA_FOUND)
+ pkg_search_module(LUA "lua<=5.2.99")
+endif()
FIND_PATH(LUA_INCLUDE_DIR lua.h
HINTS