From 74f7670af1848a814568d570d2306ed93ece1a6c Mon Sep 17 00:00:00 2001 From: Dennis Schridde Date: Fri, 2 Sep 2011 09:50:03 -0500 Subject: Make building tests optional --- Makefile.am | 6 +++++- configure.ac | 16 +++++++++++++++- tools/testapp/Makefile.am | 6 +++++- 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 -- cgit v1.2.3