]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
build: set `HAVE_WRITABLE_ARGV` for Apple cross-builds
authorViktor Szakats <commit@vsz.me>
Fri, 14 Feb 2025 16:41:09 +0000 (17:41 +0100)
committerViktor Szakats <commit@vsz.me>
Sat, 15 Feb 2025 11:23:22 +0000 (12:23 +0100)
Enable this feature for Apple cross-builds to match native macOS builds.

Closes #16338

CMakeLists.txt
configure.ac

index 93009ef65de19e2100ed03914bf6aaabdbf98454..d5f92ffffe1108bd876d4cea4ad3f51b6ec4c854 100644 (file)
@@ -546,6 +546,7 @@ if(_CURL_QUICK_DETECT)
   elseif(APPLE)
     set(HAVE_EVENTFD 0)
     set(HAVE_GETPASS_R 0)
+    set(HAVE_WRITABLE_ARGV 1)
     set(HAVE_SENDMMSG 0)
   endif()
 endif()
index f1989db135deda97f7a5623cf7137b0037f4d636..c975474ded4df08d194716508e71b99c35d0440f 100644 (file)
@@ -591,14 +591,17 @@ dnl **********************************************************************
 CURL_CHECK_WIN32_LARGEFILE
 CURL_CHECK_WIN32_CRYPTO
 
-CURL_DARWIN_CFLAGS
-
+curl_cv_apple='no'
 case $host in
-  *-apple-*)
-    CURL_SUPPORTS_BUILTIN_AVAILABLE
-    ;;
+  *-apple-*) curl_cv_apple='yes';;
 esac
 
+CURL_DARWIN_CFLAGS
+
+if test "$curl_cv_apple" = 'yes'; then
+  CURL_SUPPORTS_BUILTIN_AVAILABLE
+fi
+
 curl_cv_cygwin='no'
 case $host_os in
   cygwin*|msys*) curl_cv_cygwin='yes';;
@@ -1788,6 +1791,9 @@ int main(int argc, char **argv)
 ],[
   curl_cv_writable_argv=cross
 ])
+if test "$curl_cv_writable_argv" = 'cross' -a "$curl_cv_apple" = 'yes'; then
+  curl_cv_writable_argv=yes
+fi
 case $curl_cv_writable_argv in
   yes)
     AC_DEFINE(HAVE_WRITABLE_ARGV, 1, [Define this symbol if your OS supports changing the contents of argv])