summaryrefslogtreecommitdiff
path: root/mk/platform/Darwin.mk
diff options
context:
space:
mode:
authorjperkin <jperkin>2015-10-05 17:06:22 +0000
committerjperkin <jperkin>2015-10-05 17:06:22 +0000
commiteacb1a070075b8b0eb49a517260903fe419100f3 (patch)
tree33857f9dec9a7b36f558f17f4aca91a47c31d167 /mk/platform/Darwin.mk
parent56a82a6409e3b46d112f6a0daa541f8d4439cfe3 (diff)
downloadpkgsrc-eacb1a070075b8b0eb49a517260903fe419100f3.tar.gz
Re-order the way _OPSYS_INCLUDE_DIRS is calculated, and only perform checks for
the SDK path if we need to. This avoids issues on Yosemite and Xcode 7, which drops support for the 10.10 SDK. Trying to determine the SDK path fails, but the failure is not cached in the xcrun database, so each call to a compiler tool is unecessarily delayed (by around 3 seconds on my build hosts). For users still on Yosemite who have upgraded to Xcode 7, the solution is to install the Command Line Tools so that /usr/include is populated and used.
Diffstat (limited to 'mk/platform/Darwin.mk')
-rw-r--r--mk/platform/Darwin.mk26
1 files changed, 15 insertions, 11 deletions
diff --git a/mk/platform/Darwin.mk b/mk/platform/Darwin.mk
index 3a47fdf5fbb..918108aaf09 100644
--- a/mk/platform/Darwin.mk
+++ b/mk/platform/Darwin.mk
@@ -1,4 +1,4 @@
-# $NetBSD: Darwin.mk,v 1.71 2015/09/07 11:48:35 jperkin Exp $
+# $NetBSD: Darwin.mk,v 1.72 2015/10/05 17:06:22 jperkin Exp $
#
# Variable definitions for the Darwin operating system.
@@ -77,25 +77,29 @@ _USER_DEPENDS= user-darwin>=20130712:../../sysutils/user_darwin
_OPSYS_EMULDIR.darwin= # empty
+_OPSYS_SYSTEM_RPATH?= /usr/lib
+_OPSYS_LIB_DIRS?= /usr/lib
+
#
# From Xcode 5 onwards system headers are no longer installed by default
-# into /usr/include, so we need to query their location.
+# into /usr/include, so we need to query their location if /usr/include is
+# not available.
+#
# Use current system version SDK (avoid newer SDKs).
#
-.if exists(/usr/bin/xcrun)
+.if exists(/usr/include/stdio.h)
+_OPSYS_INCLUDE_DIRS?= /usr/include
+.elif exists(/usr/bin/xcrun)
OSX_VERS!= sw_vers -productVersion
. if ${OSX_VERS:R:R} != ${OSX_VERS:R}
-OSX_VERS:=${OSX_VERS:R}
+OSX_VERS:= ${OSX_VERS:R}
. endif
OSX_SDK_PATH!= /usr/bin/xcrun --sdk macosx${OSX_VERS} --show-sdk-path 2>/dev/null || echo /nonexistent
-.endif
-
-_OPSYS_SYSTEM_RPATH?= /usr/lib
-_OPSYS_LIB_DIRS?= /usr/lib
-.if exists(/usr/include/stdio.h)
-_OPSYS_INCLUDE_DIRS?= /usr/include
-.elif exists(${OSX_SDK_PATH}/usr/include/stdio.h)
+MAKEFLAGS+= OSX_VERS=${OSX_VERS:Q}
+MAKEFLAGS+= OSX_SDK_PATH=${OSX_SDK_PATH:Q}
+. if exists(${OSX_SDK_PATH}/usr/include/stdio.h)
_OPSYS_INCLUDE_DIRS?= ${OSX_SDK_PATH}/usr/include
+. endif
.endif
.if ${OS_VERSION:R} >= 6