File 2611-crypto-Remove-disable-deprecated-warnings-config-fla.patch of Package erlang

From bf9cc8c362a92ac5fd2b94d46fded8a1929a486f Mon Sep 17 00:00:00 2001
From: Hans Nilsson <hans@erlang.org>
Date: Wed, 1 Jun 2022 09:22:10 +0200
Subject: [PATCH 1/2] crypto: Remove --disable-deprecated-warnings config flag

Not needed anymore.  Permanently applied to dh.c and otp_test_engine.c in the Makefile
---
 lib/crypto/c_src/Makefile.in |  7 ++++++-
 lib/crypto/configure.ac      | 18 ++++--------------
 2 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/lib/crypto/c_src/Makefile.in b/lib/crypto/c_src/Makefile.in
index ec5cb32973..25167a8a3a 100644
--- a/lib/crypto/c_src/Makefile.in
+++ b/lib/crypto/c_src/Makefile.in
@@ -42,6 +42,7 @@ SSL_LIBDIR = @SSL_LIBDIR@
 SSL_INCLUDE = @SSL_INCLUDE@
 SSL_CRYPTO_LIBNAME = @SSL_CRYPTO_LIBNAME@
 SSL_SSL_LIBNAME = @SSL_SSL_LIBNAME@
+CRYPTO_NO_DEPRECATE_WARN = @CRYPTO_NO_DEPRECATE_WARN@
 
 INCLUDES = $(SSL_INCLUDE) @DED_INCLUDE@
 SSL_EXTRA_LIBS=@SSL_EXTRA_LIBS@
@@ -193,7 +194,7 @@ 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)) $<
+	$(V_CC) -c -o $@ $(filter-out -Wmissing-prototypes,$(ALL_CFLAGS) $(CRYPTO_NO_DEPRECATE_WARN)) $<
 
 $(LIBDIR)/otp_test_engine$(TYPEMARKER).so: $(TEST_ENGINE_OBJS)
 	$(V_at)$(INSTALL_DIR) $(LIBDIR)
@@ -204,6 +205,10 @@ $(LIBDIR)/otp_test_engine$(TYPEMARKER).dll: $(TEST_ENGINE_OBJS)
 	$(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)/ec$(TYPEMARKER).o: ec.c
+	$(V_at)$(INSTALL_DIR) $(OBJDIR)
+	$(V_CC) -c -o $@ $(ALL_CFLAGS) $(CRYPTO_NO_DEPRECATE_WARN) $<
+
 $(OBJDIR)/%$(TYPEMARKER).o: %.c
 	$(V_at)$(INSTALL_DIR) $(OBJDIR)
 	$(V_CC) -MMD -c -o $@ $(ALL_CFLAGS) $<
diff --git a/lib/crypto/configure.in b/lib/crypto/configure.in
index 52d1f6c324..31b1b33b64 100644
--- a/lib/crypto/configure.in
+++ b/lib/crypto/configure.in
@@ -182,14 +182,6 @@ AS_HELP_STRING([--disable-otp-test-engine],
     *)    DISABLE_OTP_TEST_ENGINE=no;;
   esac ], DISABLE_OTP_TEST_ENGINE=default)
 
-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)]),
-[ case "$enableval" in
-    no)   deprecated_warnings=no;;
-    *)    deprecated_warnings=yes;;
-  esac ], deprecated_warnings=default_yes)
-
 AC_DEFUN([ERL_LINK_CRYPTO_IFELSE], [
     test_cflags=$1
     test_ldflags=$2
@@ -904,12 +896,8 @@ AS_IF([test "x$v3_include" = "xyes"],
    fi
 fi
 
-if test "x$v3_include" = "xyes" && test "x$deprecated_warnings" = "xdefault_yes" && test "$CRYPTO_APP" != ""; then
-   deprecated_warnings=no
-fi
-
-if test "x$deprecated_warnings" = "xno"  &&  test "$CRYPTO_APP" != "" ; then
-   SSL_FLAGS="$SSL_FLAGS -Wno-deprecated-declarations"
+if test "x$v3_include" = "xyes" && test "$CRYPTO_APP" != ""; then
+   CRYPTO_NO_DEPRECATE_WARN="-Wno-deprecated-declarations"
 fi
 
 saveCFLAGS="$CFLAGS"
@@ -965,6 +953,7 @@ AC_SUBST(SSL_DYNAMIC_ONLY)
 AC_SUBST(DISABLE_EVP_DH)
 AC_SUBST(DISABLE_EVP_HMAC)
 AC_SUBST(DISABLE_OTP_TEST_ENGINE)
+AC_SUBST(CRYPTO_NO_DEPRECATE_WARN)
 
 AC_OUTPUT(c_src/$host/Makefile:c_src/Makefile.in)
 
-- 
2.35.3

openSUSE Build Service is sponsored by