From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sergey Kvachonok Subject: [PATCH] Add a configure option for SELinux support Date: Fri, 13 Jan 2017 11:02:02 +0300 Message-ID: <20170113080202.GA5766@rbox.ravenex.space> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from sog-mx-4.v43.ch3.sourceforge.com ([172.29.43.194] helo=mx.sourceforge.net) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1cRwoO-0007ye-J0 for linux-f2fs-devel@lists.sourceforge.net; Fri, 13 Jan 2017 08:02:12 +0000 Received: from mail-lf0-f65.google.com ([209.85.215.65]) by sog-mx-4.v43.ch3.sourceforge.com with esmtps (TLSv1:AES128-SHA:128) (Exim 4.76) id 1cRwoM-0003KD-PG for linux-f2fs-devel@lists.sourceforge.net; Fri, 13 Jan 2017 08:02:12 +0000 Received: by mail-lf0-f65.google.com with SMTP id h65so4482815lfi.3 for ; Fri, 13 Jan 2017 00:02:10 -0800 (PST) Received: from localhost ([82.209.222.134]) by smtp.gmail.com with ESMTPSA id 85sm2231916lfr.37.2017.01.13.00.02.02 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Jan 2017 00:02:03 -0800 (PST) Content-Disposition: inline List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net To: linux-f2fs-devel@lists.sourceforge.net ./configure --without-selinux :: unconditionally disable SELinux support ./configure --with-selinux :: enable SELinux support and abort if libselinux is not found When no configure option is specified the current libselinux autodetection behaviour is preserved. Signed-off-by: Sergey Kvachonok --- configure.ac | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 8781af1..b855afe 100644 --- a/configure.ac +++ b/configure.ac @@ -45,6 +45,12 @@ AC_CHECK_HEADERS_ONCE([ sys/mount.h ]) +# Test configure options. +AC_ARG_WITH([selinux], + AS_HELP_STRING([--without-selinux], + [Ignore presence of libselinux and disable selinux support]) +) + # Checks for programs. AC_PROG_CC AC_PROG_LIBTOOL @@ -54,9 +60,19 @@ AC_PATH_PROG([LDCONFIG], [ldconfig], # Checks for libraries. PKG_CHECK_MODULES([libuuid], [uuid]) -PKG_CHECK_MODULES([libselinux], [libselinux], + +AS_IF([test "x$with_selinux" != "xno"], + [PKG_CHECK_MODULES([libselinux], [libselinux], + [have_selinux=yes], [have_selinux=no])], + [have_selinux=no] +) + +AS_IF([test "x$have_selinux" = "xyes"], [AC_DEFINE([HAVE_LIBSELINUX], [1], [Use libselinux])], - [AC_MSG_NOTICE([libselinux not found])]) + [AS_IF([test "x$with_selinux" = "xyes"], + [AC_MSG_ERROR([selinux support requested but libselinux not found])] + )] +) # Checks for header files. AC_CHECK_HEADERS([linux/fs.h linux/blkzoned.h fcntl.h mntent.h stdlib.h string.h \ -- 2.11.0 ------------------------------------------------------------------------------ Developer Access Program for Intel Xeon Phi Processors Access to Intel Xeon Phi processor-based developer platforms. With one year of Intel Parallel Studio XE. Training and support from Colfax. Order your platform today. http://sdm.link/xeonphi