Add support for libwolfcrypttest and libwolfcryptbench to autotools flow.

These can be built by configuring with `--enable-crypttests-libs`.
This commit is contained in:
Hayden Roche
2021-09-25 10:31:06 -07:00
parent 302938d3c6
commit 709a84f8b5
3 changed files with 26 additions and 0 deletions

View File

@ -5072,6 +5072,15 @@ AC_ARG_ENABLE([crypttests],
)
AC_SUBST([ENABLED_CRYPT_TESTS])
# Build wolfCrypt test and benchmark as libraries. This will compile test.c and
# benchmark.c and make their functions available via libraries, libwolfcrypttest
# and libwolfcryptbench, respectively. Note that this feature is not enabled by
# default, and the API of these libraries should NOT be treated as stable.
AC_ARG_ENABLE([crypttests-libs],
[AS_HELP_STRING([--enable-crypttests-libs],[Enable wolfcrypt test and benchmark libraries (default: disabled)])],
[ ENABLED_CRYPT_TESTS_LIBS=$enableval ],
[ ENABLED_CRYPT_TESTS_LIBS=no ]
)
# LIBZ
ENABLED_LIBZ="no"
@ -6889,6 +6898,7 @@ AM_CONDITIONAL([BUILD_EXAMPLE_CLIENTS],[test "x$ENABLED_EXAMPLES" = "xyes"])
AM_CONDITIONAL([BUILD_TESTS],[test "x$ENABLED_EXAMPLES" = "xyes"])
AM_CONDITIONAL([BUILD_THREADED_EXAMPLES],[test "x$ENABLED_SINGLETHREADED" = "xno" && test "x$ENABLED_EXAMPLES" = "xyes" && test "x$ENABLED_LEANTLS" = "xno"])
AM_CONDITIONAL([BUILD_WOLFCRYPT_TESTS],[test "x$ENABLED_CRYPT_TESTS" = "xyes"])
AM_CONDITIONAL([BUILD_WOLFCRYPT_TESTS_LIBS],[test "x$ENABLED_CRYPT_TESTS_LIBS" = "xyes"])
AM_CONDITIONAL([BUILD_LIBZ],[test "x$ENABLED_LIBZ" = "xyes"])
AM_CONDITIONAL([BUILD_PKCS11],[test "x$ENABLED_PKCS11" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
AM_CONDITIONAL([BUILD_PKCS12],[test "x$ENABLED_PKCS12" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])

View File

@ -13,6 +13,14 @@ noinst_HEADERS += wolfcrypt/benchmark/benchmark.h
endif
endif
if BUILD_WOLFCRYPT_TESTS_LIBS
lib_LTLIBRARIES += wolfcrypt/benchmark/libwolfcryptbench.la
wolfcrypt_benchmark_libwolfcryptbench_la_SOURCES = wolfcrypt/benchmark/benchmark.c
wolfcrypt_benchmark_libwolfcryptbench_la_CPPFLAGS = -DNO_MAIN_DRIVER
wolfcrypt_benchmark_libwolfcryptbench_la_LIBADD = src/libwolfssl.la
wolfcrypt_benchmark_libwolfcryptbench_la_DEPENDENCIES = src/libwolfssl.la
endif
EXTRA_DIST += wolfcrypt/benchmark/benchmark.sln
EXTRA_DIST += wolfcrypt/benchmark/benchmark.vcproj
EXTRA_DIST += wolfcrypt/benchmark/README.md

View File

@ -16,6 +16,14 @@ noinst_HEADERS += wolfcrypt/test/test.h wolfcrypt/test/test_paths.h.in
endif
endif
if BUILD_WOLFCRYPT_TESTS_LIBS
lib_LTLIBRARIES += wolfcrypt/test/libwolfcrypttest.la
wolfcrypt_test_libwolfcrypttest_la_SOURCES = wolfcrypt/test/test.c
wolfcrypt_test_libwolfcrypttest_la_CPPFLAGS = -DNO_MAIN_DRIVER
wolfcrypt_test_libwolfcrypttest_la_LIBADD = src/libwolfssl.la
wolfcrypt_test_libwolfcrypttest_la_DEPENDENCIES = src/libwolfssl.la
endif
EXTRA_DIST += wolfcrypt/test/test.sln
EXTRA_DIST += wolfcrypt/test/test.vcproj
EXTRA_DIST += wolfcrypt/test/README.md