| @@ -1,670 +1,674 @@ | | | @@ -1,670 +1,674 @@ |
1 | # $NetBSD: bsd.prefs.mk,v 1.293 2009/05/19 09:33:53 wiz Exp $ | | 1 | # $NetBSD: bsd.prefs.mk,v 1.294 2009/05/23 23:48:44 joerg Exp $ |
2 | # | | 2 | # |
3 | # This file includes the mk.conf file, which contains the user settings. | | 3 | # This file includes the mk.conf file, which contains the user settings. |
4 | # | | 4 | # |
5 | # Packages should include this file before any of the .if directives, as | | 5 | # Packages should include this file before any of the .if directives, as |
6 | # well as before modifying variables like CFLAGS, LDFLAGS, and so on. | | 6 | # well as before modifying variables like CFLAGS, LDFLAGS, and so on. |
7 | # Otherwise the behavior may be unexpected. | | 7 | # Otherwise the behavior may be unexpected. |
8 | # | | 8 | # |
9 | # When mk.conf is included by this file, the following variables are | | 9 | # When mk.conf is included by this file, the following variables are |
10 | # defined: | | 10 | # defined: |
11 | # | | 11 | # |
12 | # ACCEPTABLE_LICENSES | | 12 | # ACCEPTABLE_LICENSES |
13 | # This variable is set to the list of Open Source licenses. See | | 13 | # This variable is set to the list of Open Source licenses. See |
14 | # mk/license.mk for details. | | 14 | # mk/license.mk for details. |
15 | # | | 15 | # |
16 | # MACHINE_PLATFORM | | 16 | # MACHINE_PLATFORM |
17 | # The platform for which the packages are built. It has the form | | 17 | # The platform for which the packages are built. It has the form |
18 | # ${OPSYS}-${OS_VERSION}-${MACHINE_ARCH}. | | 18 | # ${OPSYS}-${OS_VERSION}-${MACHINE_ARCH}. |
19 | # | | 19 | # |
20 | # NATIVE_MACHINE_PLATFORM | | 20 | # NATIVE_MACHINE_PLATFORM |
21 | # The platform on which the packages are built. This is usually | | 21 | # The platform on which the packages are built. This is usually |
22 | # the same as ${MACHINE_PLATFORM}, but can be different when | | 22 | # the same as ${MACHINE_PLATFORM}, but can be different when |
23 | # cross-building packages. | | 23 | # cross-building packages. |
24 | # | | 24 | # |
25 | # PKGPATH | | 25 | # PKGPATH |
26 | # The path of the package, relative to the pkgsrc top-level | | 26 | # The path of the package, relative to the pkgsrc top-level |
27 | # directory. Typical values look like editors/emacs or | | 27 | # directory. Typical values look like editors/emacs or |
28 | # misc/openoffice-bin. | | 28 | # misc/openoffice-bin. |
29 | # | | 29 | # |
30 | # Keywords: mk.conf user | | 30 | # Keywords: mk.conf user |
31 | # | | 31 | # |
32 | | | 32 | |
33 | .if !defined(BSD_PKG_MK) | | 33 | .if !defined(BSD_PKG_MK) |
34 | | | 34 | |
35 | # Let mk.conf know that this is pkgsrc. | | 35 | # Let mk.conf know that this is pkgsrc. |
36 | BSD_PKG_MK=1 | | 36 | BSD_PKG_MK=1 |
37 | __PREFIX_SET__:=${PREFIX} | | 37 | __PREFIX_SET__:=${PREFIX} |
38 | | | 38 | |
39 | # Set PATH if not already set | | 39 | # Set PATH if not already set |
40 | .if !defined(PATH) | | 40 | .if !defined(PATH) |
41 | PATH=/bin:/usr/bin:/sbin:/usr/sbin | | 41 | PATH=/bin:/usr/bin:/sbin:/usr/sbin |
42 | .endif | | 42 | .endif |
43 | | | 43 | |
44 | # Expand MAKE to a full path. | | 44 | # Expand MAKE to a full path. |
45 | .if !defined(_MAKE) | | 45 | .if !defined(_MAKE) |
46 | _MAKE:= ${MAKE} | | 46 | _MAKE:= ${MAKE} |
47 | # allow for MAKE=./make and similar. | | 47 | # allow for MAKE=./make and similar. |
48 | . if empty(_MAKE:M/*) && !empty(_MAKE:M*/*) && defined(PWD) && exists(${PWD}/${MAKE}) | | 48 | . if empty(_MAKE:M/*) && !empty(_MAKE:M*/*) && defined(PWD) && exists(${PWD}/${MAKE}) |
49 | _MAKE:= ${PWD}/${MAKE} | | 49 | _MAKE:= ${PWD}/${MAKE} |
50 | . endif | | 50 | . endif |
51 | . for _dir_ in ${PATH:C/\:/ /g} | | 51 | . for _dir_ in ${PATH:C/\:/ /g} |
52 | . if empty(_MAKE:M/*) | | 52 | . if empty(_MAKE:M/*) |
53 | . if exists(${_dir_}/${MAKE}) | | 53 | . if exists(${_dir_}/${MAKE}) |
54 | _MAKE:= ${_dir_}/${MAKE} | | 54 | _MAKE:= ${_dir_}/${MAKE} |
55 | . endif | | 55 | . endif |
56 | . endif | | 56 | . endif |
57 | . endfor | | 57 | . endfor |
58 | . if !empty(_MAKE:M/*) | | 58 | . if !empty(_MAKE:M/*) |
59 | MAKEFLAGS+= _MAKE=${_MAKE:Q} | | 59 | MAKEFLAGS+= _MAKE=${_MAKE:Q} |
60 | . endif | | 60 | . endif |
61 | .endif | | 61 | .endif |
62 | MAKE:= ${_MAKE} | | 62 | MAKE:= ${_MAKE} |
63 | | | 63 | |
64 | .if exists(/usr/bin/uname) | | 64 | .if exists(/usr/bin/uname) |
65 | UNAME=/usr/bin/uname | | 65 | UNAME=/usr/bin/uname |
66 | .elif exists(/bin/uname) | | 66 | .elif exists(/bin/uname) |
67 | UNAME=/bin/uname | | 67 | UNAME=/bin/uname |
68 | .else | | 68 | .else |
69 | UNAME=echo Unknown | | 69 | UNAME=echo Unknown |
70 | .endif | | 70 | .endif |
71 | | | 71 | |
72 | .if !defined(OPSYS) | | 72 | .if !defined(OPSYS) |
73 | OPSYS:= ${:!${UNAME} -s!:S/-//g:S/\///g} | | 73 | OPSYS:= ${:!${UNAME} -s!:S/-//g:S/\///g} |
74 | MAKEFLAGS+= OPSYS=${OPSYS:Q} | | 74 | MAKEFLAGS+= OPSYS=${OPSYS:Q} |
75 | .endif | | 75 | .endif |
76 | | | 76 | |
77 | # The _CMD indirection allows code below to modify these values | | 77 | # The _CMD indirection allows code below to modify these values |
78 | # without executing the commands at all. Later, recursed make | | 78 | # without executing the commands at all. Later, recursed make |
79 | # invocations will skip these blocks entirely thanks to MAKEFLAGS. | | 79 | # invocations will skip these blocks entirely thanks to MAKEFLAGS. |
80 | .if !defined(OS_VERSION) | | 80 | .if !defined(OS_VERSION) |
81 | _OS_VERSION_CMD= ${UNAME} -r | | 81 | _OS_VERSION_CMD= ${UNAME} -r |
82 | OS_VERSION= ${_OS_VERSION_CMD:sh} | | 82 | OS_VERSION= ${_OS_VERSION_CMD:sh} |
83 | MAKEFLAGS+= OS_VERSION=${OS_VERSION:Q} | | 83 | MAKEFLAGS+= OS_VERSION=${OS_VERSION:Q} |
84 | .endif | | 84 | .endif |
85 | | | 85 | |
86 | # Preload these for architectures not in all variations of bsd.own.mk, | | 86 | # Preload these for architectures not in all variations of bsd.own.mk, |
87 | # which do not match their GNU names exactly. | | 87 | # which do not match their GNU names exactly. |
88 | GNU_ARCH.arm26?= arm | | 88 | GNU_ARCH.arm26?= arm |
89 | GNU_ARCH.arm32?= arm | | 89 | GNU_ARCH.arm32?= arm |
90 | GNU_ARCH.i486?= i386 | | 90 | GNU_ARCH.i486?= i386 |
91 | GNU_ARCH.i586?= i386 | | 91 | GNU_ARCH.i586?= i386 |
92 | GNU_ARCH.i686?= i386 | | 92 | GNU_ARCH.i686?= i386 |
93 | GNU_ARCH.m68000?= m68010 | | 93 | GNU_ARCH.m68000?= m68010 |
94 | GNU_ARCH.mips?= mipsel | | 94 | GNU_ARCH.mips?= mipsel |
95 | GNU_ARCH.sh3eb?= sh | | 95 | GNU_ARCH.sh3eb?= sh |
96 | GNU_ARCH.sh3el?= shle | | 96 | GNU_ARCH.sh3el?= shle |
97 | NATIVE_MACHINE_GNU_ARCH?= ${GNU_ARCH.${NATIVE_MACHINE_ARCH}:U${NATIVE_MACHINE_ARCH}} | | 97 | NATIVE_MACHINE_GNU_ARCH?= ${GNU_ARCH.${NATIVE_MACHINE_ARCH}:U${NATIVE_MACHINE_ARCH}} |
98 | MACHINE_GNU_ARCH?= ${GNU_ARCH.${MACHINE_ARCH}:U${MACHINE_ARCH}} | | 98 | MACHINE_GNU_ARCH?= ${GNU_ARCH.${MACHINE_ARCH}:U${MACHINE_ARCH}} |
99 | | | 99 | |
100 | .if ${OPSYS} == "NetBSD" | | 100 | .if ${OPSYS} == "NetBSD" |
101 | LOWER_OPSYS?= netbsd | | 101 | LOWER_OPSYS?= netbsd |
102 | | | 102 | |
103 | .elif ${OPSYS} == "AIX" | | 103 | .elif ${OPSYS} == "AIX" |
104 | LOWER_ARCH!= _cpuid=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $$1 }'`; \ | | 104 | LOWER_ARCH!= _cpuid=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $$1 }'`; \ |
105 | if /usr/sbin/lsattr -El $$_cpuid | grep ' POWER' >/dev/null 2>&1; then \ | | 105 | if /usr/sbin/lsattr -El $$_cpuid | grep ' POWER' >/dev/null 2>&1; then \ |
106 | echo rs6000; \ | | 106 | echo rs6000; \ |
107 | else \ | | 107 | else \ |
108 | echo powerpc; \ | | 108 | echo powerpc; \ |
109 | fi | | 109 | fi |
110 | MACHINE_ARCH?= ${LOWER_ARCH} | | 110 | MACHINE_ARCH?= ${LOWER_ARCH} |
111 | . if exists(/usr/bin/oslevel) | | 111 | . if exists(/usr/bin/oslevel) |
112 | _OS_VERSION!= /usr/bin/oslevel | | 112 | _OS_VERSION!= /usr/bin/oslevel |
113 | . else | | 113 | . else |
114 | _OS_VERSION!= echo `${UNAME} -v`.`${UNAME} -r` | | 114 | _OS_VERSION!= echo `${UNAME} -v`.`${UNAME} -r` |
115 | . endif | | 115 | . endif |
116 | OS_VERSION= ${_OS_VERSION:C/\([0-9]*\.[0-9]*\).*/\1/} | | 116 | OS_VERSION= ${_OS_VERSION:C/\([0-9]*\.[0-9]*\).*/\1/} |
117 | LOWER_OPSYS_VERSUFFIX= ${_OS_VERSION} | | 117 | LOWER_OPSYS_VERSUFFIX= ${_OS_VERSION} |
118 | LOWER_OPSYS?= aix | | 118 | LOWER_OPSYS?= aix |
119 | LOWER_VENDOR?= ibm | | 119 | LOWER_VENDOR?= ibm |
120 | | | 120 | |
121 | .elif ${OPSYS} == "BSDOS" | | 121 | .elif ${OPSYS} == "BSDOS" |
122 | LOWER_OPSYS?= bsdi | | 122 | LOWER_OPSYS?= bsdi |
123 | | | 123 | |
124 | .elif ${OPSYS} == "Darwin" | | 124 | .elif ${OPSYS} == "Darwin" |
125 | LOWER_OPSYS?= darwin | | 125 | LOWER_OPSYS?= darwin |
126 | LOWER_ARCH!= ${UNAME} -p | | 126 | LOWER_ARCH!= ${UNAME} -p |
127 | MACHINE_ARCH= ${LOWER_ARCH} | | 127 | MACHINE_ARCH= ${LOWER_ARCH} |
128 | MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH:Q} | | 128 | MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH:Q} |
129 | LOWER_OPSYS_VERSUFFIX= ${LOWER_OS_VERSION:C/([0-9]*).*/\1/} | | 129 | LOWER_OPSYS_VERSUFFIX= ${LOWER_OS_VERSION:C/([0-9]*).*/\1/} |
130 | LOWER_VENDOR?= apple | | 130 | LOWER_VENDOR?= apple |
131 | | | 131 | |
132 | .elif ${OPSYS} == "DragonFly" | | 132 | .elif ${OPSYS} == "DragonFly" |
133 | OS_VERSION:= ${OS_VERSION:C/-.*$//} | | 133 | OS_VERSION:= ${OS_VERSION:C/-.*$//} |
134 | LOWER_OPSYS?= dragonfly | | 134 | LOWER_OPSYS?= dragonfly |
135 | LOWER_ARCH!= ${UNAME} -p | | 135 | LOWER_ARCH!= ${UNAME} -p |
136 | MACHINE_ARCH= ${LOWER_ARCH} | | 136 | MACHINE_ARCH= ${LOWER_ARCH} |
137 | MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH:Q} | | 137 | MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH:Q} |
138 | LOWER_VENDOR?= pc | | 138 | LOWER_VENDOR?= pc |
139 | | | 139 | |
140 | .elif ${OPSYS} == "FreeBSD" | | 140 | .elif ${OPSYS} == "FreeBSD" |
141 | OS_VERSION:= ${OS_VERSION:C/-.*$//} | | 141 | OS_VERSION:= ${OS_VERSION:C/-.*$//} |
142 | LOWER_OPSYS?= freebsd | | 142 | LOWER_OPSYS?= freebsd |
143 | LOWER_ARCH!= ${UNAME} -p | | 143 | LOWER_ARCH!= ${UNAME} -p |
144 | . if ${LOWER_ARCH} == "amd64" | | 144 | . if ${LOWER_ARCH} == "amd64" |
145 | MACHINE_ARCH= x86_64 | | 145 | MACHINE_ARCH= x86_64 |
146 | . else | | 146 | . else |
147 | MACHINE_ARCH= ${LOWER_ARCH} | | 147 | MACHINE_ARCH= ${LOWER_ARCH} |
148 | . endif | | 148 | . endif |
149 | MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH:Q} | | 149 | MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH:Q} |
150 | LOWER_OPSYS_VERSUFFIX= ${LOWER_OS_VERSION:C/([0-9]*).*/\1/} | | 150 | LOWER_OPSYS_VERSUFFIX= ${LOWER_OS_VERSION:C/([0-9]*).*/\1/} |
151 | . if ${LOWER_ARCH} == "i386" | | 151 | . if ${LOWER_ARCH} == "i386" |
152 | LOWER_VENDOR?= pc | | 152 | LOWER_VENDOR?= pc |
153 | . endif | | 153 | . endif |
154 | LOWER_VENDOR?= unknown | | 154 | LOWER_VENDOR?= unknown |
155 | | | 155 | |
156 | .elif ${OPSYS} == "Interix" | | 156 | .elif ${OPSYS} == "Interix" |
157 | LOWER_OPSYS?= interix | | 157 | LOWER_OPSYS?= interix |
158 | LOWER_OPSYS_VERSUFFIX?= 3 | | 158 | LOWER_OPSYS_VERSUFFIX?= 3 |
159 | LOWER_VENDOR?= pc | | 159 | LOWER_VENDOR?= pc |
160 | . if exists(/usr/lib/libc.so.3.5) | | 160 | . if exists(/usr/lib/libc.so.3.5) |
161 | OS_VERSION= 3.5 | | 161 | OS_VERSION= 3.5 |
162 | . elif exists(/usr/lib/libc.so.3.1) | | 162 | . elif exists(/usr/lib/libc.so.3.1) |
163 | OS_VERSION= 3.1 | | 163 | OS_VERSION= 3.1 |
164 | . else | | 164 | . else |
165 | OS_VERSION= 3.0 | | 165 | OS_VERSION= 3.0 |
166 | . endif | | 166 | . endif |
167 | | | 167 | |
168 | .elif !empty(OPSYS:MIRIX*) | | 168 | .elif !empty(OPSYS:MIRIX*) |
169 | LOWER_ARCH!= ${UNAME} -p | | 169 | LOWER_ARCH!= ${UNAME} -p |
170 | LOWER_OPSYS?= irix | | 170 | LOWER_OPSYS?= irix |
171 | LOWER_OPSYS_VERSUFFIX?= ${OS_VERSION} | | 171 | LOWER_OPSYS_VERSUFFIX?= ${OS_VERSION} |
172 | LOWER_VENDOR?= sgi | | 172 | LOWER_VENDOR?= sgi |
173 | | | 173 | |
174 | .elif ${OPSYS} == "Linux" | | 174 | .elif ${OPSYS} == "Linux" |
175 | OS_VERSION:= ${OS_VERSION:C/-.*$//} | | 175 | OS_VERSION:= ${OS_VERSION:C/-.*$//} |
176 | LOWER_OPSYS?= linux | | 176 | LOWER_OPSYS?= linux |
177 | MACHINE_ARCH:= ${MACHINE_ARCH:C/i.86/i386/} | | 177 | MACHINE_ARCH:= ${MACHINE_ARCH:C/i.86/i386/} |
178 | MACHINE_ARCH:= ${MACHINE_ARCH:C/ppc/powerpc/} | | 178 | MACHINE_ARCH:= ${MACHINE_ARCH:C/ppc/powerpc/} |
179 | . if !defined(LOWER_ARCH) | | 179 | . if !defined(LOWER_ARCH) |
180 | LOWER_ARCH!= ${UNAME} -m | sed -e 's/i.86/i386/' -e 's/ppc/powerpc/' | | 180 | LOWER_ARCH!= ${UNAME} -m | sed -e 's/i.86/i386/' -e 's/ppc/powerpc/' |
181 | . endif # !defined(LOWER_ARCH) | | 181 | . endif # !defined(LOWER_ARCH) |
182 | . if ${LOWER_ARCH} == "x86_64" | | 182 | . if ${LOWER_ARCH} == "x86_64" |
183 | MACHINE_ARCH= x86_64 | | 183 | MACHINE_ARCH= x86_64 |
184 | . endif | | 184 | . endif |
185 | . if ${MACHINE_ARCH} == "unknown" || ${MACHINE_ARCH} == "" | | 185 | . if ${MACHINE_ARCH} == "unknown" || ${MACHINE_ARCH} == "" |
186 | MACHINE_ARCH= ${LOWER_ARCH} | | 186 | MACHINE_ARCH= ${LOWER_ARCH} |
187 | MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH:Q} | | 187 | MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH:Q} |
188 | . endif | | 188 | . endif |
189 | . if exists(/etc/debian_version) | | 189 | . if exists(/etc/debian_version) |
190 | LOWER_VENDOR?= debian | | 190 | LOWER_VENDOR?= debian |
191 | . elif exists(/etc/mandrake-release) | | 191 | . elif exists(/etc/mandrake-release) |
192 | LOWER_VENDOR?= mandrake | | 192 | LOWER_VENDOR?= mandrake |
193 | . elif exists(/etc/redhat-version) | | 193 | . elif exists(/etc/redhat-version) |
194 | LOWER_VENDOR?= redhat | | 194 | LOWER_VENDOR?= redhat |
195 | . elif exists(/etc/slackware-version) | | 195 | . elif exists(/etc/slackware-version) |
196 | LOWER_VENDOR?= slackware | | 196 | LOWER_VENDOR?= slackware |
197 | . elif ${LOWER_ARCH} == "i386" | | 197 | . elif ${LOWER_ARCH} == "i386" |
198 | LOWER_VENDOR?= pc | | 198 | LOWER_VENDOR?= pc |
199 | . endif | | 199 | . endif |
200 | LOWER_VENDOR?= unknown | | 200 | LOWER_VENDOR?= unknown |
201 | | | 201 | |
202 | .elif ${OPSYS} == "OSF1" | | 202 | .elif ${OPSYS} == "OSF1" |
203 | LOWER_ARCH!= ${UNAME} -p | | 203 | LOWER_ARCH!= ${UNAME} -p |
204 | MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH:Q} | | 204 | MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH:Q} |
205 | MACHINE_ARCH?= ${LOWER_ARCH} | | 205 | MACHINE_ARCH?= ${LOWER_ARCH} |
206 | OS_VERSION:= ${OS_VERSION:C/^V//} | | 206 | OS_VERSION:= ${OS_VERSION:C/^V//} |
207 | LOWER_OPSYS?= osf1 | | 207 | LOWER_OPSYS?= osf1 |
208 | LOWER_OPSYS_VERSUFFIX?= ${OS_VERSION} | | 208 | LOWER_OPSYS_VERSUFFIX?= ${OS_VERSION} |
209 | LOWER_VENDOR?= dec | | 209 | LOWER_VENDOR?= dec |
210 | | | 210 | |
211 | .elif ${OPSYS} == "HPUX" | | 211 | .elif ${OPSYS} == "HPUX" |
212 | OS_VERSION:= ${OS_VERSION:C/^B.//} | | 212 | OS_VERSION:= ${OS_VERSION:C/^B.//} |
213 | .if ${MACHINE_ARCH} == "9000" | | 213 | .if ${MACHINE_ARCH} == "9000" |
214 | MACHINE_ARCH= hppa | | 214 | MACHINE_ARCH= hppa |
215 | .endif | | 215 | .endif |
216 | LOWER_OPSYS?= hpux | | 216 | LOWER_OPSYS?= hpux |
217 | LOWER_OPSYS_VERSUFFIX?= ${OS_VERSION} | | 217 | LOWER_OPSYS_VERSUFFIX?= ${OS_VERSION} |
218 | LOWER_VENDOR?= hp | | 218 | LOWER_VENDOR?= hp |
219 | | | 219 | |
220 | .elif ${OPSYS} == "SunOS" | | 220 | .elif ${OPSYS} == "SunOS" |
221 | . if ${MACHINE_ARCH} == "sparc" | | 221 | . if ${MACHINE_ARCH} == "sparc" |
222 | SPARC_TARGET_ARCH?= sparcv7 | | 222 | SPARC_TARGET_ARCH?= sparcv7 |
223 | . elif ${MACHINE_ARCH} == "sun4" | | 223 | . elif ${MACHINE_ARCH} == "sun4" |
224 | MACHINE_ARCH= sparc | | 224 | MACHINE_ARCH= sparc |
225 | SPARC_TARGET_ARCH?= sparcv7 | | 225 | SPARC_TARGET_ARCH?= sparcv7 |
226 | . elif ${MACHINE_ARCH} == "i86pc" || ${MACHINE_ARCH} == "i86xpv" | | 226 | . elif ${MACHINE_ARCH} == "i86pc" || ${MACHINE_ARCH} == "i86xpv" |
227 | MACHINE_ARCH= i386 | | 227 | MACHINE_ARCH= i386 |
228 | . elif ${MACHINE_ARCH} == "unknown" | | 228 | . elif ${MACHINE_ARCH} == "unknown" |
229 | . if !defined(LOWER_ARCH) | | 229 | . if !defined(LOWER_ARCH) |
230 | LOWER_ARCH!= ${UNAME} -p | | 230 | LOWER_ARCH!= ${UNAME} -p |
231 | . endif # !defined(LOWER_ARCH) | | 231 | . endif # !defined(LOWER_ARCH) |
232 | MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH:Q} | | 232 | MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH:Q} |
233 | . endif | | 233 | . endif |
234 | LOWER_VENDOR?= sun | | 234 | LOWER_VENDOR?= sun |
235 | LOWER_OPSYS?= solaris | | 235 | LOWER_OPSYS?= solaris |
236 | LOWER_OPSYS_VERSUFFIX= 2 | | 236 | LOWER_OPSYS_VERSUFFIX= 2 |
237 | | | 237 | |
238 | .elif !defined(LOWER_OPSYS) | | 238 | .elif !defined(LOWER_OPSYS) |
239 | LOWER_OPSYS:= ${OPSYS:tl} | | 239 | LOWER_OPSYS:= ${OPSYS:tl} |
240 | .endif | | 240 | .endif |
241 | | | 241 | |
242 | # Now commit the [LOWER_]OS_VERSION values computed above, eliding the :sh | | 242 | # Now commit the [LOWER_]OS_VERSION values computed above, eliding the :sh |
243 | OS_VERSION:= ${OS_VERSION} | | 243 | OS_VERSION:= ${OS_VERSION} |
244 | LOWER_OS_VERSION:= ${OS_VERSION:tl} | | 244 | LOWER_OS_VERSION:= ${OS_VERSION:tl} |
245 | | | 245 | |
246 | MAKEFLAGS+= LOWER_OPSYS=${LOWER_OPSYS:Q} | | 246 | MAKEFLAGS+= LOWER_OPSYS=${LOWER_OPSYS:Q} |
247 | | | 247 | |
248 | LOWER_VENDOR?= # empty ("arch--opsys") | | 248 | LOWER_VENDOR?= # empty ("arch--opsys") |
249 | LOWER_ARCH?= ${MACHINE_GNU_ARCH} | | 249 | LOWER_ARCH?= ${MACHINE_GNU_ARCH} |
250 | # Expand now as MACHINE_ARCH can be overriden in mk.conf and | | 250 | # Expand now as MACHINE_ARCH can be overriden in mk.conf and |
251 | # LOWER_ARCH is typically derived from it. | | 251 | # LOWER_ARCH is typically derived from it. |
252 | NATIVE_LOWER_ARCH:= ${LOWER_ARCH} | | 252 | NATIVE_LOWER_ARCH:= ${LOWER_ARCH} |
253 | NATIVE_MACHINE_ARCH:= ${MACHINE_ARCH} | | 253 | NATIVE_MACHINE_ARCH:= ${MACHINE_ARCH} |
254 | | | 254 | |
255 | NATIVE_MACHINE_PLATFORM?= ${OPSYS}-${OS_VERSION}-${NATIVE_MACHINE_ARCH} | | 255 | NATIVE_MACHINE_PLATFORM?= ${OPSYS}-${OS_VERSION}-${NATIVE_MACHINE_ARCH} |
256 | MACHINE_PLATFORM?= ${OPSYS}-${OS_VERSION}-${MACHINE_ARCH} | | 256 | MACHINE_PLATFORM?= ${OPSYS}-${OS_VERSION}-${MACHINE_ARCH} |
257 | NATIVE_MACHINE_GNU_PLATFORM?= ${NATIVE_LOWER_ARCH}-${LOWER_VENDOR}-${LOWER_OPSYS:C/[0-9]//g}${APPEND_ELF}${LOWER_OPSYS_VERSUFFIX} | | 257 | NATIVE_MACHINE_GNU_PLATFORM?= ${NATIVE_LOWER_ARCH}-${LOWER_VENDOR}-${LOWER_OPSYS:C/[0-9]//g}${APPEND_ELF}${LOWER_OPSYS_VERSUFFIX} |
258 | MACHINE_GNU_PLATFORM?= ${LOWER_ARCH}-${LOWER_VENDOR}-${LOWER_OPSYS:C/[0-9]//g}${APPEND_ELF}${LOWER_OPSYS_VERSUFFIX} | | 258 | MACHINE_GNU_PLATFORM?= ${LOWER_ARCH}-${LOWER_VENDOR}-${LOWER_OPSYS:C/[0-9]//g}${APPEND_ELF}${LOWER_OPSYS_VERSUFFIX} |
259 | | | 259 | |
260 | # Needed to prevent an "install:" target from being created in bsd.own.mk. | | 260 | # Needed to prevent an "install:" target from being created in bsd.own.mk. |
261 | NEED_OWN_INSTALL_TARGET=no | | 261 | NEED_OWN_INSTALL_TARGET=no |
262 | | | 262 | |
263 | # This prevents default use of the cross-tool harness in the "src" tree, | | 263 | # This prevents default use of the cross-tool harness in the "src" tree, |
264 | # in the odd possible case of someone extracting "pkgsrc" underneath "src". | | 264 | # in the odd possible case of someone extracting "pkgsrc" underneath "src". |
265 | USETOOLS= no | | 265 | USETOOLS= no |
266 | MAKE_ENV+= USETOOLS=no | | 266 | MAKE_ENV+= USETOOLS=no |
267 | | | 267 | |
268 | # Set this before <bsd.own.mk> does, since it doesn't know about Darwin | | 268 | # Set this before <bsd.own.mk> does, since it doesn't know about Darwin |
269 | .if ${OPSYS} == "Darwin" | | 269 | .if ${OPSYS} == "Darwin" |
270 | OBJECT_FMT?= Mach-O | | 270 | OBJECT_FMT?= Mach-O |
271 | .endif | | 271 | .endif |
272 | | | 272 | |
273 | ACCEPTABLE_LICENSES?= ${DEFAULT_ACCEPTABLE_LICENSES} | | 273 | ACCEPTABLE_LICENSES?= ${DEFAULT_ACCEPTABLE_LICENSES} |
274 | | | 274 | |
275 | # Provide PKGPATH early on so that mk.conf can use it. | | 275 | # Provide PKGPATH early on so that mk.conf can use it. |
276 | PKGPATH?= ${.CURDIR:C|.*/([^/]*/[^/]*)$|\1|} | | 276 | PKGPATH?= ${.CURDIR:C|.*/([^/]*/[^/]*)$|\1|} |
277 | | | 277 | |
278 | # Load the settings from MAKECONF, which is /etc/mk.conf by default. | | 278 | # Load the settings from MAKECONF, which is /etc/mk.conf by default. |
279 | .include <bsd.own.mk> | | 279 | .include <bsd.own.mk> |
280 | | | 280 | |
281 | # /usr/share/mk/bsd.own.mk on NetBSD 1.3 does not define OBJECT_FMT | | 281 | # /usr/share/mk/bsd.own.mk on NetBSD 1.3 does not define OBJECT_FMT |
282 | .if !empty(MACHINE_PLATFORM:MNetBSD-1.3*) | | 282 | .if !empty(MACHINE_PLATFORM:MNetBSD-1.3*) |
283 | . if ${MACHINE_ARCH} == "alpha" || \ | | 283 | . if ${MACHINE_ARCH} == "alpha" || \ |
284 | ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb" || \ | | 284 | ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb" || \ |
285 | ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "sparc64" | | 285 | ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "sparc64" |
286 | OBJECT_FMT?= ELF | | 286 | OBJECT_FMT?= ELF |
287 | . else | | 287 | . else |
288 | OBJECT_FMT?= a.out | | 288 | OBJECT_FMT?= a.out |
289 | . endif | | 289 | . endif |
290 | # override what bootstrap-pkgsrc sets, which isn't right for NetBSD | | 290 | # override what bootstrap-pkgsrc sets, which isn't right for NetBSD |
291 | # 1.4. | | 291 | # 1.4. |
292 | # XXX other ELF platforms in 1.4 need to be added to here. | | 292 | # XXX other ELF platforms in 1.4 need to be added to here. |
293 | .elif !empty(MACHINE_PLATFORM:MNetBSD-1.4*) | | 293 | .elif !empty(MACHINE_PLATFORM:MNetBSD-1.4*) |
294 | . if ${MACHINE_ARCH} == "alpha" || \ | | 294 | . if ${MACHINE_ARCH} == "alpha" || \ |
295 | ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb" || \ | | 295 | ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb" || \ |
296 | ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "sparc64" | | 296 | ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "sparc64" |
297 | OBJECT_FMT= ELF | | 297 | OBJECT_FMT= ELF |
298 | . else | | 298 | . else |
299 | OBJECT_FMT= a.out | | 299 | OBJECT_FMT= a.out |
300 | . endif | | 300 | . endif |
301 | .endif | | 301 | .endif |
302 | | | 302 | |
303 | .if ${OPSYS} == "OpenBSD" | | 303 | .if ${OPSYS} == "OpenBSD" |
304 | . if defined(ELF_TOOLCHAIN) && ${ELF_TOOLCHAIN} == "yes" | | 304 | . if defined(ELF_TOOLCHAIN) && ${ELF_TOOLCHAIN} == "yes" |
305 | OBJECT_FMT?= ELF | | 305 | OBJECT_FMT?= ELF |
306 | . else | | 306 | . else |
307 | OBJECT_FMT?= a.out | | 307 | OBJECT_FMT?= a.out |
308 | . endif | | 308 | . endif |
309 | .elif ${OPSYS} == "DragonFly" | | 309 | .elif ${OPSYS} == "DragonFly" |
310 | OBJECT_FMT= ELF | | 310 | OBJECT_FMT= ELF |
311 | .elif ${OPSYS} == "AIX" | | 311 | .elif ${OPSYS} == "AIX" |
312 | OBJECT_FMT= XCOFF | | 312 | OBJECT_FMT= XCOFF |
313 | .elif ${OPSYS} == "OSF1" | | 313 | .elif ${OPSYS} == "OSF1" |
314 | OBJECT_FMT= ECOFF | | 314 | OBJECT_FMT= ECOFF |
315 | .elif ${OPSYS} == "HPUX" | | 315 | .elif ${OPSYS} == "HPUX" |
316 | . if ${MACHINE_ARCH} == "ia64" || (defined(ABI) && ${ABI} == "64") | | 316 | . if ${MACHINE_ARCH} == "ia64" || (defined(ABI) && ${ABI} == "64") |
317 | OBJECT_FMT= ELF | | 317 | OBJECT_FMT= ELF |
318 | . else | | 318 | . else |
319 | OBJECT_FMT= SOM | | 319 | OBJECT_FMT= SOM |
320 | . endif | | 320 | . endif |
321 | .endif | | 321 | .endif |
322 | | | 322 | |
323 | # Calculate depth | | 323 | # Calculate depth |
324 | .if exists(${.CURDIR}/mk/bsd.pkg.mk) | | 324 | .if exists(${.CURDIR}/mk/bsd.pkg.mk) |
325 | _PKGSRC_TOPDIR= ${.CURDIR} | | 325 | _PKGSRC_TOPDIR= ${.CURDIR} |
326 | .elif exists(${.CURDIR}/../mk/bsd.pkg.mk) | | 326 | .elif exists(${.CURDIR}/../mk/bsd.pkg.mk) |
327 | _PKGSRC_TOPDIR= ${.CURDIR}/.. | | 327 | _PKGSRC_TOPDIR= ${.CURDIR}/.. |
328 | .elif exists(${.CURDIR}/../../mk/bsd.pkg.mk) | | 328 | .elif exists(${.CURDIR}/../../mk/bsd.pkg.mk) |
329 | _PKGSRC_TOPDIR= ${.CURDIR}/../.. | | 329 | _PKGSRC_TOPDIR= ${.CURDIR}/../.. |
330 | .endif | | 330 | .endif |
331 | | | 331 | |
332 | # include the defaults file | | 332 | # include the defaults file |
333 | .include "${_PKGSRC_TOPDIR}/mk/defaults/mk.conf" | | 333 | .include "${_PKGSRC_TOPDIR}/mk/defaults/mk.conf" |
334 | | | 334 | |
335 | SHAREOWN?= ${DOCOWN} | | 335 | SHAREOWN?= ${DOCOWN} |
336 | SHAREGRP?= ${DOCGRP} | | 336 | SHAREGRP?= ${DOCGRP} |
337 | SHAREMODE?= ${DOCMODE} | | 337 | SHAREMODE?= ${DOCMODE} |
338 | | | 338 | |
339 | .if defined(PREFIX) && (${PREFIX} != ${__PREFIX_SET__}) | | 339 | .if defined(PREFIX) && (${PREFIX} != ${__PREFIX_SET__}) |
340 | .BEGIN: | | 340 | .BEGIN: |
341 | @${ECHO_MSG} "You CANNOT set PREFIX manually or in mk.conf. Set LOCALBASE or X11BASE" | | 341 | @${ECHO_MSG} "You CANNOT set PREFIX manually or in mk.conf. Set LOCALBASE or X11BASE" |
342 | @${ECHO_MSG} "depending on your needs. See the pkg system documentation for more info." | | 342 | @${ECHO_MSG} "depending on your needs. See the pkg system documentation for more info." |
343 | @${FALSE} | | 343 | @${FALSE} |
344 | .endif | | 344 | .endif |
345 | | | 345 | |
346 | # Load the OS-specific definitions for program variables. Default to loading | | 346 | # Load the OS-specific definitions for program variables. Default to loading |
347 | # the NetBSD ones if an OS-specific file doesn't exist. | | 347 | # the NetBSD ones if an OS-specific file doesn't exist. |
348 | .if exists(${_PKGSRC_TOPDIR}/mk/platform/${OPSYS}.mk) | | 348 | .if exists(${_PKGSRC_TOPDIR}/mk/platform/${OPSYS}.mk) |
349 | . include "${_PKGSRC_TOPDIR}/mk/platform/${OPSYS}.mk" | | 349 | . include "${_PKGSRC_TOPDIR}/mk/platform/${OPSYS}.mk" |
350 | .else | | 350 | .else |
351 | . include "${_PKGSRC_TOPDIR}/mk/platform/NetBSD.mk" | | 351 | . include "${_PKGSRC_TOPDIR}/mk/platform/NetBSD.mk" |
352 | PKG_FAIL_REASON+= "missing mk/platform/${OPSYS}.mk" | | 352 | PKG_FAIL_REASON+= "missing mk/platform/${OPSYS}.mk" |
353 | .endif | | 353 | .endif |
354 | | | 354 | |
355 | PKGDIRMODE?= 755 | | 355 | PKGDIRMODE?= 755 |
356 | | | 356 | |
357 | # A meta-package is a package that does not have any files and whose | | 357 | # A meta-package is a package that does not have any files and whose |
358 | # only purpose is to depend on other packages, giving that collection | | 358 | # only purpose is to depend on other packages, giving that collection |
359 | # a simple name. | | 359 | # a simple name. |
360 | # | | 360 | # |
361 | # This variable must be set before including bsd.prefs.mk directly or | | 361 | # This variable must be set before including bsd.prefs.mk directly or |
362 | # indirectly. | | 362 | # indirectly. |
363 | # | | 363 | # |
364 | # Keywords: meta meta-package META_PACKAGE | | 364 | # Keywords: meta meta-package META_PACKAGE |
365 | # | | 365 | # |
366 | .if defined(META_PACKAGE) | | 366 | .if defined(META_PACKAGE) |
367 | PKG_DESTDIR_SUPPORT= user-destdir | | 367 | PKG_DESTDIR_SUPPORT= user-destdir |
368 | NO_CONFIGURE= yes | | 368 | NO_CONFIGURE= yes |
369 | NO_BUILD= yes | | 369 | NO_BUILD= yes |
370 | DISTFILES= # none | | 370 | DISTFILES= # none |
371 | PLIST_SRC= # none | | 371 | PLIST_SRC= # none |
372 | CHECK_PERMS= no | | 372 | CHECK_PERMS= no |
373 | USE_LANGUAGES= # empty | | 373 | USE_LANGUAGES= # empty |
374 | do-patch: | | 374 | do-patch: |
375 | @${DO_NADA} | | 375 | @${DO_NADA} |
376 | do-install: | | 376 | do-install: |
377 | @${DO_NADA} | | 377 | @${DO_NADA} |
378 | .endif | | 378 | .endif |
379 | | | 379 | |
380 | # PKG_DESTDIR_SUPPORT can only be one of "destdir" or "user-destdir". | | 380 | # PKG_DESTDIR_SUPPORT can only be one of "destdir" or "user-destdir". |
381 | USE_DESTDIR?= no | | 381 | USE_DESTDIR?= no |
382 | PKG_DESTDIR_SUPPORT?= # empty | | 382 | PKG_DESTDIR_SUPPORT?= # empty |
383 | | | 383 | |
384 | .if !empty(USE_DESTDIR:M[Ff][Uu][Ll][Ll]) | | 384 | .if !empty(USE_DESTDIR:M[Ff][Uu][Ll][Ll]) |
385 | WARNINGS+= "USE_DESTDIR=full is deprecated, just use USE_DESTDIR=yes" | | 385 | WARNINGS+= "USE_DESTDIR=full is deprecated, just use USE_DESTDIR=yes" |
386 | USE_DESTDIR:= yes | | 386 | USE_DESTDIR:= yes |
387 | .endif | | 387 | .endif |
388 | | | 388 | |
389 | .if empty(PKG_DESTDIR_SUPPORT) || empty(USE_DESTDIR:M[Yy][Ee][Ss]) | | 389 | .if empty(PKG_DESTDIR_SUPPORT) || empty(USE_DESTDIR:M[Yy][Ee][Ss]) |
390 | . if empty(USE_DESTDIR:M[Yy][Ee][Ss]) && empty(USE_DESTDIR:M[Nn][Oo]) | | 390 | . if empty(USE_DESTDIR:M[Yy][Ee][Ss]) && empty(USE_DESTDIR:M[Nn][Oo]) |
391 | PKG_FAIL_REASON+= "USE_DESTDIR must be either \`\`yes'' or \`\`no''" | | 391 | PKG_FAIL_REASON+= "USE_DESTDIR must be either \`\`yes'' or \`\`no''" |
392 | . endif | | 392 | . endif |
393 | _USE_DESTDIR= no | | 393 | _USE_DESTDIR= no |
394 | .elif ${PKG_DESTDIR_SUPPORT} == "user-destdir" | | 394 | .elif ${PKG_DESTDIR_SUPPORT} == "user-destdir" |
395 | _USE_DESTDIR= user-destdir | | 395 | _USE_DESTDIR= user-destdir |
396 | .elif ${PKG_DESTDIR_SUPPORT} == "destdir" | | 396 | .elif ${PKG_DESTDIR_SUPPORT} == "destdir" |
397 | _USE_DESTDIR= destdir | | 397 | _USE_DESTDIR= destdir |
398 | .else | | 398 | .else |
399 | PKG_FAIL_REASON+= "PKG_DESTDIR_SUPPORT must be \`\`destdir'' or \`\`user-destdir''." | | 399 | PKG_FAIL_REASON+= "PKG_DESTDIR_SUPPORT must be \`\`destdir'' or \`\`user-destdir''." |
400 | .endif | | 400 | .endif |
401 | | | 401 | |
| | | 402 | .if defined(PKG_DEVELOPER) && empty(PKG_DESTDIR_SUPPORT) |
| | | 403 | WARNINGS+= "[bsd.prefs.mk] The package ${PKGNAME} misses DESTDIR support." |
| | | 404 | .endif |
| | | 405 | |
402 | # When using staged installation, everything gets installed into | | 406 | # When using staged installation, everything gets installed into |
403 | # ${DESTDIR}${PREFIX} instead of ${PREFIX} directly. | | 407 | # ${DESTDIR}${PREFIX} instead of ${PREFIX} directly. |
404 | # | | 408 | # |
405 | .if ${_USE_DESTDIR} != "no" | | 409 | .if ${_USE_DESTDIR} != "no" |
406 | DESTDIR= ${WRKDIR}/.destdir | | 410 | DESTDIR= ${WRKDIR}/.destdir |
407 | . if ${_USE_DESTDIR} == "destdir" | | 411 | . if ${_USE_DESTDIR} == "destdir" |
408 | _MAKE_PACKAGE_AS_ROOT= yes | | 412 | _MAKE_PACKAGE_AS_ROOT= yes |
409 | _MAKE_CLEAN_AS_ROOT= yes | | 413 | _MAKE_CLEAN_AS_ROOT= yes |
410 | _MAKE_INSTALL_AS_ROOT= yes | | 414 | _MAKE_INSTALL_AS_ROOT= yes |
411 | . elif ${_USE_DESTDIR} == "user-destdir" | | 415 | . elif ${_USE_DESTDIR} == "user-destdir" |
412 | _MAKE_PACKAGE_AS_ROOT= no | | 416 | _MAKE_PACKAGE_AS_ROOT= no |
413 | _MAKE_CLEAN_AS_ROOT= no | | 417 | _MAKE_CLEAN_AS_ROOT= no |
414 | _MAKE_INSTALL_AS_ROOT= no | | 418 | _MAKE_INSTALL_AS_ROOT= no |
415 | . endif | | 419 | . endif |
416 | .else | | 420 | .else |
417 | DESTDIR= | | 421 | DESTDIR= |
418 | .endif | | 422 | .endif |
419 | | | 423 | |
420 | _MAKE_CLEAN_AS_ROOT?= no | | 424 | _MAKE_CLEAN_AS_ROOT?= no |
421 | # Whether to run the clean target as root. | | 425 | # Whether to run the clean target as root. |
422 | _MAKE_INSTALL_AS_ROOT?= yes | | 426 | _MAKE_INSTALL_AS_ROOT?= yes |
423 | # Whether to run the install target as root. | | 427 | # Whether to run the install target as root. |
424 | _MAKE_PACKAGE_AS_ROOT?= yes | | 428 | _MAKE_PACKAGE_AS_ROOT?= yes |
425 | # Whether to run the package target as root. | | 429 | # Whether to run the package target as root. |
426 | | | 430 | |
427 | # When cross-compilation support is requested, the following options | | 431 | # When cross-compilation support is requested, the following options |
428 | # must be specified as well or guessable: | | 432 | # must be specified as well or guessable: |
429 | # - MACHINE_ARCH is set to TARGET_ARCH if set. | | 433 | # - MACHINE_ARCH is set to TARGET_ARCH if set. |
430 | # - CROSS_DESTDIR is guessed from MAKEOBJDIR and MACHINE_ARCH. | | 434 | # - CROSS_DESTDIR is guessed from MAKEOBJDIR and MACHINE_ARCH. |
431 | # - PKG_DBDIR is expanded and prefixed with CROSS_DESTDIR | | 435 | # - PKG_DBDIR is expanded and prefixed with CROSS_DESTDIR |
432 | # - DESTDIR support is required | | 436 | # - DESTDIR support is required |
433 | # | | 437 | # |
434 | # _CROSS_DESTDIR is set for internal use to avoid conditionalising | | 438 | # _CROSS_DESTDIR is set for internal use to avoid conditionalising |
435 | # the use. | | 439 | # the use. |
436 | | | 440 | |
437 | .if !empty(USE_CROSS_COMPILE:M[yY][eE][sS]) | | 441 | .if !empty(USE_CROSS_COMPILE:M[yY][eE][sS]) |
438 | . if defined(TARGET_ARCH) | | 442 | . if defined(TARGET_ARCH) |
439 | MACHINE_ARCH= ${TARGET_ARCH} | | 443 | MACHINE_ARCH= ${TARGET_ARCH} |
440 | . endif | | 444 | . endif |
441 | CROSS_DESTDIR?= ${MAKEOBJDIR}/destdir.${MACHINE_ARCH} | | 445 | CROSS_DESTDIR?= ${MAKEOBJDIR}/destdir.${MACHINE_ARCH} |
442 | . if !exists(${CROSS_DESTDIR}/usr/include/stddef.h) | | 446 | . if !exists(${CROSS_DESTDIR}/usr/include/stddef.h) |
443 | PKG_FAIL_REASON+= "The cross-compiling root ${CROSS_DESTDIR:Q} is incomplete" | | 447 | PKG_FAIL_REASON+= "The cross-compiling root ${CROSS_DESTDIR:Q} is incomplete" |
444 | . else | | 448 | . else |
445 | _CROSS_DESTDIR= ${CROSS_DESTDIR} | | 449 | _CROSS_DESTDIR= ${CROSS_DESTDIR} |
446 | . endif | | 450 | . endif |
447 | .endif | | 451 | .endif |
448 | | | 452 | |
449 | # Depends on MACHINE_ARCH override above | | 453 | # Depends on MACHINE_ARCH override above |
450 | .if ${OPSYS} == "NetBSD" | | 454 | .if ${OPSYS} == "NetBSD" |
451 | . if ${OBJECT_FMT} == "ELF" && \ | | 455 | . if ${OBJECT_FMT} == "ELF" && \ |
452 | (${MACHINE_GNU_ARCH} == "arm" || \ | | 456 | (${MACHINE_GNU_ARCH} == "arm" || \ |
453 | ${MACHINE_ARCH} == "i386" || \ | | 457 | ${MACHINE_ARCH} == "i386" || \ |
454 | ${MACHINE_ARCH} == "m68k" || \ | | 458 | ${MACHINE_ARCH} == "m68k" || \ |
455 | ${MACHINE_ARCH} == "m68000" || \ | | 459 | ${MACHINE_ARCH} == "m68000" || \ |
456 | ${MACHINE_GNU_ARCH} == "sh" || \ | | 460 | ${MACHINE_GNU_ARCH} == "sh" || \ |
457 | ${MACHINE_GNU_ARCH} == "shle" || \ | | 461 | ${MACHINE_GNU_ARCH} == "shle" || \ |
458 | ${MACHINE_ARCH} == "sparc" || \ | | 462 | ${MACHINE_ARCH} == "sparc" || \ |
459 | ${MACHINE_ARCH} == "vax") | | 463 | ${MACHINE_ARCH} == "vax") |
460 | APPEND_ELF= elf | | 464 | APPEND_ELF= elf |
461 | . endif | | 465 | . endif |
462 | .endif | | 466 | .endif |
463 | | | 467 | |
464 | PKG_INSTALLATION_TYPES?= overwrite | | 468 | PKG_INSTALLATION_TYPES?= overwrite |
465 | # This is a whitespace-separated list of installation types supported | | 469 | # This is a whitespace-separated list of installation types supported |
466 | # by the package. | | 470 | # by the package. |
467 | # | | 471 | # |
468 | # *NOTE*: This variable *must* be set in the package Makefile *before* | | 472 | # *NOTE*: This variable *must* be set in the package Makefile *before* |
469 | # the inclusion of bsd.prefs.mk. | | 473 | # the inclusion of bsd.prefs.mk. |
470 | # | | 474 | # |
471 | # Possible: any of: overwrite, pkgviews | | 475 | # Possible: any of: overwrite, pkgviews |
472 | # Default: overwrite | | 476 | # Default: overwrite |
473 | | | 477 | |
474 | # Set the style of installation to be performed for the package. The | | 478 | # Set the style of installation to be performed for the package. The |
475 | # funky make variable modifiers just select the first word of the value | | 479 | # funky make variable modifiers just select the first word of the value |
476 | # stored in the referenced variable. | | 480 | # stored in the referenced variable. |
477 | # | | 481 | # |
478 | .for _pref_ in ${PKG_INSTALLATION_PREFS} | | 482 | .for _pref_ in ${PKG_INSTALLATION_PREFS} |
479 | . if !empty(PKG_INSTALLATION_TYPES:M${_pref_}) | | 483 | . if !empty(PKG_INSTALLATION_TYPES:M${_pref_}) |
480 | PKG_INSTALLATION_TYPE?= ${PKG_INSTALLATION_TYPES:M${_pref_}:S/^/_pkginsttype_/1:M_pkginsttype_*:S/^_pkginsttype_//} | | 484 | PKG_INSTALLATION_TYPE?= ${PKG_INSTALLATION_TYPES:M${_pref_}:S/^/_pkginsttype_/1:M_pkginsttype_*:S/^_pkginsttype_//} |
481 | . endif | | 485 | . endif |
482 | .endfor | | 486 | .endfor |
483 | PKG_INSTALLATION_TYPE?= none | | 487 | PKG_INSTALLATION_TYPE?= none |
484 | | | 488 | |
485 | # if the system is IPv6-ready, compile with IPv6 support turned on. | | 489 | # if the system is IPv6-ready, compile with IPv6 support turned on. |
486 | .if empty(_OPSYS_HAS_INET6:M[nN][oO]) | | 490 | .if empty(_OPSYS_HAS_INET6:M[nN][oO]) |
487 | IPV6_READY= YES | | 491 | IPV6_READY= YES |
488 | .else | | 492 | .else |
489 | IPV6_READY= NO | | 493 | IPV6_READY= NO |
490 | .endif | | 494 | .endif |
491 | | | 495 | |
492 | LOCALBASE?= /usr/pkg | | 496 | LOCALBASE?= /usr/pkg |
493 | X11_TYPE?= native | | 497 | X11_TYPE?= native |
494 | .if !empty(X11_TYPE:Mnative) | | 498 | .if !empty(X11_TYPE:Mnative) |
495 | . if ${OPSYS} == "SunOS" | | 499 | . if ${OPSYS} == "SunOS" |
496 | # On Solaris, we default to using OpenWindows for X11. | | 500 | # On Solaris, we default to using OpenWindows for X11. |
497 | X11BASE?= /usr/openwin | | 501 | X11BASE?= /usr/openwin |
498 | . elif ${OPSYS} == "IRIX" || ${OPSYS} == "OSF1" || ${OPSYS} == "HPUX" | | 502 | . elif ${OPSYS} == "IRIX" || ${OPSYS} == "OSF1" || ${OPSYS} == "HPUX" |
499 | X11BASE?= /usr | | 503 | X11BASE?= /usr |
500 | . elif !empty(MACHINE_PLATFORM:MDarwin-9.*-*) | | 504 | . elif !empty(MACHINE_PLATFORM:MDarwin-9.*-*) |
501 | X11BASE?= /usr/X11 | | 505 | X11BASE?= /usr/X11 |
502 | . elif exists(/usr/X11R7/lib/libX11.so) | | 506 | . elif exists(/usr/X11R7/lib/libX11.so) |
503 | X11BASE?= /usr/X11R7 | | 507 | X11BASE?= /usr/X11R7 |
504 | . else | | 508 | . else |
505 | X11BASE?= /usr/X11R6 | | 509 | X11BASE?= /usr/X11R6 |
506 | . endif | | 510 | . endif |
507 | .endif | | 511 | .endif |
508 | CROSSBASE?= ${LOCALBASE}/cross | | 512 | CROSSBASE?= ${LOCALBASE}/cross |
509 | | | 513 | |
510 | # If xpkgwedge.def is found, then clearly we're using xpkgwedge. | | 514 | # If xpkgwedge.def is found, then clearly we're using xpkgwedge. |
511 | .if exists(${LOCALBASE}/lib/X11/config/xpkgwedge.def) || \ | | 515 | .if exists(${LOCALBASE}/lib/X11/config/xpkgwedge.def) || \ |
512 | exists(${X11BASE}/lib/X11/config/xpkgwedge.def) | | 516 | exists(${X11BASE}/lib/X11/config/xpkgwedge.def) |
513 | USE_XPKGWEDGE= yes | | 517 | USE_XPKGWEDGE= yes |
514 | .elif ${PKG_INSTALLATION_TYPE} == "pkgviews" | | 518 | .elif ${PKG_INSTALLATION_TYPE} == "pkgviews" |
515 | USE_XPKGWEDGE= yes | | 519 | USE_XPKGWEDGE= yes |
516 | .elif ${X11_TYPE} == "modular" | | 520 | .elif ${X11_TYPE} == "modular" |
517 | USE_XPKGWEDGE= no | | 521 | USE_XPKGWEDGE= no |
518 | .else | | 522 | .else |
519 | USE_XPKGWEDGE?= yes | | 523 | USE_XPKGWEDGE?= yes |
520 | .endif | | 524 | .endif |
521 | | | 525 | |
522 | .if defined(FIX_SYSTEM_HEADERS) && ${FIX_SYSTEM_HEADERS} == "yes" && \ | | 526 | .if defined(FIX_SYSTEM_HEADERS) && ${FIX_SYSTEM_HEADERS} == "yes" && \ |
523 | !defined(BOOTSTRAP_PKG) && \ | | 527 | !defined(BOOTSTRAP_PKG) && \ |
524 | exists(../../pkgtools/compat_headers/buildlink3.mk) | | 528 | exists(../../pkgtools/compat_headers/buildlink3.mk) |
525 | . include "../../pkgtools/compat_headers/buildlink3.mk" | | 529 | . include "../../pkgtools/compat_headers/buildlink3.mk" |
526 | .endif | | 530 | .endif |
527 | | | 531 | |
528 | .if ${X11_TYPE} == "modular" | | 532 | .if ${X11_TYPE} == "modular" |
529 | X11BASE= ${LOCALBASE} | | 533 | X11BASE= ${LOCALBASE} |
530 | .endif | | 534 | .endif |
531 | | | 535 | |
532 | .if !empty(USE_XPKGWEDGE:M[Yy][Ee][Ss]) | | 536 | .if !empty(USE_XPKGWEDGE:M[Yy][Ee][Ss]) |
533 | X11PREFIX= ${LOCALBASE} | | 537 | X11PREFIX= ${LOCALBASE} |
534 | .else | | 538 | .else |
535 | X11PREFIX= ${X11BASE} | | 539 | X11PREFIX= ${X11BASE} |
536 | .endif | | 540 | .endif |
537 | | | 541 | |
538 | # Default directory for font encodings | | 542 | # Default directory for font encodings |
539 | X11_ENCODINGSDIR?= ${X11BASE}/lib/X11/fonts/encodings | | 543 | X11_ENCODINGSDIR?= ${X11BASE}/lib/X11/fonts/encodings |
540 | | | 544 | |
541 | DEPOT_SUBDIR?= packages | | 545 | DEPOT_SUBDIR?= packages |
542 | DEPOTBASE= ${LOCALBASE}/${DEPOT_SUBDIR} | | 546 | DEPOTBASE= ${LOCALBASE}/${DEPOT_SUBDIR} |
543 | | | 547 | |
544 | # LINK_RPATH_FLAG publicly exports the linker flag used to set the | | 548 | # LINK_RPATH_FLAG publicly exports the linker flag used to set the |
545 | # run-time library search path. | | 549 | # run-time library search path. |
546 | # | | 550 | # |
547 | .if defined(_OPSYS_LINKER_RPATH_FLAG) | | 551 | .if defined(_OPSYS_LINKER_RPATH_FLAG) |
548 | LINKER_RPATH_FLAG= ${_OPSYS_LINKER_RPATH_FLAG} | | 552 | LINKER_RPATH_FLAG= ${_OPSYS_LINKER_RPATH_FLAG} |
549 | .else | | 553 | .else |
550 | LINKER_RPATH_FLAG?= ${_LINKER_RPATH_FLAG} | | 554 | LINKER_RPATH_FLAG?= ${_LINKER_RPATH_FLAG} |
551 | .endif | | 555 | .endif |
552 | | | 556 | |
553 | # COMPILER_RPATH_FLAG publicly exports the compiler flag used to pass | | 557 | # COMPILER_RPATH_FLAG publicly exports the compiler flag used to pass |
554 | # run-time library search path directives to the linker. | | 558 | # run-time library search path directives to the linker. |
555 | # | | 559 | # |
556 | .if defined(_OPSYS_COMPILER_RPATH_FLAG) | | 560 | .if defined(_OPSYS_COMPILER_RPATH_FLAG) |
557 | COMPILER_RPATH_FLAG= ${_OPSYS_COMPILER_RPATH_FLAG} | | 561 | COMPILER_RPATH_FLAG= ${_OPSYS_COMPILER_RPATH_FLAG} |
558 | .else | | 562 | .else |
559 | COMPILER_RPATH_FLAG?= ${_COMPILER_RPATH_FLAG} | | 563 | COMPILER_RPATH_FLAG?= ${_COMPILER_RPATH_FLAG} |
560 | .endif | | 564 | .endif |
561 | | | 565 | |
562 | # WHOLE_ARCHIVE_FLAG and NO_WHOLE_ARCHIVE_FLAG publically export the | | 566 | # WHOLE_ARCHIVE_FLAG and NO_WHOLE_ARCHIVE_FLAG publically export the |
563 | # linker flags to extract all symbols from a static archive. | | 567 | # linker flags to extract all symbols from a static archive. |
564 | # | | 568 | # |
565 | WHOLE_ARCHIVE_FLAG?= ${_OPSYS_WHOLE_ARCHIVE_FLAG} | | 569 | WHOLE_ARCHIVE_FLAG?= ${_OPSYS_WHOLE_ARCHIVE_FLAG} |
566 | NO_WHOLE_ARCHIVE_FLAG?= ${_OPSYS_NO_WHOLE_ARCHIVE_FLAG} | | 570 | NO_WHOLE_ARCHIVE_FLAG?= ${_OPSYS_NO_WHOLE_ARCHIVE_FLAG} |
567 | | | 571 | |
568 | USE_TOOLS?= # empty | | 572 | USE_TOOLS?= # empty |
569 | | | 573 | |
570 | # Provide default values for TOOLs used by the top-level make. | | 574 | # Provide default values for TOOLs used by the top-level make. |
571 | USE_TOOLS+= [ awk dirname echo grep pwd sed test true | | 575 | USE_TOOLS+= [ awk dirname echo grep pwd sed test true |
572 | | | 576 | |
573 | # These tools are used by the top-level make only in certain packages and | | 577 | # These tools are used by the top-level make only in certain packages and |
574 | # should eventually be moved into those particular package Makefiles. | | 578 | # should eventually be moved into those particular package Makefiles. |
575 | # | | 579 | # |
576 | USE_TOOLS+= date tr | | 580 | USE_TOOLS+= date tr |
577 | | | 581 | |
578 | # These are tools used directly by bsd.prefs.mk and files included by | | 582 | # These are tools used directly by bsd.prefs.mk and files included by |
579 | # bsd.prefs.mk. | | 583 | # bsd.prefs.mk. |
580 | # | | 584 | # |
581 | USE_TOOLS+= awk:pkgsrc cut:pkgsrc echo:pkgsrc pwd:pkgsrc \ | | 585 | USE_TOOLS+= awk:pkgsrc cut:pkgsrc echo:pkgsrc pwd:pkgsrc \ |
582 | sed:pkgsrc tr:pkgsrc uname:pkgsrc | | 586 | sed:pkgsrc tr:pkgsrc uname:pkgsrc |
583 | | | 587 | |
584 | .include "${_PKGSRC_TOPDIR}/mk/tools/defaults.mk" | | 588 | .include "${_PKGSRC_TOPDIR}/mk/tools/defaults.mk" |
585 | | | 589 | |
586 | .if !defined(_PKGSRCDIR) | | 590 | .if !defined(_PKGSRCDIR) |
587 | _PKGSRCDIR!= cd ${_PKGSRC_TOPDIR} && ${PWD_CMD} | | 591 | _PKGSRCDIR!= cd ${_PKGSRC_TOPDIR} && ${PWD_CMD} |
588 | MAKEFLAGS+= _PKGSRCDIR=${_PKGSRCDIR:Q} | | 592 | MAKEFLAGS+= _PKGSRCDIR=${_PKGSRCDIR:Q} |
589 | .endif | | 593 | .endif |
590 | PKGSRCDIR= ${_PKGSRCDIR} | | 594 | PKGSRCDIR= ${_PKGSRCDIR} |
591 | | | 595 | |
592 | DISTDIR?= ${PKGSRCDIR}/distfiles | | 596 | DISTDIR?= ${PKGSRCDIR}/distfiles |
593 | PACKAGES?= ${PKGSRCDIR}/packages | | 597 | PACKAGES?= ${PKGSRCDIR}/packages |
594 | TEMPLATES?= ${PKGSRCDIR}/templates | | 598 | TEMPLATES?= ${PKGSRCDIR}/templates |
595 | | | 599 | |
596 | PATCHDIR?= ${.CURDIR}/patches | | 600 | PATCHDIR?= ${.CURDIR}/patches |
597 | FILESDIR?= ${.CURDIR}/files | | 601 | FILESDIR?= ${.CURDIR}/files |
598 | PKGDIR?= ${.CURDIR} | | 602 | PKGDIR?= ${.CURDIR} |
599 | | | 603 | |
600 | _PKGSRC_DEPS?= # empty | | 604 | _PKGSRC_DEPS?= # empty |
601 | | | 605 | |
602 | # If WRKOBJDIR is set, use that tree to build | | 606 | # If WRKOBJDIR is set, use that tree to build |
603 | .if defined(WRKOBJDIR) | | 607 | .if defined(WRKOBJDIR) |
604 | BUILD_DIR?= ${WRKOBJDIR}/${PKGPATH} | | 608 | BUILD_DIR?= ${WRKOBJDIR}/${PKGPATH} |
605 | .else | | 609 | .else |
606 | BUILD_DIR!= cd ${.CURDIR} && ${PWD_CMD} | | 610 | BUILD_DIR!= cd ${.CURDIR} && ${PWD_CMD} |
607 | .endif | | 611 | .endif |
608 | | | 612 | |
609 | # If OBJHOSTNAME is set, use first component of hostname in directory name. | | 613 | # If OBJHOSTNAME is set, use first component of hostname in directory name. |
610 | # If OBJMACHINE is set, use ${MACHINE_ARCH} in the working directory name. | | 614 | # If OBJMACHINE is set, use ${MACHINE_ARCH} in the working directory name. |
611 | # | | 615 | # |
612 | .if defined(OBJHOSTNAME) | | 616 | .if defined(OBJHOSTNAME) |
613 | . if !defined(_HOSTNAME) | | 617 | . if !defined(_HOSTNAME) |
614 | _HOSTNAME!= ${UNAME} -n | | 618 | _HOSTNAME!= ${UNAME} -n |
615 | MAKEFLAGS+= _HOSTNAME=${_HOSTNAME:Q} | | 619 | MAKEFLAGS+= _HOSTNAME=${_HOSTNAME:Q} |
616 | . endif | | 620 | . endif |
617 | WRKDIR_BASENAME?= work.${_HOSTNAME:C|\..*||} | | 621 | WRKDIR_BASENAME?= work.${_HOSTNAME:C|\..*||} |
618 | MAKEFLAGS+= OBJHOSTNAME=${OBJHOSTNAME:Q} | | 622 | MAKEFLAGS+= OBJHOSTNAME=${OBJHOSTNAME:Q} |
619 | .elif defined(OBJMACHINE) | | 623 | .elif defined(OBJMACHINE) |
620 | WRKDIR_BASENAME?= work.${MACHINE_ARCH} | | 624 | WRKDIR_BASENAME?= work.${MACHINE_ARCH} |
621 | MAKEFLAGS+= OBJMACHINE=${OBJMACHINE:Q} | | 625 | MAKEFLAGS+= OBJMACHINE=${OBJMACHINE:Q} |
622 | .else | | 626 | .else |
623 | WRKDIR_BASENAME?= work | | 627 | WRKDIR_BASENAME?= work |
624 | .endif | | 628 | .endif |
625 | | | 629 | |
626 | WRKDIR?= ${BUILD_DIR}/${WRKDIR_BASENAME} | | 630 | WRKDIR?= ${BUILD_DIR}/${WRKDIR_BASENAME} |
627 | | | 631 | |
628 | # There are many uses for a common log file, so define one that may be | | 632 | # There are many uses for a common log file, so define one that may be |
629 | # picked up and used by tools.mk, bsd.buildlink3.mk, etc. | | 633 | # picked up and used by tools.mk, bsd.buildlink3.mk, etc. |
630 | # | | 634 | # |
631 | WRKLOG?= ${WRKDIR}/.work.log | | 635 | WRKLOG?= ${WRKDIR}/.work.log |
632 | | | 636 | |
633 | PKG_DEFAULT_OPTIONS?= # empty | | 637 | PKG_DEFAULT_OPTIONS?= # empty |
634 | PKG_OPTIONS?= # empty | | 638 | PKG_OPTIONS?= # empty |
635 | | | 639 | |
636 | # we want this *before* compiler.mk, so that compiler.mk paths override them | | 640 | # we want this *before* compiler.mk, so that compiler.mk paths override them |
637 | .if ${X11_TYPE} != "modular" && defined(USE_X11) | | 641 | .if ${X11_TYPE} != "modular" && defined(USE_X11) |
638 | PREPEND_PATH+= ${X11BASE}/bin | | 642 | PREPEND_PATH+= ${X11BASE}/bin |
639 | .endif | | 643 | .endif |
640 | PREPEND_PATH+= ${LOCALBASE}/bin | | 644 | PREPEND_PATH+= ${LOCALBASE}/bin |
641 | | | 645 | |
642 | # Wrapper framework definitions | | 646 | # Wrapper framework definitions |
643 | .include "wrapper/wrapper-defs.mk" | | 647 | .include "wrapper/wrapper-defs.mk" |
644 | | | 648 | |
645 | # Binary emulator framework definitions | | 649 | # Binary emulator framework definitions |
646 | .if defined(EMUL_PLATFORMS) && !empty(EMUL_PLATFORMS) | | 650 | .if defined(EMUL_PLATFORMS) && !empty(EMUL_PLATFORMS) |
647 | . include "emulator/emulator-vars.mk" | | 651 | . include "emulator/emulator-vars.mk" |
648 | .endif | | 652 | .endif |
649 | | | 653 | |
650 | # System features framework | | 654 | # System features framework |
651 | .include "features/features-vars.mk" | | 655 | .include "features/features-vars.mk" |
652 | | | 656 | |
653 | # Package system flavor definitions | | 657 | # Package system flavor definitions |
654 | .include "flavor/bsd.flavor-vars.mk" | | 658 | .include "flavor/bsd.flavor-vars.mk" |
655 | | | 659 | |
656 | # Make variable definitions cache | | 660 | # Make variable definitions cache |
657 | .include "bsd.makevars.mk" | | 661 | .include "bsd.makevars.mk" |
658 | | | 662 | |
659 | # If MAKECONF is defined, then pass it down to all recursive make | | 663 | # If MAKECONF is defined, then pass it down to all recursive make |
660 | # processes invoked by pkgsrc. | | 664 | # processes invoked by pkgsrc. |
661 | # | | 665 | # |
662 | PKGSRC_MAKE_ENV+= ${MAKECONF:DMAKECONF=${MAKECONF:Q}} | | 666 | PKGSRC_MAKE_ENV+= ${MAKECONF:DMAKECONF=${MAKECONF:Q}} |
663 | RECURSIVE_MAKE= ${SETENV} ${PKGSRC_MAKE_ENV} ${MAKE} | | 667 | RECURSIVE_MAKE= ${SETENV} ${PKGSRC_MAKE_ENV} ${MAKE} |
664 | | | 668 | |
665 | _VARGROUPS+= dirs | | 669 | _VARGROUPS+= dirs |
666 | _USER_VARS.dirs= DISTDIR LOCALBASE PACKAGES PKG_SYSCONFDIR WRKOBJDIR | | 670 | _USER_VARS.dirs= DISTDIR LOCALBASE PACKAGES PKG_SYSCONFDIR WRKOBJDIR |
667 | _PKG_VARS.dirs= WRKSRC PATCHDIR FILESDIR PKGDIR | | 671 | _PKG_VARS.dirs= WRKSRC PATCHDIR FILESDIR PKGDIR |
668 | _SYS_VARS.dirs= WRKDIR DESTDIR PKG_SYSCONFBASEDIR | | 672 | _SYS_VARS.dirs= WRKDIR DESTDIR PKG_SYSCONFBASEDIR |
669 | | | 673 | |
670 | .endif # BSD_PKG_MK | | 674 | .endif # BSD_PKG_MK |