From ffbb4a6b1fb52dc46639d18bf0dd769fe53d3e88 Mon Sep 17 00:00:00 2001 From: Soren Sandmann Pedersen Date: Tue, 15 May 2007 11:08:24 -0400 Subject: [PATCH] Don't build GTK+ test programs if GTK+ is not available --- configure.ac | 4 ++++ test/Makefile.am | 11 +++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index 8b5217e..a4aeb1c 100644 --- a/configure.ac +++ b/configure.ac @@ -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) diff --git a/test/Makefile.am b/test/Makefile.am index fedbcdc..6389b5b 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -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 -- 2.7.4