1 dnl The SElinux security driver
3 dnl Copyright (C) 2016 Red Hat, Inc.
5 dnl This library is free software; you can redistribute it and/or
6 dnl modify it under the terms of the GNU Lesser General Public
7 dnl License as published by the Free Software Foundation; either
8 dnl version 2.1 of the License, or (at your option) any later version.
10 dnl This library is distributed in the hope that it will be useful,
11 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
12 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 dnl Lesser General Public License for more details.
15 dnl You should have received a copy of the GNU Lesser General Public
16 dnl License along with this library. If not, see
17 dnl <http://www.gnu.org/licenses/>.
20 AC_DEFUN([LIBVIRT_SECDRIVER_ARG_SELINUX], [
21 LIBVIRT_ARG_WITH([SECDRIVER_SELINUX], [use SELinux security driver], [check])
24 AC_DEFUN([LIBVIRT_SECDRIVER_CHECK_SELINUX], [
25 AC_REQUIRE([LIBVIRT_CHECK_SELINUX])
27 if test "$with_selinux" != "yes" ; then
28 if test "$with_secdriver_selinux" = "check" ; then
29 with_secdriver_selinux=no
31 if test "$with_secdriver_selinux" != "no"; then
32 AC_MSG_ERROR([You must install the libselinux development package and enable SELinux with the --with-selinux=yes in order to compile libvirt --with-secdriver-selinux=yes])
34 elif test "$with_secdriver_selinux" != "no"; then
37 CFLAGS="$CFLAGS $SELINUX_CFLAGS"
38 LIBS="$CFLAGS $SELINUX_LIBS"
41 AC_CHECK_FUNC([selinux_virtual_domain_context_path], [], [fail=1])
42 AC_CHECK_FUNC([selinux_virtual_image_context_path], [], [fail=1])
43 AC_CHECK_FUNCS([selinux_lxc_contexts_path])
47 if test "$fail" = "1" ; then
48 if test "$with_secdriver_selinux" = "check" ; then
49 with_secdriver_selinux=no
51 AC_MSG_ERROR([You must install libselinux development package >= 2.0.82 in order to compile libvirt --with-secdriver-selinux=yes])
54 with_secdriver_selinux=yes
55 AC_DEFINE_UNQUOTED([WITH_SECDRIVER_SELINUX], 1, [whether SELinux security driver is available])
58 AM_CONDITIONAL([WITH_SECDRIVER_SELINUX], [test "$with_secdriver_selinux" != "no"])
61 AC_DEFUN([LIBVIRT_SECDRIVER_RESULT_SELINUX], [
62 LIBVIRT_RESULT([SELinux], [$with_secdriver_selinux])