From c1c9ea977c5b219a0492fc37b7d9f884f9faa171 Mon Sep 17 00:00:00 2001 From: Hannes von Haugwitz Date: Mon, 20 May 2013 15:22:04 +0200 Subject: [PATCH] configure.in: fixed compilation with selinux --- ChangeLog | 1 + configure.in | 25 ++++++++++++++++++------- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index e5eced4..807e152 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ * Print checksums of databases in verbose level 2 or higher (closes feature request 1502032) * Added new 'database_attrs' option + * configure.in: fixed compilation with selinux 2013-05-18 Hannes von Haugwitz * configure.in: removed check for 'libcrypt' diff --git a/configure.in b/configure.in index 3c15eb4..25f2b21 100644 --- a/configure.in +++ b/configure.in @@ -464,15 +464,26 @@ AC_ARG_WITH([selinux], ) AS_IF([test "x$with_selinux_support" != xno], - [AC_DEFINE(WITH_SELINUX,1,[use SELinux]) - if test -n "$PKG_CONFIG" && $PKG_CONFIG --exists libselinux; then - SELINUXLIB=$(${PKG_CONFIG} --libs libselinux --static) - else - SELINUXLIB="-lselinux" - fi + AC_DEFINE(WITH_SELINUX,1,[use SELinux]) + [AC_MSG_RESULT(yes) + if test -n "$PKG_CONFIG" && $PKG_CONFIG --exists libselinux; then + if test "$aide_static_choice" == "yes"; then + SELINUXLIB=$(${PKG_CONFIG} --libs libselinux --static) + else + SELINUXLIB=$(${PKG_CONFIG} --libs libselinux) + fi + else + SELINUXLIB="-lselinux" + if test "$aide_static_choice" == "yes"; then + saveLIBS=$LIBS + LIBS="-static $SELINUXLIB" + AC_SEARCH_LIBS([lgetfilecon_raw], [], [], [SELINUXLIB="$SELINUXLIB -lpthread"]) + LIBS=$saveLIBS + fi + fi compoptionstring="${compoptionstring}WITH_SELINUX\\n" aideextragroups="${aideextragroups}+selinux" - AC_MSG_RESULT(yes)], + ], [AC_MSG_RESULT(no)] )