configure: use curl_cv_apple variable

Follow-up to 876db1070b #16338

Closes #16340
This commit is contained in:
Viktor Szakats 2025-02-15 11:57:55 +01:00
parent 1b87357967
commit ebbf51e191
No known key found for this signature in database
GPG Key ID: B5ABD165E2AEF201
5 changed files with 123 additions and 156 deletions

View File

@ -1445,9 +1445,9 @@ dnl Save build info for test runner to pick up and log
AC_DEFUN([CURL_PREPARE_BUILDINFO], [
curl_pflags=""
case $host in
*-apple-*) curl_pflags="${curl_pflags} APPLE";;
esac
if test "$curl_cv_apple" = 'yes'; then
curl_pflags="${curl_pflags} APPLE"
fi
case $host in
*-*-*bsd*|*-*-aix*|*-*-hpux*|*-*-interix*|*-*-irix*|*-*-linux*|*-*-solaris*|*-*-sunos*|*-apple-*|*-*-cygwin*|*-*-msys*)
curl_pflags="${curl_pflags} UNIX";;
@ -1561,18 +1561,6 @@ dnl with very low deployment targets.
dnl
AC_DEFUN([CURL_DARWIN_CFLAGS], [
tst_cflags="no"
case $host in
*-apple-*)
tst_cflags="yes"
;;
esac
AC_MSG_CHECKING([for good-to-use Darwin CFLAGS])
AC_MSG_RESULT([$tst_cflags]);
if test "$tst_cflags" = "yes"; then
old_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -Werror=partial-availability"
AC_MSG_CHECKING([whether $CC accepts -Werror=partial-availability])
@ -1580,8 +1568,6 @@ AC_DEFUN([CURL_DARWIN_CFLAGS], [
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
CFLAGS=$old_CFLAGS])
fi
])

View File

@ -596,9 +596,8 @@ case $host in
*-apple-*) curl_cv_apple='yes';;
esac
CURL_DARWIN_CFLAGS
if test "$curl_cv_apple" = 'yes'; then
CURL_DARWIN_CFLAGS
CURL_SUPPORTS_BUILTIN_AVAILABLE
fi
@ -1939,11 +1938,9 @@ if test x"$want_gss" = xyes; then
LIBS="-lgss $LIBS"
link_pkgconfig=1
elif test -z "$GSSAPI_LIB_DIR"; then
case $host in
*-apple-*)
if test "$curl_cv_apple" = 'yes'; then
LIBS="-lgssapi_krb5 -lresolv $LIBS"
;;
*)
else
if test $GSSAPI_ROOT != "/usr"; then
CURL_CHECK_PKGCONFIG(mit-krb5-gssapi, $GSSAPI_ROOT/lib/pkgconfig)
else
@ -1982,8 +1979,7 @@ if test x"$want_gss" = xyes; then
LIBS="-l$gss_libname $LIBS"
fi
fi
;;
esac
fi
else
LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
LDFLAGSPC="$LDFLAGSPC $GSSAPI_LIB_DIR"
@ -2738,8 +2734,7 @@ dnl Check for the presence of AppleIDN
dnl **********************************************************************
tst_links_appleidn='no'
case $host in
*-apple-*)
if test "$curl_cv_apple" = 'yes'; then
AC_MSG_CHECKING([whether to build with Apple IDN])
OPT_IDN="default"
AC_ARG_WITH(apple-idn,
@ -2766,8 +2761,7 @@ AS_HELP_STRING([--without-apple-idn],[Disable AppleIDN]),
AC_MSG_RESULT([no])
;;
esac
;;
esac
fi
dnl **********************************************************************
dnl Check for the presence of libidn2
@ -4143,7 +4137,7 @@ AM_CONDITIONAL(USE_MANUAL, test x"$USE_MANUAL" = x1)
CURL_CHECK_LIB_ARES
CURL_CHECK_OPTION_THREADED_RESOLVER
if test "$ipv6" = yes; then
if test "$ipv6" = yes -a "$curl_cv_apple" = 'yes'; then
CURL_DARWIN_SYSTEMCONFIGURATION
fi

View File

@ -1408,11 +1408,10 @@ AC_DEFUN([CURL_CHECK_FUNC_GETADDRINFO], [
#
if test "$curl_cv_func_getaddrinfo" = "yes"; then
AC_MSG_CHECKING([if getaddrinfo is threadsafe])
case $host in
*-apple-*)
if test "$curl_cv_apple" = 'yes'; then
dnl Darwin 6.0 and macOS 10.2.X and newer
tst_tsafe_getaddrinfo="yes"
esac
fi
case $host_os in
aix[[1234]].* | aix5.[[01]].*)
dnl AIX 5.1 and older
@ -4398,11 +4397,9 @@ dnl CURL_LIBRARY_PATH variable. It keeps the LD_LIBRARY_PATH
dnl changes contained within this macro.
AC_DEFUN([CURL_RUN_IFELSE], [
case $host in
*-apple-*)
if test "$curl_cv_apple" = 'yes'; then
AC_RUN_IFELSE([AC_LANG_SOURCE([$1])], $2, $3, $4)
;;
*)
else
oldcc=$CC
old=$LD_LIBRARY_PATH
CC="sh ./run-compiler"
@ -4411,8 +4408,7 @@ AC_DEFUN([CURL_RUN_IFELSE], [
AC_RUN_IFELSE([AC_LANG_SOURCE([$1])], $2, $3, $4)
LD_LIBRARY_PATH=$old # restore
CC=$oldcc
;;
esac
fi
])
dnl CURL_COVERAGE

View File

@ -83,14 +83,11 @@ if test "x$OPT_RUSTLS" != xno; then
CPPFLAGS="$CPPFLAGS $addcflags"
fi
case $host in
*-apple-*)
if test "$curl_cv_apple" = 'yes'; then
RUSTLS_LDFLAGS="-framework Security -framework Foundation"
;;
*)
else
RUSTLS_LDFLAGS="-lpthread -ldl -lm"
;;
esac
fi
AC_CHECK_LIB(rustls, rustls_connection_read,
[
AC_DEFINE(USE_RUSTLS, 1, [if Rustls is enabled])

View File

@ -24,8 +24,6 @@
AC_DEFUN([CURL_DARWIN_SYSTEMCONFIGURATION], [
AC_MSG_CHECKING([whether to link macOS CoreFoundation, CoreServices, and SystemConfiguration frameworks])
case $host in
*-apple-*)
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
#include <sys/types.h>
@ -50,8 +48,4 @@ case $host in
else
AC_MSG_RESULT(no)
fi
;;
*)
AC_MSG_RESULT(no)
esac
])