curl-amissl.m4 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #***************************************************************************
  2. # _ _ ____ _
  3. # Project ___| | | | _ \| |
  4. # / __| | | | |_) | |
  5. # | (__| |_| | _ <| |___
  6. # \___|\___/|_| \_\_____|
  7. #
  8. # Copyright (C) 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) && defined(AMISSL_V3xx) && \
  35. (OPENSSL_VERSION_NUMBER >= 0x30000000L) && \
  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. ],[
  58. AC_MSG_RESULT([no])
  59. ])
  60. test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
  61. else
  62. AC_MSG_RESULT(no)
  63. fi
  64. else
  65. AC_MSG_RESULT(no)
  66. fi
  67. ])