From da1fe759759a1a0d00c2d4d2e14d38ac0014b6ae Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Mon, 11 Aug 2014 14:14:59 +0200 Subject: [PATCH] lua: improve configure checks The base 'lua' library has different names on different OS' and even Linux distro's. Instead of selecting the proper one, we now just try all. This way no OS/distro specific knowledge about the name is needed. --- configure.ac | 54 ++++++++++++++++++++++++++++++++++------------------ 1 file changed, 36 insertions(+), 18 deletions(-) diff --git a/configure.ac b/configure.ac index 44bddddaff..3056617d7f 100644 --- a/configure.ac +++ b/configure.ac @@ -1496,7 +1496,16 @@ if test "$with_liblua_includes" != "no"; then CPPFLAGS="${CPPFLAGS} -I${with_liblua_includes}" else - PKG_CHECK_MODULES([LUA], [${LUA_PC_NAME}], LUA="no") + # lua lua51 lua5.1 lua-5.1 + PKG_CHECK_MODULES([LUA], [lua], [LUA="yes"], [ + PKG_CHECK_MODULES([LUA], [lua5.1], [LUA="yes"], [ + PKG_CHECK_MODULES([LUA], [lua-5.1], [LUA="yes"], [ + PKG_CHECK_MODULES([LUA], [lua51], [LUA="yes"], [ + LUA="no" + ]) + ]) + ]) + ]) CPPFLAGS="${CPPFLAGS} ${LUA_CFLAGS}" fi @@ -1504,27 +1513,35 @@ if test "$LUA" = "yes"; then if test "$with_liblua_libraries" != "no"; then LDFLAGS="${LDFLAGS} -L${with_liblua_libraries}" + AC_CHECK_LIB(${LUA_LIB_NAME}, luaL_openlibs,, LUA="no") + if test "$LUA" = "no"; then + echo + echo " ERROR! liblua library not found, go get it" + echo " from http://lua.org/index.html or your distribution:" + echo + echo " Ubuntu: apt-get install liblua-5.1-dev" + echo " CentOS/Fedora: yum install lua-devel" + echo + echo " If you installed software in a non-standard prefix" + echo " consider adjusting the PKG_CONFIG_PATH environment variable" + echo " or use --with-liblua-libraries configure option." + echo + exit 1 + fi else - PKG_CHECK_MODULES([LUA], [${LUA_PC_NAME}]) + # lua lua51 lua5.1 lua-5.1 + PKG_CHECK_MODULES([LUA], [lua], [LUA="yes"], [ + PKG_CHECK_MODULES([LUA], [lua5.1], [LUA="yes"], [ + PKG_CHECK_MODULES([LUA], [lua-5.1], [LUA="yes"], [ + PKG_CHECK_MODULES([LUA], [lua51], [LUA="yes"], [ + LUA="no" + ]) + ]) + ]) + ]) LDFLAGS="${LDFLAGS} ${LUA_LIBS}" fi - AC_CHECK_LIB(${LUA_LIB_NAME}, luaL_openlibs,, LUA="no") - - if test "$LUA" = "no"; then - echo - echo " ERROR! liblua library not found, go get it" - echo " from http://lua.org/index.html or your distribution:" - echo - echo " Ubuntu: apt-get install liblua-5.1-dev" - echo - echo " If you installed software in a non-standard prefix" - echo " consider adjusting the PKG_CONFIG_PATH environment variable" - echo " or use --with-liblua-libraries configure option." - echo - exit 1 - fi - AC_DEFINE([HAVE_LUA],[1],[liblua available]) enable_lua="yes" else @@ -1533,6 +1550,7 @@ echo " from http://lua.org/index.html or your distribution:" echo echo " Ubuntu: apt-get install liblua-5.1-dev" + echo " CentOS/Fedora: yum install lua-devel" echo echo " If you installed software in a non-standard prefix" echo " consider adjusting the PKG_CONFIG_PATH environment variable" -- 2.47.2