Thu Dec 3 13:45:11 2009 UTC ()
Put ${MKXORG} back to MKVARS.  It doesn't exist in bsd.own.mk but used here
to generate th set list keywork "xorg" in list_set_files().  Hopefully fix
some of reported build failures.


(uebayasi)
diff -r1.101 -r1.102 src/distrib/sets/sets.subr

cvs diff -r1.101 -r1.102 src/distrib/sets/sets.subr (switch to unified diff)

--- src/distrib/sets/sets.subr 2009/12/02 17:56:14 1.101
+++ src/distrib/sets/sets.subr 2009/12/03 13:45:11 1.102
@@ -1,547 +1,548 @@ @@ -1,547 +1,548 @@
1# $NetBSD: sets.subr,v 1.101 2009/12/02 17:56:14 uebayasi Exp $ 1# $NetBSD: sets.subr,v 1.102 2009/12/03 13:45:11 uebayasi Exp $
2# 2#
3 3
4# 4#
5# The following variables contain defaults for sets.subr functions and callers: 5# The following variables contain defaults for sets.subr functions and callers:
6# setsdir path to src/distrib/sets 6# setsdir path to src/distrib/sets
7# nlists list of base sets 7# nlists list of base sets
8# xlists list of x11 sets 8# xlists list of x11 sets
9# extlists list of extsrc sets 9# extlists list of extsrc sets
10# obsolete controls if obsolete files are selected instead 10# obsolete controls if obsolete files are selected instead
11# module if != "no", enable MODULE sets 11# module if != "no", enable MODULE sets
12# shlib shared library format (a.out, elf, or "") 12# shlib shared library format (a.out, elf, or "")
13# stlib static library format (a.out, elf) 13# stlib static library format (a.out, elf)
14# 14#
15# The following <bsd.own.mk> variables are exported to the environment: 15# The following <bsd.own.mk> variables are exported to the environment:
16# MACHINE  16# MACHINE
17# MACHINE_ARCH 17# MACHINE_ARCH
18# MACHINE_CPU 18# MACHINE_CPU
19# HAVE_BINUTILS 19# HAVE_BINUTILS
20# HAVE_GCC 20# HAVE_GCC
21# HAVE_GDB 21# HAVE_GDB
22# TOOLCHAIN_MISSING 22# TOOLCHAIN_MISSING
23# OBJECT_FMT 23# OBJECT_FMT
24# as well as: 24# as well as:
25# 25#
26 26
27# XXX don't hardcode 27# XXX don't hardcode
28MKEXTRAVARS="\ 28MKEXTRAVARS="\
29 EXTSRCS \ 29 EXTSRCS \
30 MKBFD \ 30 MKBFD \
31 MKCOMPAT \ 31 MKCOMPAT \
32 MKDYNAMICROOT \ 32 MKDYNAMICROOT \
33 MKMANPAGES \ 33 MKMANPAGES \
 34 MKXORG \
34 USE_INET6 \ 35 USE_INET6 \
35 USE_KERBEROS \ 36 USE_KERBEROS \
36 USE_LDAP \ 37 USE_LDAP \
37 USE_YP \ 38 USE_YP \
38 NETBSDSRCDIR \ 39 NETBSDSRCDIR \
39 MAKEVERBOSE \ 40 MAKEVERBOSE \
40" 41"
41# 42#
42# The following variables refer to tools that are used when building sets: 43# The following variables refer to tools that are used when building sets:
43# 44#
44: ${AWK:=awk} 45: ${AWK:=awk}
45: ${CKSUM:=cksum} 46: ${CKSUM:=cksum}
46: ${COMM:=comm} 47: ${COMM:=comm}
47: ${DATE:=date} 48: ${DATE:=date}
48: ${DB:=db} 49: ${DB:=db}
49: ${EGREP:=egrep} 50: ${EGREP:=egrep}
50: ${ENV_CMD:=env} # ${ENV} is special to sh(1), ksh(1), etc. 51: ${ENV_CMD:=env} # ${ENV} is special to sh(1), ksh(1), etc.
51: ${FGREP:=fgrep} 52: ${FGREP:=fgrep}
52: ${FIND:=find} 53: ${FIND:=find}
53: ${GREP:=grep} 54: ${GREP:=grep}
54: ${GZIP_CMD:=gzip} # ${GZIP} is special to gzip(1) 55: ${GZIP_CMD:=gzip} # ${GZIP} is special to gzip(1)
55: ${HOSTNAME_CMD:=hostname} # ${HOSTNAME} is special to bash(1) 56: ${HOSTNAME_CMD:=hostname} # ${HOSTNAME} is special to bash(1)
56: ${HOST_SH:=sh} 57: ${HOST_SH:=sh}
57: ${IDENT:=ident} 58: ${IDENT:=ident}
58: ${JOIN:=join} 59: ${JOIN:=join}
59: ${LS:=ls} 60: ${LS:=ls}
60: ${MAKE:=make} 61: ${MAKE:=make}
61: ${MKTEMP:=mktemp} 62: ${MKTEMP:=mktemp}
62: ${MTREE:=mtree} 63: ${MTREE:=mtree}
63: ${PASTE:=paste} 64: ${PASTE:=paste}
64: ${PAX:=pax} 65: ${PAX:=pax}
65: ${PRINTF:=printf} 66: ${PRINTF:=printf}
66: ${SED:=sed} 67: ${SED:=sed}
67: ${SORT:=sort} 68: ${SORT:=sort}
68: ${STAT:=stat} 69: ${STAT:=stat}
69: ${TSORT:=tsort} 70: ${TSORT:=tsort}
70: ${UNAME:=uname} 71: ${UNAME:=uname}
71: ${WC:=wc} 72: ${WC:=wc}
72 73
73# 74#
74# If printf is a shell builtin command, then we can 75# If printf is a shell builtin command, then we can
75# implement cheaper versions of basename and dirname 76# implement cheaper versions of basename and dirname
76# that do not involve any fork/exec overhead. 77# that do not involve any fork/exec overhead.
77# If printf is not builtin, approximate it using echo, 78# If printf is not builtin, approximate it using echo,
78# and hope there are no weird file names that cause 79# and hope there are no weird file names that cause
79# some versions of echo to do the wrong thing. 80# some versions of echo to do the wrong thing.
80# (Converting to this version of dirname speeded up the 81# (Converting to this version of dirname speeded up the
81# syspkgdeps script by an order of magnitude, from 68 82# syspkgdeps script by an order of magnitude, from 68
82# seconds to 6.3 seconds on one particular host.) 83# seconds to 6.3 seconds on one particular host.)
83# 84#
84# Note that naive approximations for dirname 85# Note that naive approximations for dirname
85# using ${foo%/*} do not do the right thing in cases 86# using ${foo%/*} do not do the right thing in cases
86# where the result should be "/" or ".". 87# where the result should be "/" or ".".
87# 88#
88case "$(type printf)" in 89case "$(type printf)" in
89*builtin*) 90*builtin*)
90 basename () 91 basename ()
91 { 92 {
92 local bn 93 local bn
93 bn="${1##*/}" 94 bn="${1##*/}"
94 bn="${bn%$2}" 95 bn="${bn%$2}"
95 printf "%s\n" "$bn" 96 printf "%s\n" "$bn"
96 } 97 }
97 dirname () 98 dirname ()
98 { 99 {
99 local dn 100 local dn
100 case "$1" in 101 case "$1" in
101 ?*/*) dn="${1%/*}" ;; 102 ?*/*) dn="${1%/*}" ;;
102 /*) dn=/ ;; 103 /*) dn=/ ;;
103 *) dn=. ;; 104 *) dn=. ;;
104 esac 105 esac
105 printf "%s\n" "$dn" 106 printf "%s\n" "$dn"
106 } 107 }
107 ;; 108 ;;
108*) 109*)
109 basename () 110 basename ()
110 { 111 {
111 local bn 112 local bn
112 bn="${1##*/}" 113 bn="${1##*/}"
113 bn="${bn%$2}" 114 bn="${bn%$2}"
114 echo "$bn" 115 echo "$bn"
115 } 116 }
116 dirname () 117 dirname ()
117 { 118 {
118 local dn 119 local dn
119 case "$1" in 120 case "$1" in
120 ?*/*) dn="${1%/*}" ;; 121 ?*/*) dn="${1%/*}" ;;
121 /*) dn=/ ;; 122 /*) dn=/ ;;
122 *) dn=. ;; 123 *) dn=. ;;
123 esac 124 esac
124 echo "$dn" 125 echo "$dn"
125 } 126 }
126 ;; 127 ;;
127esac 128esac
128 129
129oIFS=$IFS 130oIFS=$IFS
130IFS=" 131IFS="
131" 132"
132 133
133for x in $( 134for x in $(
134 ${MAKE} -B -f- all <<EOMAKE 135 ${MAKE} -B -f- all <<EOMAKE
135.include <bsd.own.mk> 136.include <bsd.own.mk>
136all: 137all:
137 @echo "export _MKVARS_yes=\"\${_MKVARS.yes}\"" 138 @echo "export _MKVARS_yes=\"\${_MKVARS.yes}\""
138 @echo "export _MKVARS_no=\"\${_MKVARS.no}\"" 139 @echo "export _MKVARS_no=\"\${_MKVARS.no}\""
139 140
140EOMAKE 141EOMAKE
141); do 142); do
142 eval $x 143 eval $x
143done 144done
144 145
145for x in $( 146for x in $(
146${MAKE} -B -f- all <<EOMAKE 147${MAKE} -B -f- all <<EOMAKE
147.include <bsd.own.mk> 148.include <bsd.own.mk>
148.if (\${MKMAN} == "no" || empty(MANINSTALL:Mmaninstall)) 149.if (\${MKMAN} == "no" || empty(MANINSTALL:Mmaninstall))
149MKMANPAGES=no 150MKMANPAGES=no
150.else 151.else
151MKMANPAGES=yes 152MKMANPAGES=yes
152.endif 153.endif
153.if \${MKX11} != "no" 154.if \${MKX11} != "no"
154. if \${X11FLAVOUR} == "Xorg" 155. if \${X11FLAVOUR} == "Xorg"
155MKXORG:=yes 156MKXORG:=yes
156MKX11:=no 157MKX11:=no
157. else 158. else
158MKXORG:=no 159MKXORG:=no
159. endif 160. endif
160.endif 161.endif
161all: 162all:
162.for i in MACHINE MACHINE_ARCH MACHINE_CPU \ 163.for i in MACHINE MACHINE_ARCH MACHINE_CPU \
163 HAVE_BINUTILS HAVE_GCC HAVE_GDB OBJECT_FMT TOOLCHAIN_MISSING \ 164 HAVE_BINUTILS HAVE_GCC HAVE_GDB OBJECT_FMT TOOLCHAIN_MISSING \
164 ${MKEXTRAVARS} ${_MKVARS_yes} ${_MKVARS_no} 165 ${MKEXTRAVARS} ${_MKVARS_yes} ${_MKVARS_no}
165 @echo "export \$i=\"\${\$i}\"" 166 @echo "export \$i=\"\${\$i}\""
166.endfor 167.endfor
167 168
168EOMAKE 169EOMAKE
169); do 170); do
170# echo 1>&2 "DEBUG: read $x" 171# echo 1>&2 "DEBUG: read $x"
171 eval $x 172 eval $x
172done 173done
173 174
174IFS=$oIFS 175IFS=$oIFS
175 176
176MKVARS="$MKEXTRAVARS $_MKVARS_yes $_MKVARS_no" 177MKVARS="$MKEXTRAVARS $_MKVARS_yes $_MKVARS_no"
177 178
178setsdir=${0%/*} 179setsdir=${0%/*}
179obsolete=0 180obsolete=0
180module=yes 181module=yes
181if [ "${MKKMOD}" = "no" ]; then 182if [ "${MKKMOD}" = "no" ]; then
182 module=no # MODULEs are off. 183 module=no # MODULEs are off.
183elif [ "${MACHINE}" = "evbppc" ]; then 184elif [ "${MACHINE}" = "evbppc" ]; then
184 module=no # Turn off MODULEs for some ports. 185 module=no # Turn off MODULEs for some ports.
185fi 186fi
186# Determine lib type. Do this first so stlib also gets set. 187# Determine lib type. Do this first so stlib also gets set.
187if [ "${OBJECT_FMT}" = "ELF" ]; then 188if [ "${OBJECT_FMT}" = "ELF" ]; then
188 shlib=elf 189 shlib=elf
189else 190else
190 shlib=aout 191 shlib=aout
191fi 192fi
192stlib=$shlib 193stlib=$shlib
193# Now check for MKPIC or specials and turn off shlib if need be. 194# Now check for MKPIC or specials and turn off shlib if need be.
194if [ "${MKPIC}" = "no" ]; then 195if [ "${MKPIC}" = "no" ]; then
195 shlib=no 196 shlib=no
196fi 197fi
197if [ "${MACHINE_ARCH}" = "m68000" ]; then 198if [ "${MACHINE_ARCH}" = "m68000" ]; then
198 shlib=no # Turn off shlibs for some ports. 199 shlib=no # Turn off shlibs for some ports.
199fi 200fi
200if [ "$module" != "no" ]; then 201if [ "$module" != "no" ]; then
201 nlists="base comp etc games man misc modules tests text" 202 nlists="base comp etc games man misc modules tests text"
202else 203else
203 nlists="base comp etc games man misc tests text" 204 nlists="base comp etc games man misc tests text"
204fi 205fi
205xlists="xbase xcomp xetc xfont xserver" 206xlists="xbase xcomp xetc xfont xserver"
206extlists="extbase extcomp extetc" 207extlists="extbase extcomp extetc"
207 208
208OSRELEASE=`${HOST_SH} ${NETBSDSRCDIR}/sys/conf/osrelease.sh` 209OSRELEASE=`${HOST_SH} ${NETBSDSRCDIR}/sys/conf/osrelease.sh`
209MODULEDIR="stand/${MACHINE}/${OSRELEASE}/modules" 210MODULEDIR="stand/${MACHINE}/${OSRELEASE}/modules"
210SUBST="s#@MODULEDIR@#${MODULEDIR}#g" 211SUBST="s#@MODULEDIR@#${MODULEDIR}#g"
211SUBST="${SUBST};s#@OSRELEASE@#${OSRELEASE}#g" 212SUBST="${SUBST};s#@OSRELEASE@#${OSRELEASE}#g"
212SUBST="${SUBST};s#@MACHINE@#${MACHINE}#g" 213SUBST="${SUBST};s#@MACHINE@#${MACHINE}#g"
213 214
214# 215#
215# list_set_files setfile [...] 216# list_set_files setfile [...]
216#  217#
217# Produce a packing list for setfile(s). 218# Produce a packing list for setfile(s).
218# In each file, a record consists of a path and a System Package name, 219# In each file, a record consists of a path and a System Package name,
219# separated by whitespace. E.g., 220# separated by whitespace. E.g.,
220# 221#
221# # $NetBSD: sets.subr,v 1.101 2009/12/02 17:56:14 uebayasi Exp $ 222# # $NetBSD: sets.subr,v 1.102 2009/12/03 13:45:11 uebayasi Exp $
222# . base-sys-root [keyword[,...]] 223# . base-sys-root [keyword[,...]]
223# ./altroot base-sys-root 224# ./altroot base-sys-root
224# ./bin base-sys-root 225# ./bin base-sys-root
225# ./bin/[ base-util-root 226# ./bin/[ base-util-root
226# ./bin/cat base-util-root 227# ./bin/cat base-util-root
227# [...] 228# [...]
228# 229#
229# A # in the first column marks a comment. 230# A # in the first column marks a comment.
230# 231#
231# If ${obsolete} != 0, only entries with an "obsolete" keyword will 232# If ${obsolete} != 0, only entries with an "obsolete" keyword will
232# be printed. All other keywords must be present. 233# be printed. All other keywords must be present.
233# 234#
234# The third field is an optional comma separated list of keywords to 235# The third field is an optional comma separated list of keywords to
235# control if a record is printed; every keyword listed must be enabled 236# control if a record is printed; every keyword listed must be enabled
236# for the record to be printed. The following keywords are available: 237# for the record to be printed. The following keywords are available:
237# dummy dummy entry (ignored) 238# dummy dummy entry (ignored)
238# obsolete file is obsolete, and only printed if  239# obsolete file is obsolete, and only printed if
239# ${obsolete} != 0 240# ${obsolete} != 0
240# 241#
241# bfd obsolete, use binutils. 242# bfd obsolete, use binutils.
242# binutils ${MKBINUTILS} != no 243# binutils ${MKBINUTILS} != no
243# catpages ${MKCATPAGES} != no 244# catpages ${MKCATPAGES} != no
244# compat ${MKCOMPAT} != no 245# compat ${MKCOMPAT} != no
245# crypto ${MKCRYPTO} != no 246# crypto ${MKCRYPTO} != no
246# crypto_idea ${MKCRYPTO_IDEA} != no 247# crypto_idea ${MKCRYPTO_IDEA} != no
247# crypto_mdc2 ${MKCRYPTO_MDC2} != no 248# crypto_mdc2 ${MKCRYPTO_MDC2} != no
248# crypto_rc5 ${MKCRYPTO_RC5} != no 249# crypto_rc5 ${MKCRYPTO_RC5} != no
249# cvs ${MKCVS} != no 250# cvs ${MKCVS} != no
250# debug ${MKDEBUG} != no 251# debug ${MKDEBUG} != no
251# debuglib ${MKDEBUGLIB} != no 252# debuglib ${MKDEBUGLIB} != no
252# doc ${MKDOC} != no 253# doc ${MKDOC} != no
253# dynamicroot ${MKDYNAMICROOT} != no 254# dynamicroot ${MKDYNAMICROOT} != no
254# extsrc ${MKEXTSRC} != no 255# extsrc ${MKEXTSRC} != no
255# gcc ${MKGCC} != no 256# gcc ${MKGCC} != no
256# gcccmds ${MKGCCCMDS} != no 257# gcccmds ${MKGCCCMDS} != no
257# gdb ${MKGDB} != no 258# gdb ${MKGDB} != no
258# hesiod ${MKHESIOD} != no 259# hesiod ${MKHESIOD} != no
259# html ${MKHTML} != no 260# html ${MKHTML} != no
260# inet6 ${MKINET6} != no 261# inet6 ${MKINET6} != no
261# info ${MKINFO} != no 262# info ${MKINFO} != no
262# ipfilter ${MKIPFILTER} != no 263# ipfilter ${MKIPFILTER} != no
263# iscsi ${MKISCSI} != no 264# iscsi ${MKISCSI} != no
264# kerberos ${MKKERBEROS} != no 265# kerberos ${MKKERBEROS} != no
265# kmod ${MKKMOD} != no 266# kmod ${MKKMOD} != no
266# ldap ${MKLDAP} != no 267# ldap ${MKLDAP} != no
267# lint ${MKLINT} != no 268# lint ${MKLINT} != no
268# lvm ${MKLVM} != no 269# lvm ${MKLVM} != no
269# man ${MKMAN} != no 270# man ${MKMAN} != no
270# manpages ${MKMANPAGES} != no 271# manpages ${MKMANPAGES} != no
271# manz ${MKMANZ} != no 272# manz ${MKMANZ} != no
272# mdns ${MKMDNS} != no 273# mdns ${MKMDNS} != no
273# nls ${MKNLS} != no 274# nls ${MKNLS} != no
274# nvi ${MKNVI} != no 275# nvi ${MKNVI} != no
275# pam ${MKPAM} != no 276# pam ${MKPAM} != no
276# pf ${MKPF} != no 277# pf ${MKPF} != no
277# pic ${MKPIC} != no 278# pic ${MKPIC} != no
278# postfix ${MKPOSTFIX} != no 279# postfix ${MKPOSTFIX} != no
279# profile ${MKPROFILE} != no 280# profile ${MKPROFILE} != no
280# share ${MKSHARE} != no 281# share ${MKSHARE} != no
281# skey ${MKSKEY} != no 282# skey ${MKSKEY} != no
282# x11 ${MKX11} != no && ${X11FLAVOUR} != "Xorg" 283# x11 ${MKX11} != no && ${X11FLAVOUR} != "Xorg"
283# xorg ${MKX11} != no && ${X11FLAVOUR} == "Xorg" 284# xorg ${MKX11} != no && ${X11FLAVOUR} == "Xorg"
284# yp ${MKYP} != no 285# yp ${MKYP} != no
285# zfs ${MKZFS} != no 286# zfs ${MKZFS} != no
286# 287#
287# binutils=<n> <n> = value of ${HAVE_BINUTILS} 288# binutils=<n> <n> = value of ${HAVE_BINUTILS}
288# gcc=<n> <n> = value of ${HAVE_GCC} 289# gcc=<n> <n> = value of ${HAVE_GCC}
289# gdb=<n> <n> = value of ${HAVE_GDB} 290# gdb=<n> <n> = value of ${HAVE_GDB}
290# 291#
291# use_inet6 ${USE_INET6} != no 292# use_inet6 ${USE_INET6} != no
292# use_kerberos ${USE_KERBEROS} != no 293# use_kerberos ${USE_KERBEROS} != no
293# use_yp ${USE_YP} != no 294# use_yp ${USE_YP} != no
294# 295#
295# .cat if ${MKMANZ} != "no" && ${MKCATPAGES} != "no" 296# .cat if ${MKMANZ} != "no" && ${MKCATPAGES} != "no"
296# automatically append ".gz" to the filename 297# automatically append ".gz" to the filename
297# 298#
298# .man if ${MKMANZ} != "no" && ${MKMAN} != "no" 299# .man if ${MKMANZ} != "no" && ${MKMAN} != "no"
299# automatically append ".gz" to the filename 300# automatically append ".gz" to the filename
300# 301#
301list_set_files() 302list_set_files()
302{ 303{
303 if [ ${MAKEVERBOSE:-2} -lt 3 ]; then 304 if [ ${MAKEVERBOSE:-2} -lt 3 ]; then
304 verbose=false 305 verbose=false
305 else 306 else
306 verbose=true 307 verbose=true
307 fi 308 fi
308 for setname; do 309 for setname; do
309 list=`list_set_lists $setname` 310 list=`list_set_lists $setname`
310 for l in $list; do 311 for l in $list; do
311 echo $l 312 echo $l
312 if $verbose; then 313 if $verbose; then
313 echo >&2 "DEBUG: list_set_files: $l" 314 echo >&2 "DEBUG: list_set_files: $l"
314 fi 315 fi
315 done 316 done
316 done | xargs cat | ${SED} ${SUBST} | \ 317 done | xargs cat | ${SED} ${SUBST} | \
317 ${AWK} -v obsolete=${obsolete} ' 318 ${AWK} -v obsolete=${obsolete} '
318 BEGIN { 319 BEGIN {
319 if (obsolete) 320 if (obsolete)
320 wanted["obsolete"] = 1 321 wanted["obsolete"] = 1
321  322
322 split("'"${MKVARS}"'", needvars) 323 split("'"${MKVARS}"'", needvars)
323 for (vi in needvars) { 324 for (vi in needvars) {
324 nv = needvars[vi] 325 nv = needvars[vi]
325 kw = tolower(nv) 326 kw = tolower(nv)
326 sub(/^mk/, "", kw) 327 sub(/^mk/, "", kw)
327 if (ENVIRON[nv] != "no") 328 if (ENVIRON[nv] != "no")
328 wanted[kw] = 1  329 wanted[kw] = 1
329 } 330 }
330 331
331 if ("'"${TOOLCHAIN_MISSING}"'" != "yes") { 332 if ("'"${TOOLCHAIN_MISSING}"'" != "yes") {
332 if ("binutils" in wanted) 333 if ("binutils" in wanted)
333 wanted["binutils=" "'"${HAVE_BINUTILS}"'"] = 1 334 wanted["binutils=" "'"${HAVE_BINUTILS}"'"] = 1
334 if ("gcc" in wanted) 335 if ("gcc" in wanted)
335 wanted["gcc=" "'"${HAVE_GCC}"'"] = 1 336 wanted["gcc=" "'"${HAVE_GCC}"'"] = 1
336 if ("gdb" in wanted) 337 if ("gdb" in wanted)
337 wanted["gdb=" "'"${HAVE_GDB}"'"] = 1 338 wanted["gdb=" "'"${HAVE_GDB}"'"] = 1
338 } 339 }
339 if (("man" in wanted) && ("catpages" in wanted)) 340 if (("man" in wanted) && ("catpages" in wanted))
340 wanted[".cat"] = 1 341 wanted[".cat"] = 1
341 if (("man" in wanted) && ("manpages" in wanted)) 342 if (("man" in wanted) && ("manpages" in wanted))
342 wanted[".man"] = 1 343 wanted[".man"] = 1
343 } 344 }
344 345
345 /^#/ { 346 /^#/ {
346 next; 347 next;
347 } 348 }
348 349
349 NF > 2 && $3 != "-" { 350 NF > 2 && $3 != "-" {
350 split($3, keywords, ",") 351 split($3, keywords, ",")
351 show = 1 352 show = 1
352 haveobs = 0 353 haveobs = 0
353 for (ki in keywords) { 354 for (ki in keywords) {
354 kw = keywords[ki] 355 kw = keywords[ki]
355 if (("manz" in wanted) && 356 if (("manz" in wanted) &&
356 (kw == ".cat" || kw == ".man")) 357 (kw == ".cat" || kw == ".man"))
357 $1 = $1 ".gz" 358 $1 = $1 ".gz"
358 negated = match(kw, "! *") 359 negated = match(kw, "! *")
359 if (negated > 0) { 360 if (negated > 0) {
360 kw = substr(kw, RSTART + RLENGTH) 361 kw = substr(kw, RSTART + RLENGTH)
361 if (kw in wanted) 362 if (kw in wanted)
362 show = 0 363 show = 0
363 } else { 364 } else {
364 if (! (kw in wanted)) 365 if (! (kw in wanted))
365 show = 0 366 show = 0
366 } 367 }
367 if (kw == "obsolete") 368 if (kw == "obsolete")
368 haveobs = 1 369 haveobs = 1
369 } 370 }
370 if (obsolete && ! haveobs) 371 if (obsolete && ! haveobs)
371 next 372 next
372 if (show) 373 if (show)
373 print 374 print
374 next 375 next
375 } 376 }
376 377
377 { 378 {
378 if (! obsolete) 379 if (! obsolete)
379 print 380 print
380 }' 381 }'
381 382
382} 383}
383 384
384# 385#
385# list_set_lists setname 386# list_set_lists setname
386#  387#
387# Print to stdout a list of files, one filename per line, which 388# Print to stdout a list of files, one filename per line, which
388# concatenate to create the packing list for setname. E.g., 389# concatenate to create the packing list for setname. E.g.,
389# 390#
390# .../lists/base/mi 391# .../lists/base/mi
391# .../lists/base/rescue.mi 392# .../lists/base/rescue.mi
392# .../lists/base/md.i386 393# .../lists/base/md.i386
393# [...] 394# [...]
394# 395#
395# For a given setname $set, the following files may be selected from 396# For a given setname $set, the following files may be selected from
396# .../list/$set: 397# .../list/$set:
397# mi 398# mi
398# mi.ext.* 399# mi.ext.*
399# ad.${MACHINE_ARCH} 400# ad.${MACHINE_ARCH}
400# (or) ad.${MACHINE_CPU} 401# (or) ad.${MACHINE_CPU}
401# ad.${MACHINE_CPU}.shl 402# ad.${MACHINE_CPU}.shl
402# md.${MACHINE}.${MACHINE_ARCH} 403# md.${MACHINE}.${MACHINE_ARCH}
403# (or) md.${MACHINE} 404# (or) md.${MACHINE}
404# stl.mi 405# stl.mi
405# stl.${stlib} 406# stl.${stlib}
406# shl.mi 407# shl.mi
407# shl.mi.ext.* 408# shl.mi.ext.*
408# shl.${shlib} 409# shl.${shlib}
409# shl.${shlib}.ext.* 410# shl.${shlib}.ext.*
410# module.mi if ${module} != no 411# module.mi if ${module} != no
411# module.${MACHINE} if ${module} != no 412# module.${MACHINE} if ${module} != no
412# module.ad.${MACHINE_ARCH} if ${module} != no 413# module.ad.${MACHINE_ARCH} if ${module} != no
413# (or) module.ad.${MACHINE_CPU} if ${module} != no 414# (or) module.ad.${MACHINE_CPU} if ${module} != no
414# rescue.shl 415# rescue.shl
415# rescue.${MACHINE} 416# rescue.${MACHINE}
416# rescue.ad.${MACHINE_ARCH} 417# rescue.ad.${MACHINE_ARCH}
417# (or) rescue.ad.${MACHINE_CPU} 418# (or) rescue.ad.${MACHINE_CPU}
418# rescue.ad.${MACHINE_CPU}.shl 419# rescue.ad.${MACHINE_CPU}.shl
419# 420#
420# Environment: 421# Environment:
421# shlib 422# shlib
422# stlib 423# stlib
423# 424#
424list_set_lists() 425list_set_lists()
425{ 426{
426 setname=$1 427 setname=$1
427 428
428 setdir=$setsdir/lists/$setname 429 setdir=$setsdir/lists/$setname
429 echo $setdir/mi 430 echo $setdir/mi
430 for _extsrc_pkg in ${EXTSRCS}; do 431 for _extsrc_pkg in ${EXTSRCS}; do
431 if [ -f $setdir/mi.ext.${_extsrc_pkg} ]; then 432 if [ -f $setdir/mi.ext.${_extsrc_pkg} ]; then
432 echo $setdir/mi.ext.${_extsrc_pkg} 433 echo $setdir/mi.ext.${_extsrc_pkg}
433 fi 434 fi
434 done 435 done
435 if [ "${MACHINE}" != "${MACHINE_ARCH}" ]; then 436 if [ "${MACHINE}" != "${MACHINE_ARCH}" ]; then
436 # Prefer an ad.${MACHINE_ARCH} over an ad.${MACHINE_CPU}, 437 # Prefer an ad.${MACHINE_ARCH} over an ad.${MACHINE_CPU},
437 # since the arch-specific one will be more specific than 438 # since the arch-specific one will be more specific than
438 # the cpu-specific one. 439 # the cpu-specific one.
439 if [ -f $setdir/ad.${MACHINE_ARCH} ]; then 440 if [ -f $setdir/ad.${MACHINE_ARCH} ]; then
440 echo $setdir/ad.${MACHINE_ARCH} 441 echo $setdir/ad.${MACHINE_ARCH}
441 elif [ -f $setdir/ad.${MACHINE_CPU} ]; then 442 elif [ -f $setdir/ad.${MACHINE_CPU} ]; then
442 echo $setdir/ad.${MACHINE_CPU} 443 echo $setdir/ad.${MACHINE_CPU}
443 fi 444 fi
444 if [ "$shlib" != "no" -a \ 445 if [ "$shlib" != "no" -a \
445 -f $setdir/ad.${MACHINE_CPU}.shl ]; then 446 -f $setdir/ad.${MACHINE_CPU}.shl ]; then
446 echo $setdir/ad.${MACHINE_CPU}.shl 447 echo $setdir/ad.${MACHINE_CPU}.shl
447 fi 448 fi
448 fi 449 fi
449 if [ -f $setdir/md.${MACHINE}.${MACHINE_ARCH} ]; then 450 if [ -f $setdir/md.${MACHINE}.${MACHINE_ARCH} ]; then
450 echo $setdir/md.${MACHINE}.${MACHINE_ARCH} 451 echo $setdir/md.${MACHINE}.${MACHINE_ARCH}
451 elif [ -f $setdir/md.${MACHINE} ]; then 452 elif [ -f $setdir/md.${MACHINE} ]; then
452 echo $setdir/md.${MACHINE} 453 echo $setdir/md.${MACHINE}
453 fi 454 fi
454 if [ -f $setdir/stl.mi ]; then 455 if [ -f $setdir/stl.mi ]; then
455 echo $setdir/stl.mi 456 echo $setdir/stl.mi
456 fi 457 fi
457 if [ -f $setdir/stl.${stlib} ]; then 458 if [ -f $setdir/stl.${stlib} ]; then
458 echo $setdir/stl.${stlib} 459 echo $setdir/stl.${stlib}
459 fi 460 fi
460 if [ "$shlib" != "no" ]; then 461 if [ "$shlib" != "no" ]; then
461 if [ -f $setdir/shl.mi ]; then 462 if [ -f $setdir/shl.mi ]; then
462 echo $setdir/shl.mi 463 echo $setdir/shl.mi
463 fi 464 fi
464 for _extsrc_pkg in ${EXTSRCS}; do 465 for _extsrc_pkg in ${EXTSRCS}; do
465 if [ -f $setdir/shl.mi.ext.${_extsrc_pkg} ]; then 466 if [ -f $setdir/shl.mi.ext.${_extsrc_pkg} ]; then
466 echo $setdir/shl.mi.ext.${_extsrc_pkg} 467 echo $setdir/shl.mi.ext.${_extsrc_pkg}
467 fi 468 fi
468 done 469 done
469 if [ -f $setdir/shl.${shlib} ]; then 470 if [ -f $setdir/shl.${shlib} ]; then
470 echo $setdir/shl.${shlib} 471 echo $setdir/shl.${shlib}
471 fi 472 fi
472 for _extsrc_pkg in ${EXTSRCS}; do 473 for _extsrc_pkg in ${EXTSRCS}; do
473 if [ -f $setdir/shl.${shlib}.ext.${_extsrc_pkg} ]; then 474 if [ -f $setdir/shl.${shlib}.ext.${_extsrc_pkg} ]; then
474 echo $setdir/shl.${shlib}.ext.${_extsrc_pkg} 475 echo $setdir/shl.${shlib}.ext.${_extsrc_pkg}
475 fi 476 fi
476 done 477 done
477 fi 478 fi
478 if [ "$module" != "no" ]; then 479 if [ "$module" != "no" ]; then
479 if [ -f $setdir/module.mi ]; then 480 if [ -f $setdir/module.mi ]; then
480 echo $setdir/module.mi 481 echo $setdir/module.mi
481 fi 482 fi
482 if [ -f $setdir/module.${MACHINE} ]; then 483 if [ -f $setdir/module.${MACHINE} ]; then
483 echo $setdir/module.${MACHINE} 484 echo $setdir/module.${MACHINE}
484 fi 485 fi
485 if [ "${MACHINE}" != "${MACHINE_ARCH}" ]; then 486 if [ "${MACHINE}" != "${MACHINE_ARCH}" ]; then
486 # Prefer a module.ad.${MACHINE_ARCH} over a 487 # Prefer a module.ad.${MACHINE_ARCH} over a
487 # module.ad.${MACHINE_CPU}, since the arch- 488 # module.ad.${MACHINE_CPU}, since the arch-
488 # specific one will be more specific than the 489 # specific one will be more specific than the
489 # cpu-specific one. 490 # cpu-specific one.
490 if [ -f $setdir/module.ad.${MACHINE_ARCH} ]; then 491 if [ -f $setdir/module.ad.${MACHINE_ARCH} ]; then
491 echo $setdir/module.ad.${MACHINE_ARCH} 492 echo $setdir/module.ad.${MACHINE_ARCH}
492 elif [ -f $setdir/module.ad.${MACHINE_CPU} ]; then 493 elif [ -f $setdir/module.ad.${MACHINE_CPU} ]; then
493 echo $setdir/module.ad.${MACHINE_CPU} 494 echo $setdir/module.ad.${MACHINE_CPU}
494 fi 495 fi
495 fi 496 fi
496 fi 497 fi
497 498
498 if [ -f $setdir/rescue.mi ]; then 499 if [ -f $setdir/rescue.mi ]; then
499 echo $setdir/rescue.mi 500 echo $setdir/rescue.mi
500 fi 501 fi
501 if [ -f $setdir/rescue.${MACHINE} ]; then 502 if [ -f $setdir/rescue.${MACHINE} ]; then
502 echo $setdir/rescue.${MACHINE} 503 echo $setdir/rescue.${MACHINE}
503 fi 504 fi
504 if [ "${MACHINE}" != "${MACHINE_ARCH}" ]; then 505 if [ "${MACHINE}" != "${MACHINE_ARCH}" ]; then
505 # Prefer a rescue.ad.${MACHINE_ARCH} over a 506 # Prefer a rescue.ad.${MACHINE_ARCH} over a
506 # rescue.ad.${MACHINE_CPU}, since the arch- 507 # rescue.ad.${MACHINE_CPU}, since the arch-
507 # specific one will be more specific than the 508 # specific one will be more specific than the
508 # cpu-specific one. 509 # cpu-specific one.
509 if [ -f $setdir/rescue.ad.${MACHINE_ARCH} ]; then 510 if [ -f $setdir/rescue.ad.${MACHINE_ARCH} ]; then
510 echo $setdir/rescue.ad.${MACHINE_ARCH} 511 echo $setdir/rescue.ad.${MACHINE_ARCH}
511 elif [ -f $setdir/rescue.ad.${MACHINE_CPU} ]; then 512 elif [ -f $setdir/rescue.ad.${MACHINE_CPU} ]; then
512 echo $setdir/rescue.ad.${MACHINE_CPU} 513 echo $setdir/rescue.ad.${MACHINE_CPU}
513 fi 514 fi
514 if [ "$shlib" != "no" -a \ 515 if [ "$shlib" != "no" -a \
515 -f $setdir/rescue.ad.${MACHINE_CPU}.shl ]; then 516 -f $setdir/rescue.ad.${MACHINE_CPU}.shl ]; then
516 echo $setdir/rescue.ad.${MACHINE_CPU}.shl 517 echo $setdir/rescue.ad.${MACHINE_CPU}.shl
517 fi 518 fi
518 fi 519 fi
519} 520}
520 521
521# arch_to_cpu mach 522# arch_to_cpu mach
522# 523#
523# Print the ${MACHINE_CPU} for ${MACHINE_ARCH}=mach, 524# Print the ${MACHINE_CPU} for ${MACHINE_ARCH}=mach,
524# as determined by <bsd.own.mk>. 525# as determined by <bsd.own.mk>.
525# 526#
526arch_to_cpu() 527arch_to_cpu()
527{ 528{
528 MACHINE_ARCH=${1} ${MAKE} -B -f- all <<EOMAKE 529 MACHINE_ARCH=${1} ${MAKE} -B -f- all <<EOMAKE
529.include <bsd.own.mk> 530.include <bsd.own.mk>
530all: 531all:
531 @echo \${MACHINE_CPU} 532 @echo \${MACHINE_CPU}
532EOMAKE 533EOMAKE
533} 534}
534 535
535# arch_to_endian mach 536# arch_to_endian mach
536# 537#
537# Print the ${TARGET_ENDIANNESS} for ${MACHINE_ARCH}=mach, 538# Print the ${TARGET_ENDIANNESS} for ${MACHINE_ARCH}=mach,
538# as determined by <bsd.endian.mk>. 539# as determined by <bsd.endian.mk>.
539# 540#
540arch_to_endian() 541arch_to_endian()
541{ 542{
542 MACHINE_ARCH=${1} ${MAKE} -B -f- all <<EOMAKE 543 MACHINE_ARCH=${1} ${MAKE} -B -f- all <<EOMAKE
543.include <bsd.endian.mk> 544.include <bsd.endian.mk>
544all: 545all:
545 @echo \${TARGET_ENDIANNESS} 546 @echo \${TARGET_ENDIANNESS}
546EOMAKE 547EOMAKE
547} 548}