diff --git a/configure.ac b/configure.ac index cd52e9a535..6635d1db3f 100644 --- a/configure.ac +++ b/configure.ac @@ -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 index ebddfce201..0000000000 --- a/m4/virt-apparmor.m4 +++ /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 . -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]) -]) diff --git a/meson.build b/meson.build index edcc33117d..b3183127ee 100644 --- a/meson.build +++ b/meson.build @@ -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) diff --git a/meson_options.txt b/meson_options.txt index e8cda6b139..99dd956432 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -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')