diff --git a/m4/dune.m4 b/m4/dune.m4
index a54f4cb33b780e4a1435eb5ab6b57221f0df1f9d..d74b2032eb2ea87f0cd006f92139adb31fad46e9 100644
--- a/m4/dune.m4
+++ b/m4/dune.m4
@@ -241,6 +241,8 @@ AC_DEFUN([DUNE_CHECK_MODULES],[
     with_[]_dune_module="no"
   fi
 
+  AM_CONDITIONAL(HAVE_[]_DUNE_MODULE, test x$HAVE_[]_DUNE_MODULE = x1)
+
   # reset previous flags
   CPPFLAGS="$ac_save_CPPFLAGS"
   LIBS="$ac_save_LIBS"