diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
index 1401e52..e98db6f 100644
--- a/m4/gnulib-comp.m4
+++ b/m4/gnulib-comp.m4
@@ -1751,11 +1751,11 @@ AC_DEFUN([gl_INIT],
     AC_LIBOBJ([select])
   fi
   gl_SYS_SELECT_MODULE_INDICATOR([select])
-  AC_CHECK_HEADERS([selinux/flask.h])
   AC_LIBOBJ([selinux-at])
   gl_HEADERS_SELINUX_SELINUX_H
   gl_HEADERS_SELINUX_CONTEXT_H
   if test "$with_selinux" != no && test "$ac_cv_header_selinux_selinux_h" = yes; then
+    AC_CHECK_HEADERS([selinux/flask.h])
     AC_LIBOBJ([getfilecon])
   fi
   gl_SERVENT
