Sat Nov 23 11:42:38 2013 UTC ()
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.


(jperkin)
diff -r1.57 -r1.58 pkgsrc/mk/platform/Darwin.mk

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

--- pkgsrc/mk/platform/Darwin.mk 2013/11/01 12:22:32 1.57
+++ pkgsrc/mk/platform/Darwin.mk 2013/11/23 11:42:38 1.58
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: Darwin.mk,v 1.57 2013/11/01 12:22:32 jperkin Exp $ 1# $NetBSD: Darwin.mk,v 1.58 2013/11/23 11:42:38 jperkin 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# 6#
7# Codename OS Kernel Xcode 7# Codename OS Kernel Xcode
8# Cheetah 10.0.x 1.3.1 8# Cheetah 10.0.x 1.3.1
9# Puma 10.1 1.4.1 9# Puma 10.1 1.4.1
10# 10.1.x 5.x.y 10# 10.1.x 5.x.y
11# Jaguar 10.2.x 6.x.y 11# Jaguar 10.2.x 6.x.y
12# Panther 10.3.x 7.x.y 12# Panther 10.3.x 7.x.y
13# Tiger 10.4.x 8.x.y 2.x (gcc 4.0, 4.0.1 from 2.2) 13# Tiger 10.4.x 8.x.y 2.x (gcc 4.0, 4.0.1 from 2.2)
14# Leopard 10.5.x 9.x.y 3.x (gcc 4.0.1, 4.0.1 and 4.2.1 from 3.1) 14# Leopard 10.5.x 9.x.y 3.x (gcc 4.0.1, 4.0.1 and 4.2.1 from 3.1)
@@ -61,29 +61,41 @@ ROOT_GROUP?= wheel @@ -61,29 +61,41 @@ ROOT_GROUP?= wheel
61ROOT_USER?= root 61ROOT_USER?= root
62SERIAL_DEVICES?= /dev/null 62SERIAL_DEVICES?= /dev/null
63ULIMIT_CMD_datasize?= ulimit -d `ulimit -H -d` 63ULIMIT_CMD_datasize?= ulimit -d `ulimit -H -d`
64ULIMIT_CMD_stacksize?= ulimit -s `ulimit -H -s` 64ULIMIT_CMD_stacksize?= ulimit -s `ulimit -H -s`
65ULIMIT_CMD_memorysize?= ulimit -m `ulimit -H -m` 65ULIMIT_CMD_memorysize?= ulimit -m `ulimit -H -m`
66 66
67GROUPADD?= ${LOCALBASE}/sbin/groupadd 67GROUPADD?= ${LOCALBASE}/sbin/groupadd
68USERADD?= ${LOCALBASE}/sbin/useradd 68USERADD?= ${LOCALBASE}/sbin/useradd
69_PKG_USER_HOME?= /var/empty # to match other system accounts 69_PKG_USER_HOME?= /var/empty # to match other system accounts
70_USER_DEPENDS= user-darwin>=20130712:../../sysutils/user_darwin 70_USER_DEPENDS= user-darwin>=20130712:../../sysutils/user_darwin
71 71
72_OPSYS_EMULDIR.darwin= # empty 72_OPSYS_EMULDIR.darwin= # empty
73 73
 74#
 75# From Xcode 5 onwards system headers are no longer installed by default
 76# into /usr/include, so we need to query their location.
 77#
 78.if exists(/usr/bin/xcrun)
 79OSX_SDK_PATH!= /usr/bin/xcrun --show-sdk-path
 80.endif
 81
74_OPSYS_SYSTEM_RPATH?= /usr/lib 82_OPSYS_SYSTEM_RPATH?= /usr/lib
75_OPSYS_LIB_DIRS?= /usr/lib 83_OPSYS_LIB_DIRS?= /usr/lib
 84.if exists(/usr/include)
76_OPSYS_INCLUDE_DIRS?= /usr/include 85_OPSYS_INCLUDE_DIRS?= /usr/include
 86.elif exists(${OSX_SDK_PATH}/usr/include)
 87_OPSYS_INCLUDE_DIRS?= ${OSX_SDK_PATH}/usr/include
 88.endif
77 89
78.if ${OS_VERSION:R} >= 6 90.if ${OS_VERSION:R} >= 6
79_OPSYS_HAS_INET6= yes # IPv6 is standard 91_OPSYS_HAS_INET6= yes # IPv6 is standard
80.else 92.else
81_OPSYS_HAS_INET6= no # IPv6 is not standard 93_OPSYS_HAS_INET6= no # IPv6 is not standard
82.endif 94.endif
83_OPSYS_HAS_JAVA= yes # Java is standard 95_OPSYS_HAS_JAVA= yes # Java is standard
84_OPSYS_HAS_MANZ= yes # MANZ controls gzipping of man pages 96_OPSYS_HAS_MANZ= yes # MANZ controls gzipping of man pages
85_OPSYS_HAS_OSSAUDIO= no # libossaudio is available 97_OPSYS_HAS_OSSAUDIO= no # libossaudio is available
86_OPSYS_PERL_REQD= 5.8.0 # base version of perl required 98_OPSYS_PERL_REQD= 5.8.0 # base version of perl required
87_OPSYS_PTHREAD_AUTO= yes # -lpthread not needed for pthreads 99_OPSYS_PTHREAD_AUTO= yes # -lpthread not needed for pthreads
88_OPSYS_LINKER_RPATH_FLAG= -L # darwin has no rpath, use -L instead 100_OPSYS_LINKER_RPATH_FLAG= -L # darwin has no rpath, use -L instead
89_OPSYS_COMPILER_RPATH_FLAG= -L # compiler flag to pass rpaths to linker 101_OPSYS_COMPILER_RPATH_FLAG= -L # compiler flag to pass rpaths to linker
@@ -91,38 +103,26 @@ _OPSYS_SHLIB_TYPE= dylib # shared lib ty @@ -91,38 +103,26 @@ _OPSYS_SHLIB_TYPE= dylib # shared lib ty
91_PATCH_CAN_BACKUP= yes # native patch(1) can make backups 103_PATCH_CAN_BACKUP= yes # native patch(1) can make backups
92_PATCH_BACKUP_ARG?= -V simple -b -z # switch to patch(1) for backup suffix 104_PATCH_BACKUP_ARG?= -V simple -b -z # switch to patch(1) for backup suffix
93_USE_RPATH= no # don't add rpath to LDFLAGS 105_USE_RPATH= no # don't add rpath to LDFLAGS
94 106
95# Comes with a native mit-krb5 implementation 107# Comes with a native mit-krb5 implementation
96KRB5_DEFAULT?= mit-krb5 108KRB5_DEFAULT?= mit-krb5
97 109
98# 110#
99# Builtin overrides. 111# Builtin overrides.
100# 112#
101.if !empty(OS_VERSION:M[56].*) 113.if !empty(OS_VERSION:M[56].*)
102USE_BUILTIN.dl= no # Darwin-[56].* uses devel/dlcompat 114USE_BUILTIN.dl= no # Darwin-[56].* uses devel/dlcompat
103.endif 115.endif
104# 
105# OSX Mavericks and Xcode 5 no longer ship /usr/include headers, moving them 
106# instead to SDK-specific locations. This breaks various builtin header 
107# checks, so we simply override builtins here that we know exist. 
108# 
109.if ${OS_VERSION:R} >= 13 
110IS_BUILTIN.db1= yes 
111IS_BUILTIN.dl= yes 
112IS_BUILTIN.pthread= yes 
113IS_BUILTIN.termcap= yes 
114IS_BUILTIN.terminfo= yes 
115.endif 
116 116
117# Builtin defaults which make sense for this platform. 117# Builtin defaults which make sense for this platform.
118_OPSYS_PREFER.linux-pam?= native 118_OPSYS_PREFER.linux-pam?= native
119_OPSYS_PREFER.mit-krb5?= native 119_OPSYS_PREFER.mit-krb5?= native
120 120
121# flags passed to the linker to extract all symbols from static archives. 121# flags passed to the linker to extract all symbols from static archives.
122# this is GNU ld. 122# this is GNU ld.
123_OPSYS_WHOLE_ARCHIVE_FLAG= -Wl,--whole-archive 123_OPSYS_WHOLE_ARCHIVE_FLAG= -Wl,--whole-archive
124_OPSYS_NO_WHOLE_ARCHIVE_FLAG= -Wl,--no-whole-archive 124_OPSYS_NO_WHOLE_ARCHIVE_FLAG= -Wl,--no-whole-archive
125 125
126_OPSYS_CAN_CHECK_SHLIBS= no # can't use readelf in check/bsd.check-vars.mk 126_OPSYS_CAN_CHECK_SHLIBS= no # can't use readelf in check/bsd.check-vars.mk
127 127
128_STRIPFLAG_CC?= ${_INSTALL_UNSTRIPPED:D:U-Wl,-x} # cc(1) option to strip 128_STRIPFLAG_CC?= ${_INSTALL_UNSTRIPPED:D:U-Wl,-x} # cc(1) option to strip