[dconf] conditionalise dependence on GTK



commit 3daa47e46014bb71770913b21c5e2659a4f9bf22
Author: Ryan Lortie <desrt desrt ca>
Date:   Fri Aug 14 11:31:00 2009 -0400

    conditionalise dependence on GTK

 Makefile.am  |    6 +++++-
 configure.ac |   19 ++++++++++++++++++-
 2 files changed, 23 insertions(+), 2 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 02659ea..59e5db8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,9 @@
-SUBDIRS = common dconf bin editor writer config
+SUBDIRS = common dconf bin writer config
 
 if ENABLE_GIO
 SUBDIRS += gio
 endif
+
+if ENABLE_GTK
+SUBDIRS += editor
+endif
diff --git a/configure.ac b/configure.ac
index b7b1bbd..4e8c252 100644
--- a/configure.ac
+++ b/configure.ac
@@ -7,7 +7,24 @@ AC_PROG_CC
 
 PKG_CHECK_MODULES(glib, glib-2.0)
 PKG_CHECK_MODULES(dbus, dbus-1)
-PKG_CHECK_MODULES(gtk, gtk+-2.0)
+
+AC_ARG_ENABLE(gtk,
+              AS_HELP_STRING([--enable-gtk],
+                             [Enable GTK frontends (dconf-editor)]),
+              [], [
+                if ${PKG_CONFIG} --exists gtk+-2.0; then
+                  enable_gtk=yes
+                else
+                  enable_gtk=no
+                fi
+              ])
+
+if test "$enable_gtk" = "yes"; then
+  PKG_CHECK_MODULES(gtk, gtk+-2.0)
+fi
+
+AM_CONDITIONAL(ENABLE_GTK, test "$enable_gtk" = "yes")
+AC_DEFINE(ENABLE_GTK)
 
 AC_ARG_ENABLE(gio,
               AS_HELP_STRING([--enable-gio],



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