]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
meson: add AppArmor build dependency
authorPavel Hrdina <phrdina@redhat.com>
Wed, 29 Jul 2020 12:19:59 +0000 (14:19 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Mon, 3 Aug 2020 07:26:59 +0000 (09:26 +0200)
APPARMOR_MOUNT is not used so dropping it in meson.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
configure.ac
m4/virt-apparmor.m4 [deleted file]
meson.build
meson_options.txt

index cd52e9a535cfd7f374e22cae13288077691d9c43..6635d1db3fb832495ed756f31589577b0b70376d 100644 (file)
@@ -114,7 +114,6 @@ fi
 
 # Check for compiler and library settings.
 
-LIBVIRT_ARG_APPARMOR
 LIBVIRT_ARG_ATTR
 LIBVIRT_ARG_AUDIT
 LIBVIRT_ARG_BASH_COMPLETION
@@ -150,7 +149,6 @@ LIBVIRT_ARG_VIRTUALPORT
 LIBVIRT_ARG_WIRESHARK
 LIBVIRT_ARG_YAJL
 
-LIBVIRT_CHECK_APPARMOR
 LIBVIRT_CHECK_ATTR
 LIBVIRT_CHECK_AUDIT
 LIBVIRT_CHECK_BASH_COMPLETION
@@ -477,7 +475,6 @@ LIBVIRT_RESULT_DRIVER_MODULES
 AC_MSG_NOTICE([])
 AC_MSG_NOTICE([Libraries])
 AC_MSG_NOTICE([])
-LIBVIRT_RESULT_APPARMOR
 LIBVIRT_RESULT_ATTR
 LIBVIRT_RESULT_AUDIT
 LIBVIRT_RESULT_BASH_COMPLETION
diff --git a/m4/virt-apparmor.m4 b/m4/virt-apparmor.m4
deleted file mode 100644 (file)
index ebddfce..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-dnl The libapparmor.so library
-dnl
-dnl Copyright (C) 2012-2013 Red Hat, Inc.
-dnl
-dnl This library is free software; you can redistribute it and/or
-dnl modify it under the terms of the GNU Lesser General Public
-dnl License as published by the Free Software Foundation; either
-dnl version 2.1 of the License, or (at your option) any later version.
-dnl
-dnl This library is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-dnl Lesser General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU Lesser General Public
-dnl License along with this library.  If not, see
-dnl <http://www.gnu.org/licenses/>.
-dnl
-
-AC_DEFUN([LIBVIRT_ARG_APPARMOR],[
-  LIBVIRT_ARG_WITH_FEATURE([APPARMOR], [AppArmor], [check])
-  LIBVIRT_ARG_WITH([APPARMOR_MOUNT], [set AppArmor mount point], [check])
-])
-
-AC_DEFUN([LIBVIRT_CHECK_APPARMOR],[
-  LIBVIRT_CHECK_LIB([APPARMOR], [apparmor],
-                    [aa_change_profile], [sys/apparmor.h])
-
-  if test "$with_apparmor" = "yes"; then
-    AC_DEFINE_UNQUOTED([APPARMOR_DIR],
-                       "/etc/apparmor.d",
-                       [path to apparmor directory])
-    AC_DEFINE_UNQUOTED([APPARMOR_PROFILES_PATH],
-                       "/sys/kernel/security/apparmor/profiles",
-                       [path to kernel profiles])
-  fi
-])
-
-AC_DEFUN([LIBVIRT_RESULT_APPARMOR],[
-  LIBVIRT_RESULT_LIB([APPARMOR])
-])
index edcc33117de07a1bba68445f18eeabeda18946b4..b3183127ee2ea14506b55dcc1140f9257d3978cd 100644 (file)
@@ -964,6 +964,13 @@ else
   acl_dep = dependency('', required: false)
 endif
 
+apparmor_dep = dependency('libapparmor', required: get_option('apparmor'))
+if apparmor_dep.found()
+  conf.set('WITH_APPARMOR', 1)
+  conf.set_quoted('APPARMOR_DIR', '/etc/apparmor.d')
+  conf.set_quoted('APPARMOR_PROFILES_PATH', '/sys/kernel/security/apparmor/profiles')
+endif
+
 
 # define top include directory
 
@@ -985,6 +992,7 @@ configure_file(output: 'meson-config.h', configuration: conf)
 
 libs_summary = {
   'acl': acl_dep.found(),
+  'apparmor': apparmor_dep.found(),
 }
 summary(libs_summary, section: 'Libraries', bool_yn: true)
 
index e8cda6b1399177a3812fecb8d5941214da2ab219..99dd956432740329aa39346944bc4d42f50b1624 100644 (file)
@@ -9,5 +9,9 @@ option('test_coverage', type: 'boolean', value: false, description: 'turn on cod
 option('git_werror', type: 'feature', value: 'auto', description: 'use -Werror if building from GIT')
 
 
+# build dependencies options
+option('apparmor', type: 'feature', value: 'auto', description: 'apparmor support')
+
+
 # build driver options
 option('driver_remote', type: 'feature', value: 'enabled', description: 'remote driver')