changeset 10703:e4584e8c5e4b

selinux-h: search for LIB_SELINUX and mark it as a link requirement
author David Lutterkort <lutter@redhat.com>
date Wed, 22 Oct 2008 11:07:49 -0700
parents c1444c2ed476
children c1911eda16bd
files ChangeLog m4/selinux-selinux-h.m4 modules/selinux-h
diffstat 3 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-10-23  David Lutterkort  <lutter@redhat.com>
+
+	* modules/selinux-h: Search for LIB_SELINUX and mark it as a
+	link requirement
+
 2008-10-23  Jim Meyering  <meyering@redhat.com>
 
 	selinux-h: mark parameters of stub functions as intentionally unused
--- a/m4/selinux-selinux-h.m4
+++ b/m4/selinux-selinux-h.m4
@@ -14,4 +14,12 @@
 		   [SELINUX_SELINUX_H=],
 		   [SELINUX_SELINUX_H=selinux/selinux.h])
   AC_SUBST([SELINUX_SELINUX_H])
+
+  LIB_SELINUX=
+  gl_save_LIBS=$LIBS
+  AC_SEARCH_LIBS([setfilecon], [selinux],
+                 [test "$ac_cv_search_setfilecon" = "none required" ||
+                  LIB_SELINUX=$ac_cv_search_setfilecon])
+  AC_SUBST(LIB_SELINUX)
+  LIBS=$gl_save_LIBS
 ])
--- a/modules/selinux-h
+++ b/modules/selinux-h
@@ -41,6 +41,9 @@
 #include <selinux/selinux.h>
 #include <selinux/context.h>
 
+Link:
+$(LIB_SELINUX)
+
 License:
 LGPLv2+