summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHans Nilsson <hans@erlang.org>2022-02-17 12:22:06 +0100
committerHans Nilsson <hans@erlang.org>2022-02-22 13:30:48 +0100
commitca2fed6c60039003f255ffe7a5d98744b8ebdedc (patch)
tree830ed31588179c038afe96360c8e09b3e866dab5 /lib
parentb7cd06a39f7be0d77c5db9ca98293de9f094fa73 (diff)
downloaderlang-ca2fed6c60039003f255ffe7a5d98744b8ebdedc.tar.gz
crypto: Make configure flag --disable-otp-test-engine
Diffstat (limited to 'lib')
-rw-r--r--lib/crypto/c_src/Makefile.in16
-rw-r--r--lib/crypto/configure.in10
2 files changed, 24 insertions, 2 deletions
diff --git a/lib/crypto/c_src/Makefile.in b/lib/crypto/c_src/Makefile.in
index 417a5ee865..77b95ac41b 100644
--- a/lib/crypto/c_src/Makefile.in
+++ b/lib/crypto/c_src/Makefile.in
@@ -119,11 +119,17 @@ CRYPTO_STATIC_OBJS = $(patsubst $(OBJDIR)/%$(TYPEMARKER).o,$(OBJDIR)/%_static$(T
NIF_ARCHIVE = $(LIBDIR)/crypto$(TYPEMARKER).a
-TEST_ENGINE_OBJS = $(OBJDIR)/otp_test_engine$(TYPEMARKER).o
-
NIF_LIB = $(LIBDIR)/crypto$(TYPEMARKER).@DED_EXT@
CALLBACK_LIB = $(LIBDIR)/crypto_callback$(TYPEMARKER).@DED_EXT@
+
+DISABLE_OTP_TEST_ENGINE = @DISABLE_OTP_TEST_ENGINE@
+ifeq ($(DISABLE_OTP_TEST_ENGINE),yes)
+TEST_ENGINE_LIB =
+TEST_ENGINE_OBJS =
+else
TEST_ENGINE_LIB = $(LIBDIR)/otp_test_engine$(TYPEMARKER).@DED_EXT@
+TEST_ENGINE_OBJS = $(OBJDIR)/otp_test_engine$(TYPEMARKER).o
+endif
DYNAMIC_CRYPTO_LIB=@SSL_DYNAMIC_ONLY@
# Weird that we compile as if dynamically linking when statically
@@ -182,6 +188,8 @@ debug opt valgrind asan: $(NIF_LIB) $(CALLBACK_LIB) $(TEST_ENGINE_LIB)
static_lib: $(NIF_ARCHIVE)
+ifeq ($(DISABLE_OTP_TEST_ENGINE),yes)
+else
$(OBJDIR)/otp_test_engine$(TYPEMARKER).o: otp_test_engine.c
$(V_at)$(INSTALL_DIR) $(OBJDIR)
$(V_CC) -c -o $@ $(filter-out -Wmissing-prototypes,$(ALL_CFLAGS)) $<
@@ -193,6 +201,7 @@ $(LIBDIR)/otp_test_engine$(TYPEMARKER).so: $(TEST_ENGINE_OBJS)
$(LIBDIR)/otp_test_engine$(TYPEMARKER).dll: $(TEST_ENGINE_OBJS)
$(V_at)$(INSTALL_DIR) $(LIBDIR)
$(V_LD) $(LDFLAGS) -o $@ $(SSL_DED_LD_RUNTIME_LIBRARY_PATH) -L$(SSL_LIBDIR) $(TEST_ENGINE_OBJS) -l$(SSL_CRYPTO_LIBNAME) -l$(SSL_SSL_LIBNAME) $(SSL_EXTRA_LIBS)
+endif
$(OBJDIR)/%$(TYPEMARKER).o: %.c
$(V_at)$(INSTALL_DIR) $(OBJDIR)
@@ -255,7 +264,10 @@ release_spec: opt
ifeq ($(DYNAMIC_OR_WIN_CRYPTO_LIB),yes)
$(INSTALL_PROGRAM) $(CALLBACK_LIB) "$(RELSYSDIR)/priv/lib"
endif
+ifeq ($(DISABLE_OTP_TEST_ENGINE),yes)
+else
$(INSTALL_PROGRAM) $(TEST_ENGINE_LIB) "$(RELSYSDIR)/priv/lib"
+endif
release_docs_spec:
diff --git a/lib/crypto/configure.in b/lib/crypto/configure.in
index 35acc7e532..108ec2ddf3 100644
--- a/lib/crypto/configure.in
+++ b/lib/crypto/configure.in
@@ -161,6 +161,15 @@ AS_HELP_STRING([--disable-evp-hmac],
*) DISABLE_EVP_HMAC=0;;
esac ], DISABLE_EVP_HMAC=0)
+
+AC_ARG_ENABLE(otp-test-engine,
+AS_HELP_STRING([--disable-otp-test-engine],
+ [intentionally undocumented workaround]),
+[ case "$enableval" in
+ no) DISABLE_OTP_TEST_ENGINE=yes;;
+ *) DISABLE_OTP_TEST_ENGINE=no;;
+ esac ], DISABLE_OTP_TEST_ENGINE=no)
+
AC_ARG_ENABLE(deprecated_warnings,
AS_HELP_STRING([--disable-deprecated-warnings],
[disable warnings for deprecated functions in cryptolib (default is to warn, except for OpenSSL 3.x where the default is not to warn)]),
@@ -843,6 +852,7 @@ AC_SUBST(SSL_DED_LD_RUNTIME_LIBRARY_PATH)
AC_SUBST(SSL_DYNAMIC_ONLY)
AC_SUBST(DISABLE_EVP_DH)
AC_SUBST(DISABLE_EVP_HMAC)
+AC_SUBST(DISABLE_OTP_TEST_ENGINE)
AC_OUTPUT(c_src/$host/Makefile:c_src/Makefile.in)