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.
pull/1100/head
Victor Julien 11 years ago
parent f453fb810f
commit da1fe75975

@ -1496,7 +1496,16 @@
if test "$with_liblua_includes" != "no"; then if test "$with_liblua_includes" != "no"; then
CPPFLAGS="${CPPFLAGS} -I${with_liblua_includes}" CPPFLAGS="${CPPFLAGS} -I${with_liblua_includes}"
else 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}" CPPFLAGS="${CPPFLAGS} ${LUA_CFLAGS}"
fi fi
@ -1504,19 +1513,14 @@
if test "$LUA" = "yes"; then if test "$LUA" = "yes"; then
if test "$with_liblua_libraries" != "no"; then if test "$with_liblua_libraries" != "no"; then
LDFLAGS="${LDFLAGS} -L${with_liblua_libraries}" LDFLAGS="${LDFLAGS} -L${with_liblua_libraries}"
else
PKG_CHECK_MODULES([LUA], [${LUA_PC_NAME}])
LDFLAGS="${LDFLAGS} ${LUA_LIBS}"
fi
AC_CHECK_LIB(${LUA_LIB_NAME}, luaL_openlibs,, LUA="no") AC_CHECK_LIB(${LUA_LIB_NAME}, luaL_openlibs,, LUA="no")
if test "$LUA" = "no"; then if test "$LUA" = "no"; then
echo echo
echo " ERROR! liblua library not found, go get it" echo " ERROR! liblua library not found, go get it"
echo " from http://lua.org/index.html or your distribution:" echo " from http://lua.org/index.html or your distribution:"
echo echo
echo " Ubuntu: apt-get install liblua-5.1-dev" echo " Ubuntu: apt-get install liblua-5.1-dev"
echo " CentOS/Fedora: yum install lua-devel"
echo echo
echo " If you installed software in a non-standard prefix" echo " If you installed software in a non-standard prefix"
echo " consider adjusting the PKG_CONFIG_PATH environment variable" echo " consider adjusting the PKG_CONFIG_PATH environment variable"
@ -1524,6 +1528,19 @@
echo echo
exit 1 exit 1
fi fi
else
# 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_DEFINE([HAVE_LUA],[1],[liblua available]) AC_DEFINE([HAVE_LUA],[1],[liblua available])
enable_lua="yes" enable_lua="yes"
@ -1533,6 +1550,7 @@
echo " from http://lua.org/index.html or your distribution:" echo " from http://lua.org/index.html or your distribution:"
echo echo
echo " Ubuntu: apt-get install liblua-5.1-dev" echo " Ubuntu: apt-get install liblua-5.1-dev"
echo " CentOS/Fedora: yum install lua-devel"
echo echo
echo " If you installed software in a non-standard prefix" echo " If you installed software in a non-standard prefix"
echo " consider adjusting the PKG_CONFIG_PATH environment variable" echo " consider adjusting the PKG_CONFIG_PATH environment variable"

Loading…
Cancel
Save