[libgdata] Add --disable-tests to skip the building of tests



commit 730dfd4f728ca33d5dee20216562a45b644ae952
Author: Kalev Lember <kalevlember gmail com>
Date:   Thu Oct 30 11:31:36 2014 +0100

    Add --disable-tests to skip the building of tests
    
    https://bugzilla.gnome.org/show_bug.cgi?id=739395

 Makefile.am  |    6 +++++-
 configure.ac |   12 ++++++++----
 2 files changed, 13 insertions(+), 5 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index e5c5d07..8a54690 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,8 @@
-SUBDIRS = . gdata/tests po docs
+SUBDIRS = . po docs
+
+if ENABLE_TESTS
+SUBDIRS += gdata/tests
+endif
 
 ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
 
diff --git a/configure.ac b/configure.ac
index c578235..ae57c49 100644
--- a/configure.ac
+++ b/configure.ac
@@ -149,10 +149,14 @@ AC_SUBST([GNOME_PACKAGES_PRIVATE])
 AC_SUBST([GNOME_PACKAGES])
 AC_SUBST([GOA_ENABLED])
 
-dnl ****************************
-dnl Check for uhttpmock
-dnl ****************************
-PKG_CHECK_MODULES(UHTTPMOCK, libuhttpmock-0.0)
+AC_MSG_CHECKING([whether to build tests])
+AC_ARG_ENABLE([tests], AS_HELP_STRING([--enable-tests], [Enable building of tests]),, [enable_tests=yes])
+AC_MSG_RESULT($enable_tests)
+AM_CONDITIONAL([ENABLE_TESTS], [test "x$enable_tests" = "xyes"])
+
+if test "x$enable_tests" = "xyes"; then
+       PKG_CHECK_MODULES(UHTTPMOCK, libuhttpmock-0.0)
+fi
 
 # Various necessary functions and headers
 AC_CHECK_FUNCS([memset])


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