From 72fcf757553965ab7f9fca108768b7c4b843baff Mon Sep 17 00:00:00 2001 From: David Polverari Date: Sat, 15 Oct 2022 16:23:06 -0300 Subject: [PATCH] Add support for runtime endianness check dcfldd SHA1 implementation can perform endianness runtime checks if RUNTIME_ENDIAN is defined. This commit adds suport for enabling runtime endianness check by using the '--enable-runtime-endian-check' option during configure. The option is disabled by default. --- configure.ac | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/configure.ac b/configure.ac index 9fc7f70..34821b8 100644 --- a/configure.ac +++ b/configure.ac @@ -41,6 +41,15 @@ AC_C_BIGENDIAN AC_TYPE_OFF_T AC_TYPE_SIZE_T +AC_ARG_ENABLE([runtime-endian-check], + AC_HELP_STRING([--enable-runtime-endian-check], [Enable runtime tests for big- or little-endian byte order (default is NO)]) +) + +AS_IF([test "x$enable_runtime_endian_check" = "xyes"], [ + dnl Do the stuff needed for enabling the feature + AC_DEFINE([RUNTIME_ENDIAN], 1, [Should a function (run-time) be used to determine the byte order?]) +]) + AC_CHECK_DECLS([strtol, strtoul, strtoumax, strndup]) AC_CONFIG_FILES([Makefile src/Makefile])