Mon Jun 16 15:10:48 2008 UTC ()
Make it more explicit that PKG_DESTDIR_SUPPORT and as side effect
META_PACKAGE must be set before including bsd.prefs.mk.


(joerg)
diff -r1.284 -r1.285 pkgsrc/mk/bsd.prefs.mk
diff -r1.1 -r1.2 pkgsrc/mk/help/destdir.help

cvs diff -r1.284 -r1.285 pkgsrc/mk/bsd.prefs.mk (switch to unified diff)

--- pkgsrc/mk/bsd.prefs.mk 2008/06/12 01:09:02 1.284
+++ pkgsrc/mk/bsd.prefs.mk 2008/06/16 15:10:48 1.285
@@ -1,660 +1,663 @@ @@ -1,660 +1,663 @@
1# $NetBSD: bsd.prefs.mk,v 1.284 2008/06/12 01:09:02 joerg Exp $ 1# $NetBSD: bsd.prefs.mk,v 1.285 2008/06/16 15:10:48 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.
36BSD_PKG_MK=1 36BSD_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)
41PATH=/bin:/usr/bin:/sbin:/usr/sbin 41PATH=/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/*)
59MAKEFLAGS+= _MAKE=${_MAKE:Q} 59MAKEFLAGS+= _MAKE=${_MAKE:Q}
60. endif 60. endif
61.endif 61.endif
62MAKE:= ${_MAKE} 62MAKE:= ${_MAKE}
63 63
64.if exists(/usr/bin/uname) 64.if exists(/usr/bin/uname)
65UNAME=/usr/bin/uname 65UNAME=/usr/bin/uname
66.elif exists(/bin/uname) 66.elif exists(/bin/uname)
67UNAME=/bin/uname 67UNAME=/bin/uname
68.else 68.else
69UNAME=echo Unknown 69UNAME=echo Unknown
70.endif 70.endif
71 71
72.if !defined(OPSYS) 72.if !defined(OPSYS)
73OPSYS:= ${:!${UNAME} -s!:S/-//g:S/\///g} 73OPSYS:= ${:!${UNAME} -s!:S/-//g:S/\///g}
74MAKEFLAGS+= OPSYS=${OPSYS:Q} 74MAKEFLAGS+= 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
82OS_VERSION= ${_OS_VERSION_CMD:sh} 82OS_VERSION= ${_OS_VERSION_CMD:sh}
83MAKEFLAGS+= OS_VERSION=${OS_VERSION:Q} 83MAKEFLAGS+= 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.
88GNU_ARCH.arm26?= arm 88GNU_ARCH.arm26?= arm
89GNU_ARCH.arm32?= arm 89GNU_ARCH.arm32?= arm
90GNU_ARCH.i486?= i386 90GNU_ARCH.i486?= i386
91GNU_ARCH.i586?= i386 91GNU_ARCH.i586?= i386
92GNU_ARCH.i686?= i386 92GNU_ARCH.i686?= i386
93GNU_ARCH.m68000?= m68010 93GNU_ARCH.m68000?= m68010
94GNU_ARCH.mips?= mipsel 94GNU_ARCH.mips?= mipsel
95GNU_ARCH.sh3eb?= sh 95GNU_ARCH.sh3eb?= sh
96GNU_ARCH.sh3el?= shle 96GNU_ARCH.sh3el?= shle
97NATIVE_MACHINE_GNU_ARCH?= ${GNU_ARCH.${NATIVE_MACHINE_ARCH}:U${NATIVE_MACHINE_ARCH}} 97NATIVE_MACHINE_GNU_ARCH?= ${GNU_ARCH.${NATIVE_MACHINE_ARCH}:U${NATIVE_MACHINE_ARCH}}
98MACHINE_GNU_ARCH?= ${GNU_ARCH.${MACHINE_ARCH}:U${MACHINE_ARCH}} 98MACHINE_GNU_ARCH?= ${GNU_ARCH.${MACHINE_ARCH}:U${MACHINE_ARCH}}
99 99
100.if ${OPSYS} == "NetBSD" 100.if ${OPSYS} == "NetBSD"
101LOWER_OPSYS?= netbsd 101LOWER_OPSYS?= netbsd
102 102
103.elif ${OPSYS} == "AIX" 103.elif ${OPSYS} == "AIX"
104LOWER_ARCH!= _cpuid=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $$1 }'`; \ 104LOWER_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
110MACHINE_ARCH?= ${LOWER_ARCH} 110MACHINE_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
116OS_VERSION= ${_OS_VERSION:C/\([0-9]*\.[0-9]*\).*/\1/} 116OS_VERSION= ${_OS_VERSION:C/\([0-9]*\.[0-9]*\).*/\1/}
117LOWER_OPSYS_VERSUFFIX= ${_OS_VERSION} 117LOWER_OPSYS_VERSUFFIX= ${_OS_VERSION}
118LOWER_OPSYS?= aix 118LOWER_OPSYS?= aix
119LOWER_VENDOR?= ibm 119LOWER_VENDOR?= ibm
120 120
121.elif ${OPSYS} == "BSDOS" 121.elif ${OPSYS} == "BSDOS"
122LOWER_OPSYS?= bsdi 122LOWER_OPSYS?= bsdi
123 123
124.elif ${OPSYS} == "Darwin" 124.elif ${OPSYS} == "Darwin"
125LOWER_OPSYS?= darwin 125LOWER_OPSYS?= darwin
126LOWER_ARCH!= ${UNAME} -p 126LOWER_ARCH!= ${UNAME} -p
127MACHINE_ARCH= ${LOWER_ARCH} 127MACHINE_ARCH= ${LOWER_ARCH}
128MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH:Q} 128MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH:Q}
129LOWER_OPSYS_VERSUFFIX= ${LOWER_OS_VERSION:C/([0-9]*).*/\1/} 129LOWER_OPSYS_VERSUFFIX= ${LOWER_OS_VERSION:C/([0-9]*).*/\1/}
130LOWER_VENDOR?= apple 130LOWER_VENDOR?= apple
131 131
132.elif ${OPSYS} == "DragonFly" 132.elif ${OPSYS} == "DragonFly"
133OS_VERSION:= ${OS_VERSION:C/-.*$//} 133OS_VERSION:= ${OS_VERSION:C/-.*$//}
134LOWER_OPSYS?= dragonfly 134LOWER_OPSYS?= dragonfly
135LOWER_ARCH!= ${UNAME} -p 135LOWER_ARCH!= ${UNAME} -p
136MACHINE_ARCH= ${LOWER_ARCH} 136MACHINE_ARCH= ${LOWER_ARCH}
137MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH:Q} 137MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH:Q}
138LOWER_VENDOR?= pc 138LOWER_VENDOR?= pc
139 139
140.elif ${OPSYS} == "FreeBSD" 140.elif ${OPSYS} == "FreeBSD"
141OS_VERSION:= ${OS_VERSION:C/-.*$//} 141OS_VERSION:= ${OS_VERSION:C/-.*$//}
142LOWER_OPSYS?= freebsd 142LOWER_OPSYS?= freebsd
143LOWER_ARCH!= ${UNAME} -p 143LOWER_ARCH!= ${UNAME} -p
144. if ${LOWER_ARCH} == "amd64" 144. if ${LOWER_ARCH} == "amd64"
145MACHINE_ARCH= x86_64 145MACHINE_ARCH= x86_64
146. else 146. else
147MACHINE_ARCH= ${LOWER_ARCH} 147MACHINE_ARCH= ${LOWER_ARCH}
148. endif 148. endif
149MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH:Q} 149MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH:Q}
150LOWER_OPSYS_VERSUFFIX= ${LOWER_OS_VERSION:C/([0-9]*).*/\1/} 150LOWER_OPSYS_VERSUFFIX= ${LOWER_OS_VERSION:C/([0-9]*).*/\1/}
151. if ${LOWER_ARCH} == "i386" 151. if ${LOWER_ARCH} == "i386"
152LOWER_VENDOR?= pc 152LOWER_VENDOR?= pc
153. endif 153. endif
154LOWER_VENDOR?= unknown 154LOWER_VENDOR?= unknown
155 155
156.elif ${OPSYS} == "Interix" 156.elif ${OPSYS} == "Interix"
157LOWER_OPSYS?= interix 157LOWER_OPSYS?= interix
158LOWER_OPSYS_VERSUFFIX?= 3 158LOWER_OPSYS_VERSUFFIX?= 3
159LOWER_VENDOR?= pc 159LOWER_VENDOR?= pc
160. if exists(/usr/lib/libc.so.3.5) 160. if exists(/usr/lib/libc.so.3.5)
161OS_VERSION= 3.5 161OS_VERSION= 3.5
162. elif exists(/usr/lib/libc.so.3.1) 162. elif exists(/usr/lib/libc.so.3.1)
163OS_VERSION= 3.1 163OS_VERSION= 3.1
164. else 164. else
165OS_VERSION= 3.0 165OS_VERSION= 3.0
166. endif 166. endif
167 167
168.elif !empty(OPSYS:MIRIX*) 168.elif !empty(OPSYS:MIRIX*)
169LOWER_ARCH!= ${UNAME} -p 169LOWER_ARCH!= ${UNAME} -p
170LOWER_OPSYS?= irix 170LOWER_OPSYS?= irix
171LOWER_OPSYS_VERSUFFIX?= ${OS_VERSION} 171LOWER_OPSYS_VERSUFFIX?= ${OS_VERSION}
172LOWER_VENDOR?= sgi 172LOWER_VENDOR?= sgi
173 173
174.elif ${OPSYS} == "Linux" 174.elif ${OPSYS} == "Linux"
175OS_VERSION:= ${OS_VERSION:C/-.*$//} 175OS_VERSION:= ${OS_VERSION:C/-.*$//}
176LOWER_OPSYS?= linux 176LOWER_OPSYS?= linux
177MACHINE_ARCH:= ${MACHINE_ARCH:C/i.86/i386/} 177MACHINE_ARCH:= ${MACHINE_ARCH:C/i.86/i386/}
178MACHINE_ARCH:= ${MACHINE_ARCH:C/ppc/powerpc/} 178MACHINE_ARCH:= ${MACHINE_ARCH:C/ppc/powerpc/}
179. if !defined(LOWER_ARCH) 179. if !defined(LOWER_ARCH)
180LOWER_ARCH!= ${UNAME} -m | sed -e 's/i.86/i386/' -e 's/ppc/powerpc/' 180LOWER_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"
183MACHINE_ARCH= x86_64 183MACHINE_ARCH= x86_64
184. endif 184. endif
185. if ${MACHINE_ARCH} == "unknown" || ${MACHINE_ARCH} == "" 185. if ${MACHINE_ARCH} == "unknown" || ${MACHINE_ARCH} == ""
186MACHINE_ARCH= ${LOWER_ARCH} 186MACHINE_ARCH= ${LOWER_ARCH}
187MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH:Q} 187MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH:Q}
188. endif 188. endif
189. if exists(/etc/debian_version) 189. if exists(/etc/debian_version)
190LOWER_VENDOR?= debian 190LOWER_VENDOR?= debian
191. elif exists(/etc/mandrake-release) 191. elif exists(/etc/mandrake-release)
192LOWER_VENDOR?= mandrake 192LOWER_VENDOR?= mandrake
193. elif exists(/etc/redhat-version) 193. elif exists(/etc/redhat-version)
194LOWER_VENDOR?= redhat 194LOWER_VENDOR?= redhat
195. elif exists(/etc/slackware-version) 195. elif exists(/etc/slackware-version)
196LOWER_VENDOR?= slackware 196LOWER_VENDOR?= slackware
197. elif ${LOWER_ARCH} == "i386" 197. elif ${LOWER_ARCH} == "i386"
198LOWER_VENDOR?= pc 198LOWER_VENDOR?= pc
199. endif 199. endif
200LOWER_VENDOR?= unknown 200LOWER_VENDOR?= unknown
201 201
202.elif ${OPSYS} == "OSF1" 202.elif ${OPSYS} == "OSF1"
203LOWER_ARCH!= ${UNAME} -p 203LOWER_ARCH!= ${UNAME} -p
204MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH:Q} 204MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH:Q}
205MACHINE_ARCH?= ${LOWER_ARCH} 205MACHINE_ARCH?= ${LOWER_ARCH}
206OS_VERSION:= ${OS_VERSION:C/^V//} 206OS_VERSION:= ${OS_VERSION:C/^V//}
207LOWER_OPSYS?= osf1 207LOWER_OPSYS?= osf1
208LOWER_OPSYS_VERSUFFIX?= ${OS_VERSION} 208LOWER_OPSYS_VERSUFFIX?= ${OS_VERSION}
209LOWER_VENDOR?= dec 209LOWER_VENDOR?= dec
210 210
211.elif ${OPSYS} == "HPUX" 211.elif ${OPSYS} == "HPUX"
212OS_VERSION:= ${OS_VERSION:C/^B.//} 212OS_VERSION:= ${OS_VERSION:C/^B.//}
213.if ${MACHINE_ARCH} == "9000" 213.if ${MACHINE_ARCH} == "9000"
214MACHINE_ARCH= hppa 214MACHINE_ARCH= hppa
215.endif 215.endif
216LOWER_OPSYS?= hpux 216LOWER_OPSYS?= hpux
217LOWER_OPSYS_VERSUFFIX?= ${OS_VERSION} 217LOWER_OPSYS_VERSUFFIX?= ${OS_VERSION}
218LOWER_VENDOR?= hp 218LOWER_VENDOR?= hp
219 219
220.elif ${OPSYS} == "SunOS" 220.elif ${OPSYS} == "SunOS"
221. if ${MACHINE_ARCH} == "sparc" 221. if ${MACHINE_ARCH} == "sparc"
222SPARC_TARGET_ARCH?= sparcv7 222SPARC_TARGET_ARCH?= sparcv7
223. elif ${MACHINE_ARCH} == "sun4" 223. elif ${MACHINE_ARCH} == "sun4"
224MACHINE_ARCH= sparc 224MACHINE_ARCH= sparc
225SPARC_TARGET_ARCH?= sparcv7 225SPARC_TARGET_ARCH?= sparcv7
226. elif ${MACHINE_ARCH} == "i86pc" || ${MACHINE_ARCH} == "i86xpv" 226. elif ${MACHINE_ARCH} == "i86pc" || ${MACHINE_ARCH} == "i86xpv"
227MACHINE_ARCH= i386 227MACHINE_ARCH= i386
228. elif ${MACHINE_ARCH} == "unknown" 228. elif ${MACHINE_ARCH} == "unknown"
229. if !defined(LOWER_ARCH) 229. if !defined(LOWER_ARCH)
230LOWER_ARCH!= ${UNAME} -p 230LOWER_ARCH!= ${UNAME} -p
231. endif # !defined(LOWER_ARCH) 231. endif # !defined(LOWER_ARCH)
232MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH:Q} 232MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH:Q}
233. endif 233. endif
234LOWER_VENDOR?= sun 234LOWER_VENDOR?= sun
235LOWER_OPSYS?= solaris 235LOWER_OPSYS?= solaris
236LOWER_OPSYS_VERSUFFIX= 2 236LOWER_OPSYS_VERSUFFIX= 2
237 237
238.elif !defined(LOWER_OPSYS) 238.elif !defined(LOWER_OPSYS)
239LOWER_OPSYS:= ${OPSYS:tl} 239LOWER_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
243OS_VERSION:= ${OS_VERSION} 243OS_VERSION:= ${OS_VERSION}
244LOWER_OS_VERSION:= ${OS_VERSION:tl} 244LOWER_OS_VERSION:= ${OS_VERSION:tl}
245 245
246MAKEFLAGS+= LOWER_OPSYS=${LOWER_OPSYS:Q} 246MAKEFLAGS+= LOWER_OPSYS=${LOWER_OPSYS:Q}
247 247
248LOWER_VENDOR?= # empty ("arch--opsys") 248LOWER_VENDOR?= # empty ("arch--opsys")
249LOWER_ARCH?= ${MACHINE_GNU_ARCH} 249LOWER_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.
252NATIVE_LOWER_ARCH:= ${LOWER_ARCH} 252NATIVE_LOWER_ARCH:= ${LOWER_ARCH}
253NATIVE_MACHINE_ARCH:= ${MACHINE_ARCH} 253NATIVE_MACHINE_ARCH:= ${MACHINE_ARCH}
254 254
255NATIVE_MACHINE_PLATFORM?= ${OPSYS}-${OS_VERSION}-${NATIVE_MACHINE_ARCH} 255NATIVE_MACHINE_PLATFORM?= ${OPSYS}-${OS_VERSION}-${NATIVE_MACHINE_ARCH}
256MACHINE_PLATFORM?= ${OPSYS}-${OS_VERSION}-${MACHINE_ARCH} 256MACHINE_PLATFORM?= ${OPSYS}-${OS_VERSION}-${MACHINE_ARCH}
257NATIVE_MACHINE_GNU_PLATFORM?= ${NATIVE_LOWER_ARCH}-${LOWER_VENDOR}-${LOWER_OPSYS:C/[0-9]//g}${APPEND_ELF}${LOWER_OPSYS_VERSUFFIX} 257NATIVE_MACHINE_GNU_PLATFORM?= ${NATIVE_LOWER_ARCH}-${LOWER_VENDOR}-${LOWER_OPSYS:C/[0-9]//g}${APPEND_ELF}${LOWER_OPSYS_VERSUFFIX}
258MACHINE_GNU_PLATFORM?= ${LOWER_ARCH}-${LOWER_VENDOR}-${LOWER_OPSYS:C/[0-9]//g}${APPEND_ELF}${LOWER_OPSYS_VERSUFFIX} 258MACHINE_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.
261NEED_OWN_INSTALL_TARGET=no 261NEED_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".
265USETOOLS= no 265USETOOLS= no
266MAKE_ENV+= USETOOLS=no 266MAKE_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"
270OBJECT_FMT?= Mach-O 270OBJECT_FMT?= Mach-O
271.endif 271.endif
272 272
273ACCEPTABLE_LICENSES?= ${DEFAULT_ACCEPTABLE_LICENSES} 273ACCEPTABLE_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.
276PKGPATH?= ${.CURDIR:C|.*/([^/]*/[^/]*)$|\1|} 276PKGPATH?= ${.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"
286OBJECT_FMT?= ELF 286OBJECT_FMT?= ELF
287. else 287. else
288OBJECT_FMT?= a.out 288OBJECT_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"
297OBJECT_FMT= ELF 297OBJECT_FMT= ELF
298. else 298. else
299OBJECT_FMT= a.out 299OBJECT_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"
305OBJECT_FMT?= ELF 305OBJECT_FMT?= ELF
306. else 306. else
307OBJECT_FMT?= a.out 307OBJECT_FMT?= a.out
308. endif 308. endif
309.elif ${OPSYS} == "DragonFly" 309.elif ${OPSYS} == "DragonFly"
310OBJECT_FMT= ELF 310OBJECT_FMT= ELF
311.elif ${OPSYS} == "AIX" 311.elif ${OPSYS} == "AIX"
312OBJECT_FMT= XCOFF 312OBJECT_FMT= XCOFF
313.elif ${OPSYS} == "OSF1" 313.elif ${OPSYS} == "OSF1"
314OBJECT_FMT= ECOFF 314OBJECT_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")
317OBJECT_FMT= ELF 317OBJECT_FMT= ELF
318. else 318. else
319OBJECT_FMT= SOM 319OBJECT_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
335SHAREOWN?= ${DOCOWN} 335SHAREOWN?= ${DOCOWN}
336SHAREGRP?= ${DOCGRP} 336SHAREGRP?= ${DOCGRP}
337SHAREMODE?= ${DOCMODE} 337SHAREMODE?= ${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"
352PKG_FAIL_REASON+= "missing mk/platform/${OPSYS}.mk" 352PKG_FAIL_REASON+= "missing mk/platform/${OPSYS}.mk"
353.endif 353.endif
354 354
355PKGDIRMODE?= 755 355PKGDIRMODE?= 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
 362# indirectly.
 363#
361# Keywords: meta meta-package META_PACKAGE 364# Keywords: meta meta-package META_PACKAGE
362# 365#
363.if defined(META_PACKAGE) 366.if defined(META_PACKAGE)
364PKG_DESTDIR_SUPPORT= user-destdir 367PKG_DESTDIR_SUPPORT= user-destdir
365NO_CONFIGURE= yes 368NO_CONFIGURE= yes
366NO_BUILD= yes 369NO_BUILD= yes
367DISTFILES= # none 370DISTFILES= # none
368PLIST_SRC= # none 371PLIST_SRC= # none
369do-patch: 372do-patch:
370 @${DO_NADA} 373 @${DO_NADA}
371do-install: 374do-install:
372 @${DO_NADA} 375 @${DO_NADA}
373.endif 376.endif
374 377
375# PKG_DESTDIR_SUPPORT can only be one of "destdir" or "user-destdir". 378# PKG_DESTDIR_SUPPORT can only be one of "destdir" or "user-destdir".
376USE_DESTDIR?= no 379USE_DESTDIR?= no
377PKG_DESTDIR_SUPPORT?= # empty 380PKG_DESTDIR_SUPPORT?= # empty
378 381
379.if empty(PKG_DESTDIR_SUPPORT) || (empty(USE_DESTDIR:M[Yy][Ee][Ss]) && empty(USE_DESTDIR:M[Ff][Uu][Ll][Ll])) 382.if empty(PKG_DESTDIR_SUPPORT) || (empty(USE_DESTDIR:M[Yy][Ee][Ss]) && empty(USE_DESTDIR:M[Ff][Uu][Ll][Ll]))
380_USE_DESTDIR= no 383_USE_DESTDIR= no
381.elif ${PKG_DESTDIR_SUPPORT} == "user-destdir" 384.elif ${PKG_DESTDIR_SUPPORT} == "user-destdir"
382. if !empty(USE_DESTDIR:M[Ff][Uu][Ll][Ll]) 385. if !empty(USE_DESTDIR:M[Ff][Uu][Ll][Ll])
383_USE_DESTDIR= user-destdir 386_USE_DESTDIR= user-destdir
384. else 387. else
385_USE_DESTDIR= destdir 388_USE_DESTDIR= destdir
386. endif 389. endif
387.elif ${PKG_DESTDIR_SUPPORT} == "destdir" 390.elif ${PKG_DESTDIR_SUPPORT} == "destdir"
388_USE_DESTDIR= destdir 391_USE_DESTDIR= destdir
389.else 392.else
390PKG_FAIL_REASON+= "PKG_DESTDIR_SUPPORT must be \`\`destdir'' or \`\`user-destdir''." 393PKG_FAIL_REASON+= "PKG_DESTDIR_SUPPORT must be \`\`destdir'' or \`\`user-destdir''."
391.endif 394.endif
392 395
393# When using staged installation, everything gets installed into 396# When using staged installation, everything gets installed into
394# ${DESTDIR}${PREFIX} instead of ${PREFIX} directly. 397# ${DESTDIR}${PREFIX} instead of ${PREFIX} directly.
395# 398#
396.if ${_USE_DESTDIR} != "no" 399.if ${_USE_DESTDIR} != "no"
397DESTDIR= ${WRKDIR}/.destdir 400DESTDIR= ${WRKDIR}/.destdir
398. if ${_USE_DESTDIR} == "destdir" 401. if ${_USE_DESTDIR} == "destdir"
399_MAKE_PACKAGE_AS_ROOT= yes 402_MAKE_PACKAGE_AS_ROOT= yes
400_MAKE_CLEAN_AS_ROOT= yes 403_MAKE_CLEAN_AS_ROOT= yes
401_MAKE_INSTALL_AS_ROOT= yes 404_MAKE_INSTALL_AS_ROOT= yes
402. elif ${_USE_DESTDIR} == "user-destdir" 405. elif ${_USE_DESTDIR} == "user-destdir"
403_MAKE_PACKAGE_AS_ROOT= no 406_MAKE_PACKAGE_AS_ROOT= no
404_MAKE_CLEAN_AS_ROOT= no 407_MAKE_CLEAN_AS_ROOT= no
405_MAKE_INSTALL_AS_ROOT= no 408_MAKE_INSTALL_AS_ROOT= no
406. endif 409. endif
407.else 410.else
408DESTDIR= 411DESTDIR=
409.endif 412.endif
410 413
411_MAKE_CLEAN_AS_ROOT?= no 414_MAKE_CLEAN_AS_ROOT?= no
412# Whether to run the clean target as root. 415# Whether to run the clean target as root.
413_MAKE_INSTALL_AS_ROOT?= yes 416_MAKE_INSTALL_AS_ROOT?= yes
414# Whether to run the install target as root. 417# Whether to run the install target as root.
415_MAKE_PACKAGE_AS_ROOT?= yes 418_MAKE_PACKAGE_AS_ROOT?= yes
416# Whether to run the package target as root. 419# Whether to run the package target as root.
417 420
418# When cross-compilation support is requested, the following options 421# When cross-compilation support is requested, the following options
419# must be specified as well or guessable: 422# must be specified as well or guessable:
420# - MACHINE_ARCH is set to TARGET_ARCH if set. 423# - MACHINE_ARCH is set to TARGET_ARCH if set.
421# - CROSS_DESTDIR is guessed from MAKEOBJDIR and MACHINE_ARCH. 424# - CROSS_DESTDIR is guessed from MAKEOBJDIR and MACHINE_ARCH.
422# - PKG_DBDIR is expanded and prefixed with CROSS_DESTDIR 425# - PKG_DBDIR is expanded and prefixed with CROSS_DESTDIR
423# - DESTDIR support is required 426# - DESTDIR support is required
424# 427#
425# _CROSS_DESTDIR is set for internal use to avoid conditionalising 428# _CROSS_DESTDIR is set for internal use to avoid conditionalising
426# the use. 429# the use.
427 430
428.if !empty(USE_CROSS_COMPILE:M[yY][eE][sS]) 431.if !empty(USE_CROSS_COMPILE:M[yY][eE][sS])
429. if defined(TARGET_ARCH) 432. if defined(TARGET_ARCH)
430MACHINE_ARCH= ${TARGET_ARCH} 433MACHINE_ARCH= ${TARGET_ARCH}
431. endif 434. endif
432CROSS_DESTDIR?= ${MAKEOBJDIR}/destdir.${MACHINE_ARCH} 435CROSS_DESTDIR?= ${MAKEOBJDIR}/destdir.${MACHINE_ARCH}
433. if !exists(${CROSS_DESTDIR}/usr/include/stddef.h) 436. if !exists(${CROSS_DESTDIR}/usr/include/stddef.h)
434PKG_FAIL_REASON+= "The cross-compiling root ${CROSS_DESTDIR:Q} is incomplete" 437PKG_FAIL_REASON+= "The cross-compiling root ${CROSS_DESTDIR:Q} is incomplete"
435. else 438. else
436_CROSS_DESTDIR= ${CROSS_DESTDIR} 439_CROSS_DESTDIR= ${CROSS_DESTDIR}
437. endif 440. endif
438.endif 441.endif
439 442
440# Depends on MACHINE_ARCH override above 443# Depends on MACHINE_ARCH override above
441.if ${OPSYS} == "NetBSD" 444.if ${OPSYS} == "NetBSD"
442. if ${OBJECT_FMT} == "ELF" && \ 445. if ${OBJECT_FMT} == "ELF" && \
443 (${MACHINE_GNU_ARCH} == "arm" || \ 446 (${MACHINE_GNU_ARCH} == "arm" || \
444 ${MACHINE_ARCH} == "i386" || \ 447 ${MACHINE_ARCH} == "i386" || \
445 ${MACHINE_ARCH} == "m68k" || \ 448 ${MACHINE_ARCH} == "m68k" || \
446 ${MACHINE_ARCH} == "m68000" || \ 449 ${MACHINE_ARCH} == "m68000" || \
447 ${MACHINE_GNU_ARCH} == "sh" || \ 450 ${MACHINE_GNU_ARCH} == "sh" || \
448 ${MACHINE_GNU_ARCH} == "shle" || \ 451 ${MACHINE_GNU_ARCH} == "shle" || \
449 ${MACHINE_ARCH} == "sparc" || \ 452 ${MACHINE_ARCH} == "sparc" || \
450 ${MACHINE_ARCH} == "vax") 453 ${MACHINE_ARCH} == "vax")
451APPEND_ELF= elf 454APPEND_ELF= elf
452. endif 455. endif
453.endif 456.endif
454 457
455PKG_INSTALLATION_TYPES?= overwrite 458PKG_INSTALLATION_TYPES?= overwrite
456# This is a whitespace-separated list of installation types supported 459# This is a whitespace-separated list of installation types supported
457# by the package. 460# by the package.
458# 461#
459# *NOTE*: This variable *must* be set in the package Makefile *before* 462# *NOTE*: This variable *must* be set in the package Makefile *before*
460# the inclusion of bsd.prefs.mk. 463# the inclusion of bsd.prefs.mk.
461# 464#
462# Possible: any of: overwrite, pkgviews 465# Possible: any of: overwrite, pkgviews
463# Default: overwrite 466# Default: overwrite
464 467
465# Set the style of installation to be performed for the package. The 468# Set the style of installation to be performed for the package. The
466# funky make variable modifiers just select the first word of the value 469# funky make variable modifiers just select the first word of the value
467# stored in the referenced variable. 470# stored in the referenced variable.
468# 471#
469.for _pref_ in ${PKG_INSTALLATION_PREFS} 472.for _pref_ in ${PKG_INSTALLATION_PREFS}
470. if !empty(PKG_INSTALLATION_TYPES:M${_pref_}) 473. if !empty(PKG_INSTALLATION_TYPES:M${_pref_})
471PKG_INSTALLATION_TYPE?= ${PKG_INSTALLATION_TYPES:M${_pref_}:S/^/_pkginsttype_/1:M_pkginsttype_*:S/^_pkginsttype_//} 474PKG_INSTALLATION_TYPE?= ${PKG_INSTALLATION_TYPES:M${_pref_}:S/^/_pkginsttype_/1:M_pkginsttype_*:S/^_pkginsttype_//}
472. endif 475. endif
473.endfor 476.endfor
474PKG_INSTALLATION_TYPE?= none 477PKG_INSTALLATION_TYPE?= none
475 478
476# if the system is IPv6-ready, compile with IPv6 support turned on. 479# if the system is IPv6-ready, compile with IPv6 support turned on.
477.if empty(_OPSYS_HAS_INET6:M[nN][oO]) 480.if empty(_OPSYS_HAS_INET6:M[nN][oO])
478IPV6_READY= YES 481IPV6_READY= YES
479.else 482.else
480IPV6_READY= NO 483IPV6_READY= NO
481.endif 484.endif
482 485
483LOCALBASE?= /usr/pkg 486LOCALBASE?= /usr/pkg
484X11_TYPE?= native 487X11_TYPE?= native
485.if !empty(X11_TYPE:Mnative) 488.if !empty(X11_TYPE:Mnative)
486. if ${OPSYS} == "SunOS" 489. if ${OPSYS} == "SunOS"
487# On Solaris, we default to using OpenWindows for X11. 490# On Solaris, we default to using OpenWindows for X11.
488X11BASE?= /usr/openwin 491X11BASE?= /usr/openwin
489. elif ${OPSYS} == "IRIX" || ${OPSYS} == "OSF1" || ${OPSYS} == "HPUX" 492. elif ${OPSYS} == "IRIX" || ${OPSYS} == "OSF1" || ${OPSYS} == "HPUX"
490X11BASE?= /usr 493X11BASE?= /usr
491. else 494. else
492X11BASE?= /usr/X11R6 495X11BASE?= /usr/X11R6
493. endif 496. endif
494.endif 497.endif
495CROSSBASE?= ${LOCALBASE}/cross 498CROSSBASE?= ${LOCALBASE}/cross
496 499
497# If xpkgwedge.def is found, then clearly we're using xpkgwedge. 500# If xpkgwedge.def is found, then clearly we're using xpkgwedge.
498.if exists(${LOCALBASE}/lib/X11/config/xpkgwedge.def) || \ 501.if exists(${LOCALBASE}/lib/X11/config/xpkgwedge.def) || \
499 exists(${X11BASE}/lib/X11/config/xpkgwedge.def) 502 exists(${X11BASE}/lib/X11/config/xpkgwedge.def)
500USE_XPKGWEDGE= yes 503USE_XPKGWEDGE= yes
501.elif ${PKG_INSTALLATION_TYPE} == "pkgviews" 504.elif ${PKG_INSTALLATION_TYPE} == "pkgviews"
502USE_XPKGWEDGE= yes 505USE_XPKGWEDGE= yes
503.elif ${X11_TYPE} == "modular" 506.elif ${X11_TYPE} == "modular"
504USE_XPKGWEDGE= no 507USE_XPKGWEDGE= no
505.else 508.else
506USE_XPKGWEDGE?= yes 509USE_XPKGWEDGE?= yes
507.endif 510.endif
508 511
509.if defined(FIX_SYSTEM_HEADERS) && ${FIX_SYSTEM_HEADERS} == "yes" && \ 512.if defined(FIX_SYSTEM_HEADERS) && ${FIX_SYSTEM_HEADERS} == "yes" && \
510 empty(PKGPATH:Mpkgtools/*) && empty(PKGPATH:M*/nbsed) && \ 513 empty(PKGPATH:Mpkgtools/*) && empty(PKGPATH:M*/nbsed) && \
511 empty(PKGPATH:M*/nawk) && empty(PKGPATH:M*/bmake) && \ 514 empty(PKGPATH:M*/nawk) && empty(PKGPATH:M*/bmake) && \
512 empty(PKGPATH:M*/install-sh) && empty(PKGPATH:M*/tnftp) && \ 515 empty(PKGPATH:M*/install-sh) && empty(PKGPATH:M*/tnftp) && \
513 empty(PKGPATH:M*/pax) && \ 516 empty(PKGPATH:M*/pax) && \
514 exists(../../pkgtools/compat_headers/buildlink3.mk) 517 exists(../../pkgtools/compat_headers/buildlink3.mk)
515. include "../../pkgtools/compat_headers/buildlink3.mk" 518. include "../../pkgtools/compat_headers/buildlink3.mk"
516.endif 519.endif
517 520
518.if ${X11_TYPE} == "modular" 521.if ${X11_TYPE} == "modular"
519X11BASE= ${LOCALBASE} 522X11BASE= ${LOCALBASE}
520.endif 523.endif
521 524
522.if !empty(USE_XPKGWEDGE:M[Yy][Ee][Ss]) 525.if !empty(USE_XPKGWEDGE:M[Yy][Ee][Ss])
523X11PREFIX= ${LOCALBASE} 526X11PREFIX= ${LOCALBASE}
524.else 527.else
525X11PREFIX= ${X11BASE} 528X11PREFIX= ${X11BASE}
526.endif 529.endif
527 530
528# Default directory for font encodings 531# Default directory for font encodings
529X11_ENCODINGSDIR?= ${X11BASE}/lib/X11/fonts/encodings 532X11_ENCODINGSDIR?= ${X11BASE}/lib/X11/fonts/encodings
530 533
531DEPOT_SUBDIR?= packages 534DEPOT_SUBDIR?= packages
532DEPOTBASE= ${LOCALBASE}/${DEPOT_SUBDIR} 535DEPOTBASE= ${LOCALBASE}/${DEPOT_SUBDIR}
533 536
534# LINK_RPATH_FLAG publicly exports the linker flag used to set the 537# LINK_RPATH_FLAG publicly exports the linker flag used to set the
535# run-time library search path. 538# run-time library search path.
536# 539#
537.if defined(_OPSYS_LINKER_RPATH_FLAG) 540.if defined(_OPSYS_LINKER_RPATH_FLAG)
538LINKER_RPATH_FLAG= ${_OPSYS_LINKER_RPATH_FLAG} 541LINKER_RPATH_FLAG= ${_OPSYS_LINKER_RPATH_FLAG}
539.else 542.else
540LINKER_RPATH_FLAG?= ${_LINKER_RPATH_FLAG} 543LINKER_RPATH_FLAG?= ${_LINKER_RPATH_FLAG}
541.endif 544.endif
542 545
543# COMPILER_RPATH_FLAG publicly exports the compiler flag used to pass 546# COMPILER_RPATH_FLAG publicly exports the compiler flag used to pass
544# run-time library search path directives to the linker. 547# run-time library search path directives to the linker.
545# 548#
546.if defined(_OPSYS_COMPILER_RPATH_FLAG) 549.if defined(_OPSYS_COMPILER_RPATH_FLAG)
547COMPILER_RPATH_FLAG= ${_OPSYS_COMPILER_RPATH_FLAG} 550COMPILER_RPATH_FLAG= ${_OPSYS_COMPILER_RPATH_FLAG}
548.else 551.else
549COMPILER_RPATH_FLAG?= ${_COMPILER_RPATH_FLAG} 552COMPILER_RPATH_FLAG?= ${_COMPILER_RPATH_FLAG}
550.endif 553.endif
551 554
552# WHOLE_ARCHIVE_FLAG and NO_WHOLE_ARCHIVE_FLAG publically export the 555# WHOLE_ARCHIVE_FLAG and NO_WHOLE_ARCHIVE_FLAG publically export the
553# linker flags to extract all symbols from a static archive. 556# linker flags to extract all symbols from a static archive.
554# 557#
555WHOLE_ARCHIVE_FLAG?= ${_OPSYS_WHOLE_ARCHIVE_FLAG} 558WHOLE_ARCHIVE_FLAG?= ${_OPSYS_WHOLE_ARCHIVE_FLAG}
556NO_WHOLE_ARCHIVE_FLAG?= ${_OPSYS_NO_WHOLE_ARCHIVE_FLAG} 559NO_WHOLE_ARCHIVE_FLAG?= ${_OPSYS_NO_WHOLE_ARCHIVE_FLAG}
557 560
558USE_TOOLS?= # empty 561USE_TOOLS?= # empty
559 562
560# Provide default values for TOOLs used by the top-level make. 563# Provide default values for TOOLs used by the top-level make.
561USE_TOOLS+= [ awk dirname echo grep pwd sed test true 564USE_TOOLS+= [ awk dirname echo grep pwd sed test true
562 565
563# These tools are used by the top-level make only in certain packages and 566# These tools are used by the top-level make only in certain packages and
564# should eventually be moved into those particular package Makefiles. 567# should eventually be moved into those particular package Makefiles.
565# 568#
566USE_TOOLS+= date tr 569USE_TOOLS+= date tr
567 570
568# These are tools used directly by bsd.prefs.mk and files included by 571# These are tools used directly by bsd.prefs.mk and files included by
569# bsd.prefs.mk. 572# bsd.prefs.mk.
570# 573#
571USE_TOOLS+= awk:pkgsrc cut:pkgsrc echo:pkgsrc pwd:pkgsrc \ 574USE_TOOLS+= awk:pkgsrc cut:pkgsrc echo:pkgsrc pwd:pkgsrc \
572 sed:pkgsrc tr:pkgsrc uname:pkgsrc 575 sed:pkgsrc tr:pkgsrc uname:pkgsrc
573 576
574.include "${_PKGSRC_TOPDIR}/mk/tools/defaults.mk" 577.include "${_PKGSRC_TOPDIR}/mk/tools/defaults.mk"
575 578
576.if !defined(_PKGSRCDIR) 579.if !defined(_PKGSRCDIR)
577_PKGSRCDIR!= cd ${_PKGSRC_TOPDIR} && ${PWD_CMD} 580_PKGSRCDIR!= cd ${_PKGSRC_TOPDIR} && ${PWD_CMD}
578MAKEFLAGS+= _PKGSRCDIR=${_PKGSRCDIR:Q} 581MAKEFLAGS+= _PKGSRCDIR=${_PKGSRCDIR:Q}
579.endif 582.endif
580PKGSRCDIR= ${_PKGSRCDIR} 583PKGSRCDIR= ${_PKGSRCDIR}
581 584
582DISTDIR?= ${PKGSRCDIR}/distfiles 585DISTDIR?= ${PKGSRCDIR}/distfiles
583PACKAGES?= ${PKGSRCDIR}/packages 586PACKAGES?= ${PKGSRCDIR}/packages
584TEMPLATES?= ${PKGSRCDIR}/templates 587TEMPLATES?= ${PKGSRCDIR}/templates
585 588
586PATCHDIR?= ${.CURDIR}/patches 589PATCHDIR?= ${.CURDIR}/patches
587FILESDIR?= ${.CURDIR}/files 590FILESDIR?= ${.CURDIR}/files
588PKGDIR?= ${.CURDIR} 591PKGDIR?= ${.CURDIR}
589 592
590_PKGSRC_DEPS?= # empty 593_PKGSRC_DEPS?= # empty
591 594
592# If WRKOBJDIR is set, use that tree to build 595# If WRKOBJDIR is set, use that tree to build
593.if defined(WRKOBJDIR) 596.if defined(WRKOBJDIR)
594BUILD_DIR?= ${WRKOBJDIR}/${PKGPATH} 597BUILD_DIR?= ${WRKOBJDIR}/${PKGPATH}
595.else 598.else
596BUILD_DIR!= cd ${.CURDIR} && ${PWD_CMD} 599BUILD_DIR!= cd ${.CURDIR} && ${PWD_CMD}
597.endif 600.endif
598 601
599# If OBJHOSTNAME is set, use first component of hostname in directory name. 602# If OBJHOSTNAME is set, use first component of hostname in directory name.
600# If OBJMACHINE is set, use ${MACHINE_ARCH} in the working directory name. 603# If OBJMACHINE is set, use ${MACHINE_ARCH} in the working directory name.
601# 604#
602.if defined(OBJHOSTNAME) 605.if defined(OBJHOSTNAME)
603. if !defined(_HOSTNAME) 606. if !defined(_HOSTNAME)
604_HOSTNAME!= ${UNAME} -n 607_HOSTNAME!= ${UNAME} -n
605MAKEFLAGS+= _HOSTNAME=${_HOSTNAME:Q} 608MAKEFLAGS+= _HOSTNAME=${_HOSTNAME:Q}
606. endif 609. endif
607WRKDIR_BASENAME?= work.${_HOSTNAME:C|\..*||} 610WRKDIR_BASENAME?= work.${_HOSTNAME:C|\..*||}
608MAKEFLAGS+= OBJHOSTNAME=${OBJHOSTNAME:Q} 611MAKEFLAGS+= OBJHOSTNAME=${OBJHOSTNAME:Q}
609.elif defined(OBJMACHINE) 612.elif defined(OBJMACHINE)
610WRKDIR_BASENAME?= work.${MACHINE_ARCH} 613WRKDIR_BASENAME?= work.${MACHINE_ARCH}
611MAKEFLAGS+= OBJMACHINE=${OBJMACHINE:Q} 614MAKEFLAGS+= OBJMACHINE=${OBJMACHINE:Q}
612.else 615.else
613WRKDIR_BASENAME?= work 616WRKDIR_BASENAME?= work
614.endif 617.endif
615 618
616WRKDIR?= ${BUILD_DIR}/${WRKDIR_BASENAME} 619WRKDIR?= ${BUILD_DIR}/${WRKDIR_BASENAME}
617 620
618# There are many uses for a common log file, so define one that may be 621# There are many uses for a common log file, so define one that may be
619# picked up and used by tools.mk, bsd.buildlink3.mk, etc. 622# picked up and used by tools.mk, bsd.buildlink3.mk, etc.
620# 623#
621WRKLOG?= ${WRKDIR}/.work.log 624WRKLOG?= ${WRKDIR}/.work.log
622 625
623PKG_DEFAULT_OPTIONS?= # empty 626PKG_DEFAULT_OPTIONS?= # empty
624PKG_OPTIONS?= # empty 627PKG_OPTIONS?= # empty
625 628
626# we want this *before* compiler.mk, so that compiler.mk paths override them 629# we want this *before* compiler.mk, so that compiler.mk paths override them
627.if ${X11_TYPE} != "modular" && defined(USE_X11) 630.if ${X11_TYPE} != "modular" && defined(USE_X11)
628PREPEND_PATH+= ${X11BASE}/bin 631PREPEND_PATH+= ${X11BASE}/bin
629.endif 632.endif
630PREPEND_PATH+= ${LOCALBASE}/bin 633PREPEND_PATH+= ${LOCALBASE}/bin
631 634
632# Wrapper framework definitions 635# Wrapper framework definitions
633.include "wrapper/wrapper-defs.mk" 636.include "wrapper/wrapper-defs.mk"
634 637
635# Binary emulator framework definitions 638# Binary emulator framework definitions
636.if defined(EMUL_PLATFORMS) && !empty(EMUL_PLATFORMS) 639.if defined(EMUL_PLATFORMS) && !empty(EMUL_PLATFORMS)
637. include "emulator/emulator-vars.mk" 640. include "emulator/emulator-vars.mk"
638.endif 641.endif
639 642
640# System features framework 643# System features framework
641.include "features/features-vars.mk" 644.include "features/features-vars.mk"
642 645
643# Package system flavor definitions 646# Package system flavor definitions
644.include "flavor/bsd.flavor-vars.mk" 647.include "flavor/bsd.flavor-vars.mk"
645 648
646# Make variable definitions cache 649# Make variable definitions cache
647.include "bsd.makevars.mk" 650.include "bsd.makevars.mk"
648 651
649# If MAKECONF is defined, then pass it down to all recursive make 652# If MAKECONF is defined, then pass it down to all recursive make
650# processes invoked by pkgsrc. 653# processes invoked by pkgsrc.
651# 654#
652PKGSRC_MAKE_ENV+= ${MAKECONF:DMAKECONF=${MAKECONF:Q}} 655PKGSRC_MAKE_ENV+= ${MAKECONF:DMAKECONF=${MAKECONF:Q}}
653RECURSIVE_MAKE= ${SETENV} ${PKGSRC_MAKE_ENV} ${MAKE} 656RECURSIVE_MAKE= ${SETENV} ${PKGSRC_MAKE_ENV} ${MAKE}
654 657
655_VARGROUPS+= dirs 658_VARGROUPS+= dirs
656_USER_VARS.dirs= DISTDIR LOCALBASE PACKAGES PKG_SYSCONFDIR WRKOBJDIR 659_USER_VARS.dirs= DISTDIR LOCALBASE PACKAGES PKG_SYSCONFDIR WRKOBJDIR
657_PKG_VARS.dirs= WRKSRC PATCHDIR FILESDIR PKGDIR 660_PKG_VARS.dirs= WRKSRC PATCHDIR FILESDIR PKGDIR
658_SYS_VARS.dirs= WRKDIR DESTDIR PKG_SYSCONFBASEDIR 661_SYS_VARS.dirs= WRKDIR DESTDIR PKG_SYSCONFBASEDIR
659 662
660.endif # BSD_PKG_MK 663.endif # BSD_PKG_MK

cvs diff -r1.1 -r1.2 pkgsrc/mk/help/destdir.help (switch to unified diff)

--- pkgsrc/mk/help/destdir.help 2008/01/19 22:41:47 1.1
+++ pkgsrc/mk/help/destdir.help 2008/06/16 15:10:48 1.2
@@ -1,47 +1,50 @@ @@ -1,47 +1,50 @@
1# $NetBSD: destdir.help,v 1.1 2008/01/19 22:41:47 rillig Exp $ 1# $NetBSD: destdir.help,v 1.2 2008/06/16 15:10:48 joerg Exp $
2# 2#
3# === 3# ===
4# Warning: This file is still under construction. Don't rely on it. 4# Warning: This file is still under construction. Don't rely on it.
5# === 5# ===
6# 6#
7# This file documents the variables around the DESTDIR support. 7# This file documents the variables around the DESTDIR support.
8# 8#
9# Normally, packages are installed directly into LOCALBASE and may 9# Normally, packages are installed directly into LOCALBASE and may
10# overwrite files of other packages there. It also makes it easy to 10# overwrite files of other packages there. It also makes it easy to
11# create packages which behave differently depending on whether they 11# create packages which behave differently depending on whether they
12# are installed from source or from a binary package. This is not good. 12# are installed from source or from a binary package. This is not good.
13# 13#
14# The DESTDIR support tries to prevent some of these problems. When it 14# The DESTDIR support tries to prevent some of these problems. When it
15# is enabled, packages are not installed directly into LOCALBASE. 15# is enabled, packages are not installed directly into LOCALBASE.
16# Instead, they are installed in a temporary directory, and a binary 16# Instead, they are installed in a temporary directory, and a binary
17# package is created from the files that have been installed there. 17# package is created from the files that have been installed there.
18# 18#
19# === User-settable variables === 19# === User-settable variables ===
20# 20#
21# USE_DESTDIR 21# USE_DESTDIR
22# * "yes" to enable DESTDIR support for those packages that 22# * "yes" to enable DESTDIR support for those packages that
23# explicitly support it. 23# explicitly support it.
24# 24#
25# * "full": This makes the build completely unprivileged and in 25# * "full": This makes the build completely unprivileged and in
26# turn detects any attempt to write e.g. to ${LOCALBASE}. 26# turn detects any attempt to write e.g. to ${LOCALBASE}.
27# This is not supported for actual installation yet, due to 27# This is not supported for actual installation yet, due to
28# short comings of pkg_create. [FIXME] 28# short comings of pkg_create. [FIXME]
29# 29#
30# === Package-settable variables === 30# === Package-settable variables ===
31# 31#
32# PKG_DESTDIR_SUPPORT 32# PKG_DESTDIR_SUPPORT
33# * "user-destdir" means that all files of the packages should be 33# * "user-destdir" means that all files of the packages should be
34# installed with default ownership and permissions. 34# installed with default ownership and permissions.
35# 35#
36# * "destdir" means that some of the installed files need special 36# * "destdir" means that some of the installed files need special
37# ownership or permissions. The installation is done by the 37# ownership or permissions. The installation is done by the
38# privileged user. 38# privileged user.
39# 39#
 40# This variable must be set before including bsd.prefs.mk directly or
 41# indirectly.
 42#
40# === Implementation notes === 43# === Implementation notes ===
41# 44#
42# In the "install" phase, the variable DESTDIR is set in the make(1) 45# In the "install" phase, the variable DESTDIR is set in the make(1)
43# environment of the default "do-install" target. Additionally, the 46# environment of the default "do-install" target. Additionally, the
44# variable is passed in the INSTALL_MAKE_FLAGS to override potential 47# variable is passed in the INSTALL_MAKE_FLAGS to override potential
45# "DESTDIR=" entries in the Makefiles. 48# "DESTDIR=" entries in the Makefiles.
46# 49#
47# Keywords: destdir 50# Keywords: destdir