--- a/configure.ac +++ b/configure.ac @@ -2553,20 +2553,15 @@ fi AST_EXT_LIB_CHECK([OPUSFILE], [opusfile], [op_open_callbacks], [opus/opusfile.h], [], [$__opus_include]) -for ver in 5.3 5.2 5.1; do - AST_EXT_LIB_CHECK([LUA], lua${ver}, [luaL_newstate], lua${ver}/lua.h, [-lm]) - if test "x${PBX_LUA}" = "x1" ; then - if test x"${LUA_DIR}" = x; then - LUA_INCLUDE="${LUA_INCLUDE} -I/usr/include/lua${ver}" - else - LUA_INCLUDE="${LUA_INCLUDE} -I${LUA_DIR}/lua${ver}" - fi - break; +AST_EXT_LIB_CHECK([LUA], ${LUA_IMPL}, [luaL_newstate], ${LUA_IMPL}/lua.h, [-lm]) +if test "x${PBX_LUA}" = "x1" ; then + if test x"${LUA_DIR}" = x; then + LUA_INCLUDE="${LUA_INCLUDE} -I/usr/include/${LUA_IMPL}" + else + LUA_INCLUDE="${LUA_INCLUDE} -I${LUA_DIR}/${LUA_IMPL}" fi -done - -# Some distributions (like openSUSE and NetBSD) remove the 5.x suffix. -AST_EXT_LIB_CHECK([LUA], [lua], [luaL_newstate], [lua.h], [-lm]) + break; +fi # Accept either RADIUS client library, their APIs are fully compatible, # just different header filenames and different SONAMEs