]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
m4: want_lua - Check that lualib header exists
authorAki Tuomi <aki.tuomi@open-xchange.com>
Fri, 27 Mar 2026 12:13:45 +0000 (14:13 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Sun, 29 Mar 2026 16:13:01 +0000 (19:13 +0300)
m4/want_lua.m4

index 2d8b56aea550d6086306d8845f528484a4cf796e..8857c8f7100b188b5b43650be73dc5d73278cee6 100644 (file)
@@ -16,9 +16,17 @@ AC_DEFUN([DOVECOT_WANT_LUA], [
         ])
       done
     ], [have_lua=yes])
-    AS_IF([test "$want_lua" = "yes" && test "$have_lua" = "no"], [
-      AC_MSG_ERROR([cannot build with Lua support: lua not found])
-    ])
+  ])
+
+  AS_IF([test "$have_lua" = "yes"], [
+    old_CFLAGS="$CFLAGS"
+    CFLAGS="$CFLAGS $LUA_CFLAGS"
+    AC_CHECK_HEADER([lualib.h], [have_lua=yes], [have_lua=no])
+    CFLAGS="$old_CFLAGS"
+  ])
+
+  AS_IF([test "$want_lua" = "yes" && test "$have_lua" = "no"], [
+    AC_MSG_ERROR([cannot build with Lua support: lua not found])
   ])
 
   AS_IF([test "$have_lua" != "no"], [