buildsys: add option to enable/disable building tests

When doing cross-compilation, the tests are meant to be run on the
target. However, they are currently not installed, so it does not make
sense to build tehm to start with.

Additionally, when doing a system for production, those tests are not
needed anyway.

Add a configure option to disable building the tests altogether.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
This commit is contained in:
Yann E. MORIN
2018-12-04 08:30:09 +01:00
parent b8a28fad54
commit fb2e460df9
2 changed files with 12 additions and 1 deletions
+4 -1
View File
@@ -1,5 +1,8 @@
# Generic definitions # Generic definitions
SUBDIRS = lib doc utils test-tool tests examples SUBDIRS = lib doc utils test-tool examples
if BUILD_TESTS
SUBDIRS += tests
endif
ACLOCAL_AMFLAGS =-I m4 ACLOCAL_AMFLAGS =-I m4
AUTOMAKE_OPTIONS = foreign subdir-objects AUTOMAKE_OPTIONS = foreign subdir-objects
+8
View File
@@ -47,6 +47,14 @@ AC_ARG_ENABLE([manpages],
AM_CONDITIONAL(BUILD_MANPAGES, AM_CONDITIONAL(BUILD_MANPAGES,
[expr "$ENABLE_MANPAGES" : yes > /dev/null 2>&1]) [expr "$ENABLE_MANPAGES" : yes > /dev/null 2>&1])
AC_ARG_ENABLE([tests],
[AC_HELP_STRING([--enable-tests],
[Enable building tests])],
[ENABLE_TESTS=$enableval],
[ENABLE_TESTS=yes])
AM_CONDITIONAL([BUILD_TESTS],
[expr "$ENABLE_TESTS" : yes > /dev/null 2>&1])
AC_CONFIG_HEADER(config.h) AC_CONFIG_HEADER(config.h)
AC_CHECK_LIB([gcrypt], [gcry_control]) AC_CHECK_LIB([gcrypt], [gcry_control])