Sat May 11 23:42:45 2013 UTC ()
On Debian/Ubuntu Linux, system's awk is mawk, and mawk does not
understand some regexp like [[:space:]].
ELF shared lib check is not working properly with mawk.


(ryoon)
diff -r1.191 -r1.192 pkgsrc/bootstrap/bootstrap

cvs diff -r1.191 -r1.192 pkgsrc/bootstrap/bootstrap (switch to unified diff)

--- pkgsrc/bootstrap/bootstrap 2013/03/11 22:48:23 1.191
+++ pkgsrc/bootstrap/bootstrap 2013/05/11 23:42:44 1.192
@@ -1,1188 +1,1194 @@ @@ -1,1188 +1,1194 @@
1#! /bin/sh 1#! /bin/sh
2 2
3# $NetBSD: bootstrap,v 1.191 2013/03/11 22:48:23 tcort Exp $ 3# $NetBSD: bootstrap,v 1.192 2013/05/11 23:42:44 ryoon Exp $
4# 4#
5# Copyright (c) 2001-2011 Alistair Crooks <agc@NetBSD.org> 5# Copyright (c) 2001-2011 Alistair Crooks <agc@NetBSD.org>
6# All rights reserved. 6# All rights reserved.
7# 7#
8# Redistribution and use in source and binary forms, with or without 8# Redistribution and use in source and binary forms, with or without
9# modification, are permitted provided that the following conditions 9# modification, are permitted provided that the following conditions
10# are met: 10# are met:
11# 1. Redistributions of source code must retain the above copyright 11# 1. Redistributions of source code must retain the above copyright
12# notice, this list of conditions and the following disclaimer. 12# notice, this list of conditions and the following disclaimer.
13# 2. Redistributions in binary form must reproduce the above copyright 13# 2. Redistributions in binary form must reproduce the above copyright
14# notice, this list of conditions and the following disclaimer in the 14# notice, this list of conditions and the following disclaimer in the
15# documentation and/or other materials provided with the distribution. 15# documentation and/or other materials provided with the distribution.
16# 16#
17# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27# 27#
28#set -x 28#set -x
29 29
30# the following environment variables are honored: 30# the following environment variables are honored:
31# compiler/linker flags: CFLAGS, CPPFLAGS, LDFLAGS, LIBS 31# compiler/linker flags: CFLAGS, CPPFLAGS, LDFLAGS, LIBS
32# tools: CP, GREP, ID, MKDIR, SH, TEST, TOUCH, XARGS 32# tools: CP, GREP, ID, MKDIR, SH, TEST, TOUCH, XARGS
33 33
34 34
35BOOTSTRAP_VERSION=20060721 35BOOTSTRAP_VERSION=20060721
36 36
37# Don't let the bootstrap program get confused by a pre-existing mk.conf 37# Don't let the bootstrap program get confused by a pre-existing mk.conf
38# file. 38# file.
39MAKECONF=/dev/null 39MAKECONF=/dev/null
40export MAKECONF 40export MAKECONF
41 41
42# No vulnerability checks since there might be an incompatible checker installed 42# No vulnerability checks since there might be an incompatible checker installed
43NO_PKGTOOLS_REQD_CHECK=yes 43NO_PKGTOOLS_REQD_CHECK=yes
44export NO_PKGTOOLS_REQD_CHECK 44export NO_PKGTOOLS_REQD_CHECK
45 45
46unprivileged=no 46unprivileged=no
47 47
48preserve_path=no 48preserve_path=no
49 49
50# where the building takes place 50# where the building takes place
51bootstrapdir=`dirname "$0"` 51bootstrapdir=`dirname "$0"`
52bootstrapdir=`cd "${bootstrapdir}" && pwd` 52bootstrapdir=`cd "${bootstrapdir}" && pwd`
53pkgsrcdir=`dirname "${bootstrapdir}"` 53pkgsrcdir=`dirname "${bootstrapdir}"`
54wrkdir="`pwd`/work" 54wrkdir="`pwd`/work"
55 55
56usage="Usage: $0 "' 56usage="Usage: $0 "'
57 [ --abi [32|64] ] 57 [ --abi [32|64] ]
58 [ --binary-kit <tarball> ] 58 [ --binary-kit <tarball> ]
59 [ --binary-macpkg <pkg> ] 59 [ --binary-macpkg <pkg> ]
60 [ --compiler <compiler> ] 60 [ --compiler <compiler> ]
61 [ --full ] 61 [ --full ]
62 [ --gzip-binary-kit <tarball> ] 62 [ --gzip-binary-kit <tarball> ]
63 [ --help ] 63 [ --help ]
64 [ --mk-fragment <mk.conf> ] 64 [ --mk-fragment <mk.conf> ]
65 [ --pkgdbdir <pkgdbdir> ] 65 [ --pkgdbdir <pkgdbdir> ]
66 [ --pkgmandir <pkgmandir> ] 66 [ --pkgmandir <pkgmandir> ]
67 [ --prefer-pkgsrc <list|yes|no> ] 67 [ --prefer-pkgsrc <list|yes|no> ]
68 [ --prefix <prefix> ] 68 [ --prefix <prefix> ]
69 [ --preserve-path ] 69 [ --preserve-path ]
70 [ --quiet ] 70 [ --quiet ]
71 [ --sysconfdir <sysconfdir> ] 71 [ --sysconfdir <sysconfdir> ]
72 [ --unprivileged | --ignore-user-check ] 72 [ --unprivileged | --ignore-user-check ]
73 [ --varbase <varbase> ] 73 [ --varbase <varbase> ]
74 [ --workdir <workdir> ] 74 [ --workdir <workdir> ]
75' 75'
76 76
77# this replicates some of the logic in bsd.prefs.mk. until 77# this replicates some of the logic in bsd.prefs.mk. until
78# bootstrap-pkgsrc is merged into pkgsrc, we need to determine the 78# bootstrap-pkgsrc is merged into pkgsrc, we need to determine the
79# right value for OPSYS and MACHINE_ARCH. 79# right value for OPSYS and MACHINE_ARCH.
80 80
81# strip / for BSD/OS, strip - for HP-UX 81# strip / for BSD/OS, strip - for HP-UX
82opsys=`uname -s | tr -d /-` 82opsys=`uname -s | tr -d /-`
83 83
84mkbinarykit_macpkg() 84mkbinarykit_macpkg()
85{ 85{
86 local macdestdir 86 local macdestdir
87 macdestdir=${wrkdir}/macpkg-destdir 87 macdestdir=${wrkdir}/macpkg-destdir
88 rm -rf ${macdestdir} || die "cleanup destdir" 88 rm -rf ${macdestdir} || die "cleanup destdir"
89 89
90 mkdir -p ${macdestdir}${prefix} || die "mkdir destprefix" 90 mkdir -p ${macdestdir}${prefix} || die "mkdir destprefix"
91 rmdir ${macdestdir}${prefix} || die "rmdir destprefix" 91 rmdir ${macdestdir}${prefix} || die "rmdir destprefix"
92 cp -Rp ${prefix} ${macdestdir}${prefix} || die "copy prefix" 92 cp -Rp ${prefix} ${macdestdir}${prefix} || die "copy prefix"
93 93
94 if [ ! -d ${macdestdir}${pkgdbdir} ]; then 94 if [ ! -d ${macdestdir}${pkgdbdir} ]; then
95 mkdir -p ${macdestdir}${pkgdbdir} || die "mkdir destdbdir" 95 mkdir -p ${macdestdir}${pkgdbdir} || die "mkdir destdbdir"
96 rmdir ${macdestdir}${pkgdbdir} || die "rmdir destdbdir" 96 rmdir ${macdestdir}${pkgdbdir} || die "rmdir destdbdir"
97 cp -Rp ${pkgdbdir} ${macdestdir}${pkgdbdir} || die "copy dbdir" 97 cp -Rp ${pkgdbdir} ${macdestdir}${pkgdbdir} || die "copy dbdir"
98 fi 98 fi
99 99
100 ${sedprog} -e "s|%WRKDIR%|${wrkdir}|g" \ 100 ${sedprog} -e "s|%WRKDIR%|${wrkdir}|g" \
101 -e "s|%TARGETDIR%|${targetdir}|g" -e "s|%DATE%|${date}|g" \ 101 -e "s|%TARGETDIR%|${targetdir}|g" -e "s|%DATE%|${date}|g" \
102 < macpkg.pmproj.in > ${wrkdir}/macpkg.pmproj 102 < macpkg.pmproj.in > ${wrkdir}/macpkg.pmproj
103 ${packagemaker} -build -proj ${wrkdir}/macpkg.pmproj -p "${binary_macpkg}" 103 ${packagemaker} -build -proj ${wrkdir}/macpkg.pmproj -p "${binary_macpkg}"
104} 104}
105 105
106mkbinarykit_tar() 106mkbinarykit_tar()
107{ 107{
108 # in case tar was built by bootstrap 108 # in case tar was built by bootstrap
109 PATH="$prefix/bin:$PATH"; export PATH 109 PATH="$prefix/bin:$PATH"; export PATH
110 cd / && tar -hcf "${binary_kit}" .$prefix .$pkgdbdir .$etc_mk_conf 110 cd / && tar -hcf "${binary_kit}" .$prefix .$pkgdbdir .$etc_mk_conf
111} 111}
112 112
113mkbinarykit_tgz() 113mkbinarykit_tgz()
114{ 114{
115 # in case tar was built by bootstrap 115 # in case tar was built by bootstrap
116 PATH="$prefix/bin:$PATH"; export PATH 116 PATH="$prefix/bin:$PATH"; export PATH
117 cd / && tar -hcf - .$prefix .$pkgdbdir .$etc_mk_conf | gzip > "${binary_gzip_kit}" 117 cd / && tar -hcf - .$prefix .$pkgdbdir .$etc_mk_conf | gzip > "${binary_gzip_kit}"
118} 118}
119 119
120die() 120die()
121{ 121{
122 echo >&2 "$@" 122 echo >&2 "$@"
123 exit 1 123 exit 1
124} 124}
125 125
126echo_msg() 126echo_msg()
127{ 127{
128 echo "===> $@" 128 echo "===> $@"
129} 129}
130 130
131# see if we're using gcc. If so, set $compiler_is_gnu to '1'. 131# see if we're using gcc. If so, set $compiler_is_gnu to '1'.
132get_compiler() 132get_compiler()
133{ 133{
134 testcc="${CC}" 134 testcc="${CC}"
135 # normally, we'd just use 'cc', but certain configure tools look 135 # normally, we'd just use 'cc', but certain configure tools look
136 # for gcc specifically, so we have to see if that comes first 136 # for gcc specifically, so we have to see if that comes first
137 if [ -z "${testcc}" ]; then 137 if [ -z "${testcc}" ]; then
138 save_IFS="${IFS}" 138 save_IFS="${IFS}"
139 IFS=':' 139 IFS=':'
140 for dir in ${PATH}; do 140 for dir in ${PATH}; do
141 test -z "$dir" && dir=. 141 test -z "$dir" && dir=.
142 if [ -x "$dir/gcc" ]; then 142 if [ -x "$dir/gcc" ]; then
143 testcc="$dir/gcc" 143 testcc="$dir/gcc"
144 break 144 break
145 fi 145 fi
146 done 146 done
147 IFS="${save_IFS}" 147 IFS="${save_IFS}"
148 fi 148 fi
149 149
150 cat >${wrkdir}/$$.c <<EOF 150 cat >${wrkdir}/$$.c <<EOF
151#ifdef __GNUC__ 151#ifdef __GNUC__
152indeed 152indeed
153#endif 153#endif
154EOF 154EOF
155 compiler_is_gnu=`${testcc:-cc} -E ${wrkdir}/$$.c 2>/dev/null | grep -c indeed` 155 compiler_is_gnu=`${testcc:-cc} -E ${wrkdir}/$$.c 2>/dev/null | grep -c indeed`
156 rm -f ${wrkdir}/$$.c 156 rm -f ${wrkdir}/$$.c
157 157
158} 158}
159get_abi() 159get_abi()
160{ 160{
161 abi_opsys=$@ 161 abi_opsys=$@
162 162
163 if [ -n "$abi" ]; then 163 if [ -n "$abi" ]; then
164 die "ERROR: $abi_opsys has special ABI handling, --abi not supported (yet)." 164 die "ERROR: $abi_opsys has special ABI handling, --abi not supported (yet)."
165 fi 165 fi
166 166
167 case "$abi_opsys" in 167 case "$abi_opsys" in
168 IRIX) 168 IRIX)
169 if [ `uname -r` -ge 6 ]; then 169 if [ `uname -r` -ge 6 ]; then
170 abi=`sed -e 's/.*\(abi=\)\([on]*[36][24]\).*/\2/' /etc/compiler.defaults` 170 abi=`sed -e 's/.*\(abi=\)\([on]*[36][24]\).*/\2/' /etc/compiler.defaults`
171 isa=`sed -e 's/.*\(isa=mips\)\([1234]\).*/\2/' /etc/compiler.defaults` 171 isa=`sed -e 's/.*\(isa=mips\)\([1234]\).*/\2/' /etc/compiler.defaults`
172 case "$abi" in 172 case "$abi" in
173 o32) 173 o32)
174 imakeopts="-DBuildO32 -DSgiISAo32=$isa" 174 imakeopts="-DBuildO32 -DSgiISAo32=$isa"
175 abi="" 175 abi=""
176 ;; 176 ;;
177 n32) imakeopts="-DBuildN32 -DSgiISA32=$isa" 177 n32) imakeopts="-DBuildN32 -DSgiISA32=$isa"
178 abi="32" 178 abi="32"
179 ;; 179 ;;
180 64 | n64) 180 64 | n64)
181 imakeopts="-DBuild64bit -DSgiISA64=$isa" 181 imakeopts="-DBuild64bit -DSgiISA64=$isa"
182 abi="64" 182 abi="64"
183 ;; 183 ;;
184 esac 184 esac
185 else # IRIX before 6 185 else # IRIX before 6
186 abi=32 186 abi=32
187 fi 187 fi
188 ;; 188 ;;
189 esac 189 esac
190} 190}
191 191
192get_machine_arch_aix() 192get_machine_arch_aix()
193{ 193{
194 _cpuid=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` 194 _cpuid=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
195 if /usr/sbin/lsattr -El $_cpuid | grep ' POWER' >/dev/null 2>&1; then 195 if /usr/sbin/lsattr -El $_cpuid | grep ' POWER' >/dev/null 2>&1; then
196 echo rs6000 196 echo rs6000
197 else 197 else
198 echo powerpc 198 echo powerpc
199 fi 199 fi
200} 200}
201 201
202check_prog() 202check_prog()
203{ 203{
204 _var="$1"; _name="$2" 204 _var="$1"; _name="$2"
205 205
206 eval _tmp=\"\$$_var\" 206 eval _tmp=\"\$$_var\"
207 if [ "x$_tmp" != "x" ]; then 207 if [ "x$_tmp" != "x" ]; then
208 # Variable is already set (by the user, for example) 208 # Variable is already set (by the user, for example)
209 return 0 209 return 0
210 fi 210 fi
211 211
212 for _d in `echo $PATH | tr ':' ' '`; do 212 for _d in `echo $PATH | tr ':' ' '`; do
213 if [ -f "$_d/$_name" ] && [ -x "$_d/$_name" ]; then 213 if [ -f "$_d/$_name" ] && [ -x "$_d/$_name" ]; then
214 # Program found 214 # Program found
215 eval $_var=\""$_d/$_name"\" 215 eval $_var=\""$_d/$_name"\"
216 return 1 216 return 1
217 fi 217 fi
218 done 218 done
219 219
220 die "$_name not found in path." 220 die "$_name not found in path."
221} 221}
222 222
223opsys_finish() 223opsys_finish()
224{ 224{
225 case "$opsys" in 225 case "$opsys" in
226 IRIX) 226 IRIX)
227 if [ -n "$imakeopts" ]; then 227 if [ -n "$imakeopts" ]; then
228 echo "IMAKEOPTS+= $imakeopts" >> ${TARGET_MKCONF} 228 echo "IMAKEOPTS+= $imakeopts" >> ${TARGET_MKCONF}
229 fi 229 fi
230 if [ `uname -r` -lt 6 ]; then 230 if [ `uname -r` -lt 6 ]; then
231 echo_msg "Installing fake ldd script" 231 echo_msg "Installing fake ldd script"
232 run_cmd "$install_sh -c -o $user -g $group -m 755 $pkgsrcdir/pkgtools/bootstrap-extras/files/fakeldd $prefix/sbin" 232 run_cmd "$install_sh -c -o $user -g $group -m 755 $pkgsrcdir/pkgtools/bootstrap-extras/files/fakeldd $prefix/sbin"
233 need_extras=yes 233 need_extras=yes
234 echo "LDD= $prefix/sbin/fakeldd" >> ${TARGET_MKCONF} 234 echo "LDD= $prefix/sbin/fakeldd" >> ${TARGET_MKCONF}
235 fi 235 fi
236 ;; 236 ;;
237 Haiku) 237 Haiku)
238 need_extras=yes 238 need_extras=yes
239 echo "LDD= $prefix/sbin/fakeldd" >> ${TARGET_MKCONF} 239 echo "LDD= $prefix/sbin/fakeldd" >> ${TARGET_MKCONF}
240 ;; 240 ;;
241 esac 241 esac
242} 242}
243 243
244is_root() 244is_root()
245{ 245{
246 if [ `uname -s` = "IRIX" ]; then 246 if [ `uname -s` = "IRIX" ]; then
247 if [ `uname -r` -lt 6 -a -z "$ID" ]; then 247 if [ `uname -r` -lt 6 -a -z "$ID" ]; then
248 # older version of IRIX have an id command with limited features 248 # older version of IRIX have an id command with limited features
249 if [ "`$idprog`" != "uid=0(root) gid=0(sys)" ]; then 249 if [ "`$idprog`" != "uid=0(root) gid=0(sys)" ]; then
250 return 1 250 return 1
251 fi 251 fi
252 return 0 252 return 0
253 fi 253 fi
254 fi 254 fi
255 if [ `$idprog -u` != 0 ]; then 255 if [ `$idprog -u` != 0 ]; then
256 return 1 256 return 1
257 fi 257 fi
258 return 0 258 return 0
259} 259}
260 260
261# run a command, abort if it fails 261# run a command, abort if it fails
262run_cmd() 262run_cmd()
263{ 263{
264 echo_msg "running: $@" 264 echo_msg "running: $@"
265 eval "$@" 265 eval "$@"
266 ret=$? 266 ret=$?
267 if [ $ret -ne 0 ]; then 267 if [ $ret -ne 0 ]; then
268 echo_msg "exited with status $ret" 268 echo_msg "exited with status $ret"
269 die "aborted." 269 die "aborted."
270 fi 270 fi
271} 271}
272 272
273# Some versions of mkdir (notably SunOS) bail out too easily, so use the 273# Some versions of mkdir (notably SunOS) bail out too easily, so use the
274# install-sh wrapper instead. 274# install-sh wrapper instead.
275mkdir_p() 275mkdir_p()
276{ 276{
277 for dir in $@; do 277 for dir in $@; do
278 run_cmd "$install_sh -d -o $user -g $group $dir" 278 run_cmd "$install_sh -d -o $user -g $group $dir"
279 done 279 done
280} 280}
281 281
282mkdir_p_early() 282mkdir_p_early()
283{ 283{
284 [ -d "$1" ] && return 0 284 [ -d "$1" ] && return 0
285 mkdir -p "$1" 2> /dev/null && return 0 285 mkdir -p "$1" 2> /dev/null && return 0
286 parent=`dirname "$1"` 286 parent=`dirname "$1"`
287 mkdir_p_early "$parent" 287 mkdir_p_early "$parent"
288 if [ ! -d "$1" ] && mkdir "$1"; then 288 if [ ! -d "$1" ] && mkdir "$1"; then
289 echo_msg "mkdir $1 exited with status $?" 289 echo_msg "mkdir $1 exited with status $?"
290 die "aborted." 290 die "aborted."
291 fi 291 fi
292 return 0 292 return 0
293} 293}
294 294
295copy_src() 295copy_src()
296{ 296{
297 _src="$1"; _dst="$2" 297 _src="$1"; _dst="$2"
298 if [ ! -d $wrkdir/$_dst ]; then 298 if [ ! -d $wrkdir/$_dst ]; then
299 mkdir_p $wrkdir/$_dst 299 mkdir_p $wrkdir/$_dst
300 fi 300 fi
301 $cpprog -r $_src/* $wrkdir/$_dst 301 $cpprog -r $_src/* $wrkdir/$_dst
302} 302}
303 303
304get_optarg() 304get_optarg()
305{ 305{
306 expr "x$1" : "x[^=]*=\\(.*\\)" 306 expr "x$1" : "x[^=]*=\\(.*\\)"
307} 307}
308 308
309checkarg_sane_absolute_path() { 309checkarg_sane_absolute_path() {
310 case "$1" in 310 case "$1" in
311 "") ;; # the default value will be used. 311 "") ;; # the default value will be used.
312 *[!-A-Za-z0-9_./]*) 312 *[!-A-Za-z0-9_./]*)
313 die "ERROR: Invalid characters in path $1 (from $2)." ;; 313 die "ERROR: Invalid characters in path $1 (from $2)." ;;
314 */) die "ERROR: The argument to $2 must not end in /." ;; 314 */) die "ERROR: The argument to $2 must not end in /." ;;
315 /*) ;; 315 /*) ;;
316 *) die "ERROR: The argument to $2 must be an absolute path." ;; 316 *) die "ERROR: The argument to $2 must be an absolute path." ;;
317 esac 317 esac
318} 318}
319 319
320checkarg_sane_relative_path() { 320checkarg_sane_relative_path() {
321 case "$1" in 321 case "$1" in
322 "") ;; # the default value will be used. 322 "") ;; # the default value will be used.
323 *[!-A-Za-z0-9_./]*) 323 *[!-A-Za-z0-9_./]*)
324 die "ERROR: Invalid characters in path $1 (from $2)." ;; 324 die "ERROR: Invalid characters in path $1 (from $2)." ;;
325 /*) die "ERROR: The argument to $2 must be a relative path." ;; 325 /*) die "ERROR: The argument to $2 must be a relative path." ;;
326 *) ;; 326 *) ;;
327 esac 327 esac
328} 328}
329 329
330bootstrap_sh=${SH-/bin/sh} 330bootstrap_sh=${SH-/bin/sh}
331bootstrap_sh_set=${SH+set} 331bootstrap_sh_set=${SH+set}
332 332
333case "$bootstrap_sh" in 333case "$bootstrap_sh" in
334/*) 334/*)
335 ;; 335 ;;
336*) 336*)
337 echo "ERROR: The variable SH must contain an absolute path" 1>&2 337 echo "ERROR: The variable SH must contain an absolute path" 1>&2
338 exit 1 338 exit 1
339 ;; 339 ;;
340esac 340esac
341 341
342# On some newer Ubuntu installations, /bin/sh is a symlink to /bin/dash, 342# On some newer Ubuntu installations, /bin/sh is a symlink to /bin/dash,
343# whose echo(1) is not BSD-compatible. 343# whose echo(1) is not BSD-compatible.
344dash_echo_test=`$bootstrap_sh -c 'echo "\\100"'` 344dash_echo_test=`$bootstrap_sh -c 'echo "\\100"'`
345if [ "$dash_echo_test" = "@" ]; then 345if [ "$dash_echo_test" = "@" ]; then
346 { echo "ERROR: Your shell's echo command is not BSD-compatible." 346 { echo "ERROR: Your shell's echo command is not BSD-compatible."
347 echo "ERROR: Please select another shell by setting the environment" 347 echo "ERROR: Please select another shell by setting the environment"
348 echo "ERROR: variable SH." 348 echo "ERROR: variable SH."
349 } 1>&2 349 } 1>&2
350 exit 1; 350 exit 1;
351fi 351fi
352 352
353if [ -n "$PKG_PATH" ]; then 353if [ -n "$PKG_PATH" ]; then
354 echo "ERROR: Please unset PKG_PATH before running bootstrap." 1>&2 354 echo "ERROR: Please unset PKG_PATH before running bootstrap." 1>&2
355 exit 1; 355 exit 1;
356fi 356fi
357 357
358build_start=`date` 358build_start=`date`
359echo_msg "bootstrap command: $0 $@" 359echo_msg "bootstrap command: $0 $@"
360echo_msg "bootstrap started: $build_start" 360echo_msg "bootstrap started: $build_start"
361 361
362# ensure system locations are empty; we will set them later when we know 362# ensure system locations are empty; we will set them later when we know
363# whether they will be system wide or user specific 363# whether they will be system wide or user specific
364prefix= 364prefix=
365pkgdbdir= 365pkgdbdir=
366pkgmandir= 366pkgmandir=
367sysconfdir= 367sysconfdir=
368varbase= 368varbase=
369 369
370full=no 370full=no
371compiler="" 371compiler=""
372quiet=no 372quiet=no
373mk_fragment= 373mk_fragment=
374 374
375while [ $# -gt 0 ]; do 375while [ $# -gt 0 ]; do
376 case $1 in 376 case $1 in
377 --workdir=*) wrkdir=`get_optarg "$1"` ;; 377 --workdir=*) wrkdir=`get_optarg "$1"` ;;
378 --workdir) wrkdir="$2"; shift ;; 378 --workdir) wrkdir="$2"; shift ;;
379 --prefix=*) prefix=`get_optarg "$1"` ;; 379 --prefix=*) prefix=`get_optarg "$1"` ;;
380 --prefix) prefix="$2"; shift ;; 380 --prefix) prefix="$2"; shift ;;
381 --pkgdbdir=*) pkgdbdir=`get_optarg "$1"` ;; 381 --pkgdbdir=*) pkgdbdir=`get_optarg "$1"` ;;
382 --pkgdbdir) pkgdbdir="$2"; shift ;; 382 --pkgdbdir) pkgdbdir="$2"; shift ;;
383 --pkgmandir=*) pkgmandir=`get_optarg "$1"` ;; 383 --pkgmandir=*) pkgmandir=`get_optarg "$1"` ;;
384 --pkgmandir) pkgmandir="$2"; shift ;; 384 --pkgmandir) pkgmandir="$2"; shift ;;
385 --sysconfdir=*) sysconfdir=`get_optarg "$1"` ;; 385 --sysconfdir=*) sysconfdir=`get_optarg "$1"` ;;
386 --sysconfdir) sysconfdir="$2"; shift ;; 386 --sysconfdir) sysconfdir="$2"; shift ;;
387 --varbase=*) varbase=`get_optarg "$1"` ;; 387 --varbase=*) varbase=`get_optarg "$1"` ;;
388 --varbase) varbase="$2"; shift ;; 388 --varbase) varbase="$2"; shift ;;
389 --compiler=*) compiler=`get_optarg "$1"` ;; 389 --compiler=*) compiler=`get_optarg "$1"` ;;
390 --compiler) compiler="$2"; shift ;; 390 --compiler) compiler="$2"; shift ;;
391 --abi=*) abi=`get_optarg "$1"` ;; 391 --abi=*) abi=`get_optarg "$1"` ;;
392 --abi) abi="$2"; shift ;; 392 --abi) abi="$2"; shift ;;
393 --unprivileged | --ignore-user-check) unprivileged=yes ;; 393 --unprivileged | --ignore-user-check) unprivileged=yes ;;
394 --prefer-pkgsrc=*) 394 --prefer-pkgsrc=*)
395 prefer_pkgsrc=`get_optarg "$1"` ;; 395 prefer_pkgsrc=`get_optarg "$1"` ;;
396 --prefer-pkgsrc) 396 --prefer-pkgsrc)
397 prefer_pkgsrc="$2"; shift ;; 397 prefer_pkgsrc="$2"; shift ;;
398 --preserve-path) preserve_path=yes ;; 398 --preserve-path) preserve_path=yes ;;
399 --mk-fragment=*) 399 --mk-fragment=*)
400 mk_fragment=`get_optarg "$1"` ;; 400 mk_fragment=`get_optarg "$1"` ;;
401 --mk-fragment) 401 --mk-fragment)
402 mk_fragment="$2"; shift ;; 402 mk_fragment="$2"; shift ;;
403 --binary-kit=*) 403 --binary-kit=*)
404 binary_kit=`get_optarg "$1"` ;; 404 binary_kit=`get_optarg "$1"` ;;
405 --binary-kit) 405 --binary-kit)
406 binary_kit="$2"; shift ;; 406 binary_kit="$2"; shift ;;
407 --gzip-binary-kit=*) 407 --gzip-binary-kit=*)
408 binary_gzip_kit=`get_optarg "$1"` ;; 408 binary_gzip_kit=`get_optarg "$1"` ;;
409 --gzip-binary-kit) 409 --gzip-binary-kit)
410 binary_gzip_kit="$2"; shift ;; 410 binary_gzip_kit="$2"; shift ;;
411 --binary-macpkg=*) 411 --binary-macpkg=*)
412 binary_macpkg=`get_optarg "$1"` ;; 412 binary_macpkg=`get_optarg "$1"` ;;
413 --binary-macpkg) 413 --binary-macpkg)
414 binary_macpkg="$2"; shift ;; 414 binary_macpkg="$2"; shift ;;
415 --full) full=yes ;; 415 --full) full=yes ;;
416 --quiet) quiet=yes ;; 416 --quiet) quiet=yes ;;
417 --help) echo "$usage"; exit ;; 417 --help) echo "$usage"; exit ;;
418 -h) echo "$usage"; exit ;; 418 -h) echo "$usage"; exit ;;
419 --*) echo "$usage"; exit 1 ;; 419 --*) echo "$usage"; exit 1 ;;
420 esac 420 esac
421 shift 421 shift
422done 422done
423 423
424checkarg_sane_absolute_path "$wrkdir" "--workdir" 424checkarg_sane_absolute_path "$wrkdir" "--workdir"
425checkarg_sane_absolute_path "$prefix" "--prefix" 425checkarg_sane_absolute_path "$prefix" "--prefix"
426checkarg_sane_absolute_path "$pkgdbdir" "--pkgdbdir" 426checkarg_sane_absolute_path "$pkgdbdir" "--pkgdbdir"
427checkarg_sane_absolute_path "$sysconfdir" "--sysconfdir" 427checkarg_sane_absolute_path "$sysconfdir" "--sysconfdir"
428checkarg_sane_absolute_path "$varbase" "--varbase" 428checkarg_sane_absolute_path "$varbase" "--varbase"
429checkarg_sane_relative_path "$pkgmandir" "--pkgmandir" 429checkarg_sane_relative_path "$pkgmandir" "--pkgmandir"
430 430
431# set defaults for system locations if not already set by the user 431# set defaults for system locations if not already set by the user
432wrkobjdir=${wrkdir}/pkgsrc 432wrkobjdir=${wrkdir}/pkgsrc
433if [ "$unprivileged" = "yes" ]; then 433if [ "$unprivileged" = "yes" ]; then
434 [ -z "$prefix" ] && prefix=${HOME}/pkg 434 [ -z "$prefix" ] && prefix=${HOME}/pkg
435elif [ -z "$prefix" -o "$prefix" = "/usr/pkg" ]; then 435elif [ -z "$prefix" -o "$prefix" = "/usr/pkg" ]; then
436 prefix=/usr/pkg 436 prefix=/usr/pkg
437 [ -z "$varbase" ] && varbase=/var 437 [ -z "$varbase" ] && varbase=/var
438fi 438fi
439 439
440[ -z "$varbase" ] && varbase=${prefix}/var 440[ -z "$varbase" ] && varbase=${prefix}/var
441[ -z "$pkgdbdir" ] && pkgdbdir=${varbase}/db/pkg 441[ -z "$pkgdbdir" ] && pkgdbdir=${varbase}/db/pkg
442 442
443if [ "$prefix" = "/usr" ]; then 443if [ "$prefix" = "/usr" ]; then
444 [ -z "$pkgmandir" ] && pkgmandir=share/man 444 [ -z "$pkgmandir" ] && pkgmandir=share/man
445else 445else
446 [ -z "$pkgmandir" ] && pkgmandir=man 446 [ -z "$pkgmandir" ] && pkgmandir=man
447fi 447fi
448mandir=${prefix}/${pkgmandir} 448mandir=${prefix}/${pkgmandir}
449[ -z "$sysconfdir" ] && sysconfdir=${prefix}/etc 449[ -z "$sysconfdir" ] && sysconfdir=${prefix}/etc
450 450
451if [ "x$preserve_path" != "xyes" ]; then 451if [ "x$preserve_path" != "xyes" ]; then
452 PATH="$PATH:/sbin:/usr/sbin" 452 PATH="$PATH:/sbin:/usr/sbin"
453fi 453fi
454 454
455overpath="" 455overpath=""
456root_user=root 456root_user=root
457bmakexenv= 457bmakexenv=
458bmakexargs= 458bmakexargs=
459need_extras=no 459need_extras=no
460case "$opsys" in 460case "$opsys" in
461AIX) 461AIX)
462 root_group=system 462 root_group=system
463 need_bsd_install=yes 463 need_bsd_install=yes
464 need_awk=yes 464 need_awk=yes
465 need_sed=yes 465 need_sed=yes
466 need_fixed_strip=yes 466 need_fixed_strip=yes
467 set_opsys=no 467 set_opsys=no
468 machine_arch=`get_machine_arch_aix` 468 machine_arch=`get_machine_arch_aix`
469 ;; 469 ;;
470CYGWIN_*) 470CYGWIN_*)
471 is_root () { 471 is_root () {
472 if id -nG | grep -q 'Administrators'; then 472 if id -nG | grep -q 'Administrators'; then
473 return 0 473 return 0
474 fi 474 fi
475 return 1 475 return 1
476 } 476 }
477 root_user=Administrators 477 root_user=Administrators
478 root_group=Administrators 478 root_group=Administrators
479 need_bsd_install=no 479 need_bsd_install=no
480 opsys=`uname -o` 480 opsys=`uname -o`
481 need_awk=no 481 need_awk=no
482 need_sed=no 482 need_sed=no
483 need_xargs=no 483 need_xargs=no
484 # only used for unprivileged builds. 484 # only used for unprivileged builds.
485 whoamiprog='id -u' 485 whoamiprog='id -u'
486 groupsprog='id -g' 486 groupsprog='id -g'
487 ;; 487 ;;
488 488
489Darwin) 489Darwin)
490 root_group=wheel 490 root_group=wheel
491 need_bsd_install=no 491 need_bsd_install=no
492 need_awk=no 492 need_awk=no
493 need_sed=no 493 need_sed=no
494 set_opsys=no 494 set_opsys=no
495 machine_arch=`uname -p` 495 machine_arch=`uname -p`
496 CC=${CC:-"gcc -isystem /usr/include"}; export CC 496 CC=${CC:-"gcc -isystem /usr/include"}; export CC
497 osrev=`uname -r` 497 osrev=`uname -r`
498 macosx_version=`echo $osrev | awk -F . '{ print "10."$1-4; }'` 498 macosx_version=`echo $osrev | awk -F . '{ print "10."$1-4; }'`
499 case "$macosx_version" in 499 case "$macosx_version" in
500 10.[0-4]) 500 10.[0-4])
501 packagemaker=/Developer/Tools/packagemaker 501 packagemaker=/Developer/Tools/packagemaker
502 ;; 502 ;;
503 *) 503 *)
504 packagemaker=/Developer/usr/bin/packagemaker 504 packagemaker=/Developer/usr/bin/packagemaker
505 ;; 505 ;;
506 esac 506 esac
507 unset osrev macosx_version 507 unset osrev macosx_version
508 ;; 508 ;;
509DragonFly) 509DragonFly)
510 root_group=wheel 510 root_group=wheel
511 need_bsd_install=no 511 need_bsd_install=no
512 need_awk=no 512 need_awk=no
513 need_sed=no 513 need_sed=no
514 set_opsys=no 514 set_opsys=no
515 check_prog tarprog tar 515 check_prog tarprog tar
516 machine_arch=`uname -p` 516 machine_arch=`uname -p`
517 ;; 517 ;;
518FreeBSD) 518FreeBSD)
519 root_group=wheel 519 root_group=wheel
520 need_bsd_install=no 520 need_bsd_install=no
521 need_awk=no 521 need_awk=no
522 need_sed=no 522 need_sed=no
523 set_opsys=no 523 set_opsys=no
524 machine_arch=`uname -p` 524 machine_arch=`uname -p`
525 ;; 525 ;;
526Haiku) 526Haiku)
527 root_user=`id -un` 527 root_user=`id -un`
528 root_group=root 528 root_group=root
529 need_bsd_install=no 529 need_bsd_install=no
530 need_awk=no 530 need_awk=no
531 need_sed=no 531 need_sed=no
532 set_opsys=no 532 set_opsys=no
533 case `uname -m` in 533 case `uname -m` in
534 BeMac) 534 BeMac)
535 machine_arch=powerpc 535 machine_arch=powerpc
536 ;; 536 ;;
537 BePC) 537 BePC)
538 machine_arch=i386 538 machine_arch=i386
539 ;; 539 ;;
540 *) 540 *)
541 machine_arch=`uname -p` 541 machine_arch=`uname -p`
542 ;; 542 ;;
543 esac 543 esac
544 ;; 544 ;;
545HPUX) 545HPUX)
546 root_group=sys 546 root_group=sys
547 need_bsd_install=yes 547 need_bsd_install=yes
548 need_awk=yes 548 need_awk=yes
549 need_sed=yes 549 need_sed=yes
550 set_opsys=no 550 set_opsys=no
551 machine_arch=`uname -m | sed 's/^9000.*$/hppa/'` 551 machine_arch=`uname -m | sed 's/^9000.*$/hppa/'`
552 ;; 552 ;;
553Interix) 553Interix)
554 is_root () { 554 is_root () {
555 if id -G | grep -q 131616; then 555 if id -G | grep -q 131616; then
556 return 0 556 return 0
557 fi 557 fi
558 return 1 558 return 1
559 } 559 }
560 mkdir_p () { 560 mkdir_p () {
561 mkdir -p "$@" # allows umask to take effect 561 mkdir -p "$@" # allows umask to take effect
562 } 562 }
563 default_install_mode=0775 563 default_install_mode=0775
564 root_user=`id -u` 564 root_user=`id -u`
565 root_group=131616 565 root_group=131616
566 case `uname -r` in 566 case `uname -r` in
567 3.* | 5.*) 567 3.* | 5.*)
568 need_bsd_install=yes 568 need_bsd_install=yes
569 need_awk=yes 569 need_awk=yes
570 need_sed=yes 570 need_sed=yes
571 set_opsys=no 571 set_opsys=no
572 need_xargs=yes 572 need_xargs=yes
573 ;; 573 ;;
574 *) 574 *)
575 need_bsd_install=no 575 need_bsd_install=no
576 need_awk=no 576 need_awk=no
577 need_sed=no 577 need_sed=no
578 set_opsys=no 578 set_opsys=no
579 need_xargs=no 579 need_xargs=no
580 ;; 580 ;;
581 esac 581 esac
582 # only used for unprivileged builds 582 # only used for unprivileged builds
583 groupsprog="id -gn" 583 groupsprog="id -gn"
584 # for bootstrap only; pkgsrc uses CPPFLAGS 584 # for bootstrap only; pkgsrc uses CPPFLAGS
585 CC="gcc -D_ALL_SOURCE"; export CC 585 CC="gcc -D_ALL_SOURCE"; export CC
586 ac_cv_header_poll_h=no; export ac_cv_header_poll_h 586 ac_cv_header_poll_h=no; export ac_cv_header_poll_h
587 ac_cv_func_poll=no; export ac_cv_func_poll 587 ac_cv_func_poll=no; export ac_cv_func_poll
588 ;; 588 ;;
589IRIX*) 589IRIX*)
590 if [ -d "/usr/freeware/bin" ]; then 590 if [ -d "/usr/freeware/bin" ]; then
591 overpath="/usr/freeware/bin:$overpath" 591 overpath="/usr/freeware/bin:$overpath"
592 fi 592 fi
593 if [ -d "/usr/bsd" ]; then 593 if [ -d "/usr/bsd" ]; then
594 overpath="/usr/bsd:$overpath" 594 overpath="/usr/bsd:$overpath"
595 fi 595 fi
596 if [ -d "/usr/bsd/bin" ]; then 596 if [ -d "/usr/bsd/bin" ]; then
597 overpath="/usr/bsd/bin:$overpath" 597 overpath="/usr/bsd/bin:$overpath"
598 fi 598 fi
599 root_group=sys 599 root_group=sys
600 need_bsd_install=yes 600 need_bsd_install=yes
601 get_abi "IRIX" 601 get_abi "IRIX"
602 opsys=IRIX 602 opsys=IRIX
603 need_awk=yes 603 need_awk=yes
604 need_sed=yes 604 need_sed=yes
605 set_opsys=yes 605 set_opsys=yes
606 machine_arch=mipseb 606 machine_arch=mipseb
607 bmakexargs="MACHINE_ARCH=$machine_arch" 607 bmakexargs="MACHINE_ARCH=$machine_arch"
608 bmakexenv="MAKE=pmake" 608 bmakexenv="MAKE=pmake"
609 check_compiler=yes 609 check_compiler=yes
610 if [ `uname -r` -lt 6 ]; then 610 if [ `uname -r` -lt 6 ]; then
611# IRIX 5's mkdir bails out with an error when trying to create with the -p 611# IRIX 5's mkdir bails out with an error when trying to create with the -p
612# option an already existing directory 612# option an already existing directory
613 need_mkdir=yes 613 need_mkdir=yes
614 fi 614 fi
615 ;; 615 ;;
616Linux) 616Linux)
617 if [ -f /etc/ssdlinux_version ]; then 617 if [ -f /etc/ssdlinux_version ]; then
618 root_group=wheel 618 root_group=wheel
619 else 619 else
620 root_group=root 620 root_group=root
621 fi 621 fi
622 need_bsd_install=no 622 need_bsd_install=no
623 need_awk=no 623 # Debian/Ubuntu's awk is mawk, and mawk does not understand
 624 # some regexp used in pkgsrc/mk.
 625 if [ -f /etc/debian_version ]; then
 626 need_awk=yes
 627 else
 628 need_awk=no
 629 fi
624 need_sed=no 630 need_sed=no
625 set_opsys=no 631 set_opsys=no
626 machine_arch=`uname -m | sed -e 's/i.86/i386/'` 632 machine_arch=`uname -m | sed -e 's/i.86/i386/'`
627 ;; 633 ;;
628Minix) 634Minix)
629 root_group=operator 635 root_group=operator
630 need_bsd_install=yes 636 need_bsd_install=yes
631 need_awk=no 637 need_awk=no
632 need_sed=no 638 need_sed=no
633 set_opsys=no 639 set_opsys=no
634 machine_arch=`uname -p` 640 machine_arch=`uname -p`
635 LDFLAGS="-lcompat_minix -lminlib" 641 LDFLAGS="-lcompat_minix -lminlib"
636 ;;  642 ;;
637MirBSD) 643MirBSD)
638 root_group=wheel 644 root_group=wheel
639 need_pax=yes 645 need_pax=yes
640 need_mtree=no 646 need_mtree=no
641 need_bsd_install=no 647 need_bsd_install=no
642 need_awk=no 648 need_awk=no
643 need_sed=no 649 need_sed=no
644 set_opsys=no 650 set_opsys=no
645 check_prog mtreeprog mtree 651 check_prog mtreeprog mtree
646 machine_arch=`arch -s` 652 machine_arch=`arch -s`
647 # there is no /usr/bin/cc, so use mgcc if unset 653 # there is no /usr/bin/cc, so use mgcc if unset
648 test -n "$CC" || { CC=mgcc; export CC; } 654 test -n "$CC" || { CC=mgcc; export CC; }
649 # get some variables from the native make if unset 655 # get some variables from the native make if unset
650 for var in CFLAGS CPPFLAGS LDFLAGS; do 656 for var in CFLAGS CPPFLAGS LDFLAGS; do
651 # check if variable is already set 657 # check if variable is already set
652 eval _tmp=\"\$$var\" 658 eval _tmp=\"\$$var\"
653 [ "x$_tmp" != x ] && continue 659 [ "x$_tmp" != x ] && continue
654 # ask the native make (EXPERIMENTAL = don't add -Werror) 660 # ask the native make (EXPERIMENTAL = don't add -Werror)
655 # the -I${.CURDIR} dance is to prevent junk in CPPFLAGS 661 # the -I${.CURDIR} dance is to prevent junk in CPPFLAGS
656 _tmp=`printf '%s\nall:\n\t@%s %%s %s=${%s:M*:Q:Q}\n%s\n%s\n' \ 662 _tmp=`printf '%s\nall:\n\t@%s %%s %s=${%s:M*:Q:Q}\n%s\n%s\n' \
657 $var'+=-I${.CURDIR}' printf $var $var':S/-I${.CURDIR}//' \ 663 $var'+=-I${.CURDIR}' printf $var $var':S/-I${.CURDIR}//' \
658 EXPERIMENTAL=yes '.include <bsd.prog.mk>' | \ 664 EXPERIMENTAL=yes '.include <bsd.prog.mk>' | \
659 (unset MAKECONF; /usr/bin/make -f - all 2>/dev/null) | \ 665 (unset MAKECONF; /usr/bin/make -f - all 2>/dev/null) | \
660 sed 's/^x//'` 666 sed 's/^x//'`
661 eval $_tmp 667 eval $_tmp
662 eval export $var 668 eval export $var
663 done 669 done
664 ;; 670 ;;
665NetBSD) 671NetBSD)
666 root_group=wheel 672 root_group=wheel
667 need_bsd_install=no 673 need_bsd_install=no
668 need_awk=no 674 need_awk=no
669 need_sed=no 675 need_sed=no
670 set_opsys=no 676 set_opsys=no
671 machine_arch=`uname -p` 677 machine_arch=`uname -p`
672 ;; 678 ;;
673OpenBSD) 679OpenBSD)
674 root_group=wheel 680 root_group=wheel
675 need_bsd_install=no 681 need_bsd_install=no
676 need_awk=no 682 need_awk=no
677 need_sed=no 683 need_sed=no
678 set_opsys=no 684 set_opsys=no
679 machine_arch=`uname -m` 685 machine_arch=`uname -m`
680 ;; 686 ;;
681OSF1) 687OSF1)
682 root_group=system 688 root_group=system
683 need_bsd_install=yes 689 need_bsd_install=yes
684 need_awk=yes 690 need_awk=yes
685 need_sed=yes 691 need_sed=yes
686 need_ksh=yes 692 need_ksh=yes
687 set_opsys=no 693 set_opsys=no
688 ;; 694 ;;
689QNX) 695QNX)
690 root_group=root 696 root_group=root
691 need_bsd_install=yes 697 need_bsd_install=yes
692 need_awk=yes 698 need_awk=yes
693 need_sed=yes 699 need_sed=yes
694 set_opsys=no 700 set_opsys=no
695 groupsprog="id -gn" 701 groupsprog="id -gn"
696 whoamiprog="id -un" 702 whoamiprog="id -un"
697 machine_arch=`uname -p | sed -e 's/x86/i386/'` 703 machine_arch=`uname -p | sed -e 's/x86/i386/'`
698 ;; 704 ;;
699SunOS) 705SunOS)
700 root_group=root 706 root_group=root
701 need_bsd_install=yes 707 need_bsd_install=yes
702 if [ -x "/usr/gnu/bin/awk" ]; then 708 if [ -x "/usr/gnu/bin/awk" ]; then
703 need_awk=no 709 need_awk=no
704 else 710 else
705 need_awk=yes 711 need_awk=yes
706 fi 712 fi
707 if [ -x "/usr/gnu/bin/sed" ]; then 713 if [ -x "/usr/gnu/bin/sed" ]; then
708 need_sed=no 714 need_sed=no
709 else 715 else
710 need_sed=yes 716 need_sed=yes
711 fi 717 fi
712 if [ "`uname -r`" = "5.11" -a -x "/usr/bin/bash" ]; then 718 if [ "`uname -r`" = "5.11" -a -x "/usr/bin/bash" ]; then
713 bootstrap_sh=${SH:-/usr/bin/bash} 719 bootstrap_sh=${SH:-/usr/bin/bash}
714 bootstrap_sh_set=set 720 bootstrap_sh_set=set
715 else 721 else
716 need_ksh=yes 722 need_ksh=yes
717 fi 723 fi
718 set_opsys=no 724 set_opsys=no
719 idprog="/usr/xpg4/bin/id" 725 idprog="/usr/xpg4/bin/id"
720 groupsprog="${idprog} -gn" 726 groupsprog="${idprog} -gn"
721 whoamiprog="${idprog} -un" 727 whoamiprog="${idprog} -un"
722 machine_arch=`uname -p | sed -e 's/i86pc/i386/'` 728 machine_arch=`uname -p | sed -e 's/i86pc/i386/'`
723 check_compiler=yes 729 check_compiler=yes
724 ;; 730 ;;
725UnixWare) 731UnixWare)
726 root_group=sys 732 root_group=sys
727 need_bsd_install=no 733 need_bsd_install=no
728 BSTRAP_ENV="INSTALL=/usr/ucb/install $BSTRAP_ENV" 734 BSTRAP_ENV="INSTALL=/usr/ucb/install $BSTRAP_ENV"
729 need_mkdir=yes 735 need_mkdir=yes
730 need_awk=yes 736 need_awk=yes
731 need_sed=yes 737 need_sed=yes
732 whoamiprog=/usr/ucb/whoami 738 whoamiprog=/usr/ucb/whoami
733 set_opsys=no 739 set_opsys=no
734 CC="gcc -DUNIXWARE"; export CC 740 CC="gcc -DUNIXWARE"; export CC
735 ;; 741 ;;
736*) 742*)
737 echo "This platform ($opsys) is untried - good luck, and thanks for using pkgsrc" 743 echo "This platform ($opsys) is untried - good luck, and thanks for using pkgsrc"
738 root_group=wheel 744 root_group=wheel
739 need_bsd_install=yes 745 need_bsd_install=yes
740 need_awk=yes 746 need_awk=yes
741 need_sed=yes 747 need_sed=yes
742 set_opsys=no 748 set_opsys=no
743 ;; 749 ;;
744esac 750esac
745 751
746# If "--full" is specified, then install all of the platform-independent 752# If "--full" is specified, then install all of the platform-independent
747# bootstrap software. 753# bootstrap software.
748# 754#
749case "$full" in 755case "$full" in
750yes) 756yes)
751 need_bsd_install=yes 757 need_bsd_install=yes
752 need_awk=yes 758 need_awk=yes
753 need_sed=yes 759 need_sed=yes
754 need_ksh=yes 760 need_ksh=yes
755 ;; 761 ;;
756esac 762esac
757 763
758case "$quiet" in 764case "$quiet" in
759yes) 765yes)
760 configure_quiet_flags="--quiet" 766 configure_quiet_flags="--quiet"
761 make_quiet_flags="-s" 767 make_quiet_flags="-s"
762 ;; 768 ;;
763no) 769no)
764 configure_quiet_flags="" 770 configure_quiet_flags=""
765 make_quiet_flags="" 771 make_quiet_flags=""
766esac 772esac
767 773
768# export OPSYS and MACHINE_ARCH for pkg_install. we only set 774# export OPSYS and MACHINE_ARCH for pkg_install. we only set
769# MACHINE_ARCH on platforms where we override bmake's value. 775# MACHINE_ARCH on platforms where we override bmake's value.
770OPSYS=${opsys} 776OPSYS=${opsys}
771export OPSYS 777export OPSYS
772if [ "${machine_arch}" != "" ]; then 778if [ "${machine_arch}" != "" ]; then
773 MACHINE_ARCH=${machine_arch} 779 MACHINE_ARCH=${machine_arch}
774 export MACHINE_ARCH 780 export MACHINE_ARCH
775fi 781fi
776 782
777if [ "x$preserve_path" != "xyes" ]; then 783if [ "x$preserve_path" != "xyes" ]; then
778 PATH="$overpath:$PATH" 784 PATH="$overpath:$PATH"
779fi 785fi
780 786
781check_prog awkprog awk 787check_prog awkprog awk
782check_prog chmodprog chmod 788check_prog chmodprog chmod
783if [ -n "$CP" ]; then 789if [ -n "$CP" ]; then
784 cpprog="$CP" 790 cpprog="$CP"
785else 791else
786 check_prog cpprog cp 792 check_prog cpprog cp
787fi 793fi
788if [ -n "$ID" ]; then 794if [ -n "$ID" ]; then
789 idprog="$ID" 795 idprog="$ID"
790else 796else
791 check_prog idprog id 797 check_prog idprog id
792fi 798fi
793check_prog groupsprog groups 799check_prog groupsprog groups
794check_prog lnprog ln 800check_prog lnprog ln
795check_prog lsprog ls 801check_prog lsprog ls
796check_prog rmdirprog rmdir 802check_prog rmdirprog rmdir
797check_prog sedprog sed 803check_prog sedprog sed
798check_prog shprog sh 804check_prog shprog sh
799check_prog whoamiprog whoami 805check_prog whoamiprog whoami
800 806
801if [ -d "${wrkdir}" ] || [ -f "${wrkdir}" ]; then 807if [ -d "${wrkdir}" ] || [ -f "${wrkdir}" ]; then
802 echo "\"${wrkdir}\" already exists, please remove it or use --workdir."; 808 echo "\"${wrkdir}\" already exists, please remove it or use --workdir.";
803 exit 1 809 exit 1
804fi 810fi
805 811
806mkdir_p_early ${wrkdir} 812mkdir_p_early ${wrkdir}
807if touch ${wrkdir}/.writeable; then 813if touch ${wrkdir}/.writeable; then
808 : 814 :
809else 815else
810 echo "\"${wrkdir}\" is not writeable. Try $0 -h."; 816 echo "\"${wrkdir}\" is not writeable. Try $0 -h.";
811 exit 1 817 exit 1
812fi 818fi
813echo "Working directory is: ${wrkdir}" 819echo "Working directory is: ${wrkdir}"
814 820
815if [ "$compiler" = "" ] && [ x"$check_compiler" = x"yes" ]; then 821if [ "$compiler" = "" ] && [ x"$check_compiler" = x"yes" ]; then
816 get_compiler 822 get_compiler
817 if [ $compiler_is_gnu -gt 0 ]; then 823 if [ $compiler_is_gnu -gt 0 ]; then
818 compiler="gcc" 824 compiler="gcc"
819 else 825 else
820 case "$opsys" in 826 case "$opsys" in
821 IRIX) 827 IRIX)
822 if [ `uname -r` -ge 6 ]; then 828 if [ `uname -r` -ge 6 ]; then
823 compiler="mipspro" 829 compiler="mipspro"
824 else 830 else
825 compiler="ido" 831 compiler="ido"
826 fi 832 fi
827 test -n "$CC" || CC=cc 833 test -n "$CC" || CC=cc
828 ;; 834 ;;
829 SunOS) compiler="sunpro" 835 SunOS) compiler="sunpro"
830 test -n "$CC" || CC=cc 836 test -n "$CC" || CC=cc
831 ;; 837 ;;
832 esac 838 esac
833 fi 839 fi
834fi 840fi
835 841
836mkdir_p_early ${wrkdir}/bin 842mkdir_p_early ${wrkdir}/bin
837 843
838# build install-sh 844# build install-sh
839run_cmd "$sedprog -e 's|@DEFAULT_INSTALL_MODE@|'${default_install_mode-0755}'|' $pkgsrcdir/sysutils/install-sh/files/install-sh.in > $wrkdir/bin/install-sh" 845run_cmd "$sedprog -e 's|@DEFAULT_INSTALL_MODE@|'${default_install_mode-0755}'|' $pkgsrcdir/sysutils/install-sh/files/install-sh.in > $wrkdir/bin/install-sh"
840run_cmd "$chmodprog +x $wrkdir/bin/install-sh" 846run_cmd "$chmodprog +x $wrkdir/bin/install-sh"
841install_sh="$shprog $wrkdir/bin/install-sh" 847install_sh="$shprog $wrkdir/bin/install-sh"
842 848
843if [ $unprivileged = "yes" ]; then 849if [ $unprivileged = "yes" ]; then
844 user=`$whoamiprog` 850 user=`$whoamiprog`
845 group=`$groupsprog | $awkprog '{print $1}'` 851 group=`$groupsprog | $awkprog '{print $1}'`
846 echo_msg "building as unprivileged user $user/$group" 852 echo_msg "building as unprivileged user $user/$group"
847 853
848 # force bmake install target to use $user and $group 854 # force bmake install target to use $user and $group
849 echo "BINOWN=$user 855 echo "BINOWN=$user
850BINGRP=$group 856BINGRP=$group
851LIBOWN=$user 857LIBOWN=$user
852LIBGRP=$group 858LIBGRP=$group
853MANOWN=$user 859MANOWN=$user
854MANGRP=$group" > ${wrkdir}/Makefile.inc 860MANGRP=$group" > ${wrkdir}/Makefile.inc
855elif is_root; then 861elif is_root; then
856 user=$root_user 862 user=$root_user
857 group=$root_group 863 group=$root_group
858else 864else
859 die "You must be either root to install bootstrap-pkgsrc or use the --unprivileged option." 865 die "You must be either root to install bootstrap-pkgsrc or use the --unprivileged option."
860fi 866fi
861 867
862# export the proper environment 868# export the proper environment
863PATH=$prefix/bin:$prefix/sbin:${PATH}; export PATH 869PATH=$prefix/bin:$prefix/sbin:${PATH}; export PATH
864if [ -d /usr/ccs/bin -a -x /usr/ccs/bin/make ]; then 870if [ -d /usr/ccs/bin -a -x /usr/ccs/bin/make ]; then
865 PATH=${PATH}:/usr/ccs/bin; export PATH 871 PATH=${PATH}:/usr/ccs/bin; export PATH
866fi 872fi
867PKG_DBDIR=$pkgdbdir; export PKG_DBDIR 873PKG_DBDIR=$pkgdbdir; export PKG_DBDIR
868LOCALBASE=$prefix; export LOCALBASE 874LOCALBASE=$prefix; export LOCALBASE
869VARBASE=$varbase; export VARBASE 875VARBASE=$varbase; export VARBASE
870 876
871# set up an example mk.conf file 877# set up an example mk.conf file
872TARGET_MKCONF=${wrkdir}/mk.conf.example 878TARGET_MKCONF=${wrkdir}/mk.conf.example
873echo_msg "Creating default mk.conf in ${wrkdir}" 879echo_msg "Creating default mk.conf in ${wrkdir}"
874echo "# Example ${sysconfdir}/mk.conf file produced by bootstrap-pkgsrc" > ${TARGET_MKCONF} 880echo "# Example ${sysconfdir}/mk.conf file produced by bootstrap-pkgsrc" > ${TARGET_MKCONF}
875echo "# `date`" >> ${TARGET_MKCONF} 881echo "# `date`" >> ${TARGET_MKCONF}
876echo "" >> ${TARGET_MKCONF} 882echo "" >> ${TARGET_MKCONF}
877echo ".ifdef BSD_PKG_MK # begin pkgsrc settings" >> ${TARGET_MKCONF} 883echo ".ifdef BSD_PKG_MK # begin pkgsrc settings" >> ${TARGET_MKCONF}
878echo "" >> ${TARGET_MKCONF} 884echo "" >> ${TARGET_MKCONF}
879 885
880# IRIX64 needs to be set to IRIX, for example 886# IRIX64 needs to be set to IRIX, for example
881if [ "$set_opsys" = "yes" ]; then 887if [ "$set_opsys" = "yes" ]; then
882 echo "OPSYS= $opsys" >> ${TARGET_MKCONF} 888 echo "OPSYS= $opsys" >> ${TARGET_MKCONF}
883fi 889fi
884 890
885if [ -n "$abi" ]; then 891if [ -n "$abi" ]; then
886 echo "ABI= $abi" >> ${TARGET_MKCONF} 892 echo "ABI= $abi" >> ${TARGET_MKCONF}
887fi 893fi
888if [ "$compiler" != "" ]; then 894if [ "$compiler" != "" ]; then
889 echo "PKGSRC_COMPILER= $compiler" >> ${TARGET_MKCONF} 895 echo "PKGSRC_COMPILER= $compiler" >> ${TARGET_MKCONF}
890fi 896fi
891case "$compiler" in 897case "$compiler" in
892sunpro) 898sunpro)
893 echo "CC= cc" >> ${TARGET_MKCONF} 899 echo "CC= cc" >> ${TARGET_MKCONF}
894 echo "CXX= CC" >> ${TARGET_MKCONF} 900 echo "CXX= CC" >> ${TARGET_MKCONF}
895 echo "CPP= \${CC} -E" >> ${TARGET_MKCONF} 901 echo "CPP= \${CC} -E" >> ${TARGET_MKCONF}
896 ;; 902 ;;
897clang) 903clang)
898 echo "CC= clang" >> ${TARGET_MKCONF} 904 echo "CC= clang" >> ${TARGET_MKCONF}
899 echo "CXX= clang++" >> ${TARGET_MKCONF} 905 echo "CXX= clang++" >> ${TARGET_MKCONF}
900 echo "CPP= \${CC} -E" >> ${TARGET_MKCONF} 906 echo "CPP= \${CC} -E" >> ${TARGET_MKCONF}
901 if [ -n "$CLANGBASE" -o -f "/bin/clang" ]; then 907 if [ -n "$CLANGBASE" -o -f "/bin/clang" ]; then
902 echo "CLANGBASE= $CLANGBASE" >> ${TARGET_MKCONF} 908 echo "CLANGBASE= $CLANGBASE" >> ${TARGET_MKCONF}
903 fi 909 fi
904 ;; 910 ;;
905esac 911esac
906if [ -n "$GCCBASE" ]; then 912if [ -n "$GCCBASE" ]; then
907 echo "GCCBASE= $GCCBASE" >> ${TARGET_MKCONF} 913 echo "GCCBASE= $GCCBASE" >> ${TARGET_MKCONF}
908fi 914fi
909if [ -n "$SUNWSPROBASE" ]; then 915if [ -n "$SUNWSPROBASE" ]; then
910 echo "SUNWSPROBASE= $SUNWSPROBASE" >> ${TARGET_MKCONF} 916 echo "SUNWSPROBASE= $SUNWSPROBASE" >> ${TARGET_MKCONF}
911fi 917fi
912echo "" >> ${TARGET_MKCONF} 918echo "" >> ${TARGET_MKCONF}
913 919
914# enable unprivileged builds if not root 920# enable unprivileged builds if not root
915if [ "$unprivileged" = "yes" ]; then 921if [ "$unprivileged" = "yes" ]; then
916 echo "UNPRIVILEGED= yes" >> ${TARGET_MKCONF} 922 echo "UNPRIVILEGED= yes" >> ${TARGET_MKCONF}
917fi 923fi
918 924
919# save environment in example mk.conf 925# save environment in example mk.conf
920echo "PKG_DBDIR= $pkgdbdir" >> ${TARGET_MKCONF} 926echo "PKG_DBDIR= $pkgdbdir" >> ${TARGET_MKCONF}
921echo "LOCALBASE= $prefix" >> ${TARGET_MKCONF} 927echo "LOCALBASE= $prefix" >> ${TARGET_MKCONF}
922echo "VARBASE= $varbase" >> ${TARGET_MKCONF} 928echo "VARBASE= $varbase" >> ${TARGET_MKCONF}
923if [ "${sysconfdir}" != "${prefix}/etc" ]; then 929if [ "${sysconfdir}" != "${prefix}/etc" ]; then
924 echo "PKG_SYSCONFBASE= $sysconfdir" >> ${TARGET_MKCONF} 930 echo "PKG_SYSCONFBASE= $sysconfdir" >> ${TARGET_MKCONF}
925fi 931fi
926echo "PKG_TOOLS_BIN= $prefix/sbin" >> ${TARGET_MKCONF} 932echo "PKG_TOOLS_BIN= $prefix/sbin" >> ${TARGET_MKCONF}
927echo "PKGMANDIR= $pkgmandir" >> ${TARGET_MKCONF} 933echo "PKGMANDIR= $pkgmandir" >> ${TARGET_MKCONF}
928echo "" >> ${TARGET_MKCONF} 934echo "" >> ${TARGET_MKCONF}
929 935
930if [ -n "$prefer_pkgsrc" ]; then 936if [ -n "$prefer_pkgsrc" ]; then
931 echo "PREFER_PKGSRC= $prefer_pkgsrc" >> ${TARGET_MKCONF} 937 echo "PREFER_PKGSRC= $prefer_pkgsrc" >> ${TARGET_MKCONF}
932 echo "" >> ${TARGET_MKCONF} 938 echo "" >> ${TARGET_MKCONF}
933fi 939fi
934 940
935BOOTSTRAP_MKCONF=${wrkdir}/mk.conf 941BOOTSTRAP_MKCONF=${wrkdir}/mk.conf
936cp ${TARGET_MKCONF} ${BOOTSTRAP_MKCONF} 942cp ${TARGET_MKCONF} ${BOOTSTRAP_MKCONF}
937 943
938# sbin is used by pkg_install, share/mk by bootstrap-mk-files 944# sbin is used by pkg_install, share/mk by bootstrap-mk-files
939mkdir_p $wrkdir/sbin $wrkdir/share/mk 945mkdir_p $wrkdir/sbin $wrkdir/share/mk
940mkdir_p_early ${wrkdir} 946mkdir_p_early ${wrkdir}
941 947
942if [ "$need_bsd_install" = "yes" ]; then 948if [ "$need_bsd_install" = "yes" ]; then
943 BSTRAP_ENV="INSTALL='$prefix/bin/install-sh -c' $BSTRAP_ENV" 949 BSTRAP_ENV="INSTALL='$prefix/bin/install-sh -c' $BSTRAP_ENV"
944 echo "TOOLS_PLATFORM.install?= $prefix/bin/install-sh" >> ${TARGET_MKCONF} 950 echo "TOOLS_PLATFORM.install?= $prefix/bin/install-sh" >> ${TARGET_MKCONF}
945 echo "TOOLS_PLATFORM.install?= $wrkdir/bin/install-sh" >> ${BOOTSTRAP_MKCONF} 951 echo "TOOLS_PLATFORM.install?= $wrkdir/bin/install-sh" >> ${BOOTSTRAP_MKCONF}
946fi 952fi
947 953
948if [ "$need_fixed_strip" = "yes" ] ; then 954if [ "$need_fixed_strip" = "yes" ] ; then
949 echo_msg "Installing fixed strip script" 955 echo_msg "Installing fixed strip script"
950 run_cmd "$install_sh -c -o $user -g $group -m 755 $pkgsrcdir/pkgtools/bootstrap-extras/files/strip-sh $wrkdir/bin/strip" 956 run_cmd "$install_sh -c -o $user -g $group -m 755 $pkgsrcdir/pkgtools/bootstrap-extras/files/strip-sh $wrkdir/bin/strip"
951 echo "TOOLS_PLATFORM.strip?= $prefix/bin/strip" >> ${TARGET_MKCONF} 957 echo "TOOLS_PLATFORM.strip?= $prefix/bin/strip" >> ${TARGET_MKCONF}
952 echo "TOOLS_PLATFORM.strip?= $wrkdir/bin/strip" >> ${BOOTSTRAP_MKCONF} 958 echo "TOOLS_PLATFORM.strip?= $wrkdir/bin/strip" >> ${BOOTSTRAP_MKCONF}
953 need_extras=yes 959 need_extras=yes
954fi 960fi
955 961
956if [ "$need_mkdir" = "yes" -a -z "$MKDIR" ]; then 962if [ "$need_mkdir" = "yes" -a -z "$MKDIR" ]; then
957 echo_msg "Installing fixed mkdir script \"mkdir-sh\"" 963 echo_msg "Installing fixed mkdir script \"mkdir-sh\""
958 run_cmd "$install_sh -c -o $user -g $group -m 755 $pkgsrcdir/pkgtools/bootstrap-extras/files/mkdir-sh $wrkdir/bin/mkdir-sh" 964 run_cmd "$install_sh -c -o $user -g $group -m 755 $pkgsrcdir/pkgtools/bootstrap-extras/files/mkdir-sh $wrkdir/bin/mkdir-sh"
959 echo "TOOLS_PLATFORM.mkdir?= $prefix/bin/mkdir-sh -p" >> ${TARGET_MKCONF} 965 echo "TOOLS_PLATFORM.mkdir?= $prefix/bin/mkdir-sh -p" >> ${TARGET_MKCONF}
960 echo "TOOLS_PLATFORM.mkdir?= $wrkdir/bin/mkdir-sh -p" >> ${BOOTSTRAP_MKCONF} 966 echo "TOOLS_PLATFORM.mkdir?= $wrkdir/bin/mkdir-sh -p" >> ${BOOTSTRAP_MKCONF}
961 need_extras=yes 967 need_extras=yes
962fi 968fi
963 969
964if [ "$need_xargs" = "yes" ]; then 970if [ "$need_xargs" = "yes" ]; then
965 echo_msg "Installing fixed xargs script" 971 echo_msg "Installing fixed xargs script"
966 run_cmd "$install_sh -c -o $user -g $group -m 755 $pkgsrcdir/pkgtools/bootstrap-extras/files/xargs-sh $wrkdir/bin/xargs" 972 run_cmd "$install_sh -c -o $user -g $group -m 755 $pkgsrcdir/pkgtools/bootstrap-extras/files/xargs-sh $wrkdir/bin/xargs"
967 echo "TOOLS_PLATFORM.xargs?= $prefix/bin/xargs" >> ${TARGET_MKCONF} 973 echo "TOOLS_PLATFORM.xargs?= $prefix/bin/xargs" >> ${TARGET_MKCONF}
968 echo "TOOLS_PLATFORM.xargs?= $wrkdir/bin/xargs" >> ${BOOTSTRAP_MKCONF} 974 echo "TOOLS_PLATFORM.xargs?= $wrkdir/bin/xargs" >> ${BOOTSTRAP_MKCONF}
969 need_extras=yes 975 need_extras=yes
970fi 976fi
971 977
972echo_msg "Bootstrapping mk-files" 978echo_msg "Bootstrapping mk-files"
973run_cmd "(cd ${pkgsrcdir}/pkgtools/bootstrap-mk-files/files && env CP=${cpprog} \ 979run_cmd "(cd ${pkgsrcdir}/pkgtools/bootstrap-mk-files/files && env CP=${cpprog} \
974 OPSYS=${opsys} MK_DST=${wrkdir}/share/mk ROOT_GROUP=${root_group} \ 980 OPSYS=${opsys} MK_DST=${wrkdir}/share/mk ROOT_GROUP=${root_group} \
975ROOT_USER=${root_user} SED=${sedprog} SYSCONFDIR=${sysconfdir} \ 981ROOT_USER=${root_user} SED=${sedprog} SYSCONFDIR=${sysconfdir} \
976$shprog ./bootstrap.sh)" 982$shprog ./bootstrap.sh)"
977 983
978bootstrap_bmake() { 984bootstrap_bmake() {
979 echo_msg "Bootstrapping bmake" 985 echo_msg "Bootstrapping bmake"
980 copy_src $pkgsrcdir/devel/bmake/files bmake 986 copy_src $pkgsrcdir/devel/bmake/files bmake
981 run_cmd "(cd $wrkdir/bmake && env $bmakexenv $shprog ./boot-strap $configure_quiet_flags -q -o bootstrap.$opsys --prefix=$wrkdir --sysconfdir=$wrkdir --mksrc none --with-default-sys-path="$wrkdir/share/mk" $bmakexargs)" 987 run_cmd "(cd $wrkdir/bmake && env $bmakexenv $shprog ./boot-strap $configure_quiet_flags -q -o bootstrap.$opsys --prefix=$wrkdir --sysconfdir=$wrkdir --mksrc none --with-default-sys-path="$wrkdir/share/mk" $bmakexargs)"
982 run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/bmake/bootstrap.$opsys/bmake $wrkdir/bin/bmake" 988 run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/bmake/bootstrap.$opsys/bmake $wrkdir/bin/bmake"
983} 989}
984bootstrap_bmake 990bootstrap_bmake
985 991
986bmake="$wrkdir/bin/bmake $make_quiet_flags" 992bmake="$wrkdir/bin/bmake $make_quiet_flags"
987 993
988# build libnbcompat 994# build libnbcompat
989echo_msg "Building libnbcompat" 995echo_msg "Building libnbcompat"
990copy_src $pkgsrcdir/pkgtools/libnbcompat/files libnbcompat 996copy_src $pkgsrcdir/pkgtools/libnbcompat/files libnbcompat
991run_cmd "(cd $wrkdir/libnbcompat; $shprog ./configure $configure_quiet_flags -C --prefix=$prefix --mandir=$mandir --sysconfdir=$sysconfdir --enable-bsd-getopt --enable-db && $bmake $make_quiet_flags)" 997run_cmd "(cd $wrkdir/libnbcompat; $shprog ./configure $configure_quiet_flags -C --prefix=$prefix --mandir=$mandir --sysconfdir=$sysconfdir --enable-bsd-getopt --enable-db && $bmake $make_quiet_flags)"
992 998
993# bootstrap ksh if necessary 999# bootstrap ksh if necessary
994case "$need_ksh" in 1000case "$need_ksh" in
995yes) echo_msg "Bootstrapping ksh" 1001yes) echo_msg "Bootstrapping ksh"
996 copy_src $pkgsrcdir/shells/pdksh/files ksh 1002 copy_src $pkgsrcdir/shells/pdksh/files ksh
997 test -n "$CC" || CC=gcc # default to gcc if no compiler is specified 1003 test -n "$CC" || CC=gcc # default to gcc if no compiler is specified
998 run_cmd "(cd $wrkdir/ksh && env $BSTRAP_ENV $shprog ./configure $configure_quiet_flags --prefix=$prefix --mandir=$mandir --sysconfdir=$sysconfdir && $bmake)" 1004 run_cmd "(cd $wrkdir/ksh && env $BSTRAP_ENV $shprog ./configure $configure_quiet_flags --prefix=$prefix --mandir=$mandir --sysconfdir=$sysconfdir && $bmake)"
999 run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/ksh/ksh $wrkdir/bin/pdksh" 1005 run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/ksh/ksh $wrkdir/bin/pdksh"
1000 echo "TOOLS_PLATFORM.sh?= $prefix/bin/pdksh" >> ${TARGET_MKCONF} 1006 echo "TOOLS_PLATFORM.sh?= $prefix/bin/pdksh" >> ${TARGET_MKCONF}
1001 echo "TOOLS_PLATFORM.sh?= $wrkdir/bin/pdksh" >> ${BOOTSTRAP_MKCONF} 1007 echo "TOOLS_PLATFORM.sh?= $wrkdir/bin/pdksh" >> ${BOOTSTRAP_MKCONF}
1002 echo "TOOLS_PLATFORM.ksh?= $prefix/bin/pdksh" >> ${TARGET_MKCONF} 1008 echo "TOOLS_PLATFORM.ksh?= $prefix/bin/pdksh" >> ${TARGET_MKCONF}
1003 echo "TOOLS_PLATFORM.ksh?= $wrkdir/bin/pdksh" >> ${BOOTSTRAP_MKCONF} 1009 echo "TOOLS_PLATFORM.ksh?= $wrkdir/bin/pdksh" >> ${BOOTSTRAP_MKCONF}
1004# Now rebootstrap bmake for ksh 1010# Now rebootstrap bmake for ksh
1005 echo_msg "Rebootstrapping bmake for ksh" 1011 echo_msg "Rebootstrapping bmake for ksh"
1006 bmakexargs="$bmakexargs --with-defshell=$wrkdir/bin/pdksh" 1012 bmakexargs="$bmakexargs --with-defshell=$wrkdir/bin/pdksh"
1007 bootstrap_bmake 1013 bootstrap_bmake
1008 ;; 1014 ;;
1009esac 1015esac
1010 1016
1011# bootstrap awk if necessary 1017# bootstrap awk if necessary
1012case "$need_awk" in 1018case "$need_awk" in
1013yes) echo_msg "Bootstrapping awk" 1019yes) echo_msg "Bootstrapping awk"
1014 copy_src $pkgsrcdir/lang/nawk/files awk 1020 copy_src $pkgsrcdir/lang/nawk/files awk
1015 test -n "$CC" || CC=gcc # default to gcc if no compiler is specified 1021 test -n "$CC" || CC=gcc # default to gcc if no compiler is specified
1016 run_cmd "(cd $wrkdir/awk && $bmake -f Makefile CC=\"${CC}\" CFLAGS=\"${CFLAGS}\")" 1022 run_cmd "(cd $wrkdir/awk && $bmake -f Makefile CC=\"${CC}\" CFLAGS=\"${CFLAGS}\")"
1017 run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/awk/a.out $wrkdir/bin/nawk" 1023 run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/awk/a.out $wrkdir/bin/nawk"
1018 echo "TOOLS_PLATFORM.awk?= $prefix/bin/nawk" >> ${TARGET_MKCONF} 1024 echo "TOOLS_PLATFORM.awk?= $prefix/bin/nawk" >> ${TARGET_MKCONF}
1019 echo "TOOLS_PLATFORM.awk?= $wrkdir/bin/nawk" >> ${BOOTSTRAP_MKCONF} 1025 echo "TOOLS_PLATFORM.awk?= $wrkdir/bin/nawk" >> ${BOOTSTRAP_MKCONF}
1020 ;; 1026 ;;
1021esac 1027esac
1022 1028
1023# bootstrap sed if necessary 1029# bootstrap sed if necessary
1024case "$need_sed" in 1030case "$need_sed" in
1025yes) echo_msg "Bootstrapping sed" 1031yes) echo_msg "Bootstrapping sed"
1026 copy_src $pkgsrcdir/textproc/nbsed/files sed 1032 copy_src $pkgsrcdir/textproc/nbsed/files sed
1027 run_cmd "(cd $wrkdir/sed; env $BSTRAP_ENV CPPFLAGS='$CPPFLAGS -I../libnbcompat' LDFLAGS='$LDFLAGS -L../libnbcompat' LIBS='$LIBS -lnbcompat' $shprog ./configure $configure_quiet_flags -C --prefix=$prefix --mandir=$mandir --sysconfdir=$sysconfdir --program-transform-name='s,sed,nbsed,' && $bmake)" 1033 run_cmd "(cd $wrkdir/sed; env $BSTRAP_ENV CPPFLAGS='$CPPFLAGS -I../libnbcompat' LDFLAGS='$LDFLAGS -L../libnbcompat' LIBS='$LIBS -lnbcompat' $shprog ./configure $configure_quiet_flags -C --prefix=$prefix --mandir=$mandir --sysconfdir=$sysconfdir --program-transform-name='s,sed,nbsed,' && $bmake)"
1028 run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/sed/sed $wrkdir/bin/sed" 1034 run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/sed/sed $wrkdir/bin/sed"
1029 echo "TOOLS_PLATFORM.sed?= $prefix/bin/nbsed" >> ${TARGET_MKCONF} 1035 echo "TOOLS_PLATFORM.sed?= $prefix/bin/nbsed" >> ${TARGET_MKCONF}
1030 echo "TOOLS_PLATFORM.sed?= $wrkdir/bin/sed" >> ${BOOTSTRAP_MKCONF} 1036 echo "TOOLS_PLATFORM.sed?= $wrkdir/bin/sed" >> ${BOOTSTRAP_MKCONF}
1031 ;; 1037 ;;
1032esac 1038esac
1033 1039
1034# bootstrap pkg_install 1040# bootstrap pkg_install
1035echo_msg "Bootstrapping pkgtools" 1041echo_msg "Bootstrapping pkgtools"
1036copy_src $pkgsrcdir/pkgtools/pkg_install/files pkg_install 1042copy_src $pkgsrcdir/pkgtools/pkg_install/files pkg_install
1037run_cmd "(cd $wrkdir/pkg_install; env $BSTRAP_ENV \ 1043run_cmd "(cd $wrkdir/pkg_install; env $BSTRAP_ENV \
1038CPPFLAGS='$CPPFLAGS -I../libnbcompat -I../../libnbcompat' \ 1044CPPFLAGS='$CPPFLAGS -I../libnbcompat -I../../libnbcompat' \
1039LDFLAGS='$LDFLAGS -L../libnbcompat -L../../libnbcompat' \ 1045LDFLAGS='$LDFLAGS -L../libnbcompat -L../../libnbcompat' \
1040LIBS='$LIBS -lnbcompat' $shprog ./configure $configure_quiet_flags -C \ 1046LIBS='$LIBS -lnbcompat' $shprog ./configure $configure_quiet_flags -C \
1041--enable-bootstrap --prefix=$prefix --sysconfdir=$sysconfdir \ 1047--enable-bootstrap --prefix=$prefix --sysconfdir=$sysconfdir \
1042--with-pkgdbdir=$pkgdbdir --mandir=$mandir $pkg_install_args && $bmake)" 1048--with-pkgdbdir=$pkgdbdir --mandir=$mandir $pkg_install_args && $bmake)"
1043run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/admin/pkg_admin $wrkdir/sbin/pkg_admin" 1049run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/admin/pkg_admin $wrkdir/sbin/pkg_admin"
1044run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/create/pkg_create $wrkdir/sbin/pkg_create" 1050run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/create/pkg_create $wrkdir/sbin/pkg_create"
1045run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/info/pkg_info $wrkdir/sbin/pkg_info" 1051run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/info/pkg_info $wrkdir/sbin/pkg_info"
1046echo "PKG_ADMIN_CMD?= $wrkdir/sbin/pkg_admin" >> ${BOOTSTRAP_MKCONF} 1052echo "PKG_ADMIN_CMD?= $wrkdir/sbin/pkg_admin" >> ${BOOTSTRAP_MKCONF}
1047echo "PKG_CREATE_CMD?= $wrkdir/sbin/pkg_create" >> ${BOOTSTRAP_MKCONF} 1053echo "PKG_CREATE_CMD?= $wrkdir/sbin/pkg_create" >> ${BOOTSTRAP_MKCONF}
1048echo "PKG_INFO_CMD?= $wrkdir/sbin/pkg_info" >> ${BOOTSTRAP_MKCONF} 1054echo "PKG_INFO_CMD?= $wrkdir/sbin/pkg_info" >> ${BOOTSTRAP_MKCONF}
1049 1055
1050MAKECONF=$wrkdir/mk.conf 1056MAKECONF=$wrkdir/mk.conf
1051export MAKECONF 1057export MAKECONF
1052 1058
1053if [ "$bootstrap_sh_set" = "set" ]; then 1059if [ "$bootstrap_sh_set" = "set" ]; then
1054 echo "TOOLS_PLATFORM.sh?= ${bootstrap_sh}" >> ${TARGET_MKCONF} 1060 echo "TOOLS_PLATFORM.sh?= ${bootstrap_sh}" >> ${TARGET_MKCONF}
1055 echo "TOOLS_PLATFORM.sh?= ${bootstrap_sh}" >> ${BOOTSTRAP_MKCONF} 1061 echo "TOOLS_PLATFORM.sh?= ${bootstrap_sh}" >> ${BOOTSTRAP_MKCONF}
1056fi 1062fi
1057 1063
1058# preserve compiler and tool environment variables settings 1064# preserve compiler and tool environment variables settings
1059if test -n "$CP"; then 1065if test -n "$CP"; then
1060 echo "TOOLS_PLATFORM.cp?= $CP" >> ${TARGET_MKCONF} 1066 echo "TOOLS_PLATFORM.cp?= $CP" >> ${TARGET_MKCONF}
1061 echo "TOOLS_PLATFORM.cp?= $CP" >> ${BOOTSTRAP_MKCONF} 1067 echo "TOOLS_PLATFORM.cp?= $CP" >> ${BOOTSTRAP_MKCONF}
1062fi 1068fi
1063if test -n "$GREP"; then 1069if test -n "$GREP"; then
1064 echo "TOOLS_PLATFORM.grep?= $GREP" >> ${TARGET_MKCONF} 1070 echo "TOOLS_PLATFORM.grep?= $GREP" >> ${TARGET_MKCONF}
1065 echo "TOOLS_PLATFORM.grep?= $GREP" >> ${BOOTSTRAP_MKCONF} 1071 echo "TOOLS_PLATFORM.grep?= $GREP" >> ${BOOTSTRAP_MKCONF}
1066fi 1072fi
1067if test -n "$ID"; then 1073if test -n "$ID"; then
1068 echo "TOOLS_PLATFORM.id?= $ID" >> ${TARGET_MKCONF} 1074 echo "TOOLS_PLATFORM.id?= $ID" >> ${TARGET_MKCONF}
1069 echo "TOOLS_PLATFORM.id?= $ID" >> ${BOOTSTRAP_MKCONF} 1075 echo "TOOLS_PLATFORM.id?= $ID" >> ${BOOTSTRAP_MKCONF}
1070fi 1076fi
1071if test -n "$MKDIR"; then 1077if test -n "$MKDIR"; then
1072 echo "TOOLS_PLATFORM.mkdir?= $MKDIR" >> ${TARGET_MKCONF} 1078 echo "TOOLS_PLATFORM.mkdir?= $MKDIR" >> ${TARGET_MKCONF}
1073 echo "TOOLS_PLATFORM.mkdir?= $MKDIR" >> ${BOOTSTRAP_MKCONF} 1079 echo "TOOLS_PLATFORM.mkdir?= $MKDIR" >> ${BOOTSTRAP_MKCONF}
1074fi 1080fi
1075if test -n "$TEST"; then 1081if test -n "$TEST"; then
1076 echo "TOOLS_PLATFORM.test?= $TEST" >> ${TARGET_MKCONF} 1082 echo "TOOLS_PLATFORM.test?= $TEST" >> ${TARGET_MKCONF}
1077 echo "TOOLS_PLATFORM.test?= $TEST" >> ${BOOTSTRAP_MKCONF} 1083 echo "TOOLS_PLATFORM.test?= $TEST" >> ${BOOTSTRAP_MKCONF}
1078fi 1084fi
1079if test -n "$TOUCH"; then 1085if test -n "$TOUCH"; then
1080 echo "TOOLS_PLATFORM.touch?= $TOUCH" >> ${TARGET_MKCONF} 1086 echo "TOOLS_PLATFORM.touch?= $TOUCH" >> ${TARGET_MKCONF}
1081 echo "TOOLS_PLATFORM.touch?= $TOUCH" >> ${BOOTSTRAP_MKCONF} 1087 echo "TOOLS_PLATFORM.touch?= $TOUCH" >> ${BOOTSTRAP_MKCONF}
1082fi 1088fi
1083if test -n "$XARGS"; then 1089if test -n "$XARGS"; then
1084 echo "TOOLS_PLATFORM.xargs?= $XARGS" >> ${TARGET_MKCONF} 1090 echo "TOOLS_PLATFORM.xargs?= $XARGS" >> ${TARGET_MKCONF}
1085 echo "TOOLS_PLATFORM.xargs?= $XARGS" >> ${BOOTSTRAP_MKCONF} 1091 echo "TOOLS_PLATFORM.xargs?= $XARGS" >> ${BOOTSTRAP_MKCONF}
1086fi 1092fi
1087if test -n "$CFLAGS"; then 1093if test -n "$CFLAGS"; then
1088 echo "CFLAGS+= $CFLAGS" >> ${TARGET_MKCONF} 1094 echo "CFLAGS+= $CFLAGS" >> ${TARGET_MKCONF}
1089 echo "DBG= # prevent DBG from adding default optimizer flags" >> ${TARGET_MKCONF} 1095 echo "DBG= # prevent DBG from adding default optimizer flags" >> ${TARGET_MKCONF}
1090 echo "DBG= # prevent DBG from adding default optimizer flags" >> ${BOOTSTRAP_MKCONF} 1096 echo "DBG= # prevent DBG from adding default optimizer flags" >> ${BOOTSTRAP_MKCONF}
1091fi 1097fi
1092if test -n "$CPPFLAGS"; then 1098if test -n "$CPPFLAGS"; then
1093 echo "CPPFLAGS+= $CPPFLAGS" >> ${TARGET_MKCONF} 1099 echo "CPPFLAGS+= $CPPFLAGS" >> ${TARGET_MKCONF}
1094fi 1100fi
1095if test -n "$LDFLAGS"; then 1101if test -n "$LDFLAGS"; then
1096 echo "LDFLAGS+= $LDFLAGS" >> ${TARGET_MKCONF} 1102 echo "LDFLAGS+= $LDFLAGS" >> ${TARGET_MKCONF}
1097fi 1103fi
1098if test -n "$LIBS"; then 1104if test -n "$LIBS"; then
1099 echo "LIBS+= $LIBS" >> ${TARGET_MKCONF} 1105 echo "LIBS+= $LIBS" >> ${TARGET_MKCONF}
1100fi 1106fi
1101 1107
1102# opsys specific fiddling 1108# opsys specific fiddling
1103opsys_finish 1109opsys_finish
1104 1110
1105echo "WRKOBJDIR= ${wrkdir}/wrk" >> ${BOOTSTRAP_MKCONF} 1111echo "WRKOBJDIR= ${wrkdir}/wrk" >> ${BOOTSTRAP_MKCONF}
1106 1112
1107echo "" >> ${TARGET_MKCONF} 1113echo "" >> ${TARGET_MKCONF}
1108echo "" >> ${BOOTSTRAP_MKCONF} 1114echo "" >> ${BOOTSTRAP_MKCONF}
1109if test -n "${mk_fragment}"; then 1115if test -n "${mk_fragment}"; then
1110 cat "${mk_fragment}" >> ${TARGET_MKCONF} 1116 cat "${mk_fragment}" >> ${TARGET_MKCONF}
1111 echo "" >> ${TARGET_MKCONF} 1117 echo "" >> ${TARGET_MKCONF}
1112fi 1118fi
1113echo ".endif # end pkgsrc settings" >> ${TARGET_MKCONF} 1119echo ".endif # end pkgsrc settings" >> ${TARGET_MKCONF}
1114echo ".endif # end pkgsrc settings" >> ${BOOTSTRAP_MKCONF} 1120echo ".endif # end pkgsrc settings" >> ${BOOTSTRAP_MKCONF}
1115 1121
1116# register packages 1122# register packages
1117# usage: register_package <packagedirectory> [additional arguments] 1123# usage: register_package <packagedirectory> [additional arguments]
1118build_package() { 1124build_package() {
1119 run_cmd "(cd $pkgsrcdir/$1 && $bmake USE_DESTDIR=no -DPKG_PRESERVE MAKECONF=${BOOTSTRAP_MKCONF} install)" 1125 run_cmd "(cd $pkgsrcdir/$1 && $bmake USE_DESTDIR=no -DPKG_PRESERVE MAKECONF=${BOOTSTRAP_MKCONF} install)"
1120} 1126}
1121 1127
1122# 1128#
1123# Please make sure that the following packages and 1129# Please make sure that the following packages and
1124# only the following packages set BOOTSTRAP_PKG=yes. 1130# only the following packages set BOOTSTRAP_PKG=yes.
1125# 1131#
1126echo_msg "Installing packages" 1132echo_msg "Installing packages"
1127build_package "pkgtools/bootstrap-mk-files" 1133build_package "pkgtools/bootstrap-mk-files"
1128case "$need_bsd_install" in 1134case "$need_bsd_install" in
1129yes) build_package "sysutils/install-sh";; 1135yes) build_package "sysutils/install-sh";;
1130esac 1136esac
1131case "$need_ksh" in 1137case "$need_ksh" in
1132yes) build_package "shells/pdksh";; 1138yes) build_package "shells/pdksh";;
1133esac 1139esac
1134build_package "devel/bmake" 1140build_package "devel/bmake"
1135case "$need_awk" in 1141case "$need_awk" in
1136yes) build_package "lang/nawk";; 1142yes) build_package "lang/nawk";;
1137esac 1143esac
1138case "$need_sed" in 1144case "$need_sed" in
1139yes) build_package "textproc/nbsed";; 1145yes) build_package "textproc/nbsed";;
1140esac 1146esac
1141case "$need_extras" in 1147case "$need_extras" in
1142yes) build_package "pkgtools/bootstrap-extras";; 1148yes) build_package "pkgtools/bootstrap-extras";;
1143esac 1149esac
1144build_package "pkgtools/pkg_install" 1150build_package "pkgtools/pkg_install"
1145 1151
1146etc_mk_conf="$sysconfdir/mk.conf" 1152etc_mk_conf="$sysconfdir/mk.conf"
1147 1153
1148# Install the example mk.conf so that it is used, but only if it doesn't 1154# Install the example mk.conf so that it is used, but only if it doesn't
1149# exist yet. This can happen with non-default sysconfdir settings. 1155# exist yet. This can happen with non-default sysconfdir settings.
1150mkdir_p "$sysconfdir" 1156mkdir_p "$sysconfdir"
1151if [ ! -f "$etc_mk_conf" ]; then 1157if [ ! -f "$etc_mk_conf" ]; then
1152 cp "$TARGET_MKCONF" "$etc_mk_conf" 1158 cp "$TARGET_MKCONF" "$etc_mk_conf"
1153 TARGET_MKCONF="$etc_mk_conf" 1159 TARGET_MKCONF="$etc_mk_conf"
1154fi 1160fi
1155 1161
1156hline="===========================================================================" 1162hline="==========================================================================="
1157echo "" 1163echo ""
1158echo "$hline" 1164echo "$hline"
1159echo "" 1165echo ""
1160echo "Please remember to add $prefix/bin to your PATH environment variable" 1166echo "Please remember to add $prefix/bin to your PATH environment variable"
1161echo "and $mandir to your MANPATH environment variable, if necessary." 1167echo "and $mandir to your MANPATH environment variable, if necessary."
1162echo "" 1168echo ""
1163echo "An example mk.conf file with the settings you provided to \"bootstrap\"" 1169echo "An example mk.conf file with the settings you provided to \"bootstrap\""
1164echo "has been created for you. It can be found in:" 1170echo "has been created for you. It can be found in:"
1165echo "" 1171echo ""
1166echo " ${TARGET_MKCONF}" 1172echo " ${TARGET_MKCONF}"
1167echo "" 1173echo ""
1168if [ "$TARGET_MKCONF" != "$etc_mk_conf" ]; then 1174if [ "$TARGET_MKCONF" != "$etc_mk_conf" ]; then
1169 echo "Please copy it to $etc_mk_conf to use it." 1175 echo "Please copy it to $etc_mk_conf to use it."
1170 echo "" 1176 echo ""
1171fi 1177fi
1172echo "You can find extensive documentation of the NetBSD Packages Collection" 1178echo "You can find extensive documentation of the NetBSD Packages Collection"
1173echo "in $pkgsrcdir/doc/pkgsrc.txt." 1179echo "in $pkgsrcdir/doc/pkgsrc.txt."
1174echo "" 1180echo ""
1175echo "Hopefully everything is now complete." 1181echo "Hopefully everything is now complete."
1176echo "Thank you for using pkgsrc!" 1182echo "Thank you for using pkgsrc!"
1177echo "" 1183echo ""
1178echo "$hline" 1184echo "$hline"
1179echo "" 1185echo ""
1180 1186
1181[ -n "${binary_kit}" ] && mkbinarykit_tar 1187[ -n "${binary_kit}" ] && mkbinarykit_tar
1182[ -n "${binary_gzip_kit}" ] && mkbinarykit_tgz 1188[ -n "${binary_gzip_kit}" ] && mkbinarykit_tgz
1183[ -n "${binary_macpkg}" ] && mkbinarykit_macpkg 1189[ -n "${binary_macpkg}" ] && mkbinarykit_macpkg
1184 1190
1185echo_msg "bootstrap started: $build_start" 1191echo_msg "bootstrap started: $build_start"
1186echo_msg "bootstrap ended: `date`" 1192echo_msg "bootstrap ended: `date`"
1187 1193
1188exit 0 1194exit 0