curl-amissl.m4 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #***************************************************************************
  2. # _ _ ____ _
  3. # Project ___| | | | _ \| |
  4. # / __| | | | |_) | |
  5. # | (__| |_| | _ <| |___
  6. # \___|\___/|_| \_\_____|
  7. #
  8. # Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
  9. #
  10. # This software is licensed as described in the file COPYING, which
  11. # you should have received as part of this distribution. The terms
  12. # are also available at https://curl.se/docs/copyright.html.
  13. #
  14. # You may opt to use, copy, modify, merge, publish, distribute and/or sell
  15. # copies of the Software, and permit persons to whom the Software is
  16. # furnished to do so, under the terms of the COPYING file.
  17. #
  18. # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  19. # KIND, either express or implied.
  20. #
  21. # SPDX-License-Identifier: curl
  22. #
  23. #***************************************************************************
  24. AC_DEFUN([CURL_WITH_AMISSL], [
  25. AC_MSG_CHECKING([whether to enable Amiga native SSL/TLS (AmiSSL v5)])
  26. if test "$HAVE_PROTO_BSDSOCKET_H" = "1"; then
  27. if test "x$OPT_AMISSL" != xno; then
  28. ssl_msg=
  29. AC_COMPILE_IFELSE([
  30. AC_LANG_PROGRAM([[
  31. #include <libraries/amisslmaster.h>
  32. #include <openssl/opensslv.h>
  33. ]],[[
  34. #if defined(AMISSL_CURRENT_VERSION) && (AMISSL_CURRENT_VERSION >= AMISSL_V303) && \
  35. defined(OPENSSL_VERSION_MAJOR) && (OPENSSL_VERSION_MAJOR >= 3) && \
  36. defined(PROTO_AMISSL_H)
  37. return 0;
  38. #else
  39. #error not AmiSSL v5 / OpenSSL 3
  40. #endif
  41. ]])
  42. ],[
  43. AC_MSG_RESULT([yes])
  44. ssl_msg="AmiSSL"
  45. test amissl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
  46. AMISSL_ENABLED=1
  47. OPENSSL_ENABLED=1
  48. # Use AmiSSL's built-in ca bundle
  49. check_for_ca_bundle=1
  50. with_ca_fallback=yes
  51. LIBS="-lamisslstubs -lamisslauto $LIBS"
  52. AC_DEFINE(USE_AMISSL, 1, [if AmiSSL is in use])
  53. AC_DEFINE(USE_OPENSSL, 1, [if OpenSSL is in use])
  54. AC_DEFINE_UNQUOTED(HAVE_OPENSSL3, 1, [Define to 1 if using OpenSSL 3 or later.])
  55. AC_CHECK_HEADERS(openssl/x509.h openssl/rsa.h openssl/crypto.h \
  56. openssl/pem.h openssl/ssl.h openssl/err.h)
  57. dnl OpenSSLv3 marks the DES functions deprecated but we have no
  58. dnl replacements (yet) so tell the compiler to not warn for them
  59. dnl
  60. dnl Ask OpenSSL to suppress the warnings.
  61. CPPFLAGS="$CPPFLAGS -DOPENSSL_SUPPRESS_DEPRECATED"
  62. ],[
  63. AC_MSG_RESULT([no])
  64. ])
  65. test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
  66. else
  67. AC_MSG_RESULT(no)
  68. fi
  69. else
  70. AC_MSG_RESULT(no)
  71. fi
  72. ])