[totem] build: Fix detection of GDK backend in case of multiple backends



commit 870b8a95cdfcbc45cd9c02b9f141ad50a074f798
Author: Vincent Untz <vuntz gnome org>
Date:   Wed Jul 6 10:27:39 2011 +0200

    build: Fix detection of GDK backend in case of multiple backends
    
    The GDK backend detection routine only worked in the case where GTK+ is
    built for one and only one backend.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=654070

 configure.in |   93 ++++++++++++++++++++++++++++++---------------------------
 1 files changed, 49 insertions(+), 44 deletions(-)
---
diff --git a/configure.in b/configure.in
index 33d923f..3b4ea4d 100644
--- a/configure.in
+++ b/configure.in
@@ -238,52 +238,57 @@ dnl *************************
 dnl X11 related functionality
 dnl *************************
 have_x11=no
-if test x$(pkg-config --variable=targets gtk+-3.0) = xx11; then
-	AC_PATH_X
+gdk_targets=$(pkg-config --variable=targets gtk+-3.0)
+for gdk_target in $gdk_targets; do
+	if test x$gdk_target = xx11; then
+		AC_PATH_X
 
-	have_x11=yes
+		have_x11=yes
 
-	if test x"$x_includes" != x"NONE" && test -n "$x_includes" ; then
-		X_INCLUDES=-I`echo $x_includes | sed -e "s/:/ -I/g"`
-	fi
-	if test x"$x_libraries" != x"NONE" && test -n "$x_libraries" ; then
-		X_LIBRARIES=-L`echo $x_libraries | sed -e "s/:/ -L/g"`
-	fi
-	CFLAGS="$X_INCLUDES $CFLAGS"
-	LIBS="$X_LIBRARIES $LIBS"
-
-	XTEST_LIBS=""
-	enable_xtest=no
-	AC_CHECK_LIB(Xtst, XTestFakeKeyEvent,
-		XTEST_LIBS="-lX11 -lXtst $X_LIBRARIES"
-		enable_xtest=yes
-		AC_DEFINE(HAVE_XTEST, 1, [defined if you have XTest library]),
-		,
-		$X_LIBRARIES)
-	AC_SUBST(XTEST_LIBS)
-
-	X_LIBS=""
-
-	dnl Explicitely link against libX11 to avoid problems with crappy linkers
-	X_LIBS="$X_LIBRARIES -lX11"
-	AC_SUBST(X_LIBS)
-
-	dnl Multimedia keys
-	have_xfree=no
-	AC_COMPILE_IFELSE([
-		#include <X11/XF86keysym.h>
-		int main(int argc,char **argv) {
-		return 0;
-		}
-		],
-		have_xfree=yes
-	)
-	AC_MSG_CHECKING(for X11 XFree86 headers)
-	AC_MSG_RESULT([$have_xfree])
-	if test x"$have_xfree" = "xyes" ; then
-		AC_DEFINE(HAVE_XFREE, 1, [defined if you have X11/XF86keysym.h])
+		if test x"$x_includes" != x"NONE" && test -n "$x_includes" ; then
+			X_INCLUDES=-I`echo $x_includes | sed -e "s/:/ -I/g"`
+		fi
+		if test x"$x_libraries" != x"NONE" && test -n "$x_libraries" ; then
+			X_LIBRARIES=-L`echo $x_libraries | sed -e "s/:/ -L/g"`
+		fi
+		CFLAGS="$X_INCLUDES $CFLAGS"
+		LIBS="$X_LIBRARIES $LIBS"
+
+		XTEST_LIBS=""
+		enable_xtest=no
+		AC_CHECK_LIB(Xtst, XTestFakeKeyEvent,
+			XTEST_LIBS="-lX11 -lXtst $X_LIBRARIES"
+			enable_xtest=yes
+			AC_DEFINE(HAVE_XTEST, 1, [defined if you have XTest library]),
+			,
+			$X_LIBRARIES)
+		AC_SUBST(XTEST_LIBS)
+
+		X_LIBS=""
+
+		dnl Explicitely link against libX11 to avoid problems with crappy linkers
+		X_LIBS="$X_LIBRARIES -lX11"
+		AC_SUBST(X_LIBS)
+
+		dnl Multimedia keys
+		have_xfree=no
+		AC_COMPILE_IFELSE([
+			#include <X11/XF86keysym.h>
+			int main(int argc,char **argv) {
+			return 0;
+			}
+			],
+			have_xfree=yes
+		)
+		AC_MSG_CHECKING(for X11 XFree86 headers)
+		AC_MSG_RESULT([$have_xfree])
+		if test x"$have_xfree" = "xyes" ; then
+			AC_DEFINE(HAVE_XFREE, 1, [defined if you have X11/XF86keysym.h])
+		fi
+
+		break
 	fi
-fi
+done
 
 dnl ================================================================
 dnl Plugins support



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]