From: Stefan Eissing Date: Mon, 7 Oct 2024 13:58:26 +0000 (+0200) Subject: curl-rustls.m4: set linker flags to allow rustls build on macos X-Git-Tag: curl-8_11_0~158 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=aa43b424619df32ac3f441d3f564cb3d10919582;p=thirdparty%2Fcurl.git curl-rustls.m4: set linker flags to allow rustls build on macos Assisted-by: Viktor Szakats Closes #15175 --- diff --git a/m4/curl-rustls.m4 b/m4/curl-rustls.m4 index fa0118ec7f..fdcbfcd5b1 100644 --- a/m4/curl-rustls.m4 +++ b/m4/curl-rustls.m4 @@ -34,13 +34,6 @@ if test "x$OPT_RUSTLS" != xno; then CLEANLDFLAGS="$LDFLAGS" CLEANCPPFLAGS="$CPPFLAGS" - case $host in - *-apple-*) - LDFLAGS="$LDFLAGS -framework Security" - ;; - *) - ;; - esac ## NEW CODE dnl use pkg-config unless we have been given a path @@ -88,6 +81,14 @@ if test "x$OPT_RUSTLS" != xno; then CPPFLAGS="$CPPFLAGS $addcflags" fi + case $host in + *-apple-*) + RUSTLS_LDFLAGS="-framework Security -framework Foundation" + ;; + *) + RUSTLS_LDFLAGS="-lpthread -ldl -lm" + ;; + esac AC_CHECK_LIB(rustls, rustls_connection_read, [ AC_DEFINE(USE_RUSTLS, 1, [if Rustls is enabled]) @@ -98,11 +99,11 @@ if test "x$OPT_RUSTLS" != xno; then test rustls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes ], AC_MSG_ERROR([--with-rustls was specified but could not find Rustls.]), - -lpthread -ldl -lm) + $RUSTLS_LDFLAGS) LIB_RUSTLS="$PREFIX_RUSTLS/lib$libsuff" if test "$PREFIX_RUSTLS" != "/usr" ; then - SSL_LDFLAGS="-L$LIB_RUSTLS" + SSL_LDFLAGS="-L$LIB_RUSTLS $RUSTLS_LDFLAGS" SSL_CPPFLAGS="-I$PREFIX_RUSTLS/include" fi fi