[zenity] Bug 559638 – explicitly link against libX11



commit eae739b52894f9eb631cfef4535b2c36384aba31
Author: Frederic Peters <fpeters 0d be>
Date:   Sat Aug 8 17:15:34 2009 +0100

    Bug 559638 â?? explicitly link against libX11

 configure.in |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)
---
diff --git a/configure.in b/configure.in
index b3f8ea2..2034b2e 100644
--- a/configure.in
+++ b/configure.in
@@ -22,6 +22,34 @@ PKG_CHECK_MODULES([ZENITY],[gtk+-2.0 >= $GTK_REQUIRED glib-2.0])
 AC_SUBST([ZENITY_CFLAGS])
 AC_SUBST([ZENITY_LIBS])
 
+dnl *************************
+dnl Check for the GTK+ backend, if it's X11, we -lX11
+dnl *************************
+
+zenity_save_cflags="$CFLAGS"
+# pull in the CFLAGS to locate gdkconfig.h
+CFLAGS=`$PKG_CONFIG --cflags gtk+-2.0`
+AC_COMPILE_IFELSE([
+#include <gdkconfig.h>
+
+int main(void) {
+#ifndef GDK_WINDOWING_X11
+#error GDK_WINDOWING_X11 not defined
+#endif
+    return 0;
+}
+],
+        GDK_BACKEND_X11=yes,
+        GDK_BACKEND_X11=no)
+
+CFLAGS="$zenity_save_cflags"
+
+if test "x$GDK_BACKEND_X11" = "xyes"; then
+	PKG_CHECK_MODULES(X, x11)
+	ZENITY_CFLAGS="$ZENITY_CFLAGS $X_CFLAGS"
+	ZENITY_LIBS="$ZENITY_LIBS $X_LIBS"
+fi
+
 # *******************************
 # perl check
 # *******************************



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