meson: add attr build option

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
This commit is contained in:
Pavel Hrdina 2020-07-29 14:20:15 +02:00
parent d75d7ddc06
commit 3ace72965c
4 changed files with 7 additions and 16 deletions

View File

@ -114,7 +114,6 @@ fi
# Check for compiler and library settings.
LIBVIRT_ARG_ATTR
LIBVIRT_ARG_AUDIT
LIBVIRT_ARG_BASH_COMPLETION
LIBVIRT_ARG_BLKID
@ -149,7 +148,6 @@ LIBVIRT_ARG_VIRTUALPORT
LIBVIRT_ARG_WIRESHARK
LIBVIRT_ARG_YAJL
LIBVIRT_CHECK_ATTR
LIBVIRT_CHECK_AUDIT
LIBVIRT_CHECK_BASH_COMPLETION
LIBVIRT_CHECK_BLKID
@ -475,7 +473,6 @@ LIBVIRT_RESULT_DRIVER_MODULES
AC_MSG_NOTICE([])
AC_MSG_NOTICE([Libraries])
AC_MSG_NOTICE([])
LIBVIRT_RESULT_ATTR
LIBVIRT_RESULT_AUDIT
LIBVIRT_RESULT_BASH_COMPLETION
LIBVIRT_RESULT_BLKID

View File

@ -1,13 +0,0 @@
dnl The libattr.so library
AC_DEFUN([LIBVIRT_ARG_ATTR],[
LIBVIRT_ARG_WITH_FEATURE([ATTR], [attr], [check])
])
AC_DEFUN([LIBVIRT_CHECK_ATTR],[
LIBVIRT_CHECK_LIB([ATTR], [attr], [getxattr], [sys/xattr.h])
])
AC_DEFUN([LIBVIRT_RESULT_ATTR],[
LIBVIRT_RESULT_LIB([ATTR])
])

View File

@ -971,6 +971,11 @@ if apparmor_dep.found()
conf.set_quoted('APPARMOR_PROFILES_PATH', '/sys/kernel/security/apparmor/profiles')
endif
attr_dep = cc.find_library('attr', required: get_option('attr'))
if attr_dep.found()
conf.set('HAVE_LIBATTR', 1)
endif
# define top include directory
@ -993,6 +998,7 @@ configure_file(output: 'meson-config.h', configuration: conf)
libs_summary = {
'acl': acl_dep.found(),
'apparmor': apparmor_dep.found(),
'attr': attr_dep.found(),
}
summary(libs_summary, section: 'Libraries', bool_yn: true)

View File

@ -11,6 +11,7 @@ option('git_werror', type: 'feature', value: 'auto', description: 'use -Werror i
# build dependencies options
option('apparmor', type: 'feature', value: 'auto', description: 'apparmor support')
option('attr', type: 'feature', value: 'auto', description: 'attr support')
# build driver options