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



commit 40d11faf6fa5afc2bea31a288d45b11b45f38d75
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 9940f4a..24c1d82 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 442d104..5a102b4 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]