aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Schridde <devurandom@gmx.net>2011-09-02 09:50:03 -0500
committerTed Gould <ted@gould.cx>2011-09-02 09:50:03 -0500
commit74f7670af1848a814568d570d2306ed93ece1a6c (patch)
treed00af6c1e689e697fb7a8b20ac0d944db3895a37
parent9e5549b8a612db4a68bb7df14b5d7244bb82154c (diff)
downloadlibdbusmenu-74f7670af1848a814568d570d2306ed93ece1a6c.tar.gz
libdbusmenu-74f7670af1848a814568d570d2306ed93ece1a6c.tar.bz2
libdbusmenu-74f7670af1848a814568d570d2306ed93ece1a6c.zip
Make building tests optional
-rw-r--r--Makefile.am6
-rw-r--r--configure.ac16
-rw-r--r--tools/testapp/Makefile.am6
3 files changed, 25 insertions, 3 deletions
diff --git a/Makefile.am b/Makefile.am
index c2c0980..81a2cbb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3,11 +3,15 @@ EXTRA_DIST = \
COPYING-GPL3 \
m4/introspection.m4
+if WANT_TESTS
+TESTS_SUBDIR = tests
+endif
+
SUBDIRS = \
libdbusmenu-glib \
libdbusmenu-gtk \
tools \
- tests \
+ $(TESTS_SUBDIR) \
docs \
po
diff --git a/configure.ac b/configure.ac
index fcec99a..6430cc3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -99,8 +99,17 @@ AC_SUBST(DBUSMENUDUMPER_LIBS)
JSON_GLIB_REQUIRED_VERSION=0.13.4
GIO_UNIX_REQUIRED_VERSION=2.24
+AC_ARG_ENABLE([tests],
+ AC_HELP_STRING([--disable-tests], [Disable tests]),
+ [enable_tests=$enableval], [enable_tests=auto])
+AM_CONDITIONAL([WANT_TESTS], [test "x$enable_tests" != "xno"])
+
+AS_IF([test "x$enable_tests" != "xno"],[
PKG_CHECK_MODULES(DBUSMENUTESTS, json-glib-1.0 >= $JSON_GLIB_REQUIRED_VERSION
- gio-unix-2.0 >= $GIO_UNIX_REQUIRED_VERSION)
+ gio-unix-2.0 >= $GIO_UNIX_REQUIRED_VERSION,
+ [have_tests=yes]
+)
+])
AC_SUBST(DBUSMENUTESTS_CFLAGS)
AC_SUBST(DBUSMENUTESTS_LIBS)
@@ -199,3 +208,8 @@ libdbusmenu Configuration:
GTK+ Version: $with_gtk
])
+AS_IF([test "x$have_tests" = "xyes"],
+ AC_MSG_NOTICE([ Tests: yes]),
+ AC_MSG_NOTICE([ Tests: no])
+)
+
diff --git a/tools/testapp/Makefile.am b/tools/testapp/Makefile.am
index 39de532..ee12ec9 100644
--- a/tools/testapp/Makefile.am
+++ b/tools/testapp/Makefile.am
@@ -5,7 +5,11 @@ else
VER=
endif
-libexec_PROGRAMS = dbusmenu-testapp
+libexec_PROGRAMS =
+
+if WANT_TESTS
+libexec_PROGRAMS += dbusmenu-testapp
+endif
dbusmenu_testapp_SOURCES = \
main.c