curl: error out if wolfSSL is not usable
authorPetr Štetiar <ynezz@true.cz>
Mon, 10 Oct 2022 08:47:55 +0000 (10:47 +0200)
committerStan Grishin <stangri@melmac.ca>
Mon, 10 Oct 2022 15:12:12 +0000 (15:12 +0000)
commita1d76d41c3c1bdcca67e076d4a8fd5688c92ae97
treeb2d153d5d3c06a24cb16d81b928b39c81056f3be
parent110ff0b4cb60044b837526dfdbc980c125004edc
curl: error out if wolfSSL is not usable

When we explicitly declare, that we would like to have curl built with
wolfSSL support using `--with-wolfssl` configure option, then we should
make sure, that we either endup with curl having that support, or it
shouldn't be available at all, otherwise we risk, that we end up with
regressions like following:

  configure:25299: checking for wolfSSL_Init in -lwolfssl
  configure:25321: x86_64-openwrt-linux-musl-gcc -o conftest [snip]
  In file included from target-x86_64_musl/usr/include/wolfssl/wolfcrypt/dsa.h:33,
                   from target-x86_64_musl/usr/include/wolfssl/wolfcrypt/asn_public.h:35,
                  from target-x86_64_musl/usr/include/wolfssl/ssl.h:35,
                   from conftest.c:47:
  target-x86_64_musl/usr/include/wolfssl/wolfcrypt/integer.h:37:14: fatal error: wolfssl/wolfcrypt/sp_int.h: No such file or directory
       #include <wolfssl/wolfcrypt/sp_int.h>
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  compilation terminated.

and in the end thus produce curl without https support:

 curl: (1) Protocol "https" not supported or disabled in libcurl

So fix it, by making the working wolfSSL mandatory and error out in
configure step when that's not the case:

 checking for wolfSSL_Init in -lwolfssl... no
 configure: error: --with-wolfssl but wolfSSL was not found or doesn't work

References: #19005, #19547
Upstream-Status: Accepted [https://github.com/curl/curl/pull/9682]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 9140f366ef91c6eeb04ca39347c40deecaf56419)
net/curl/patches/300-curl-wolfssl.m4-error-out-if-wolfSSL-is-not-usable.patch [new file with mode: 0644]