[Spice-commits] 2 commits - configure.ac spice-client-glib-2.0.pc.in src/spice-client-glib-usb-acl-helper.c
Christophe Fergau
teuf at kemper.freedesktop.org
Tue Jan 9 13:44:48 UTC 2018
configure.ac | 11 ++++++++---
spice-client-glib-2.0.pc.in | 1 +
src/spice-client-glib-usb-acl-helper.c | 2 +-
3 files changed, 10 insertions(+), 4 deletions(-)
New commits:
commit 03d3ea2fa96566dfb413c7f53854390b089f9eed
Author: Ting-Wei Lan <lantw at src.gnome.org>
Date: Sun Jan 7 17:52:24 2018 +0800
build-sys: Workaround missing openssl.pc for FreeBSD
FreeBSD has OpenSSL installed in base, but .pc files are not available.
We can still successfully build spice-gtk by setting SSL_CFLAGS and
SSL_LIBS variables manually, but openssl will still be recorded to
Requires.private field of spice-client-glib-2.0.pc, causing problems for
applications using spice-gtk. To workaround the issue, we do the check
again without using SSL_CFLAGS and SSL_LIBS variables and put SSL_LIBS
into Libs.private field when openssl.pc cannot be found.
https://bugs.freedesktop.org/show_bug.cgi?id=104524
diff --git a/configure.ac b/configure.ac
index 6101c22..2a14055 100644
--- a/configure.ac
+++ b/configure.ac
@@ -107,6 +107,7 @@ dnl =========================================================================
dnl Chek optional features
SPICE_GLIB_REQUIRES=""
+SPICE_GLIB_LIBS=""
SPICE_GTK_REQUIRES=""
PKG_CHECK_MODULES(PIXMAN, pixman-1 >= 0.17.7)
@@ -115,7 +116,9 @@ SPICE_GLIB_REQUIRES="${SPICE_GLIB_REQUIRES} pixman-1 >= 0.17.7"
PKG_CHECK_MODULES(SSL, openssl)
-SPICE_GLIB_REQUIRES="${SPICE_GLIB_REQUIRES} openssl"
+PKG_CHECK_EXISTS(openssl,
+ [SPICE_GLIB_REQUIRES="${SPICE_GLIB_REQUIRES} openssl"],
+ [SPICE_GLIB_LIBS="${SPICE_GLIB_LIBS} ${SSL_LIBS}"])
SPICE_CHECK_SASL
@@ -588,6 +591,7 @@ AC_SUBST(SPICE_GLIB_CFLAGS)
AC_SUBST(SPICE_GTK_CFLAGS)
AC_SUBST(SPICE_GLIB_REQUIRES)
+AC_SUBST(SPICE_GLIB_LIBS)
AC_SUBST(SPICE_GTK_REQUIRES)
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
diff --git a/spice-client-glib-2.0.pc.in b/spice-client-glib-2.0.pc.in
index 27d6886..1b5cce0 100644
--- a/spice-client-glib-2.0.pc.in
+++ b/spice-client-glib-2.0.pc.in
@@ -10,4 +10,5 @@ Version: @VERSION@
Requires: spice-protocol
Requires.private: @SPICE_GLIB_REQUIRES@
Libs: -L${libdir} -lspice-client-glib-2.0
+Libs.private: @SPICE_GLIB_LIBS@
Cflags: -I${includedir}/spice-client-glib-2.0
commit 0f588eb3fdfc17394c7d5bdf23cb1d0ea6e3c190
Author: Ting-Wei Lan <lantw at src.gnome.org>
Date: Sun Jan 7 18:19:55 2018 +0800
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
diff --git a/configure.ac b/configure.ac
index 8fd525b..6101c22 100644
--- a/configure.ac
+++ b/configure.ac
@@ -383,8 +383,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 <sys/stat.h>
#include <gio/gunixinputstream.h>
#include <polkit/polkit.h>
-#include <acl/libacl.h>
+#include <sys/acl.h>
#define FATAL_ERROR(...) \
do { \
More information about the Spice-commits
mailing list