Permalink
Browse files

Fix build for gtk-quartz.

  • Loading branch information...
1 parent a3d862d commit 5d69bd09689bdcc6dc942c56a2f53a1280a536eb @chergert chergert committed Aug 14, 2009
Showing with 20 additions and 3 deletions.
  1. +8 −1 configure.ac
  2. +4 −0 src/Makefile.am
  3. +8 −2 src/widget-tree.c
View
@@ -55,6 +55,9 @@ PKG_CHECK_MODULES(GTK, [gtk+-2.0 >= 2.12.0])
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
+GDK_BACKEND=`pkg-config --variable=target gtk+-2.0`
+AM_CONDITIONAL(HAVE_X11, [test x"$GDK_BACKEND" = x"x11"])
+
AM_PATH_PYTHON([2.4], [
AC_PATH_PROG(PYTHON_CONFIG, python$PYTHON_VERSION-config)
if test x"$PYTHON_CONFIG" == x""; then
@@ -69,7 +72,11 @@ AM_PATH_PYTHON([2.4], [
fi
# Kind of a hacky way to get this, but that's alright..
- PYTHON_SHARED_LIB="libpython${PYTHON_VERSION}.so"
+ if test x"$GDK_BACKEND" == x"quartz"; then
+ PYTHON_SHARED_LIB="libpython${PYTHON_VERSION}.dylib"
+ else
+ PYTHON_SHARED_LIB="libpython${PYTHON_VERSION}.so"
+ fi
AC_SUBST(PYTHON_SHARED_LIB)
PKG_CHECK_MODULES(PYGTK,
View
@@ -36,3 +36,7 @@ INCLUDES = \
$(PYTHON_CFLAGS) \
$(PYGTK_CFLAGS) \
-DPYTHON_SHARED_LIB="\"$(PYTHON_SHARED_LIB)\""
+
+if HAVE_X11
+INCLUDES += -DHAVE_X11
+endif
View
@@ -25,7 +25,9 @@
#include "widget-tree.h"
#include <string.h>
+#if HAVE_X11
#include <gdk/gdkx.h>
+#endif
enum
@@ -389,8 +391,12 @@ append_widget(GtkTreeStore *model,
if (widget->window)
{
- window_info = g_strdup_printf("%p (XID 0x%x)", widget->window,
- (int)GDK_WINDOW_XID(widget->window));
+#if HAVE_X11
+ window_info = g_strdup_printf("%p (XID 0x%x)", widget->window,
+ (int)GDK_WINDOW_XID(widget->window));
+#else
+ window_info = g_strdup("");
+#endif
}
else
{

0 comments on commit 5d69bd0

Please sign in to comment.