summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--lib/se-selinux.in.h2
-rw-r--r--m4/selinux-selinux-h.m49
-rw-r--r--modules/selinux-h1
4 files changed, 19 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 494ca0f227..87de925f86 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
2023-04-13 Bruno Haible <bruno@clisp.org>
+ selinux-h: Avoid using HAVE_* macros in *.in.h files.
+ * m4/selinux-selinux-h.m4 (gl_HEADERS_SELINUX_SELINUX_H): Initialize
+ HAVE_SELINUX_SELINUX_H.
+ * modules/selinux-h (Makefile.am): Substitute HAVE_SELINUX_SELINUX_H.
+ * lib/se-selinux.in.h: Test HAVE_SELINUX_SELINUX_H as an Autoconf
+ variable.
+
+2023-04-13 Bruno Haible <bruno@clisp.org>
+
ialloc, gethrxtime: Restore GCC diagnostics options.
* lib/ialloc.h: Invoke _GL_INLINE_HEADER_END.
* lib/xtime.h: Likewise.
diff --git a/lib/se-selinux.in.h b/lib/se-selinux.in.h
index 5ec13dde73..0296ccdd36 100644
--- a/lib/se-selinux.in.h
+++ b/lib/se-selinux.in.h
@@ -19,7 +19,7 @@
#endif
@PRAGMA_COLUMNS@
-#if HAVE_SELINUX_SELINUX_H
+#if @HAVE_SELINUX_SELINUX_H@
#@INCLUDE_NEXT@ @NEXT_SELINUX_SELINUX_H@
diff --git a/m4/selinux-selinux-h.m4 b/m4/selinux-selinux-h.m4
index f69eb3c375..7028248c71 100644
--- a/m4/selinux-selinux-h.m4
+++ b/m4/selinux-selinux-h.m4
@@ -1,4 +1,4 @@
-# serial 5 -*- Autoconf -*-
+# serial 6 -*- Autoconf -*-
# Copyright (C) 2006-2007, 2009-2023 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -15,6 +15,13 @@ AC_DEFUN([gl_HEADERS_SELINUX_SELINUX_H],
if test "$with_selinux" != no; then
AC_CHECK_HEADERS([selinux/selinux.h])
+ if test $ac_cv_header_selinux_selinux_h = yes; then
+ HAVE_SELINUX_SELINUX_H=1
+ else
+ HAVE_SELINUX_SELINUX_H=0
+ fi
+ AC_SUBST([HAVE_SELINUX_SELINUX_H])
+
if test "$ac_cv_header_selinux_selinux_h" = yes; then
# We do have <selinux/selinux.h>, so do compile getfilecon.c
# and arrange to use its wrappers.
diff --git a/modules/selinux-h b/modules/selinux-h
index 041b0663d5..d4e89cc4fc 100644
--- a/modules/selinux-h
+++ b/modules/selinux-h
@@ -34,6 +34,7 @@ selinux/selinux.h: se-selinux.in.h $(top_builddir)/config.status
$(AM_V_GEN)$(MKDIR_P) '%reldir%/selinux'
$(AM_V_at)$(SED_HEADER_STDOUT) \
-e 's|@''GUARD_PREFIX''@|${gl_include_guard_prefix}|g' \
+ -e 's/@''HAVE_SELINUX_SELINUX_H''@/$(HAVE_SELINUX_SELINUX_H)/g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \