mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-31 10:05:31 +00:00
meson: Rewrite libacl check
libacl is Linux-only, so we don't need to explicitly check for either the target platform or header availability, and we can simply rely on cc.find_library() instead. The corresponding preprocessor define is renamed to more accurately reflect the nature of the check. Signed-off-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
b6b7897ce8
commit
f5298b8589
@ -844,11 +844,9 @@ endforeach
|
|||||||
|
|
||||||
# generic build dependencies
|
# generic build dependencies
|
||||||
|
|
||||||
if host_machine.system() == 'linux' and cc.has_header('sys/acl.h')
|
acl_dep = cc.find_library('acl', required: false)
|
||||||
acl_dep = cc.find_library('acl', required: false)
|
if acl_dep.found()
|
||||||
conf.set('WITH_SYS_ACL_H', 1)
|
conf.set('WITH_LIBACL', 1)
|
||||||
else
|
|
||||||
acl_dep = dependency('', required: false)
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
apparmor_dep = dependency('libapparmor', required: get_option('apparmor'))
|
apparmor_dep = dependency('libapparmor', required: get_option('apparmor'))
|
||||||
|
@ -852,7 +852,7 @@ qemuDomainNamespaceAvailable(qemuDomainNamespace ns G_GNUC_UNUSED)
|
|||||||
|
|
||||||
switch (ns) {
|
switch (ns) {
|
||||||
case QEMU_DOMAIN_NS_MOUNT:
|
case QEMU_DOMAIN_NS_MOUNT:
|
||||||
# if !defined(WITH_SYS_ACL_H) || !defined(WITH_SELINUX)
|
# if !defined(WITH_LIBACL) || !defined(WITH_SELINUX)
|
||||||
/* We can't create the exact copy of paths if either of
|
/* We can't create the exact copy of paths if either of
|
||||||
* these is not available. */
|
* these is not available. */
|
||||||
return false;
|
return false;
|
||||||
|
@ -56,7 +56,7 @@
|
|||||||
#if WITH_SYS_SYSCALL_H
|
#if WITH_SYS_SYSCALL_H
|
||||||
# include <sys/syscall.h>
|
# include <sys/syscall.h>
|
||||||
#endif
|
#endif
|
||||||
#if WITH_SYS_ACL_H
|
#if WITH_LIBACL
|
||||||
# include <sys/acl.h>
|
# include <sys/acl.h>
|
||||||
#endif
|
#endif
|
||||||
#include <sys/file.h>
|
#include <sys/file.h>
|
||||||
@ -3752,7 +3752,7 @@ virFileMoveMount(const char *src G_GNUC_UNUSED,
|
|||||||
#endif /* !defined(__linux__) || !defined(WITH_SYS_MOUNT_H) */
|
#endif /* !defined(__linux__) || !defined(WITH_SYS_MOUNT_H) */
|
||||||
|
|
||||||
|
|
||||||
#if defined(WITH_SYS_ACL_H)
|
#if defined(WITH_LIBACL)
|
||||||
int
|
int
|
||||||
virFileGetACLs(const char *file,
|
virFileGetACLs(const char *file,
|
||||||
void **acl)
|
void **acl)
|
||||||
@ -3782,7 +3782,7 @@ virFileFreeACLs(void **acl)
|
|||||||
*acl = NULL;
|
*acl = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* !defined(WITH_SYS_ACL_H) */
|
#else /* !defined(WITH_LIBACL) */
|
||||||
|
|
||||||
int
|
int
|
||||||
virFileGetACLs(const char *file G_GNUC_UNUSED,
|
virFileGetACLs(const char *file G_GNUC_UNUSED,
|
||||||
@ -3808,7 +3808,7 @@ virFileFreeACLs(void **acl)
|
|||||||
*acl = NULL;
|
*acl = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* !defined(WITH_SYS_ACL_H) */
|
#endif /* !defined(WITH_LIBACL) */
|
||||||
|
|
||||||
int
|
int
|
||||||
virFileCopyACLs(const char *src,
|
virFileCopyACLs(const char *src,
|
||||||
|
Loading…
Reference in New Issue
Block a user