From d07bd8c654a2efe94165a75eafbf905d5c8268e5 Mon Sep 17 00:00:00 2001 From: Ting-Wei Lan Date: Sun, 7 Jan 2018 18:19:55 +0800 Subject: [PATCH] build-sys: Enable ACL support on FreeBSD sys/acl.h works on both FreeBSD and Linux, so we should use it instead of acl/libacl.h, which only works on Linux. FreeBSD puts ACL functions in libc, so we should check whether ACL functions are available in libc before doing the check with -lacl. https://bugs.freedesktop.org/show_bug.cgi?id=104525 --- configure.ac | 5 +++-- src/spice-client-glib-usb-acl-helper.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 31e5b1d..2a14055 100644 --- a/configure.ac +++ b/configure.ac @@ -386,8 +386,9 @@ if test "x$have_usbredir" = "xyes" && test "x$enable_polkit" != "xno"; then PKG_CHECK_MODULES([POLKIT], [polkit-gobject-1 >= 0.96], [have_polkit=yes], [have_polkit=no]) - AC_CHECK_HEADER([acl/libacl.h], [], [have_polkit=no]) - AC_CHECK_LIB([acl], [acl_get_file], [ACL_LIBS=-lacl], [have_polkit=no]) + AC_CHECK_HEADER([sys/acl.h], [], [have_polkit=no]) + AC_CHECK_LIB([c], [acl_get_file], [ACL_LIBS=""], [ + AC_CHECK_LIB([acl], [acl_get_file], [ACL_LIBS=-lacl], [have_polkit=no])]) if test "x$enable_polkit" = "xyes" && test "x$have_polkit" = "xno"; then AC_MSG_ERROR([PolicyKit support explicitly requested, but some required packages are not available]) fi diff --git a/src/spice-client-glib-usb-acl-helper.c b/src/spice-client-glib-usb-acl-helper.c index 80cdced..f75e0fc 100644 --- a/src/spice-client-glib-usb-acl-helper.c +++ b/src/spice-client-glib-usb-acl-helper.c @@ -32,7 +32,7 @@ #include #include #include -#include +#include #define FATAL_ERROR(...) \ do { \ -- 2.15.1