Wed Nov 7 16:50:27 2018 UTC ()
If an SDK matching our OS X version isn't found -- for instance, because
OS X has been upgraded and Xcode hasn't been -- try again without
specifying the version. This (1) works better and (2) gives a better
error message when it doesn't. From Markus Mayer in PR pkg/50317.


(schmonz)
diff -r1.88 -r1.89 pkgsrc/mk/platform/Darwin.mk

cvs diff -r1.88 -r1.89 pkgsrc/mk/platform/Darwin.mk (expand / switch to unified diff)

--- pkgsrc/mk/platform/Darwin.mk 2017/10/10 13:57:23 1.88
+++ pkgsrc/mk/platform/Darwin.mk 2018/11/07 16:50:27 1.89
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: Darwin.mk,v 1.88 2017/10/10 13:57:23 jperkin Exp $ 1# $NetBSD: Darwin.mk,v 1.89 2018/11/07 16:50:27 schmonz Exp $
2# 2#
3# Variable definitions for the Darwin operating system. 3# Variable definitions for the Darwin operating system.
4 4
5# OS, Kernel, Xcode Version 5# OS, Kernel, Xcode Version
6# Note that Xcode gets updates on older systems sometimes. 6# Note that Xcode gets updates on older systems sometimes.
7# pkgsrc generally expects that the most up-to-date xcode available for 7# pkgsrc generally expects that the most up-to-date xcode available for
8# an OS version is installed 8# an OS version is installed
9# 9#
10# Codename OS Kernel Xcode 10# Codename OS Kernel Xcode
11# Cheetah 10.0.x 1.3.1 11# Cheetah 10.0.x 1.3.1
12# Puma 10.1 1.4.1 12# Puma 10.1 1.4.1
13# 10.1.x 5.x.y 13# 10.1.x 5.x.y
14# Jaguar 10.2.x 6.x.y 14# Jaguar 10.2.x 6.x.y
@@ -91,26 +91,29 @@ MAKEFLAGS+= OSX_VERSION=${OSX_VERSION:Q @@ -91,26 +91,29 @@ MAKEFLAGS+= OSX_VERSION=${OSX_VERSION:Q
91 91
92# 92#
93# From Xcode 5 onwards system headers are no longer installed by default 93# From Xcode 5 onwards system headers are no longer installed by default
94# into /usr/include, so we need to query their location if /usr/include is 94# into /usr/include, so we need to query their location if /usr/include is
95# not available. 95# not available.
96# 96#
97# Use current system version SDK (avoid newer SDKs). 97# Use current system version SDK (avoid newer SDKs).
98# 98#
99.if exists(/usr/include/stdio.h) 99.if exists(/usr/include/stdio.h)
100_OPSYS_INCLUDE_DIRS?= /usr/include 100_OPSYS_INCLUDE_DIRS?= /usr/include
101.elif exists(/usr/bin/xcrun) 101.elif exists(/usr/bin/xcrun)
102. if !defined(OSX_SDK_PATH) 102. if !defined(OSX_SDK_PATH)
103OSX_SDK_PATH!= /usr/bin/xcrun --sdk macosx${OSX_VERSION} --show-sdk-path 2>/dev/null || echo /nonexistent 103OSX_SDK_PATH!= /usr/bin/xcrun --sdk macosx${OSX_VERSION} --show-sdk-path 2>/dev/null || echo /nonexistent
 104. if ${OSX_SDK_PATH} == "/nonexistent"
 105OSX_SDK_PATH!= /usr/bin/xcrun --sdk macosx --show-sdk-path 2>/dev/null || echo /nonexistent
 106. endif
104MAKEFLAGS+= OSX_SDK_PATH=${OSX_SDK_PATH:Q} 107MAKEFLAGS+= OSX_SDK_PATH=${OSX_SDK_PATH:Q}
105. endif 108. endif
106. if exists(${OSX_SDK_PATH}/usr/include/stdio.h) 109. if exists(${OSX_SDK_PATH}/usr/include/stdio.h)
107_OPSYS_INCLUDE_DIRS?= ${OSX_SDK_PATH}/usr/include 110_OPSYS_INCLUDE_DIRS?= ${OSX_SDK_PATH}/usr/include
108. else 111. else
109PKG_FAIL_REASON+= "No suitable Xcode SDK or Command Line Tools installed." 112PKG_FAIL_REASON+= "No suitable Xcode SDK or Command Line Tools installed."
110. endif 113. endif
111.endif 114.endif
112 115
113.if ${OS_VERSION:R} >= 6 116.if ${OS_VERSION:R} >= 6
114_OPSYS_HAS_INET6= yes # IPv6 is standard 117_OPSYS_HAS_INET6= yes # IPv6 is standard
115.else 118.else
116_OPSYS_HAS_INET6= no # IPv6 is not standard 119_OPSYS_HAS_INET6= no # IPv6 is not standard