diff --git a/configure b/configure
index 6ab81b4eb4e13f9b1d35f941f640cba62c2a326a..b424bd8b66da682e0b2b0adf6fa589c95d1848a5 100755
--- a/configure
+++ b/configure
@@ -29630,7 +29630,7 @@ fi
 
 
 
-for ver in 5.3 5.2 5.1; do
+for ver in 5.4 5.3 5.2 5.1; do
 
 if test "x${PBX_LUA}" != "x1" -a "${USE_LUA}" != "no"; then
    pbxlibdir=""
diff --git a/configure.ac b/configure.ac
index 0fe37b05e3f708a66a4a664a275725d8fb5e84e4..88309d096a06654520d36a35918bdc3b045d9748 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2557,7 +2557,7 @@ if test -z "$__opus_include" -o x"$__opus_include" = x" " ; then
 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
+for ver in 5.4 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