From 403bf9b1b41c3f7ce8a4cbb36ca3139e59ecc1f3 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Tue, 29 Sep 2020 20:34:51 +0200 Subject: [PATCH] build: configure: check for Criterion --- configure.ac | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/configure.ac b/configure.ac index c6a1ad9..0647ca6 100644 --- a/configure.ac +++ b/configure.ac @@ -58,4 +58,22 @@ AC_CHECK_HEADERS( [AC_MSG_ERROR([GNU Argp is needed to parse arguments])] ) +# Check for Criterion +PKG_CHECK_MODULES( + [CRITERION], + [criterion], + [HAVE_CRITERION=1], + [HAVE_CRITERION=0] +) +# Make a conditional +AM_CONDITIONAL([USING_CRITERION], [test "$HAVE_CRITERION" -eq 1]) +# Substitute the defined flags +AM_COND_IF( + [USING_CRITERION], + [AC_SUBST([CRITERION_CFLAGS]) AC_SUBST([CRITERION_LIBS])] +) + +# Use Autotools TAP driver +AC_REQUIRE_AUX_FILE([tap-driver.sh]) + AC_OUTPUT