From 1031739dda98f25efce5bb395bfe0cb86ba37ac8 Mon Sep 17 00:00:00 2001 From: Ting-Wei Lan Date: Sun, 7 Jan 2018 17:52:24 +0800 Subject: [PATCH] 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 --- configure.ac | 6 +++++- spice-client-glib-2.0.pc.in | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 8fd525b..31e5b1d 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 @@ -587,6 +590,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 -- 2.15.1