[Spice-devel] [PATCH] Add missing libX11 reference to build system

Ian Stakenvicius axs at gentoo.org
Fri Aug 19 16:07:13 UTC 2016


GTK on its own is not enough to ensure libX11 is properly linked with
libspice-client-gtk.  This patch adds X11_LIBS to SPICE_GTK_LIBADD_COMMON
(and X11_CFLAGS to a relevant section as well) in src/Makefile.am, and
performs an approriate pkg-config based check to determine the correct
values in configure.ac when not building for win32 or quartz.

For more info see http://bugs.gentoo.org/585118
---
 configure.ac    | 4 ++++
 src/Makefile.am | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/configure.ac b/configure.ac
index b9458b7..9b2351d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -165,6 +165,10 @@ AS_IF([test "x$have_win32" = "xyes"], [AC_DEFINE([HAVE_WINDOWS], 1, [Have Win32?
 AM_CONDITIONAL([WITH_DISPLAY_WINDOWS], [test "x$have_win32" = "xyes"])
 
 AC_CHECK_HEADERS([X11/XKBlib.h])
+AS_IF([test "x$have_quartz" != "xyes" && test "x$have_win32" != "xyes"],
+      [PKG_CHECK_MODULES(X11,x11)])
+AC_SUBST(X11_CFLAGS)
+AC_SUBST(X11_LIBS)
 
 AC_ARG_WITH([pnp-ids-path],
   AC_HELP_STRING([--with-pnp-ids-path],
diff --git a/src/Makefile.am b/src/Makefile.am
index fd90db3..7542580 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -100,6 +100,7 @@ SPICE_COMMON_CPPFLAGS =						\
 	$(GUDEV_CFLAGS)						\
 	$(SOUP_CFLAGS)						\
 	$(PHODAV_CFLAGS)					\
+	$(X11_CFLAGS)					\
 	$(LZ4_CFLAGS)					\
 	$(NULL)
 
@@ -120,6 +121,7 @@ SPICE_GTK_LIBADD_COMMON =		\
 	libspice-client-glib-2.0.la	\
 	$(GTK_LIBS)			\
 	$(CAIRO_LIBS)			\
+	$(X11_LIBS)			\
 	$(LIBM)				\
 	$(NULL)
 
-- 
2.7.3



More information about the Spice-devel mailing list