2
0

curl-amissl.m4 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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_CHECK_HEADERS(openssl/x509.h openssl/rsa.h openssl/crypto.h \
  55. openssl/pem.h openssl/ssl.h openssl/err.h)
  56. ],[
  57. AC_MSG_RESULT([no])
  58. ])
  59. test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
  60. else
  61. AC_MSG_RESULT(no)
  62. fi
  63. else
  64. AC_MSG_RESULT(no)
  65. fi
  66. ])