Don't build GTK+ test programs if GTK+ is not available
authorSoren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com>
Tue, 15 May 2007 15:08:24 +0000 (11:08 -0400)
committerSoren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com>
Tue, 15 May 2007 15:08:24 +0000 (11:08 -0400)
configure.ac
test/Makefile.am

index 8b5217e..a4aeb1c 100644 (file)
@@ -42,7 +42,11 @@ if test "x$GCC" = "xyes"; then
   *) CFLAGS="$CFLAGS -Wall" ;;
   esac fi changequote([,])dnl
 
+PKG_CHECK_MODULES(GTK, [gtk+-2.0], [HAVE_GTK=yes], [HAVE_GTK=no])
+AM_CONDITIONAL(HAVE_GTK, [test "x$HAVE_GTK" = xyes])
 
+AC_SUBST(GTK_CFLAGS)
+AC_SUBST(GTK_LIBS)
 AC_SUBST(DEP_CFLAGS)
 AC_SUBST(DEP_LIBS)
                  
index fedbcdc..6389b5b 100644 (file)
@@ -1,14 +1,13 @@
+if HAVE_GTK
 TESTPROGRAMS = \
        composite-test          \
        gradient-test
 
 noinst_PROGRAMS = $(TESTPROGRAMS)
 
-INCLUDES = -I$(top_srcdir)/pixman `pkg-config --cflags gtk+-2.0`
-
-GTKLIBS = -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpng12 -lm -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0
-
-composite_test_LDADD = $(top_builddir)/pixman/libpixman.la $(GTKLIBS)
-gradient_test_LDADD = $(top_builddir)/pixman/libpixman.la $(GTKLIBS)
+INCLUDES = -I$(top_srcdir)/pixman $(GTK_CFLAGS)
 
+composite_test_LDADD = $(top_builddir)/pixman/libpixman.la $(GTK_LIBS)
+gradient_test_LDADD = $(top_builddir)/pixman/libpixman.la $(GTK_LIBS)
 
+endif
\ No newline at end of file