xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame^] | 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 | |
| 25 | AC_DEFUN([CURL_WITH_AMISSL], [ |
| 26 | AC_MSG_CHECKING([whether to enable Amiga native SSL/TLS (AmiSSL v5)]) |
| 27 | if test "$HAVE_PROTO_BSDSOCKET_H" = "1"; then |
| 28 | if test "x$OPT_AMISSL" != xno; then |
| 29 | ssl_msg= |
| 30 | AC_COMPILE_IFELSE([ |
| 31 | AC_LANG_PROGRAM([[ |
| 32 | #include <libraries/amisslmaster.h> |
| 33 | #include <openssl/opensslv.h> |
| 34 | ]],[[ |
| 35 | #if defined(AMISSL_CURRENT_VERSION) && (AMISSL_CURRENT_VERSION >= AMISSL_V303) && \ |
| 36 | defined(OPENSSL_VERSION_MAJOR) && (OPENSSL_VERSION_MAJOR >= 3) && \ |
| 37 | defined(PROTO_AMISSL_H) |
| 38 | return 0; |
| 39 | #else |
| 40 | #error not AmiSSL v5 / OpenSSL 3 |
| 41 | #endif |
| 42 | ]]) |
| 43 | ],[ |
| 44 | AC_MSG_RESULT([yes]) |
| 45 | ssl_msg="AmiSSL" |
| 46 | test amissl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes |
| 47 | AMISSL_ENABLED=1 |
| 48 | OPENSSL_ENABLED=1 |
| 49 | # Use AmiSSL's built-in ca bundle |
| 50 | check_for_ca_bundle=1 |
| 51 | with_ca_fallback=yes |
| 52 | LIBS="-lamisslstubs -lamisslauto $LIBS" |
| 53 | AC_DEFINE(USE_AMISSL, 1, [if AmiSSL is in use]) |
| 54 | AC_DEFINE(USE_OPENSSL, 1, [if OpenSSL is in use]) |
| 55 | AC_DEFINE_UNQUOTED(HAVE_OPENSSL3, 1, [Define to 1 if using OpenSSL 3 or later.]) |
| 56 | AC_CHECK_HEADERS(openssl/x509.h openssl/rsa.h openssl/crypto.h \ |
| 57 | openssl/pem.h openssl/ssl.h openssl/err.h) |
| 58 | dnl OpenSSLv3 marks the DES functions deprecated but we have no |
| 59 | dnl replacements (yet) so tell the compiler to not warn for them |
| 60 | dnl |
| 61 | dnl Ask OpenSSL to suppress the warnings. |
| 62 | CPPFLAGS="$CPPFLAGS -DOPENSSL_SUPPRESS_DEPRECATED" |
| 63 | ],[ |
| 64 | AC_MSG_RESULT([no]) |
| 65 | ]) |
| 66 | test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg" |
| 67 | else |
| 68 | AC_MSG_RESULT(no) |
| 69 | fi |
| 70 | else |
| 71 | AC_MSG_RESULT(no) |
| 72 | fi |
| 73 | |
| 74 | ]) |