From bfdedc2f762027ec9a50fda659d66720718bb28d Mon Sep 17 00:00:00 2001 From: Gilles Dartiguelongue Date: Wed, 25 Nov 2015 09:23:51 +0100 Subject: [PATCH] Make libselinux dependency controllable by configure switch --- configure.ac | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/configure.ac b/configure.ac index 777ff84..37a65ba 100644 --- a/configure.ac +++ b/configure.ac @@ -140,18 +140,19 @@ dnl ========================================================================== dnl **************************** dnl *** Check for libselinux *** dnl **************************** - -SELINUX_LIBS= + msg_selinux=no -AC_CHECK_LIB(selinux, is_selinux_enabled, - [AC_CHECK_HEADERS(selinux/selinux.h, - [AC_SEARCH_LIBS(selinux_raw_to_trans_context, selinux, - [AC_DEFINE(HAVE_SELINUX, 1, [Define to 1 if libselinux is available]) - SELINUX_LIBS="-lselinux" - msg_selinux=yes]) - ]) - ]) -AC_SUBST(SELINUX_LIBS) + +AC_ARG_ENABLE([selinux], + [AS_HELP_STRING([--enable-selinux], + [Enable selinux support])]) +AS_IF([test "$enable_selinux" != "no"], + [PKG_CHECK_MODULES([SELINUX], [libselinux >= 2.0], + [ + AC_DEFINE([HAVE_SELINUX], [1], [Define to 1 if libselinux is available]) + msg_selinux=yes + ]) + ]) AC_ARG_ENABLE(empty_view, -- 2.6.3