From 97557ed29b6dd5a28899e28b1980987ba7f4e135 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Mon, 8 Nov 2021 18:25:15 -0600 Subject: [PATCH] linuxkm: add --enable-benchmark switch (default yes) and BUILD_BENCHMARK conditional to configure.ac to allow build with testwolfcrypt but without benchmark; change gate in wolfcrypt/benchmark/include.am from `if !BUILD_LINUXKM` to `if BUILD_BENCHMARK`. --- configure.ac | 9 +++++++++ wolfcrypt/benchmark/include.am | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 7d8700c65..67cdd3b69 100644 --- a/configure.ac +++ b/configure.ac @@ -330,6 +330,13 @@ then fi +AC_ARG_ENABLE([benchmark], + [AS_HELP_STRING([--enable-benchmark],[Build benchmark when building crypttests (default: enabled)])], + [ENABLED_BENCHMARK=$enableval], + [ENABLED_BENCHMARK=yes] + ) + + # Linux Kernel Module AC_ARG_ENABLE([linuxkm], [AS_HELP_STRING([--enable-linuxkm],[Enable Linux Kernel Module (default: disabled)])], @@ -377,6 +384,7 @@ if test "x$ENABLED_LINUXKM" = "xyes" then AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_LINUXKM" ENABLED_NO_LIBRARY=yes + ENABLED_BENCHMARK=no output_objdir="$(realpath "$output_objdir")/linuxkm" if test "$KERNEL_ROOT" = ""; then @@ -7267,6 +7275,7 @@ AM_CONDITIONAL([BUILD_HASHFLAGS],[test "x$ENABLED_HASHFLAGS" = "xyes"]) AM_CONDITIONAL([BUILD_CAAM],[test "x$ENABLED_CAAM" = "xyes" || test "x$ENABLED_CAAM" = "xqnx"]) AM_CONDITIONAL([BUILD_LINUXKM],[test "$ENABLED_LINUXKM" = "yes"]) AM_CONDITIONAL([BUILD_NO_LIBRARY],[test "$ENABLED_NO_LIBRARY" = "yes"]) +AM_CONDITIONAL([BUILD_BENCHMARK],[test "$ENABLED_BENCHMARK" = "yes"]) AM_CONDITIONAL([BUILD_RC2],[test "x$ENABLED_RC2" = "xyes"]) AM_CONDITIONAL([BUILD_QNXCAAM],[test "x$ENABLED_CAAM" = "xqnx"]) AM_CONDITIONAL([BUILD_IOTSAFE],[test "x$ENABLED_IOTSAFE" = "xyes"]) diff --git a/wolfcrypt/benchmark/include.am b/wolfcrypt/benchmark/include.am index b493bde38..7914f4f28 100644 --- a/wolfcrypt/benchmark/include.am +++ b/wolfcrypt/benchmark/include.am @@ -2,7 +2,7 @@ # All paths should be given relative to the root if BUILD_WOLFCRYPT_TESTS -if !BUILD_LINUXKM +if BUILD_BENCHMARK noinst_PROGRAMS += wolfcrypt/benchmark/benchmark wolfcrypt_benchmark_benchmark_SOURCES = wolfcrypt/benchmark/benchmark.c