[libdmapsharing] Make building tests optional



commit 1f6ae2a6d01fac70106ddac862c64b3cec0717ef
Author: W. Michael Petullo <mike flyn org>
Date:   Mon Sep 1 14:55:44 2014 -0400

    Make building tests optional
    
    Signed-off-by: W. Michael Petullo <mike flyn org>

 configure.ac      |    8 ++++++++
 tests/Makefile.am |    4 ++++
 2 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index a45a567..ffa2152 100644
--- a/configure.ac
+++ b/configure.ac
@@ -45,6 +45,14 @@ GOBJECT_INTROSPECTION_CHECK([1.30.0])
 GTK_DOC_CHECK(1.0)
 AC_CONFIG_MACRO_DIR(m4)
 
+dnl Test if --disable-tests given
+AC_ARG_ENABLE(tests, [AC_HELP_STRING([--disable-tests],[do not build tests])], tests=$enableval, tests=yes)
+if test x$tests = xyes; then
+       AC_DEFINE(WITH_TESTS,1,[Defined when tests are to be built])
+       AM_CONDITIONAL(WITH_TESTS, true)
+else
+       AM_CONDITIONAL(WITH_TESTS, false)
+fi
 
 dnl Test if --enable-debug given
 AC_ARG_ENABLE(debug, [AC_HELP_STRING([--enable-debug],[enable debugging mode])])
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 9c0048f..3d43200 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,3 +1,4 @@
+if WITH_TESTS
 noinst_PROGRAMS = test-dmap-client test-dmap-server
 
 if HAVE_GEE
@@ -13,6 +14,7 @@ noinst_PROGRAMS += unit-test
 
 LIBS += $(CHECK_LIBS)
 endif
+endif
 
 test_dmap_client_SOURCES = \
        test-dmap-db.c \
@@ -53,7 +55,9 @@ test_dmap_server_LDADD = \
        $(MDNS_LIBS)
 
 if HAVE_VALAC
+if WITH_TESTS
 BUILT_SOURCES = dacplisten.stamp dpapview.stamp dmapcopy.stamp dmapserve.stamp
+endif
 
 dacplisten.stamp: $(dacplisten_VALASOURCES)
        $(VALAC) --vapidir=../vala --pkg gee-0.8 --pkg gstreamer-1.0 --pkg libdmapsharing-3.0 --pkg 
libsoup-2.4 --pkg glib-2.0 --pkg avahi-gobject  $^ -C


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