From f2d0ed7cfd024eb1ade9983d46d9592f74bcf3ad Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Fri, 19 Jan 2024 11:35:35 +0100 Subject: [PATCH] build: allow to build if atf and kyua are not present --- Makefile.am | 7 ++++++- configure.ac | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index a92e3007..760c40f6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -11,9 +11,14 @@ man1_MANS = man/mlmmj-bounce.1 man/mlmmj-make-ml.1 man/mlmmj-receive.1 \ man/mlmmj-sub.1 man/mlmmj-maintd.1 man/mlmmj-process.1 \ man/mlmmj-send.1 man/mlmmj-unsub.1 man/mlmmj-list.1 -SUBDIRS = src listtexts contrib tests +SUBDIRS = src listtexts contrib + +if TESTS +SUBDIRS += tests check: $(check_SCRIPTS) $(check_PROGRAMS) kyua --config=none test --kyuafile='$(builddir)/Kyuafile' \ --build-root='$(builddir)' +endif + diff --git a/configure.ac b/configure.ac index c304d894..f638c3f1 100644 --- a/configure.ac +++ b/configure.ac @@ -52,7 +52,9 @@ AM_CONDITIONAL(WANT_RECEIVESTRIP, test x"$enable_receive_strip" = xyes) AC_FUNC_MALLOC AC_CHECK_FUNCS([syslog]) AC_CHECK_FUNCS([arc4random_uniform copy_file_range]) -PKG_CHECK_MODULES([ATF], [atf-c]) +PKG_CHECK_MODULES([ATF], [atf-c], [HAVE_ATF=1], [NO_ATF=1]) +AC_CHECK_PROG([KYUA], [kyua], [HAVE_KYUA=1]) +AM_CONDITIONAL([TESTS], [test "x$HAVE_ATF" = x1 -a "x$HAVE_KYUA" = x1 ]) AC_CONFIG_FILES([Makefile]) AC_CONFIG_FILES([src/Makefile]) -- 2.47.2