Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame^] | 1 | From 25e3bf09bbbb04aa930ea0fd9f28809a24fb7194 Mon Sep 17 00:00:00 2001 |
| 2 | From: Peter Kjellerstedt <pkj@axis.com> |
| 3 | Date: Sun, 2 Oct 2022 17:47:29 +0200 |
| 4 | Subject: [PATCH] Make it possible to configure whether to use SELinux or not |
| 5 | |
| 6 | Upstream-Status: Backport [https://salsa.debian.org/debian/base-passwd/-/commit/396c41bb35e03c5dcc727aa9f74218a45874ac1f] |
| 7 | Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> |
| 8 | --- |
| 9 | configure.ac | 13 ++++++++++++- |
| 10 | 1 file changed, 12 insertions(+), 1 deletion(-) |
| 11 | |
| 12 | diff --git a/configure.ac b/configure.ac |
| 13 | index 589df88..e46403b 100644 |
| 14 | --- a/configure.ac |
| 15 | +++ b/configure.ac |
| 16 | @@ -13,7 +13,18 @@ AC_SYS_LARGEFILE |
| 17 | |
| 18 | dnl Scan for things we need |
| 19 | AC_CHECK_FUNCS([putgrent]) |
| 20 | -AC_CHECK_LIB([selinux], [is_selinux_enabled]) |
| 21 | + |
| 22 | +dnl Check for SELinux |
| 23 | +AC_MSG_CHECKING([whether to enable SELinux support]) |
| 24 | +AC_ARG_ENABLE([selinux], |
| 25 | + [AS_HELP_STRING([--disable-selinux], [disable support for SELinux])], |
| 26 | + [], |
| 27 | + [enable_selinux=yes]) |
| 28 | +AC_MSG_RESULT($enable_selinux) |
| 29 | +AS_IF([test "x$enable_selinux" != xno], |
| 30 | + [AC_CHECK_LIB([selinux], [is_selinux_enabled], [], |
| 31 | + [AC_MSG_ERROR( |
| 32 | + [SELinux support not available (use --disable-selinux to disable)])])]) |
| 33 | |
| 34 | dnl Check for debconf |
| 35 | AC_MSG_CHECKING([whether to enable debconf support]) |