Fix detection of Lua when there's no pkgconfig file.

Linking with liblua requires libdl on Linux; if the test link with liblua
fails try including libdl.

Fixes the problem reported in:
https://www.wireshark.org/lists/wireshark-dev/201711/msg00102.html

Change-Id: I8561f15f8d9adbab52d668d102811fb821b45034
Reviewed-on: https://code.wireshark.org/review/24678
Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Jeff Morriss 2017-12-02 17:42:16 -05:00 committed by Anders Broman
parent a9f5016429
commit 11ccd83068
1 changed files with 12 additions and 1 deletions

View File

@ -704,7 +704,18 @@ AC_DEFUN([AC_WIRESHARK_LIBLUA_CHECK],[
LUA_LIBS="-L$lua_dir/lib $ac_cv_search_luaL_openlibs -lm"
have_lua=yes
],[
have_lua=no
# Try again with -ldl
# Tell autoconf we don't want to use the cached result
unset ac_cv_search_luaL_openlibs
AC_SEARCH_LIBS(luaL_openlibs, [lua-${lua_ver} lua${lua_ver} lua],
[
LUA_LIBS="-L$lua_dir/lib $ac_cv_search_luaL_openlibs -lm -ldl"
have_lua=yes
],[
have_lua=no
], -lm -ldl)
], -lm)
fi
fi