aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2011-09-02 11:58:55 -0500
committerTed Gould <ted@gould.cx>2011-09-02 11:58:55 -0500
commit00006803a347a74f679bf262800f0bed484d9cdb (patch)
tree32ca6d82b28fcc59adbb77cf6d4ff34914864930
parent74f7670af1848a814568d570d2306ed93ece1a6c (diff)
parent89cf0dc43171c9d2b708cd8c9de27593f1338097 (diff)
downloadlibdbusmenu-00006803a347a74f679bf262800f0bed484d9cdb.tar.gz
libdbusmenu-00006803a347a74f679bf262800f0bed484d9cdb.tar.bz2
libdbusmenu-00006803a347a74f679bf262800f0bed484d9cdb.zip
Making GTK optional
-rw-r--r--Makefile.am6
-rw-r--r--configure.ac29
-rw-r--r--docs/Makefile.am8
-rw-r--r--tests/Makefile.am18
4 files changed, 47 insertions, 14 deletions
diff --git a/Makefile.am b/Makefile.am
index 81a2cbb..a69c377 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -7,9 +7,13 @@ if WANT_TESTS
TESTS_SUBDIR = tests
endif
+if WANT_LIBDBUSMENUGTK
+LIBDBUSMENUGTK_SUBDIR = libdbusmenu-gtk
+endif
+
SUBDIRS = \
libdbusmenu-glib \
- libdbusmenu-gtk \
+ $(LIBDBUSMENUGTK_SUBDIR) \
tools \
$(TESTS_SUBDIR) \
docs \
diff --git a/configure.ac b/configure.ac
index 6430cc3..895f9f8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -58,27 +58,37 @@ AC_SUBST(DBUSMENUGLIB_LIBS)
GTK_REQUIRED_VERSION=2.16
GTK3_REQUIRED_VERSION=2.91
+AC_ARG_ENABLE([gtk],
+ AC_HELP_STRING([--disable-gtk], [Disable libdbusmenu-gtk library]),
+ [enable_gtk=$enableval], [enable_gtk=auto])
+AM_CONDITIONAL([WANT_LIBDBUSMENUGTK], [test "x$enable_gtk" != "xno"])
+
AC_ARG_WITH([gtk],
[AS_HELP_STRING([--with-gtk],
[Which version of gtk to use @<:@default=3@:>@])],
[],
[with_gtk=3])
+AM_CONDITIONAL([USE_GTK3], [test "x$with_gtk" = "x3"])
+
+AS_IF([test "x$enable_gtk" != "xno"],[
AS_IF([test "x$with_gtk" = x3],
[PKG_CHECK_MODULES(DBUSMENUGTK, gtk+-3.0 >= $GTK3_REQUIRED_VERSION
- glib-2.0 >= $GLIB_REQUIRED_VERSION)
- AC_SUBST(DBUSMENUGTK_CFLAGS)
- AC_SUBST(DBUSMENUGTK_LIBS)
+ glib-2.0 >= $GLIB_REQUIRED_VERSION,
+ [have_gtk=yes]
+)
AC_DEFINE(HAVE_GTK3, 1, [whether gtk3 is available])
],
[test "x$with_gtk" = x2],
[PKG_CHECK_MODULES(DBUSMENUGTK, gtk+-2.0 >= $GTK_REQUIRED_VERSION
- glib-2.0 >= $GLIB_REQUIRED_VERSION)
- AC_SUBST(DBUSMENUGTK_CFLAGS)
- AC_SUBST(DBUSMENUGTK_LIBS)
+ glib-2.0 >= $GLIB_REQUIRED_VERSION,
+ [have_gtk=yes]
+)
],
[AC_MSG_FAILURE([Value for --with-gtk was neither 2 nor 3])]
)
-AM_CONDITIONAL(USE_GTK3, [test "x$with_gtk" = x3])
+])
+AC_SUBST(DBUSMENUGTK_CFLAGS)
+AC_SUBST(DBUSMENUGTK_LIBS)
###########################
# Dependencies - dumper
@@ -213,3 +223,8 @@ AS_IF([test "x$have_tests" = "xyes"],
AC_MSG_NOTICE([ Tests: no])
)
+AS_IF([test "x$enable_gtk" = "xno"],
+ AC_MSG_NOTICE([ Gtk: no]),
+ AC_MSG_NOTICE([ Gtk: yes (gtk$with_gtk)])
+)
+
diff --git a/docs/Makefile.am b/docs/Makefile.am
index 87ffe5f..23a4c86 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -1 +1,7 @@
-SUBDIRS = libdbusmenu-glib libdbusmenu-gtk
+if WANT_LIBDBUSMENUGTK
+LIBDBUSMENUGTK_SUBDIR = libdbusmenu-gtk
+endif
+
+SUBDIRS = \
+ libdbusmenu-glib \
+ $(LIBDBUSMENUGTK_SUBDIR)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index a4763da..e6882af 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -13,13 +13,17 @@ TESTS = \
test-glib-proxy \
test-glib-simple-items \
test-glib-submenu \
- test-json \
+ test-json
+
+if WANT_LIBDBUSMENUGTK
+TESTS += \
test-gtk-objects-test \
test-gtk-label \
test-gtk-shortcut \
test-gtk-reorder \
test-gtk-submenu \
test-gtk-parser-test
+endif
XFAIL_TESTS = \
test-glib-proxy
@@ -44,20 +48,24 @@ check_PROGRAMS = \
test-glib-proxy-client \
test-glib-proxy-server \
test-glib-proxy-proxy \
- test-gtk-objects \
test-glib-submenu-client \
test-glib-submenu-server \
+ test-glib-simple-items \
+ test-json-client \
+ test-json-server
+
+if WANT_LIBDBUSMENUGTK
+check_PROGRAMS += \
+ test-gtk-objects \
test-gtk-label-client \
test-gtk-label-server \
test-gtk-shortcut-client \
test-gtk-shortcut-server \
- test-glib-simple-items \
test-gtk-reorder-server \
- test-json-client \
- test-json-server \
test-gtk-submenu-server \
test-gtk-submenu-client \
test-gtk-parser
+endif
XVFB_RUN=". $(srcdir)/run-xvfb.sh"