Use xcrun to determine the full path to the SDK, and use the headers from that location in the new find-headers infrastructure when they have not been installed into /usr/include. This allows us to remove the hardcoded builtins, as they can now be correctly determined automatically.diff -r1.57 -r1.58 pkgsrc/mk/platform/Darwin.mk
(jperkin)
@@ -1,4 +1,4 @@
-# $NetBSD: Darwin.mk,v 1.57 2013/11/01 12:22:32 jperkin Exp $
+# $NetBSD: Darwin.mk,v 1.58 2013/11/23 11:42:38 jperkin Exp $
#
# Variable definitions for the Darwin operating system.
@@ -71,9 +71,21 @@
_OPSYS_EMULDIR.darwin= # empty
+#
+# From Xcode 5 onwards system headers are no longer installed by default
+# into /usr/include, so we need to query their location.
+#
+.if exists(/usr/bin/xcrun)
+OSX_SDK_PATH!= /usr/bin/xcrun --show-sdk-path
+.endif
+
_OPSYS_SYSTEM_RPATH?= /usr/lib
_OPSYS_LIB_DIRS?= /usr/lib
+.if exists(/usr/include)
_OPSYS_INCLUDE_DIRS?= /usr/include
+.elif exists(${OSX_SDK_PATH}/usr/include)
+_OPSYS_INCLUDE_DIRS?= ${OSX_SDK_PATH}/usr/include
+.endif
.if ${OS_VERSION:R} >= 6
_OPSYS_HAS_INET6= yes # IPv6 is standard
@@ -100,18 +112,6 @@
#
.if !empty(OS_VERSION:M[56].*)
USE_BUILTIN.dl= no # Darwin-[56].* uses devel/dlcompat
-.endif
-#
-# OSX Mavericks and Xcode 5 no longer ship /usr/include headers, moving them
-# instead to SDK-specific locations. This breaks various builtin header
-# checks, so we simply override builtins here that we know exist.
-#
-.if ${OS_VERSION:R} >= 13
-IS_BUILTIN.db1= yes
-IS_BUILTIN.dl= yes
-IS_BUILTIN.pthread= yes
-IS_BUILTIN.termcap= yes
-IS_BUILTIN.terminfo= yes
.endif
# Builtin defaults which make sense for this platform.