selinux-h: search for LIB_SELINUX and mark it as a link requirement
authorDavid Lutterkort <lutter@redhat.com>
Wed, 22 Oct 2008 18:07:49 +0000 (11:07 -0700)
committerJim Meyering <meyering@redhat.com>
Thu, 23 Oct 2008 12:34:40 +0000 (14:34 +0200)
ChangeLog
m4/selinux-selinux-h.m4
modules/selinux-h

index 47831cc..bf5f629 100644 (file)
--- 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
index 822ffa2..464b782 100644 (file)
@@ -14,4 +14,12 @@ AC_DEFUN([gl_HEADERS_SELINUX_SELINUX_H],
                   [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
 ])
index 05cdd71..b7b8d82 100644 (file)
@@ -41,6 +41,9 @@ Include:
 #include <selinux/selinux.h>
 #include <selinux/context.h>
 
+Link:
+$(LIB_SELINUX)
+
 License:
 LGPLv2+