waylandsink: Only build if gtk-3.0 was built with wayland target
Check in configure if the gtk-3.0 has wayland support, and don't
build the waylandsink example if it doesn't.
diff --git a/configure.ac b/configure.ac
index 5fe28fa..39273bc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -305,6 +305,7 @@
dnl GTK is optional and used in examples
HAVE_GTK3=NO
+HAVE_GTK3_WAYLAND=""
if test "x$BUILD_EXAMPLES" = "xyes"; then
PKG_CHECK_MODULES(GTK3, gtk+-3.0 >= 3.4, HAVE_GTK3=yes, HAVE_GTK3=no)
if test "x$HAVE_GTK3" = "xyes"; then
@@ -313,12 +314,15 @@
AC_SUBST(GTK_VERSION)
GTK_PREFIX=`$PKG_CONFIG --variable=prefix gdk-pixbuf-2.0`
AC_SUBST(GTK_BASE_DIR)
+ GTK3_TARGETS=`$PKG_CONFIG --variable=targets gtk+-3.0`
+ case "$GTK3_TARGETS" in *wayland*) HAVE_GTK3_WAYLAND="1" ;; esac
fi
fi
AC_SUBST(GTK3_LIBS)
AC_SUBST(GTK3_CFLAGS)
AC_SUBST(HAVE_GTK3)
AM_CONDITIONAL(HAVE_GTK3, test "x$HAVE_GTK3" = "xyes")
+AM_CONDITIONAL(HAVE_GTK3_WAYLAND, test "x$HAVE_GTK3_WAYLAND" = "x1")
dnl x11 is optional for librfb
HAVE_X11=NO
diff --git a/tests/examples/Makefile.am b/tests/examples/Makefile.am
index 68f3412..5dc5614 100644
--- a/tests/examples/Makefile.am
+++ b/tests/examples/Makefile.am
@@ -31,7 +31,7 @@
endif
if USE_WAYLAND
-if HAVE_GTK3
+if HAVE_GTK3_WAYLAND
WAYLAND_DIR=waylandsink
else
WAYLAND_DIR=