diff modules/selinux-h @ 12143:d1f84df3a7a4

selinux-h: always use getfilecon wrappers * lib/getfilecon.c: New file. * lib/se-selinux.in.h: Use a better inclusion guard symbol name. [HAVE_SELINUX_SELINUX_H]: Include-next <selinux/selinux.h>. [!HAVE_SELINUX_SELINUX_H]: Use better parameter names. (fgetfilecon): Provide a stub. * m4/selinux-selinux-h.m4 (gl_HEADERS_SELINUX_SELINUX_H): Don't AC_SUBST SELINUX_SELINUX_H, since now we're generating that file unconditionally. When <selinux/selinux.h> is found, arrange to use wrappers. * modules/selinux-h (Files): Add getfilecon.c. (Makefile.am): Substitute include-next-related bits into the now-always-generated selinux/selinux.h file. * doc/glibc-functions/getfilecon.texi: New file. * doc/glibc-functions/lgetfilecon.texi: New file. * doc/glibc-functions/fgetfilecon.texi: New file. * doc/glibc-functions/getfilecon-desc.texi: New file. * doc/gnulib.texi (Glibc selinux/selinux.h): New section, by which to pull in the new files. * MODULES.html.sh (Misc): Add selinux-h.
author Jim Meyering <meyering@redhat.com>
date Wed, 07 Oct 2009 19:00:42 +0200 (2009-10-07)
parents 18ea6ab4e81d
children 92194f05b35f
line wrap: on
line diff
--- a/modules/selinux-h
+++ b/modules/selinux-h
@@ -2,6 +2,7 @@
 SELinux-related headers for systems that lack them.
 
 Files:
+lib/getfilecon.c
 lib/se-context.in.h
 lib/se-selinux.in.h
 m4/selinux-context-h.m4
@@ -18,11 +19,16 @@
 Makefile.am:
 lib_SOURCES += se-context.in.h se-selinux.in.h
 
-BUILT_SOURCES += $(SELINUX_SELINUX_H)
+BUILT_SOURCES += selinux/selinux.h
 selinux/selinux.h: se-selinux.in.h
 	$(AM_V_at)$(MKDIR_P) selinux
 	$(AM_V_GEN)rm -f $@-t $@ && \
-	cp $(srcdir)/se-selinux.in.h $@-t && \
+	{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+	  sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+	      -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+	      -e 's|@''NEXT_SELINUX_SELINUX_H''@|$(NEXT_SELINUX_SELINUX_H)|g' \
+	      < $(srcdir)/se-selinux.in.h; \
+	} > $@-t && \
 	chmod a-x $@-t && \
 	mv $@-t $@
 MOSTLYCLEANFILES += selinux/selinux.h selinux/selinux.h-t