Only sepolicy-plugin needs linking to libsemanage
authorPanu Matilainen <pmatilai@redhat.com>
Wed, 22 Dec 2010 12:58:11 +0000 (14:58 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Wed, 22 Dec 2010 12:58:11 +0000 (14:58 +0200)
configure.ac
plugins/Makefile.am

index 9254dc6..2aa190b 100644 (file)
@@ -599,6 +599,7 @@ AS_IF([test "$with_selinux" = yes],[
     AC_MSG_ERROR([--with-selinux given, but selinux/label.h not found])
   ])
 
+  dnl FIXME: semanage is only needed for the sepolicy plugin
   AC_CHECK_HEADER([semanage/semanage.h],[
     save_LIBS="$LIBS"
     AC_CHECK_LIB([semanage],[semanage_begin_transaction],[],[
@@ -637,9 +638,11 @@ AS_IF([test "$with_selinux" = yes],[
 
 AS_IF([test "$with_selinux" = yes],[
   AC_DEFINE(WITH_SELINUX, 1, [Build with selinux support?])
-  WITH_SELINUX_LIB="-lselinux -lsemanage"
+  WITH_SELINUX_LIB="-lselinux"
+  WITH_SEMANAGE_LIB="-lsemanage"
 ])
 AC_SUBST(WITH_SELINUX_LIB)
+AC_SUBST(WITH_SEMANAGE_LIB)
 AM_CONDITIONAL(SELINUX,[test "$with_selinux" = yes])
 
 # libcap
index b9fd823..69230de 100644 (file)
@@ -19,5 +19,5 @@ exec_la_SOURCES = plugin.h exec.c
 exec_la_LIBADD = $(top_builddir)/lib/librpm.la $(top_builddir)/rpmio/librpmio.la
 
 sepolicy_la_SOURCES = plugin.h sepolicy.c
-sepolicy_la_LIBADD = $(top_builddir)/lib/librpm.la $(top_builddir)/rpmio/librpmio.la @WITH_SELINUX_LIB@
+sepolicy_la_LIBADD = $(top_builddir)/lib/librpm.la $(top_builddir)/rpmio/librpmio.la @WITH_SELINUX_LIB@ @WITH_SEMANAGE_LIB@