0001-configure.ac-use-pkg-config-to-retrieve-openssl-depe.patch 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. From 93865bad4c00e7d3c867965663fdb9a1a0448db8 Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Sun, 1 Jan 2023 16:53:23 +0100
  4. Subject: [PATCH] configure.ac: use pkg-config to retrieve openssl dependencies
  5. Use pkg-config to retrieve openssl dependencies such as -latomic and
  6. avoids the following build failure when building statically on
  7. architectures such as sparc:
  8. /home/autobuild/autobuild/instance-1/output-1/host/lib/gcc/sparc-buildroot-linux-uclibc/10.4.0/../../../../sparc-buildroot-linux-uclibc/bin/ld: /home/autobuild/autobuild/instance-1/output-1/host/sparc-buildroot-linux-uclibc/sysroot/usr/lib/libcrypto.a(threads_pthread.o): in function `CRYPTO_atomic_add':
  9. threads_pthread.c:(.text+0x208): undefined reference to `__atomic_is_lock_free'
  10. Fixes:
  11. - http://autobuild.buildroot.org/results/49abbaa1eab94b248bff434b40728065d687e278
  12. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  13. Upstream: https://github.com/WayneD/rsync/pull/426
  14. ---
  15. configure.ac | 12 ++++++++----
  16. 1 file changed, 8 insertions(+), 4 deletions(-)
  17. diff --git a/configure.ac b/configure.ac
  18. index ccad7f13..b9591866 100644
  19. --- a/configure.ac
  20. +++ b/configure.ac
  21. @@ -432,11 +432,15 @@ AH_TEMPLATE([USE_OPENSSL],
  22. if test x"$enable_openssl" != x"no"; then
  23. if test x"$ac_cv_header_openssl_md4_h" = x"yes" && test x"$ac_cv_header_openssl_md5_h" = x"yes"; then
  24. AC_MSG_RESULT(yes)
  25. - AC_SEARCH_LIBS(EVP_MD_CTX_copy, crypto,
  26. + PKG_CHECK_MODULES(LIBCRYPTO, libcrypto,
  27. [AC_DEFINE(USE_OPENSSL)
  28. - enable_openssl=yes],
  29. - [err_msg="$err_msg$nl- Failed to find EVP_MD_CTX_copy function in openssl crypto lib.";
  30. - no_lib="$no_lib openssl"])
  31. + enable_openssl=yes
  32. + LIBS="$LIBS $LIBCRYPTO_LIBS"],
  33. + [AC_SEARCH_LIBS(EVP_MD_CTX_copy, crypto,
  34. + [AC_DEFINE(USE_OPENSSL)
  35. + enable_openssl=yes],
  36. + [err_msg="$err_msg$nl- Failed to find EVP_MD_CTX_copy function in openssl crypto lib.";
  37. + no_lib="$no_lib openssl"])])
  38. else
  39. AC_MSG_RESULT(no)
  40. err_msg="$err_msg$nl- Failed to find openssl/md4.h and openssl/md5.h for openssl crypto lib support."
  41. --
  42. 2.35.1