[poppler] [PATCH] Make it possible to disable tests building.
Diego 'Flameeyes' Pettenò
flameeyes at gmail.com
Wed Jun 11 14:27:19 PDT 2008
Most source distributions like Gentoo, FreeBSD's Ports or pkgsrc allow
their users to choose whether to run unit testing or not. When the
user doesn't want to run unit testing, building the tests will just
take time during 'make all' phase for no good reason.
On the other hand, during development, tests can be used to make sure
that the library is still in a state where it can be linked agains, so
disabling them entirely during that phase might not be what is wanted.
This patch adds a configure switch to explicitly disable building of
tests during 'make all', still leaving an option to build them with an
explicit request.
---
Makefile.am | 6 +++++-
configure.ac | 7 +++++++
2 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 5ce9904..9bc4d74 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -29,7 +29,11 @@ if BUILD_UTILS
utils_subdir = utils
endif
-SUBDIRS = goo fofi $(splash_subdir) poppler $(utils_subdir) $(glib_subdir) $(qt_subdir) test $(qt4_subdir)
+if BUILD_TESTS
+tests_subdir = test
+endif
+
+SUBDIRS = goo fofi $(splash_subdir) poppler $(utils_subdir) $(glib_subdir) $(qt_subdir) $(tests_subdir) $(qt4_subdir)
EXTRA_DIST = \
README-XPDF \
diff --git a/configure.ac b/configure.ac
index dccba6e..b4d521c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -332,6 +332,13 @@ elif test x$enable_gtk_test = xtry; then
fi
AM_CONDITIONAL(BUILD_GTK_TEST, test x$enable_gtk_test = xyes -a x$enable_poppler_glib = xyes)
+AC_ARG_ENABLE(tests,
+ AC_HELP_STRING([--disable-tests],
+ [Don't compile poppler test programs.]),
+ enable_tests=$enableval,
+ enable_tests="yes")
+AM_CONDITIONAL(BUILD_TESTS, test x$enable_tests = xyes)
+
AC_ARG_ENABLE(abiword-output,
AC_HELP_STRING([--disable-abiword-output],
[Don't build the abiword backend.]),
More information about the poppler
mailing list