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 47831cc3a0b647257a039196624716d74e6cb74b..bf5f629ccad3bb3c1e31d7c8efbf9d2c7113e539 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 822ffa20941c1cc9414eab32a8b9bdb9d4264d0b..464b7821f1b49e220ac58d49a2fc68f37dd5a972 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 05cdd71f2ed6f8f9f1e1135d750500d78b3b911d..b7b8d82b2995ff26f7721f08d547ea1419ea8d02 100644 (file)
@@ -41,6 +41,9 @@ Include:
 #include <selinux/selinux.h>
 #include <selinux/context.h>
 
+Link:
+$(LIB_SELINUX)
+
 License:
 LGPLv2+