On Thu, 20 Oct 2016, Daniel Stenberg wrote:

On Thu, 20 Oct 2016, Martin Storsjö wrote:

So to expand the fix to "just work" in most cases, perhaps we should add -miphoneos-version-min=6.0, which should be ancient enough for any current usage.

Sound logic, but it seems we need to pick one of them because if we use both I get:

clang: error: invalid argument '-mmacosx-version-min=10.5' not allowed with '-miphoneos-version-min=6.0'

Hmm, ok. I guess it's better to leave it as is then. If the -mmacosx-version-min parameter is set while building with an iOS SDK, you get a warning like this:

clang: warning: using sysroot for 'iPhoneOS' but targeting 'MacOSX'

So that will at least give another clue to iOS builders that they might need to set something if they didn't already.


What might need to be adjusted though, is the fact that one also can use -mios-version-min instead of -miphoneos-version-min. (And for the other newlings, there's also -mtvos-version-min and -mwatchos-version-min.)

What about the attached patch for that?

// Martin
From d1c163c06b90c62d3ca525324fe255220d7b2c1a Mon Sep 17 00:00:00 2001
From: Martin Storsjo <mar...@martin.st>
Date: Thu, 20 Oct 2016 13:16:10 +0300
Subject: [PATCH] configure: Check for other variants of the -m*os*-version-min
 flags

In addition to -miphoneos-version-min, the same version can be set
using -mios-version-min. And for WatchOS and TvOS, there's
-mwatchos-version-min and -mtvos-version-min.
---
 acinclude.m4 | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/acinclude.m4 b/acinclude.m4
index ea97400..95a73e5 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -3203,8 +3203,9 @@ TEST EINVAL TEST
 
 dnl CURL_MAC_CFLAGS
 dnl
-dnl Check if -mmacosx-version-min or -miphoneos-version-min are set manually,
-dnl otherwise do. And set -Werror=partial-availability.
+dnl Check if -mmacosx-version-min, -miphoneos-version-min or any
+dnl similar are set manually, otherwise do. And set
+dnl -Werror=partial-availability.
 dnl
 
 AC_DEFUN([CURL_MAC_CFLAGS], [
@@ -3222,8 +3223,7 @@ AC_DEFUN([CURL_MAC_CFLAGS], [
   if test "$tst_cflags" = "yes"; then
     AC_MSG_CHECKING([for *version-min in CFLAGS])
     min=""
-    if test -z "$(echo $CFLAGS | grep mmacosx-version-min)" -a
-       test -z "$(echo $CFLAGS | grep miphoneos-version-min)"; then
+    if test -z "$(echo $CFLAGS | grep m.*os.*-version-min)"; then
       min="-mmacosx-version-min=10.5"
       CFLAGS="$CFLAGS $min"
     fi
-- 
2.8.4 (Apple Git-73)

-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:  https://curl.haxx.se/mail/etiquette.html

Reply via email to