0002-configure.ac-use-pkg-config-to-find-openssl.patch 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. From 1ed0af7f1bbcaccbd7356bd90596f5c942b64720 Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Fri, 22 Mar 2019 20:24:54 +0100
  4. Subject: [PATCH 1/1] configure.ac: use pkg-config to find openssl
  5. openssl can have multiples dependencies such as libatomic on sparcv8
  6. 32 bits
  7. Fixes:
  8. - http://autobuild.buildroot.org/results/58e5aa7c6ba8fe7474071d7a3cba6ed3a1b4cff4
  9. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  10. [Upstream status:
  11. https://gitlab.com/fetchmail/fetchmail/merge_requests/14]
  12. ---
  13. configure.ac | 37 +++++++++++++++++++------------------
  14. 1 file changed, 19 insertions(+), 18 deletions(-)
  15. diff --git a/configure.ac b/configure.ac
  16. index 16b0fcba..3a75ec6e 100644
  17. --- a/configure.ac
  18. +++ b/configure.ac
  19. @@ -778,24 +778,25 @@ then
  20. else
  21. AC_MSG_ERROR([SSL support enabled, but OpenSSL not found])
  22. fi
  23. - LDFLAGS="$LDFLAGS -L$with_ssl/lib"
  24. - LIBS="$LIBS -lssl -lcrypto"
  25. - dnl check if -ldl is needed
  26. - AC_MSG_CHECKING([for additional library dependencies of SSL])
  27. - found=0
  28. - save_LIBS="$LIBS"
  29. - for i in "" "-ldl" ; do
  30. - LIBS="$LDFLAGS $save_LIBS $i"
  31. - AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <openssl/ssl.h>],[SSL_library_init()])],[found=1; break])
  32. - done
  33. - if test $found = 0 ; then
  34. - AC_MSG_RESULT([error])
  35. - AC_MSG_ERROR([cannot link with SSL - check config.log])
  36. - fi
  37. - LIBS="$save_LIBS $i"
  38. - if test "$i" = "" ; then i="(none)" ; fi
  39. - AC_MSG_RESULT($i)
  40. - dnl XXX FIXME: use pkg-config if available!
  41. + PKG_CHECK_MODULES([SSL],[libssl],[LIBS="$LIBS $SSL_LIBS"],[
  42. + LDFLAGS="$LDFLAGS -L$with_ssl/lib"
  43. + LIBS="$LIBS -lssl -lcrypto"
  44. + dnl check if -ldl is needed
  45. + AC_MSG_CHECKING([for additional library dependencies of SSL])
  46. + found=0
  47. + save_LIBS="$LIBS"
  48. + for i in "" "-ldl" ; do
  49. + LIBS="$LDFLAGS $save_LIBS $i"
  50. + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <openssl/ssl.h>],[SSL_library_init()])],[found=1; break])
  51. + done
  52. + if test $found = 0 ; then
  53. + AC_MSG_RESULT([error])
  54. + AC_MSG_ERROR([cannot link with SSL - check config.log])
  55. + fi
  56. + LIBS="$save_LIBS $i"
  57. + if test "$i" = "" ; then i="(none)" ; fi
  58. + AC_MSG_RESULT($i)
  59. + ])
  60. AC_DEFINE(SSL_ENABLE)
  61. else
  62. AC_MSG_WARN(Disabling SSL support.)
  63. --
  64. 2.20.1