| @@ -1,1488 +1,1488 @@ | | | @@ -1,1488 +1,1488 @@ |
1 | #! /bin/sh | | 1 | #! /bin/sh |
2 | | | 2 | |
3 | # $NetBSD: bootstrap,v 1.304 2021/11/29 18:32:51 jperkin Exp $ | | 3 | # $NetBSD: bootstrap,v 1.305 2021/12/27 14:16:30 schmonz 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 | # The bootstrap program must be able to run with very limited shells. | | 34 | # The bootstrap program must be able to run with very limited shells. |
35 | # It must not use any of the following features: | | 35 | # It must not use any of the following features: |
36 | # | | 36 | # |
37 | # * the ${var%pattern} or ${var#pattern} expansions | | 37 | # * the ${var%pattern} or ${var#pattern} expansions |
38 | # * the $(command) subshell | | 38 | # * the $(command) subshell |
39 | | | 39 | |
40 | # Don't let the bootstrap program get confused by a pre-existing mk.conf | | 40 | # Don't let the bootstrap program get confused by a pre-existing mk.conf |
41 | # file. | | 41 | # file. |
42 | MAKECONF=/dev/null | | 42 | MAKECONF=/dev/null |
43 | export MAKECONF | | 43 | export MAKECONF |
44 | | | 44 | |
45 | # No vulnerability checks since there might be an incompatible checker installed | | 45 | # No vulnerability checks since there might be an incompatible checker installed |
46 | NO_PKGTOOLS_REQD_CHECK=yes | | 46 | NO_PKGTOOLS_REQD_CHECK=yes |
47 | export NO_PKGTOOLS_REQD_CHECK | | 47 | export NO_PKGTOOLS_REQD_CHECK |
48 | | | 48 | |
49 | unprivileged=no | | 49 | unprivileged=no |
50 | | | 50 | |
51 | preserve_path=no | | 51 | preserve_path=no |
52 | | | 52 | |
53 | # where the building takes place | | 53 | # where the building takes place |
54 | bootstrapdir=`dirname "$0"` | | 54 | bootstrapdir=`dirname "$0"` |
55 | bootstrapdir=`cd "${bootstrapdir}" && pwd` | | 55 | bootstrapdir=`cd "${bootstrapdir}" && pwd` |
56 | pkgsrcdir=`dirname "${bootstrapdir}"` | | 56 | pkgsrcdir=`dirname "${bootstrapdir}"` |
57 | wrkdir="`pwd`/work" | | 57 | wrkdir="`pwd`/work" |
58 | | | 58 | |
59 | usage="Usage: $0 "' | | 59 | usage="Usage: $0 "' |
60 | [ --abi [32|64] ] | | 60 | [ --abi [32|64] ] |
61 | [ --binary-kit <tarball> ] | | 61 | [ --binary-kit <tarball> ] |
62 | [ --compiler <compiler> ] | | 62 | [ --compiler <compiler> ] |
63 | [ --cwrappers <auto|yes|no> ] | | 63 | [ --cwrappers <auto|yes|no> ] |
64 | [ --full ] | | 64 | [ --full ] |
65 | [ --gzip-binary-kit <tarball> ] | | 65 | [ --gzip-binary-kit <tarball> ] |
66 | [ --help ] | | 66 | [ --help ] |
67 | [ --machine-arch <arch> ] | | 67 | [ --machine-arch <arch> ] |
68 | [ --make-jobs <num> ] | | 68 | [ --make-jobs <num> ] |
69 | [ --mk-fragment <mk.conf> ] | | 69 | [ --mk-fragment <mk.conf> ] |
70 | [ --pkgdbdir <pkgdbdir> ] | | 70 | [ --pkgdbdir <pkgdbdir> ] |
71 | [ --pkginfodir <pkginfodir> ] | | 71 | [ --pkginfodir <pkginfodir> ] |
72 | [ --pkgmandir <pkgmandir> ] | | 72 | [ --pkgmandir <pkgmandir> ] |
73 | [ --prefer-pkgsrc <list|yes|no> ] | | 73 | [ --prefer-pkgsrc <list|yes|no> ] |
74 | [ --prefer-native <list|yes|no> ] | | 74 | [ --prefer-native <list|yes|no> ] |
75 | [ --prefix <prefix> ] | | 75 | [ --prefix <prefix> ] |
76 | [ --preserve-path ] | | 76 | [ --preserve-path ] |
77 | [ --quiet ] | | 77 | [ --quiet ] |
78 | [ --sysconfbase <sysconfbase> ] | | 78 | [ --sysconfbase <sysconfbase> ] |
79 | [ --sysconfdir <sysconfdir> ] | | 79 | [ --sysconfdir <sysconfdir> ] |
80 | [ --unprivileged | --ignore-user-check ] | | 80 | [ --unprivileged | --ignore-user-check ] |
81 | [ --varbase <varbase> ] | | 81 | [ --varbase <varbase> ] |
82 | [ --workdir <workdir> ] | | 82 | [ --workdir <workdir> ] |
83 | ' | | 83 | ' |
84 | | | 84 | |
85 | # strip / for BSD/OS, strip - for HP-UX | | 85 | # strip / for BSD/OS, strip - for HP-UX |
86 | opsys=`uname -s | tr -d /-` | | 86 | opsys=`uname -s | tr -d /-` |
87 | | | 87 | |
88 | mkbinarykit_tar() | | 88 | mkbinarykit_tar() |
89 | { | | 89 | { |
90 | # in case tar was built by bootstrap | | 90 | # in case tar was built by bootstrap |
91 | PATH="$prefix/bin:$PATH"; export PATH | | 91 | PATH="$prefix/bin:$PATH"; export PATH |
92 | cd / && tar -hcf "${binary_kit}" .$prefix .$pkgdbdir .$etc_mk_conf | | 92 | cd / && tar -hcf "${binary_kit}" .$prefix .$pkgdbdir .$etc_mk_conf |
93 | } | | 93 | } |
94 | | | 94 | |
95 | mkbinarykit_tgz() | | 95 | mkbinarykit_tgz() |
96 | { | | 96 | { |
97 | # in case tar was built by bootstrap | | 97 | # in case tar was built by bootstrap |
98 | PATH="$prefix/bin:$PATH"; export PATH | | 98 | PATH="$prefix/bin:$PATH"; export PATH |
99 | cd / && tar -hcf - .$prefix .$pkgdbdir .$etc_mk_conf | gzip > "${binary_gzip_kit}" | | 99 | cd / && tar -hcf - .$prefix .$pkgdbdir .$etc_mk_conf | gzip > "${binary_gzip_kit}" |
100 | } | | 100 | } |
101 | | | 101 | |
102 | die() | | 102 | die() |
103 | { | | 103 | { |
104 | echo >&2 "$*" | | 104 | echo >&2 "$*" |
105 | exit 1 | | 105 | exit 1 |
106 | } | | 106 | } |
107 | | | 107 | |
108 | echo_msg() | | 108 | echo_msg() |
109 | { | | 109 | { |
110 | echo "===> $*" | | 110 | echo "===> $*" |
111 | } | | 111 | } |
112 | | | 112 | |
113 | # see if we're using gcc. If so, set $compiler_is_gnu to '1'. | | 113 | # see if we're using gcc. If so, set $compiler_is_gnu to '1'. |
114 | get_compiler() | | 114 | get_compiler() |
115 | { | | 115 | { |
116 | testcc="${CC}" | | 116 | testcc="${CC}" |
117 | # normally, we'd just use 'cc', but certain configure tools look | | 117 | # normally, we'd just use 'cc', but certain configure tools look |
118 | # for gcc specifically, so we have to see if that comes first | | 118 | # for gcc specifically, so we have to see if that comes first |
119 | if [ -z "${testcc}" ]; then | | 119 | if [ -z "${testcc}" ]; then |
120 | save_IFS="${IFS}" | | 120 | save_IFS="${IFS}" |
121 | IFS=':' | | 121 | IFS=':' |
122 | for dir in ${PATH}; do | | 122 | for dir in ${PATH}; do |
123 | test -z "$dir" && dir=. | | 123 | test -z "$dir" && dir=. |
124 | if [ -x "$dir/gcc" ]; then | | 124 | if [ -x "$dir/gcc" ]; then |
125 | testcc="$dir/gcc" | | 125 | testcc="$dir/gcc" |
126 | break | | 126 | break |
127 | fi | | 127 | fi |
128 | done | | 128 | done |
129 | IFS="${save_IFS}" | | 129 | IFS="${save_IFS}" |
130 | fi | | 130 | fi |
131 | | | 131 | |
132 | # Clang compiler pretends to be GCC, so we have to check that | | 132 | # Clang compiler pretends to be GCC, so we have to check that |
133 | cat >${wrkdir}/$$.c <<EOF | | 133 | cat >${wrkdir}/$$.c <<EOF |
134 | #ifdef __clang__ | | 134 | #ifdef __clang__ |
135 | indeed | | 135 | indeed |
136 | #endif | | 136 | #endif |
137 | EOF | | 137 | EOF |
138 | compiler_is_clang=`${testcc:-cc} -E ${wrkdir}/$$.c 2>/dev/null | grep -c indeed` | | 138 | compiler_is_clang=`${testcc:-cc} -E ${wrkdir}/$$.c 2>/dev/null | grep -c indeed` |
139 | rm -f ${wrkdir}/$$.c | | 139 | rm -f ${wrkdir}/$$.c |
140 | | | 140 | |
141 | cat >${wrkdir}/$$.c <<EOF | | 141 | cat >${wrkdir}/$$.c <<EOF |
142 | #ifdef __GNUC__ | | 142 | #ifdef __GNUC__ |
143 | #ifndef __clang__ | | 143 | #ifndef __clang__ |
144 | indeed | | 144 | indeed |
145 | #endif | | 145 | #endif |
146 | #endif | | 146 | #endif |
147 | EOF | | 147 | EOF |
148 | compiler_is_gnu=`${testcc:-cc} -E ${wrkdir}/$$.c 2>/dev/null | grep -c indeed` | | 148 | compiler_is_gnu=`${testcc:-cc} -E ${wrkdir}/$$.c 2>/dev/null | grep -c indeed` |
149 | rm -f ${wrkdir}/$$.c | | 149 | rm -f ${wrkdir}/$$.c |
150 | | | 150 | |
151 | } | | 151 | } |
152 | get_abi() | | 152 | get_abi() |
153 | { | | 153 | { |
154 | abi_opsys=$@ | | 154 | abi_opsys=$@ |
155 | | | 155 | |
156 | if [ -n "$abi" ]; then | | 156 | if [ -n "$abi" ]; then |
157 | case "$abi_opsys" in | | 157 | case "$abi_opsys" in |
158 | IRIX) | | 158 | IRIX) |
159 | die "ERROR: $abi_opsys has special ABI handling, --abi not supported (yet)." | | 159 | die "ERROR: $abi_opsys has special ABI handling, --abi not supported (yet)." |
160 | ;; | | 160 | ;; |
161 | esac | | 161 | esac |
162 | fi | | 162 | fi |
163 | | | 163 | |
164 | case "$abi_opsys" in | | 164 | case "$abi_opsys" in |
165 | IRIX) | | 165 | IRIX) |
166 | if [ `uname -r` -ge 6 ]; then | | 166 | if [ `uname -r` -ge 6 ]; then |
167 | abi=`sed -e 's/.*\(abi=\)\([on]*[36][24]\).*/\2/' /etc/compiler.defaults` | | 167 | abi=`sed -e 's/.*\(abi=\)\([on]*[36][24]\).*/\2/' /etc/compiler.defaults` |
168 | isa=`sed -e 's/.*\(isa=mips\)\([1234]\).*/\2/' /etc/compiler.defaults` | | 168 | isa=`sed -e 's/.*\(isa=mips\)\([1234]\).*/\2/' /etc/compiler.defaults` |
169 | case "$abi" in | | 169 | case "$abi" in |
170 | o32) | | 170 | o32) |
171 | imakeopts="-DBuildO32 -DSgiISAo32=$isa" | | 171 | imakeopts="-DBuildO32 -DSgiISAo32=$isa" |
172 | abi="" | | 172 | abi="" |
173 | ;; | | 173 | ;; |
174 | n32) imakeopts="-DBuildN32 -DSgiISA32=$isa" | | 174 | n32) imakeopts="-DBuildN32 -DSgiISA32=$isa" |
175 | abi="32" | | 175 | abi="32" |
176 | ;; | | 176 | ;; |
177 | 64 | n64) | | 177 | 64 | n64) |
178 | imakeopts="-DBuild64bit -DSgiISA64=$isa" | | 178 | imakeopts="-DBuild64bit -DSgiISA64=$isa" |
179 | abi="64" | | 179 | abi="64" |
180 | ;; | | 180 | ;; |
181 | esac | | 181 | esac |
182 | else # IRIX before 6 | | 182 | else # IRIX before 6 |
183 | abi=32 | | 183 | abi=32 |
184 | fi | | 184 | fi |
185 | ;; | | 185 | ;; |
186 | esac | | 186 | esac |
187 | } | | 187 | } |
188 | | | 188 | |
189 | get_machine_arch_aix() | | 189 | get_machine_arch_aix() |
190 | { | | 190 | { |
191 | _cpuid=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` | | 191 | _cpuid=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` |
192 | if /usr/sbin/lsattr -El $_cpuid | grep ' POWER' >/dev/null 2>&1; then | | 192 | if /usr/sbin/lsattr -El $_cpuid | grep ' POWER' >/dev/null 2>&1; then |
193 | echo rs6000 | | 193 | echo rs6000 |
194 | else | | 194 | else |
195 | echo powerpc | | 195 | echo powerpc |
196 | fi | | 196 | fi |
197 | } | | 197 | } |
198 | | | 198 | |
199 | get_machine_arch_darwin() | | 199 | get_machine_arch_darwin() |
200 | { | | 200 | { |
201 | case `uname -p` in | | 201 | case `uname -p` in |
202 | arm) | | 202 | arm) |
203 | echo "aarch64" | | 203 | echo "aarch64" |
204 | ;; | | 204 | ;; |
205 | i386) | | 205 | i386) |
206 | # Returns "i386" or "x86_64" depending on CPU | | 206 | # Returns "i386" or "x86_64" depending on CPU |
207 | echo `uname -m` | | 207 | echo `uname -m` |
208 | ;; | | 208 | ;; |
209 | powerpc) | | 209 | powerpc) |
210 | echo "powerpc" | | 210 | echo "powerpc" |
211 | ;; | | 211 | ;; |
212 | esac | | 212 | esac |
213 | } | | 213 | } |
214 | | | 214 | |
215 | check_prog() | | 215 | check_prog() |
216 | { | | 216 | { |
217 | _var="$1"; _name="$2" | | 217 | _var="$1"; _name="$2" |
218 | | | 218 | |
219 | eval _tmp=\"\$$_var\" | | 219 | eval _tmp=\"\$$_var\" |
220 | if [ "x$_tmp" != "x" ]; then | | 220 | if [ "x$_tmp" != "x" ]; then |
221 | # Variable is already set (by the user, for example) | | 221 | # Variable is already set (by the user, for example) |
222 | return 0 | | 222 | return 0 |
223 | fi | | 223 | fi |
224 | | | 224 | |
225 | for _d in `echo $PATH | tr ':' ' '`; do | | 225 | for _d in `echo $PATH | tr ':' ' '`; do |
226 | if [ -f "$_d/$_name" ] && [ -x "$_d/$_name" ]; then | | 226 | if [ -f "$_d/$_name" ] && [ -x "$_d/$_name" ]; then |
227 | # Program found | | 227 | # Program found |
228 | eval $_var=\""$_d/$_name"\" | | 228 | eval $_var=\""$_d/$_name"\" |
229 | return 1 | | 229 | return 1 |
230 | fi | | 230 | fi |
231 | done | | 231 | done |
232 | | | 232 | |
233 | die "$_name not found in path." | | 233 | die "$_name not found in path." |
234 | } | | 234 | } |
235 | | | 235 | |
236 | opsys_finish() | | 236 | opsys_finish() |
237 | { | | 237 | { |
238 | case "$opsys" in | | 238 | case "$opsys" in |
239 | IRIX) | | 239 | IRIX) |
240 | if [ -n "$imakeopts" ]; then | | 240 | if [ -n "$imakeopts" ]; then |
241 | echo "IMAKEOPTS+= $imakeopts" >> ${TARGET_MKCONF} | | 241 | echo "IMAKEOPTS+= $imakeopts" >> ${TARGET_MKCONF} |
242 | fi | | 242 | fi |
243 | if [ `uname -r` -lt 6 ]; then | | 243 | if [ `uname -r` -lt 6 ]; then |
244 | echo_msg "Installing fake ldd script" | | 244 | echo_msg "Installing fake ldd script" |
245 | run_cmd "$install_sh -c -o $user -g $group -m 755 $pkgsrcdir/pkgtools/bootstrap-extras/files/fakeldd $prefix/sbin" | | 245 | run_cmd "$install_sh -c -o $user -g $group -m 755 $pkgsrcdir/pkgtools/bootstrap-extras/files/fakeldd $prefix/sbin" |
246 | need_extras=yes | | 246 | need_extras=yes |
247 | echo "LDD= $prefix/sbin/fakeldd" >> ${TARGET_MKCONF} | | 247 | echo "LDD= $prefix/sbin/fakeldd" >> ${TARGET_MKCONF} |
248 | fi | | 248 | fi |
249 | ;; | | 249 | ;; |
250 | Haiku) | | 250 | Haiku) |
251 | need_extras=yes | | 251 | need_extras=yes |
252 | echo "LDD= $prefix/sbin/fakeldd" >> ${TARGET_MKCONF} | | 252 | echo "LDD= $prefix/sbin/fakeldd" >> ${TARGET_MKCONF} |
253 | ;; | | 253 | ;; |
254 | esac | | 254 | esac |
255 | } | | 255 | } |
256 | | | 256 | |
257 | is_root() | | 257 | is_root() |
258 | { | | 258 | { |
259 | if [ `uname -s` = "IRIX" ]; then | | 259 | if [ `uname -s` = "IRIX" ]; then |
260 | if [ `uname -r` -lt 6 -a -z "$ID" ]; then | | 260 | if [ `uname -r` -lt 6 -a -z "$ID" ]; then |
261 | # older version of IRIX have an id command with limited features | | 261 | # older version of IRIX have an id command with limited features |
262 | if [ "`$idprog`" != "uid=0(root) gid=0(sys)" ]; then | | 262 | if [ "`$idprog`" != "uid=0(root) gid=0(sys)" ]; then |
263 | return 1 | | 263 | return 1 |
264 | fi | | 264 | fi |
265 | return 0 | | 265 | return 0 |
266 | fi | | 266 | fi |
267 | fi | | 267 | fi |
268 | if [ `$idprog -u` != 0 ]; then | | 268 | if [ `$idprog -u` != 0 ]; then |
269 | return 1 | | 269 | return 1 |
270 | fi | | 270 | fi |
271 | return 0 | | 271 | return 0 |
272 | } | | 272 | } |
273 | | | 273 | |
274 | # run a command, abort if it fails | | 274 | # run a command, abort if it fails |
275 | run_cmd() | | 275 | run_cmd() |
276 | { | | 276 | { |
277 | echo_msg "running: $*" | | 277 | echo_msg "running: $*" |
278 | eval "$@" | | 278 | eval "$@" |
279 | ret=$? | | 279 | ret=$? |
280 | if [ $ret -ne 0 ]; then | | 280 | if [ $ret -ne 0 ]; then |
281 | echo_msg "exited with status $ret" | | 281 | echo_msg "exited with status $ret" |
282 | die "aborted." | | 282 | die "aborted." |
283 | fi | | 283 | fi |
284 | } | | 284 | } |
285 | | | 285 | |
286 | # Some versions of mkdir (notably SunOS) bail out too easily, so use the | | 286 | # Some versions of mkdir (notably SunOS) bail out too easily, so use the |
287 | # install-sh wrapper instead. | | 287 | # install-sh wrapper instead. |
288 | mkdir_p() | | 288 | mkdir_p() |
289 | { | | 289 | { |
290 | for dir in "$@"; do | | 290 | for dir in "$@"; do |
291 | run_cmd "$install_sh -d -o $user -g $group $dir" | | 291 | run_cmd "$install_sh -d -o $user -g $group $dir" |
292 | done | | 292 | done |
293 | } | | 293 | } |
294 | | | 294 | |
295 | mkdir_p_early() | | 295 | mkdir_p_early() |
296 | { | | 296 | { |
297 | [ -d "$1" ] && return 0 | | 297 | [ -d "$1" ] && return 0 |
298 | mkdir -p "$1" 2> /dev/null && return 0 | | 298 | mkdir -p "$1" 2> /dev/null && return 0 |
299 | parent=`dirname "$1"` | | 299 | parent=`dirname "$1"` |
300 | mkdir_p_early "$parent" | | 300 | mkdir_p_early "$parent" |
301 | if [ ! -d "$1" ] && mkdir "$1"; then | | 301 | if [ ! -d "$1" ] && mkdir "$1"; then |
302 | echo_msg "mkdir $1 exited with status $?" | | 302 | echo_msg "mkdir $1 exited with status $?" |
303 | die "aborted." | | 303 | die "aborted." |
304 | fi | | 304 | fi |
305 | return 0 | | 305 | return 0 |
306 | } | | 306 | } |
307 | | | 307 | |
308 | copy_src() | | 308 | copy_src() |
309 | { | | 309 | { |
310 | _src="$1"; _dst="$2" | | 310 | _src="$1"; _dst="$2" |
311 | if [ ! -d $wrkdir/$_dst ]; then | | 311 | if [ ! -d $wrkdir/$_dst ]; then |
312 | mkdir_p $wrkdir/$_dst | | 312 | mkdir_p $wrkdir/$_dst |
313 | fi | | 313 | fi |
314 | $cpprog -r $_src/* $wrkdir/$_dst | | 314 | $cpprog -r $_src/* $wrkdir/$_dst |
315 | if [ -f $wrkdir/$_dst/config.guess ]; then | | 315 | if [ -f $wrkdir/$_dst/config.guess ]; then |
316 | $cpprog $pkgsrcdir/mk/gnu-config/config.guess $wrkdir/$_dst/ | | 316 | $cpprog $pkgsrcdir/mk/gnu-config/config.guess $wrkdir/$_dst/ |
317 | fi | | 317 | fi |
318 | if [ -f $wrkdir/$_dst/config.sub ]; then | | 318 | if [ -f $wrkdir/$_dst/config.sub ]; then |
319 | $cpprog $pkgsrcdir/mk/gnu-config/config.sub $wrkdir/$_dst/ | | 319 | $cpprog $pkgsrcdir/mk/gnu-config/config.sub $wrkdir/$_dst/ |
320 | fi | | 320 | fi |
321 | } | | 321 | } |
322 | | | 322 | |
323 | get_optarg() | | 323 | get_optarg() |
324 | { | | 324 | { |
325 | expr "x$1" : "x[^=]*=\\(.*\\)" | | 325 | expr "x$1" : "x[^=]*=\\(.*\\)" |
326 | } | | 326 | } |
327 | | | 327 | |
328 | # The --prefer-pkgsrc and --prefer native options require an argument, | | 328 | # The --prefer-pkgsrc and --prefer native options require an argument, |
329 | # but our manual getopt parser is unable to detect the difference | | 329 | # but our manual getopt parser is unable to detect the difference |
330 | # between a valid argument and the next getopt option (or no option | | 330 | # between a valid argument and the next getopt option (or no option |
331 | # at all if it's the last). Ensure that the argument does not begin | | 331 | # at all if it's the last). Ensure that the argument does not begin |
332 | # with "-" or is empty in case the user forgets to provide one. | | 332 | # with "-" or is empty in case the user forgets to provide one. |
333 | checkarg_missing() | | 333 | checkarg_missing() |
334 | { | | 334 | { |
335 | case $1 in | | 335 | case $1 in |
336 | -*|"") | | 336 | -*|"") |
337 | die "ERROR: $2 takes yes, no or a list" | | 337 | die "ERROR: $2 takes yes, no or a list" |
338 | ;; | | 338 | ;; |
339 | esac | | 339 | esac |
340 | } | | 340 | } |
341 | | | 341 | |
342 | checkarg_sane_absolute_path() | | 342 | checkarg_sane_absolute_path() |
343 | { | | 343 | { |
344 | case "$1" in | | 344 | case "$1" in |
345 | "") ;; # the default value will be used. | | 345 | "") ;; # the default value will be used. |
346 | *[!-A-Za-z0-9_./]*) | | 346 | *[!-A-Za-z0-9_./]*) |
347 | die "ERROR: Invalid characters in path $1 (from $2)." ;; | | 347 | die "ERROR: Invalid characters in path $1 (from $2)." ;; |
348 | */) die "ERROR: The argument to $2 must not end in /." ;; | | 348 | */) die "ERROR: The argument to $2 must not end in /." ;; |
349 | *//* | */. | */./* | */.. | */../*) | | 349 | *//* | */. | */./* | */.. | */../*) |
350 | die "ERROR: The path $1 (from $2) must be canonical." ;; | | 350 | die "ERROR: The path $1 (from $2) must be canonical." ;; |
351 | /*) checkarg_no_symlink_path "$1" "$2" ;; | | 351 | /*) checkarg_no_symlink_path "$1" "$2" ;; |
352 | *) die "ERROR: The argument to $2 must be an absolute path." ;; | | 352 | *) die "ERROR: The argument to $2 must be an absolute path." ;; |
353 | esac | | 353 | esac |
354 | } | | 354 | } |
355 | | | 355 | |
356 | checkarg_no_symlink_path() | | 356 | checkarg_no_symlink_path() |
357 | { | | 357 | { |
358 | _dir=$1 | | 358 | _dir=$1 |
359 | while [ ! -d "$_dir" ]; do | | 359 | while [ ! -d "$_dir" ]; do |
360 | _dir=`dirname "$_dir"` | | 360 | _dir=`dirname "$_dir"` |
361 | [ "$_dir" ] || _dir="/" | | 361 | [ "$_dir" ] || _dir="/" |
362 | done | | 362 | done |
363 | | | 363 | |
364 | _realdir=`cd "$_dir" && exec pwd` | | 364 | _realdir=`cd "$_dir" && exec pwd` |
365 | [ "$_realdir" = "$_dir" ] && return | | 365 | [ "$_realdir" = "$_dir" ] && return |
366 | | | 366 | |
367 | die "ERROR: The path $1 (from $2) must not contain symlinks. | | 367 | die "ERROR: The path $1 (from $2) must not contain symlinks. |
368 | | | 368 | |
369 | Given path : $1 | | 369 | Given path : $1 |
370 | Resolved path: $_realdir${1##${_dir}} | | 370 | Resolved path: $_realdir${1##${_dir}} |
371 | | | 371 | |
372 | Several packages assume that the given path of $2 stays the same | | 372 | Several packages assume that the given path of $2 stays the same |
373 | when symlinks are resolved. When that assumption fails, they will: | | 373 | when symlinks are resolved. When that assumption fails, they will: |
374 | | | 374 | |
375 | * not find some include files or libraries during the build phase | | 375 | * not find some include files or libraries during the build phase |
376 | since the files from dependencies are not installed in | | 376 | since the files from dependencies are not installed in |
377 | \${WRKDIR}/.buildlink. | | 377 | \${WRKDIR}/.buildlink. |
378 | | | 378 | |
379 | * install their files into the wrong path inside \${WRKDIR}/.destdir, | | 379 | * install their files into the wrong path inside \${WRKDIR}/.destdir, |
380 | which will fail the PLIST check during the install phase." | | 380 | which will fail the PLIST check during the install phase." |
381 | } | | 381 | } |
382 | | | 382 | |
383 | checkarg_sane_relative_path() { | | 383 | checkarg_sane_relative_path() { |
384 | case "$1" in | | 384 | case "$1" in |
385 | "") ;; # the default value will be used. | | 385 | "") ;; # the default value will be used. |
386 | *[!-A-Za-z0-9_./]*) | | 386 | *[!-A-Za-z0-9_./]*) |
387 | die "ERROR: Invalid characters in path $1 (from $2)." ;; | | 387 | die "ERROR: Invalid characters in path $1 (from $2)." ;; |
388 | /*) die "ERROR: The argument to $2 must be a relative path." ;; | | 388 | /*) die "ERROR: The argument to $2 must be a relative path." ;; |
389 | *) ;; | | 389 | *) ;; |
390 | esac | | 390 | esac |
391 | } | | 391 | } |
392 | | | 392 | |
393 | bootstrap_sh=${SH-/bin/sh} | | 393 | bootstrap_sh=${SH-/bin/sh} |
394 | bootstrap_sh_set=${SH+set} | | 394 | bootstrap_sh_set=${SH+set} |
395 | | | 395 | |
396 | case "$bootstrap_sh" in | | 396 | case "$bootstrap_sh" in |
397 | /*) | | 397 | /*) |
398 | ;; | | 398 | ;; |
399 | *) | | 399 | *) |
400 | die "ERROR: The variable SH must contain an absolute path" | | 400 | die "ERROR: The variable SH must contain an absolute path" |
401 | ;; | | 401 | ;; |
402 | esac | | 402 | esac |
403 | | | 403 | |
404 | if [ -n "$PKG_PATH" ]; then | | 404 | if [ -n "$PKG_PATH" ]; then |
405 | die "ERROR: Please unset PKG_PATH before running bootstrap." | | 405 | die "ERROR: Please unset PKG_PATH before running bootstrap." |
406 | fi | | 406 | fi |
407 | | | 407 | |
408 | build_start=`date` | | 408 | build_start=`date` |
409 | echo_msg "bootstrap command: $0 $*" | | 409 | echo_msg "bootstrap command: $0 $*" |
410 | echo_msg "bootstrap started: $build_start" | | 410 | echo_msg "bootstrap started: $build_start" |
411 | | | 411 | |
412 | # ensure system locations are empty; we will set them later when we know | | 412 | # ensure system locations are empty; we will set them later when we know |
413 | # whether they will be system wide or user specific | | 413 | # whether they will be system wide or user specific |
414 | prefix= | | 414 | prefix= |
415 | pkgdbdir= | | 415 | pkgdbdir= |
416 | pkginfodir= | | 416 | pkginfodir= |
417 | pkgmandir= | | 417 | pkgmandir= |
418 | sysconfbase= | | 418 | sysconfbase= |
419 | sysconfdir= | | 419 | sysconfdir= |
420 | varbase= | | 420 | varbase= |
421 | | | 421 | |
422 | compiler="" | | 422 | compiler="" |
423 | cwrappers=auto | | 423 | cwrappers=auto |
424 | full=no | | 424 | full=no |
425 | march= | | 425 | march= |
426 | make_jobs=1 | | 426 | make_jobs=1 |
427 | mk_fragment= | | 427 | mk_fragment= |
428 | quiet=no | | 428 | quiet=no |
429 | | | 429 | |
430 | # Set these variables so that we can test whether they have been | | 430 | # Set these variables so that we can test whether they have been |
431 | # correctly enabled by the user and not left empty | | 431 | # correctly enabled by the user and not left empty |
432 | prefer_native=unset | | 432 | prefer_native=unset |
433 | prefer_pkgsrc=unset | | 433 | prefer_pkgsrc=unset |
434 | | | 434 | |
435 | while [ $# -gt 0 ]; do | | 435 | while [ $# -gt 0 ]; do |
436 | case $1 in | | 436 | case $1 in |
437 | --workdir=*) wrkdir=`get_optarg "$1"` ;; | | 437 | --workdir=*) wrkdir=`get_optarg "$1"` ;; |
438 | --workdir) wrkdir="$2"; shift ;; | | 438 | --workdir) wrkdir="$2"; shift ;; |
439 | --prefix=*) prefix=`get_optarg "$1"` ;; | | 439 | --prefix=*) prefix=`get_optarg "$1"` ;; |
440 | --prefix) prefix="$2"; shift ;; | | 440 | --prefix) prefix="$2"; shift ;; |
441 | --pkgdbdir=*) pkgdbdir=`get_optarg "$1"` ;; | | 441 | --pkgdbdir=*) pkgdbdir=`get_optarg "$1"` ;; |
442 | --pkgdbdir) pkgdbdir="$2"; shift ;; | | 442 | --pkgdbdir) pkgdbdir="$2"; shift ;; |
443 | --pkginfodir=*) pkginfodir=`get_optarg "$1"` ;; | | 443 | --pkginfodir=*) pkginfodir=`get_optarg "$1"` ;; |
444 | --pkginfodir) pkginfodir="$2"; shift ;; | | 444 | --pkginfodir) pkginfodir="$2"; shift ;; |
445 | --pkgmandir=*) pkgmandir=`get_optarg "$1"` ;; | | 445 | --pkgmandir=*) pkgmandir=`get_optarg "$1"` ;; |
446 | --pkgmandir) pkgmandir="$2"; shift ;; | | 446 | --pkgmandir) pkgmandir="$2"; shift ;; |
447 | --sysconfbase=*)sysconfbase=`get_optarg "$1"` ;; | | 447 | --sysconfbase=*)sysconfbase=`get_optarg "$1"` ;; |
448 | --sysconfbase) sysconfbase="$2"; shift ;; | | 448 | --sysconfbase) sysconfbase="$2"; shift ;; |
449 | --sysconfdir=*) sysconfdir=`get_optarg "$1"` ;; | | 449 | --sysconfdir=*) sysconfdir=`get_optarg "$1"` ;; |
450 | --sysconfdir) sysconfdir="$2"; shift ;; | | 450 | --sysconfdir) sysconfdir="$2"; shift ;; |
451 | --varbase=*) varbase=`get_optarg "$1"` ;; | | 451 | --varbase=*) varbase=`get_optarg "$1"` ;; |
452 | --varbase) varbase="$2"; shift ;; | | 452 | --varbase) varbase="$2"; shift ;; |
453 | --compiler=*) compiler=`get_optarg "$1"` ;; | | 453 | --compiler=*) compiler=`get_optarg "$1"` ;; |
454 | --compiler) compiler="$2"; shift ;; | | 454 | --compiler) compiler="$2"; shift ;; |
455 | --abi=*) abi=`get_optarg "$1"` ;; | | 455 | --abi=*) abi=`get_optarg "$1"` ;; |
456 | --abi) abi="$2"; shift ;; | | 456 | --abi) abi="$2"; shift ;; |
457 | --cwrappers=*) cwrappers=`get_optarg "$1"` ;; | | 457 | --cwrappers=*) cwrappers=`get_optarg "$1"` ;; |
458 | --cwrappers) cwrappers="$2"; shift ;; | | 458 | --cwrappers) cwrappers="$2"; shift ;; |
459 | --unprivileged | --ignore-user-check) unprivileged=yes ;; | | 459 | --unprivileged | --ignore-user-check) unprivileged=yes ;; |
460 | --prefer-pkgsrc=*) | | 460 | --prefer-pkgsrc=*) |
461 | prefer_pkgsrc=`get_optarg "$1"` ;; | | 461 | prefer_pkgsrc=`get_optarg "$1"` ;; |
462 | --prefer-pkgsrc) | | 462 | --prefer-pkgsrc) |
463 | prefer_pkgsrc="$2"; shift ;; | | 463 | prefer_pkgsrc="$2"; shift ;; |
464 | --prefer-native=*) | | 464 | --prefer-native=*) |
465 | prefer_native=`get_optarg "$1"` ;; | | 465 | prefer_native=`get_optarg "$1"` ;; |
466 | --prefer-native) | | 466 | --prefer-native) |
467 | prefer_native="$2"; shift ;; | | 467 | prefer_native="$2"; shift ;; |
468 | --preserve-path) preserve_path=yes ;; | | 468 | --preserve-path) preserve_path=yes ;; |
469 | --mk-fragment=*) | | 469 | --mk-fragment=*) |
470 | mk_fragment=`get_optarg "$1"` ;; | | 470 | mk_fragment=`get_optarg "$1"` ;; |
471 | --mk-fragment) | | 471 | --mk-fragment) |
472 | mk_fragment="$2"; shift ;; | | 472 | mk_fragment="$2"; shift ;; |
473 | --binary-kit=*) | | 473 | --binary-kit=*) |
474 | binary_kit=`get_optarg "$1"` ;; | | 474 | binary_kit=`get_optarg "$1"` ;; |
475 | --binary-kit) | | 475 | --binary-kit) |
476 | binary_kit="$2"; shift ;; | | 476 | binary_kit="$2"; shift ;; |
477 | --gzip-binary-kit=*) | | 477 | --gzip-binary-kit=*) |
478 | binary_gzip_kit=`get_optarg "$1"` ;; | | 478 | binary_gzip_kit=`get_optarg "$1"` ;; |
479 | --gzip-binary-kit) | | 479 | --gzip-binary-kit) |
480 | binary_gzip_kit="$2"; shift ;; | | 480 | binary_gzip_kit="$2"; shift ;; |
481 | --machine-arch=*) | | 481 | --machine-arch=*) |
482 | march=`get_optarg "$1"` ;; | | 482 | march=`get_optarg "$1"` ;; |
483 | --machine-arch) march="$2"; shift ;; | | 483 | --machine-arch) march="$2"; shift ;; |
484 | --make-jobs=*) make_jobs=`get_optarg "$1"` ;; | | 484 | --make-jobs=*) make_jobs=`get_optarg "$1"` ;; |
485 | --make-jobs) make_jobs="$2"; shift ;; | | 485 | --make-jobs) make_jobs="$2"; shift ;; |
486 | --full) full=yes ;; | | 486 | --full) full=yes ;; |
487 | --quiet) quiet=yes ;; | | 487 | --quiet) quiet=yes ;; |
488 | --help) echo "$usage"; exit ;; | | 488 | --help) echo "$usage"; exit ;; |
489 | -h) echo "$usage"; exit ;; | | 489 | -h) echo "$usage"; exit ;; |
490 | -*) echo "${0##*/}: unknown option \"$1\"" 1>&2 | | 490 | -*) echo "${0##*/}: unknown option \"$1\"" 1>&2 |
491 | echo "$usage" 1>&2; exit 1 ;; | | 491 | echo "$usage" 1>&2; exit 1 ;; |
492 | esac | | 492 | esac |
493 | shift | | 493 | shift |
494 | done | | 494 | done |
495 | | | 495 | |
496 | checkarg_sane_absolute_path "$pkgdbdir" "--pkgdbdir" | | 496 | checkarg_sane_absolute_path "$pkgdbdir" "--pkgdbdir" |
497 | checkarg_sane_absolute_path "$sysconfbase" "--sysconfbase" | | 497 | checkarg_sane_absolute_path "$sysconfbase" "--sysconfbase" |
498 | checkarg_sane_absolute_path "$sysconfdir" "--sysconfdir" | | 498 | checkarg_sane_absolute_path "$sysconfdir" "--sysconfdir" |
499 | checkarg_sane_absolute_path "$varbase" "--varbase" | | 499 | checkarg_sane_absolute_path "$varbase" "--varbase" |
500 | checkarg_sane_relative_path "$pkginfodir" "--pkginfodir" | | 500 | checkarg_sane_relative_path "$pkginfodir" "--pkginfodir" |
501 | checkarg_sane_relative_path "$pkgmandir" "--pkgmandir" | | 501 | checkarg_sane_relative_path "$pkgmandir" "--pkgmandir" |
502 | checkarg_sane_absolute_path "$wrkdir" "--workdir" | | 502 | checkarg_sane_absolute_path "$wrkdir" "--workdir" |
503 | checkarg_missing "$prefer_pkgsrc" "--prefer-pkgsrc" | | 503 | checkarg_missing "$prefer_pkgsrc" "--prefer-pkgsrc" |
504 | checkarg_missing "$prefer_native" "--prefer-native" | | 504 | checkarg_missing "$prefer_native" "--prefer-native" |
505 | | | 505 | |
506 | | | 506 | |
507 | # set defaults for system locations if not already set by the user | | 507 | # set defaults for system locations if not already set by the user |
508 | wrkobjdir=${wrkdir}/pkgsrc | | 508 | wrkobjdir=${wrkdir}/pkgsrc |
509 | if [ "$unprivileged" = "yes" ]; then | | 509 | if [ "$unprivileged" = "yes" ]; then |
510 | [ -z "$prefix" ] && prefix=${HOME}/pkg | | 510 | [ -z "$prefix" ] && prefix=${HOME}/pkg |
511 | elif [ -z "$prefix" -o "$prefix" = "/usr/pkg" ]; then | | 511 | elif [ -z "$prefix" -o "$prefix" = "/usr/pkg" ]; then |
512 | prefix=/usr/pkg | | 512 | prefix=/usr/pkg |
513 | [ -z "$sysconfbase" ] && sysconfbase=/etc | | 513 | [ -z "$sysconfbase" ] && sysconfbase=/etc |
514 | [ -z "$varbase" ] && varbase=/var | | 514 | [ -z "$varbase" ] && varbase=/var |
515 | fi | | 515 | fi |
516 | checkarg_sane_absolute_path "$prefix" "--prefix" | | 516 | checkarg_sane_absolute_path "$prefix" "--prefix" |
517 | | | 517 | |
518 | [ -z "$varbase" ] && varbase=${prefix}/var | | 518 | [ -z "$varbase" ] && varbase=${prefix}/var |
519 | [ -z "$pkgdbdir" ] && pkgdbdir=${prefix}/pkgdb | | 519 | [ -z "$pkgdbdir" ] && pkgdbdir=${prefix}/pkgdb |
520 | | | 520 | |
521 | if [ "$prefix" = "/usr" ]; then | | 521 | if [ "$prefix" = "/usr" ]; then |
522 | [ -z "$pkginfodir" ] && pkginfodir=share/info | | 522 | [ -z "$pkginfodir" ] && pkginfodir=share/info |
523 | [ -z "$pkgmandir" ] && pkgmandir=share/man | | 523 | [ -z "$pkgmandir" ] && pkgmandir=share/man |
524 | [ -z "$sysconfbase" ] && sysconfbase=/etc | | 524 | [ -z "$sysconfbase" ] && sysconfbase=/etc |
525 | else | | 525 | else |
526 | [ -z "$pkginfodir" ] && pkginfodir=info | | 526 | [ -z "$pkginfodir" ] && pkginfodir=info |
527 | [ -z "$pkgmandir" ] && pkgmandir=man | | 527 | [ -z "$pkgmandir" ] && pkgmandir=man |
528 | [ -z "$sysconfbase" ] && sysconfbase=${prefix}/etc | | 528 | [ -z "$sysconfbase" ] && sysconfbase=${prefix}/etc |
529 | fi | | 529 | fi |
530 | infodir=${prefix}/${pkginfodir} | | 530 | infodir=${prefix}/${pkginfodir} |
531 | mandir=${prefix}/${pkgmandir} | | 531 | mandir=${prefix}/${pkgmandir} |
532 | [ -z "$sysconfdir" ] && sysconfdir=${prefix}/etc | | 532 | [ -z "$sysconfdir" ] && sysconfdir=${prefix}/etc |
533 | | | 533 | |
534 | if [ "x$preserve_path" != "xyes" ]; then | | 534 | if [ "x$preserve_path" != "xyes" ]; then |
535 | PATH="$PATH:/sbin:/usr/sbin" | | 535 | PATH="$PATH:/sbin:/usr/sbin" |
536 | fi | | 536 | fi |
537 | | | 537 | |
538 | if [ "$prefer_native" = "unset" ]; then | | 538 | if [ "$prefer_native" = "unset" ]; then |
539 | prefer_native= | | 539 | prefer_native= |
540 | fi | | 540 | fi |
541 | if [ "$prefer_pkgsrc" = "unset" ]; then | | 541 | if [ "$prefer_pkgsrc" = "unset" ]; then |
542 | prefer_pkgsrc= | | 542 | prefer_pkgsrc= |
543 | fi | | 543 | fi |
544 | | | 544 | |
545 | | | 545 | |
546 | overpath="" | | 546 | overpath="" |
547 | root_user=root | | 547 | root_user=root |
548 | bmakexargs= | | 548 | bmakexargs= |
549 | need_awk=no | | 549 | need_awk=no |
550 | need_bsd_install=no | | 550 | need_bsd_install=no |
551 | need_extras=no | | 551 | need_extras=no |
552 | need_sed=no | | 552 | need_sed=no |
553 | need_xargs=no | | 553 | need_xargs=no |
554 | set_opsys=no | | 554 | set_opsys=no |
555 | use_bsdinstall= | | 555 | use_bsdinstall= |
556 | case "$opsys" in | | 556 | case "$opsys" in |
557 | AIX) | | 557 | AIX) |
558 | root_group=system | | 558 | root_group=system |
559 | need_bsd_install=yes | | 559 | need_bsd_install=yes |
560 | need_awk=yes | | 560 | need_awk=yes |
561 | need_sed=yes | | 561 | need_sed=yes |
562 | need_ksh=yes | | 562 | need_ksh=yes |
563 | need_fixed_strip=yes | | 563 | need_fixed_strip=yes |
564 | machine_arch=`get_machine_arch_aix` | | 564 | machine_arch=`get_machine_arch_aix` |
565 | ;; | | 565 | ;; |
566 | Bitrig) | | 566 | Bitrig) |
567 | root_group=wheel | | 567 | root_group=wheel |
568 | machine_arch=`arch -s` | | 568 | machine_arch=`arch -s` |
569 | check_compiler=yes | | 569 | check_compiler=yes |
570 | ;; | | 570 | ;; |
571 | CYGWIN_*) | | 571 | CYGWIN_*) |
572 | is_root () { | | 572 | is_root () { |
573 | if id -nG | grep -q 'Administrators'; then | | 573 | if id -nG | grep -q 'Administrators'; then |
574 | return 0 | | 574 | return 0 |
575 | fi | | 575 | fi |
576 | return 1 | | 576 | return 1 |
577 | } | | 577 | } |
578 | root_user=Administrators | | 578 | root_user=Administrators |
579 | root_group=Administrators | | 579 | root_group=Administrators |
580 | opsys=`uname -o` | | 580 | opsys=`uname -o` |
581 | need_sed=yes | | 581 | need_sed=yes |
582 | machine_arch=`uname -m` | | 582 | machine_arch=`uname -m` |
583 | # only used for unprivileged builds. | | 583 | # only used for unprivileged builds. |
584 | whoamiprog='id -u' | | 584 | whoamiprog='id -u' |
585 | groupsprog='id -g' | | 585 | groupsprog='id -g' |
586 | ;; | | 586 | ;; |
587 | Darwin) | | 587 | Darwin) |
588 | root_group=wheel | | 588 | root_group=wheel |
589 | machine_arch=`get_machine_arch_darwin` | | 589 | machine_arch=`get_machine_arch_darwin` |
590 | CC=${CC:-"cc -isystem /usr/include"}; export CC | | 590 | CC=${CC:-"cc -isystem /usr/include"}; export CC |
591 | check_compiler=yes | | 591 | check_compiler=yes |
592 | | | 592 | |
593 | # Combine major.minor product version for simpler numerical tests. | | 593 | # Combine major.minor product version for simpler numerical tests. |
594 | macos_version=`sw_vers -productVersion | \ | | 594 | macos_version=`sw_vers -productVersion | \ |
595 | awk -F. '{ printf("%02d%02d", $1, $2) }'` | | 595 | awk -F. '{ printf("%02d%02d", $1, $2) }'` |
596 | | | 596 | |
597 | # Newer native sed does not support multibyte correctly. | | 597 | # Newer native sed does not support multibyte correctly. |
598 | if [ $macos_version -ge 1008 ]; then | | 598 | if [ $macos_version -ge 1008 ]; then |
599 | need_awk=yes | | 599 | need_awk=yes |
600 | need_sed=yes | | 600 | need_sed=yes |
601 | fi | | 601 | fi |
602 | | | 602 | |
603 | # Avoid system shells on macOS versions that enable System Integrity | | 603 | # Avoid system shells on macOS versions that enable System Integrity |
604 | # Protection (SIP) as it affects packages that rely on variables such | | 604 | # Protection (SIP) as it affects packages that rely on variables such |
605 | # as LD_LIBRARY_PATH. SIP unsets any variables that may affect | | 605 | # as LD_LIBRARY_PATH. SIP unsets any variables that may affect |
606 | # security when using system binaries, i.e. /bin/*sh, but using a | | 606 | # security when using system binaries, i.e. /bin/*sh, but using a |
607 | # non-system shell is unaffected, at least for now. | | 607 | # non-system shell is unaffected, at least for now. |
608 | if [ $macos_version -ge 1011 ]; then | | 608 | if [ $macos_version -ge 1011 ]; then |
609 | need_mksh=yes | | 609 | need_mksh=yes |
610 | fi | | 610 | fi |
611 | | | 611 | |
612 | unset macos_version | | 612 | unset macos_version |
613 | ;; | | 613 | ;; |
614 | DragonFly) | | 614 | DragonFly) |
615 | root_group=wheel | | 615 | root_group=wheel |
616 | check_prog tarprog tar | | 616 | check_prog tarprog tar |
617 | machine_arch=`uname -p` | | 617 | machine_arch=`uname -p` |
618 | ;; | | 618 | ;; |
619 | FreeBSD) | | 619 | FreeBSD) |
620 | root_group=wheel | | 620 | root_group=wheel |
621 | machine_arch=`uname -p` | | 621 | machine_arch=`uname -p` |
622 | check_compiler=yes | | 622 | check_compiler=yes |
623 | ;; | | 623 | ;; |
624 | FreeMiNT) | | 624 | FreeMiNT) |
625 | root_group=root | | 625 | root_group=root |
626 | machine_arch=m68k | | 626 | machine_arch=m68k |
627 | ;; | | 627 | ;; |
628 | GNUkFreeBSD) | | 628 | GNUkFreeBSD) |
629 | root_group=root | | 629 | root_group=root |
630 | need_awk=yes | | 630 | need_awk=yes |
631 | machine_arch=`uname -m` | | 631 | machine_arch=`uname -m` |
632 | ;; | | 632 | ;; |
633 | Haiku) | | 633 | Haiku) |
634 | root_user=`id -un` | | 634 | root_user=`id -un` |
635 | root_group=root | | 635 | root_group=root |
636 | case `uname -m` in | | 636 | case `uname -m` in |
637 | BeMac) | | 637 | BeMac) |
638 | machine_arch=powerpc | | 638 | machine_arch=powerpc |
639 | ;; | | 639 | ;; |
640 | BePC) | | 640 | BePC) |
641 | machine_arch=i386 | | 641 | machine_arch=i386 |
642 | ;; | | 642 | ;; |
643 | *) | | 643 | *) |
644 | machine_arch=`uname -p` | | 644 | machine_arch=`uname -p` |
645 | ;; | | 645 | ;; |
646 | esac | | 646 | esac |
647 | ;; | | 647 | ;; |
648 | HPUX) | | 648 | HPUX) |
649 | root_group=sys | | 649 | root_group=sys |
650 | need_bsd_install=yes | | 650 | need_bsd_install=yes |
651 | need_awk=yes | | 651 | need_awk=yes |
652 | need_sed=yes | | 652 | need_sed=yes |
653 | machine_arch=`uname -m | sed 's/^9000.*$/hppa/'` | | 653 | machine_arch=`uname -m | sed 's/^9000.*$/hppa/'` |
654 | ;; | | 654 | ;; |
655 | Interix) | | 655 | Interix) |
656 | is_root () { | | 656 | is_root () { |
657 | if id -G | grep -q 131616; then | | 657 | if id -G | grep -q 131616; then |
658 | return 0 | | 658 | return 0 |
659 | fi | | 659 | fi |
660 | return 1 | | 660 | return 1 |
661 | } | | 661 | } |
662 | mkdir_p () { | | 662 | mkdir_p () { |
663 | mkdir -p "$@" # allows umask to take effect | | 663 | mkdir -p "$@" # allows umask to take effect |
664 | } | | 664 | } |
665 | default_install_mode=0775 | | 665 | default_install_mode=0775 |
666 | root_user=`id -un` | | 666 | root_user=`id -un` |
667 | root_group=+Administrators | | 667 | root_group=+Administrators |
668 | case `uname -r` in | | 668 | case `uname -r` in |
669 | 3.* | 5.*) | | 669 | 3.* | 5.*) |
670 | need_bsd_install=yes | | 670 | need_bsd_install=yes |
671 | need_awk=yes | | 671 | need_awk=yes |
672 | need_sed=yes | | 672 | need_sed=yes |
673 | need_xargs=yes | | 673 | need_xargs=yes |
674 | ;; | | 674 | ;; |
675 | esac | | 675 | esac |
676 | # only used for unprivileged builds | | 676 | # only used for unprivileged builds |
677 | groupsprog="id -gn" | | 677 | groupsprog="id -gn" |
678 | # for bootstrap only; pkgsrc uses CPPFLAGS | | 678 | # for bootstrap only; pkgsrc uses CPPFLAGS |
679 | CC="gcc -D_ALL_SOURCE"; export CC | | 679 | CC="gcc -D_ALL_SOURCE"; export CC |
680 | ac_cv_header_poll_h=no; export ac_cv_header_poll_h | | 680 | ac_cv_header_poll_h=no; export ac_cv_header_poll_h |
681 | ac_cv_func_poll=no; export ac_cv_func_poll | | 681 | ac_cv_func_poll=no; export ac_cv_func_poll |
682 | ;; | | 682 | ;; |
683 | IRIX*) | | 683 | IRIX*) |
684 | if [ -d "/usr/freeware/bin" ]; then | | 684 | if [ -d "/usr/freeware/bin" ]; then |
685 | overpath="/usr/freeware/bin:$overpath" | | 685 | overpath="/usr/freeware/bin:$overpath" |
686 | fi | | 686 | fi |
687 | if [ -d "/usr/bsd" ]; then | | 687 | if [ -d "/usr/bsd" ]; then |
688 | overpath="/usr/bsd:$overpath" | | 688 | overpath="/usr/bsd:$overpath" |
689 | fi | | 689 | fi |
690 | if [ -d "/usr/bsd/bin" ]; then | | 690 | if [ -d "/usr/bsd/bin" ]; then |
691 | overpath="/usr/bsd/bin:$overpath" | | 691 | overpath="/usr/bsd/bin:$overpath" |
692 | fi | | 692 | fi |
693 | root_group=sys | | 693 | root_group=sys |
694 | need_bsd_install=yes | | 694 | need_bsd_install=yes |
695 | get_abi "IRIX" | | 695 | get_abi "IRIX" |
696 | opsys=IRIX | | 696 | opsys=IRIX |
697 | need_awk=yes | | 697 | need_awk=yes |
698 | need_sed=yes | | 698 | need_sed=yes |
699 | set_opsys=yes | | 699 | set_opsys=yes |
700 | machine_arch=mipseb | | 700 | machine_arch=mipseb |
701 | check_compiler=yes | | 701 | check_compiler=yes |
702 | if [ `uname -r` -lt 6 ]; then | | 702 | if [ `uname -r` -lt 6 ]; then |
703 | # IRIX 5's mkdir bails out with an error when trying to create with the -p | | 703 | # IRIX 5's mkdir bails out with an error when trying to create with the -p |
704 | # option an already existing directory | | 704 | # option an already existing directory |
705 | need_mkdir=yes | | 705 | need_mkdir=yes |
706 | fi | | 706 | fi |
707 | ;; | | 707 | ;; |
708 | Linux) | | 708 | Linux) |
709 | if [ -f /etc/ssdlinux_version ]; then | | 709 | if [ -f /etc/ssdlinux_version ]; then |
710 | root_group=wheel | | 710 | root_group=wheel |
711 | else | | 711 | else |
712 | root_group=root | | 712 | root_group=root |
713 | fi | | 713 | fi |
714 | # Debian/Ubuntu's awk is mawk, and mawk does not understand | | 714 | # Debian/Ubuntu's awk is mawk, and mawk does not understand |
715 | # some regexp used in pkgsrc/mk. | | 715 | # some regexp used in pkgsrc/mk. |
716 | if [ -f /etc/debian_version ]; then | | 716 | if [ -f /etc/debian_version ]; then |
717 | need_awk=yes | | 717 | need_awk=yes |
718 | # Arch uses gawk 5 that breaks some regexps. It doesn't provide pax | | 718 | # Arch uses gawk 5 that breaks some regexps. It doesn't provide pax |
719 | # anymore. | | 719 | # anymore. |
720 | elif [ -f /etc/arch-release ]; then | | 720 | elif [ -f /etc/arch-release ]; then |
721 | need_awk=yes | | 721 | need_awk=yes |
722 | need_pax=yes | | 722 | need_pax=yes |
723 | elif grep -sq '^CHROMEOS_RELEASE_NAME' /etc/lsb-release; then | | 723 | elif grep -sq '^CHROMEOS_RELEASE_NAME' /etc/lsb-release; then |
724 | need_awk=yes | | 724 | need_awk=yes |
725 | need_sed=yes | | 725 | need_sed=yes |
726 | fi | | 726 | fi |
727 | machine_arch=`uname -m` | | 727 | machine_arch=`uname -m` |
728 | # Override machine_arch where required. | | 728 | # Override machine_arch where required. |
729 | case "$machine_arch" in | | 729 | case "$machine_arch" in |
730 | i?86) machine_arch=i386 ;; | | 730 | i?86) machine_arch=i386 ;; |
731 | ppc64le) machine_arch=powerpc64le ;; | | 731 | ppc64le) machine_arch=powerpc64le ;; |
732 | esac | | 732 | esac |
733 | ;; | | 733 | ;; |
734 | MidnightBSD) | | 734 | MidnightBSD) |
735 | root_group=wheel | | 735 | root_group=wheel |
736 | machine_arch=`uname -p` | | 736 | machine_arch=`uname -p` |
737 | check_compiler=yes | | 737 | check_compiler=yes |
738 | ;; | | 738 | ;; |
739 | Minix) | | 739 | Minix) |
740 | root_group=wheel | | 740 | root_group=wheel |
741 | machine_arch=`uname -p` | | 741 | machine_arch=`uname -p` |
742 | check_compiler=yes | | 742 | check_compiler=yes |
743 | ;; | | 743 | ;; |
744 | MirBSD) | | 744 | MirBSD) |
745 | root_group=wheel | | 745 | root_group=wheel |
746 | need_pax=yes | | 746 | need_pax=yes |
747 | machine_arch=`arch -s` | | 747 | machine_arch=`arch -s` |
748 | # there is no /usr/bin/cc, so use mgcc if unset | | 748 | # there is no /usr/bin/cc, so use mgcc if unset |
749 | test -n "$CC" || { CC=mgcc; export CC; } | | 749 | test -n "$CC" || { CC=mgcc; export CC; } |
750 | # get some variables from the native make if unset | | 750 | # get some variables from the native make if unset |
751 | for var in CFLAGS CPPFLAGS LDFLAGS; do | | 751 | for var in CFLAGS CPPFLAGS LDFLAGS; do |
752 | # check if variable is already set | | 752 | # check if variable is already set |
753 | eval _tmp=\"\$$var\" | | 753 | eval _tmp=\"\$$var\" |
754 | [ "x$_tmp" != x ] && continue | | 754 | [ "x$_tmp" != x ] && continue |
755 | # ask the native make (EXPERIMENTAL = don't add -Werror) | | 755 | # ask the native make (EXPERIMENTAL = don't add -Werror) |
756 | # the -I${.CURDIR} dance is to prevent junk in CPPFLAGS | | 756 | # the -I${.CURDIR} dance is to prevent junk in CPPFLAGS |
757 | _tmp=`printf '%s\nall:\n\t@%s %%s %s=${%s:M*:Q:Q}\n%s\n%s\n' \ | | 757 | _tmp=`printf '%s\nall:\n\t@%s %%s %s=${%s:M*:Q:Q}\n%s\n%s\n' \ |
758 | $var'+=-I${.CURDIR}' printf $var $var':S/-I${.CURDIR}//' \ | | 758 | $var'+=-I${.CURDIR}' printf $var $var':S/-I${.CURDIR}//' \ |
759 | EXPERIMENTAL=yes '.include <bsd.prog.mk>' | \ | | 759 | EXPERIMENTAL=yes '.include <bsd.prog.mk>' | \ |
760 | (unset MAKECONF; /usr/bin/make -f - all 2>/dev/null) | \ | | 760 | (unset MAKECONF; /usr/bin/make -f - all 2>/dev/null) | \ |
761 | sed 's/^x//'` | | 761 | sed 's/^x//'` |
762 | eval $_tmp | | 762 | eval $_tmp |
763 | eval export $var | | 763 | eval export $var |
764 | done | | 764 | done |
765 | ;; | | 765 | ;; |
766 | NetBSD) | | 766 | NetBSD) |
767 | root_group=wheel | | 767 | root_group=wheel |
768 | machine_arch=`uname -p` | | 768 | machine_arch=`uname -p` |
769 | ;; | | 769 | ;; |
770 | OpenBSD) | | 770 | OpenBSD) |
771 | root_group=wheel | | 771 | root_group=wheel |
772 | machine_arch=`arch -s` | | 772 | machine_arch=`arch -s` |
773 | CC=${CC:-cc}; export CC | | 773 | CC=${CC:-cc}; export CC |
774 | check_compiler=yes | | 774 | check_compiler=yes |
775 | ;; | | 775 | ;; |
776 | OSF1) | | 776 | OSF1) |
777 | root_group=system | | 777 | root_group=system |
778 | need_bsd_install=yes | | 778 | need_bsd_install=yes |
779 | need_awk=yes | | 779 | need_awk=yes |
780 | need_sed=yes | | 780 | need_sed=yes |
781 | need_mksh=yes | | 781 | need_mksh=yes |
782 | machine_arch=`uname -p` | | 782 | machine_arch=`uname -p` |
783 | ;; | | 783 | ;; |
784 | QNX) | | 784 | QNX) |
785 | root_group=root | | 785 | root_group=root |
786 | need_bsd_install=yes | | 786 | need_bsd_install=yes |
787 | need_awk=yes | | 787 | need_awk=yes |
788 | need_sed=yes | | 788 | need_sed=yes |
789 | groupsprog="id -gn" | | 789 | groupsprog="id -gn" |
790 | whoamiprog="id -un" | | 790 | whoamiprog="id -un" |
791 | machine_arch=`uname -p | sed -e 's/x86/i386/'` | | 791 | machine_arch=`uname -p | sed -e 's/x86/i386/'` |
792 | # libarchive checks for "rm -f" with no arguments being accepted. This | | 792 | # libarchive checks for "rm -f" with no arguments being accepted. This |
793 | # does not work on QNX. Interestingly, libarchive doesn't seem to | | 793 | # does not work on QNX. Interestingly, libarchive doesn't seem to |
794 | # actually need it during the build. | | 794 | # actually need it during the build. |
795 | export ACCEPT_INFERIOR_RM_PROGRAM=yes | | 795 | export ACCEPT_INFERIOR_RM_PROGRAM=yes |
796 | ;; | | 796 | ;; |
797 | SCO_SV) | | 797 | SCO_SV) |
798 | root_group=root | | 798 | root_group=root |
799 | need_awk=yes | | 799 | need_awk=yes |
800 | need_bsd_install=yes | | 800 | need_bsd_install=yes |
801 | need_sed=yes | | 801 | need_sed=yes |
802 | whoamiprog='id -u' | | 802 | whoamiprog='id -u' |
803 | groupsprog='id -g' | | 803 | groupsprog='id -g' |
804 | # /bin/sh under OpenServer 5.0.7/3.2 breaks bmake tests. | | 804 | # /bin/sh under OpenServer 5.0.7/3.2 breaks bmake tests. |
805 | #bmakexargs="$bmakexargs --with-defshell=/bin/ksh" | | 805 | #bmakexargs="$bmakexargs --with-defshell=/bin/ksh" |
806 | ;; | | 806 | ;; |
807 | SunOS) | | 807 | SunOS) |
808 | root_group=root | | 808 | root_group=root |
809 | need_bsd_install=yes | | 809 | need_bsd_install=yes |
810 | use_bsdinstall=yes | | 810 | use_bsdinstall=yes |
811 | if [ ! -x "/usr/gnu/bin/awk" ]; then | | 811 | if [ ! -x "/usr/gnu/bin/awk" ]; then |
812 | need_awk=yes | | 812 | need_awk=yes |
813 | fi | | 813 | fi |
814 | if [ ! -x "/usr/gnu/bin/sed" ]; then | | 814 | if [ ! -x "/usr/gnu/bin/sed" ]; then |
815 | need_sed=yes | | 815 | need_sed=yes |
816 | fi | | 816 | fi |
817 | if [ -x "/usr/bin/bash" ]; then | | 817 | if [ -x "/usr/bin/bash" ]; then |
818 | bootstrap_sh=${SH:-/usr/bin/bash} | | 818 | bootstrap_sh=${SH:-/usr/bin/bash} |
819 | bootstrap_sh_set=set | | 819 | bootstrap_sh_set=set |
820 | else | | 820 | else |
821 | need_mksh=yes | | 821 | need_mksh=yes |
822 | fi | | 822 | fi |
823 | idprog="/usr/xpg4/bin/id" | | 823 | idprog="/usr/xpg4/bin/id" |
824 | groupsprog="${idprog} -gn" | | 824 | groupsprog="${idprog} -gn" |
825 | whoamiprog="${idprog} -un" | | 825 | whoamiprog="${idprog} -un" |
826 | machine_arch=`isainfo -k` | | 826 | machine_arch=`isainfo -k` |
827 | check_compiler=yes | | 827 | check_compiler=yes |
828 | check_ssp=yes | | 828 | check_ssp=yes |
829 | ;; | | 829 | ;; |
830 | UnixWare) | | 830 | UnixWare) |
831 | root_group=sys | | 831 | root_group=sys |
832 | BSTRAP_ENV="INSTALL=/usr/ucb/install $BSTRAP_ENV" | | 832 | BSTRAP_ENV="INSTALL=/usr/ucb/install $BSTRAP_ENV" |
833 | need_mkdir=yes | | 833 | need_mkdir=yes |
834 | need_awk=yes | | 834 | need_awk=yes |
835 | need_sed=yes | | 835 | need_sed=yes |
836 | whoamiprog=/usr/ucb/whoami | | 836 | whoamiprog=/usr/ucb/whoami |
837 | machine_arch=`uname -m` | | 837 | machine_arch=`uname -m` |
838 | CC="gcc -DUNIXWARE"; export CC | | 838 | CC="gcc -DUNIXWARE"; export CC |
839 | ;; | | 839 | ;; |
840 | *) | | 840 | *) |
841 | echo "This platform ($opsys) is untried - good luck, and thanks for using pkgsrc" | | 841 | echo "This platform ($opsys) is untried - good luck, and thanks for using pkgsrc" |
842 | root_group=wheel | | 842 | root_group=wheel |
843 | need_bsd_install=yes | | 843 | need_bsd_install=yes |
844 | need_awk=yes | | 844 | need_awk=yes |
845 | need_sed=yes | | 845 | need_sed=yes |
846 | ;; | | 846 | ;; |
847 | esac | | 847 | esac |
848 | | | 848 | |
849 | # Override if the user explicitly requests it. | | 849 | # Override if the user explicitly requests it. |
850 | if [ -n "${march}" ]; then | | 850 | if [ -n "${march}" ]; then |
851 | machine_arch="${march}" | | 851 | machine_arch="${march}" |
852 | fi | | 852 | fi |
853 | | | 853 | |
854 | # Fixup MACHINE_ARCH to use canonical pkgsrc variants, and support multiarch | | 854 | # Fixup MACHINE_ARCH to use canonical pkgsrc variants, and support multiarch |
855 | # systems via --abi, setting a default $abi based on MACHINE_ARCH if not set. | | 855 | # systems via --abi, setting a default $abi based on MACHINE_ARCH if not set. |
856 | # | | 856 | # |
857 | case "$machine_arch/$abi" in | | 857 | case "$machine_arch/$abi" in |
858 | # "amd64" translates to "x86_64", defaults to 64-bit | | 858 | # "amd64" translates to "x86_64", defaults to 64-bit |
859 | amd64/32) abi=32 machine_arch=i386 ;; | | 859 | amd64/32) abi=32 machine_arch=i386 ;; |
860 | amd64/*) abi=64 machine_arch=x86_64 ;; | | 860 | amd64/*) abi=64 machine_arch=x86_64 ;; |
861 | # XXX: hppa untested | | 861 | # XXX: hppa untested |
862 | hppa/64) abi=64 machine_arch=hppa64 ;; | | 862 | hppa/64) abi=64 machine_arch=hppa64 ;; |
863 | hppa/*) abi=32 machine_arch=hppa ;; | | 863 | hppa/*) abi=32 machine_arch=hppa ;; |
864 | hppa64/32) abi=32 machine_arch=hppa ;; | | 864 | hppa64/32) abi=32 machine_arch=hppa ;; |
865 | hppa64/*) abi=64 machine_arch=hppa64 ;; | | 865 | hppa64/*) abi=64 machine_arch=hppa64 ;; |
866 | # "i386" can support 64-bit, e.g. SunOS, defaults to 32-bit. | | 866 | # "i386" can support 64-bit, e.g. SunOS, defaults to 32-bit. |
867 | i386/64) abi=64 machine_arch=x86_64 ;; | | 867 | i386/64) abi=64 machine_arch=x86_64 ;; |
868 | i386/*) abi=32 machine_arch=i386 ;; | | 868 | i386/*) abi=32 machine_arch=i386 ;; |
869 | # XXX: powerpc untested | | 869 | # XXX: powerpc untested |
870 | powerpc/64) abi=64 machine_arch=powerpc64 ;; | | 870 | powerpc/64) abi=64 machine_arch=powerpc64 ;; |
871 | powerpc/*) abi=32 machine_arch=powerpc ;; | | 871 | powerpc/*) abi=32 machine_arch=powerpc ;; |
872 | powerpc64/32) abi=32 machine_arch=powerpc ;; | | 872 | powerpc64/32) abi=32 machine_arch=powerpc ;; |
873 | powerpc64/*) abi=64 machine_arch=powerpc64 ;; | | 873 | powerpc64/*) abi=64 machine_arch=powerpc64 ;; |
874 | powerpc64le/*) abi=64 machine_arch=powerpc64le;; | | 874 | powerpc64le/*) abi=64 machine_arch=powerpc64le;; |
875 | # sparc/sparcv9 support 32-bit/64-bit, default to native. | | 875 | # sparc/sparcv9 support 32-bit/64-bit, default to native. |
876 | sparcv9/32) abi=32 machine_arch=sparc ;; | | 876 | sparcv9/32) abi=32 machine_arch=sparc ;; |
877 | sparcv9/*) abi=64 machine_arch=sparc64 ;; | | 877 | sparcv9/*) abi=64 machine_arch=sparc64 ;; |
878 | sparc/64) abi=64 machine_arch=sparc64 ;; | | 878 | sparc/64) abi=64 machine_arch=sparc64 ;; |
879 | sparc/*) abi=32 machine_arch=sparc ;; | | 879 | sparc/*) abi=32 machine_arch=sparc ;; |
880 | # x86_64 supports 32-bit/64-bit, defaults to 64-bit. | | 880 | # x86_64 supports 32-bit/64-bit, defaults to 64-bit. |
881 | x86_64/32) abi=32 machine_arch=i386 ;; | | 881 | x86_64/32) abi=32 machine_arch=i386 ;; |
882 | x86_64/*) abi=64 machine_arch=x86_64 ;; | | 882 | x86_64/*) abi=64 machine_arch=x86_64 ;; |
883 | esac | | 883 | esac |
884 | | | 884 | |
885 | # If "--full" is specified, then install all of the platform-independent | | 885 | # If "--full" is specified, then install all of the platform-independent |
886 | # bootstrap software. | | 886 | # bootstrap software. |
887 | # | | 887 | # |
888 | case "$full" in | | 888 | case "$full" in |
889 | yes) | | 889 | yes) |
890 | need_bsd_install=yes | | 890 | need_bsd_install=yes |
891 | need_awk=yes | | 891 | need_awk=yes |
892 | need_sed=yes | | 892 | need_sed=yes |
893 | need_mksh=yes | | 893 | need_mksh=yes |
894 | ;; | | 894 | ;; |
895 | esac | | 895 | esac |
896 | | | 896 | |
897 | # mksh and ksh are mutually exclusive, prefer mksh while we transition to it. | | 897 | # mksh and ksh are mutually exclusive, prefer mksh while we transition to it. |
898 | case "$need_mksh" in | | 898 | case "$need_mksh" in |
899 | yes) need_ksh=no ;; | | 899 | yes) need_ksh=no ;; |
900 | esac | | 900 | esac |
901 | | | 901 | |
902 | case "$quiet" in | | 902 | case "$quiet" in |
903 | yes) | | 903 | yes) |
904 | configure_quiet_flags="--quiet" | | 904 | configure_quiet_flags="--quiet" |
905 | make_quiet_flags="-s" | | 905 | make_quiet_flags="-s" |
906 | ;; | | 906 | ;; |
907 | no) | | 907 | no) |
908 | configure_quiet_flags="" | | 908 | configure_quiet_flags="" |
909 | make_quiet_flags="" | | 909 | make_quiet_flags="" |
910 | esac | | 910 | esac |
911 | | | 911 | |
912 | test ${make_jobs} -gt 0 2>/dev/null | | 912 | test ${make_jobs} -gt 0 2>/dev/null |
913 | if [ $? -ne 0 ]; then | | 913 | if [ $? -ne 0 ]; then |
914 | die "ERROR: --make-jobs must be a positive integer argument" | | 914 | die "ERROR: --make-jobs must be a positive integer argument" |
915 | fi | | 915 | fi |
916 | | | 916 | |
917 | # export MACHINE_ARCH and OPSYS for bmake and pkg_install. | | 917 | # export MACHINE_ARCH and OPSYS for bmake and pkg_install. |
918 | MACHINE_ARCH=${machine_arch}; export MACHINE_ARCH | | 918 | MACHINE_ARCH=${machine_arch}; export MACHINE_ARCH |
919 | OPSYS=${opsys}; export OPSYS | | 919 | OPSYS=${opsys}; export OPSYS |
920 | | | 920 | |
921 | if [ "x$preserve_path" != "xyes" ]; then | | 921 | if [ "x$preserve_path" != "xyes" ]; then |
922 | PATH="$overpath:$PATH" | | 922 | PATH="$overpath:$PATH" |
923 | fi | | 923 | fi |
924 | | | 924 | |
925 | check_prog awkprog awk | | 925 | check_prog awkprog awk |
926 | check_prog chmodprog chmod | | 926 | check_prog chmodprog chmod |
927 | if [ -n "$CP" ]; then | | 927 | if [ -n "$CP" ]; then |
928 | cpprog="$CP" | | 928 | cpprog="$CP" |
929 | else | | 929 | else |
930 | check_prog cpprog cp | | 930 | check_prog cpprog cp |
931 | fi | | 931 | fi |
932 | if [ -n "$ID" ]; then | | 932 | if [ -n "$ID" ]; then |
933 | idprog="$ID" | | 933 | idprog="$ID" |
934 | else | | 934 | else |
935 | check_prog idprog id | | 935 | check_prog idprog id |
936 | fi | | 936 | fi |
937 | check_prog groupsprog groups | | 937 | check_prog groupsprog groups |
938 | check_prog lnprog ln | | 938 | check_prog lnprog ln |
939 | check_prog lsprog ls | | 939 | check_prog lsprog ls |
940 | check_prog rmdirprog rmdir | | 940 | check_prog rmdirprog rmdir |
941 | check_prog sedprog sed | | 941 | check_prog sedprog sed |
942 | check_prog shprog sh | | 942 | check_prog shprog sh |
943 | check_prog whoamiprog whoami | | 943 | check_prog whoamiprog whoami |
944 | | | 944 | |
945 | if [ -d "${wrkdir}" ] || [ -f "${wrkdir}" ]; then | | 945 | if [ -d "${wrkdir}" ] || [ -f "${wrkdir}" ]; then |
946 | die "\"${wrkdir}\" already exists, please remove it or use --workdir" | | 946 | die "\"${wrkdir}\" already exists, please remove it or use --workdir" |
947 | fi | | 947 | fi |
948 | | | 948 | |
949 | if [ -f "${prefix}/share/mk/sys.mk" ]; then | | 949 | if [ -f "${prefix}/share/mk/sys.mk" ]; then |
950 | die "\"${prefix}\" already in use, remove it or use a different --prefix" | | 950 | die "\"${prefix}\" already in use, remove it or use a different --prefix" |
951 | fi | | 951 | fi |
952 | | | 952 | |
953 | if [ -d "${pkgdbdir}/bootstrap-mk-files-"* ]; then | | 953 | if [ -d "${pkgdbdir}/bootstrap-mk-files-"* ]; then |
954 | die "\"${pkgdbdir}\" already in use, remove it or use a different --pkgdbdir" | | 954 | die "\"${pkgdbdir}\" already in use, remove it or use a different --pkgdbdir" |
955 | fi | | 955 | fi |
956 | | | 956 | |
957 | mkdir_p_early ${wrkdir} | | 957 | mkdir_p_early ${wrkdir} |
958 | if touch ${wrkdir}/.writeable; then | | 958 | if touch ${wrkdir}/.writeable; then |
959 | : | | 959 | : |
960 | else | | 960 | else |
961 | die "\"${wrkdir}\" is not writeable. Try $0 -h" | | 961 | die "\"${wrkdir}\" is not writeable. Try $0 -h" |
962 | fi | | 962 | fi |
963 | echo "Working directory is: ${wrkdir}" | | 963 | echo "Working directory is: ${wrkdir}" |
964 | | | 964 | |
965 | if [ "$compiler" = "" ] && [ x"$check_compiler" = x"yes" ]; then | | 965 | if [ "$compiler" = "" ] && [ x"$check_compiler" = x"yes" ]; then |
966 | get_compiler | | 966 | get_compiler |
967 | # Clang pretends to be GCC, so we have to check it first. | | 967 | # Clang pretends to be GCC, so we have to check it first. |
968 | if [ $compiler_is_clang -gt 0 ]; then | | 968 | if [ $compiler_is_clang -gt 0 ]; then |
969 | compiler="clang" | | 969 | compiler="clang" |
970 | elif [ $compiler_is_gnu -gt 0 ]; then | | 970 | elif [ $compiler_is_gnu -gt 0 ]; then |
971 | compiler="gcc" | | 971 | compiler="gcc" |
972 | else | | 972 | else |
973 | case "$opsys" in | | 973 | case "$opsys" in |
974 | IRIX) | | 974 | IRIX) |
975 | if [ `uname -r` -ge 6 ]; then | | 975 | if [ `uname -r` -ge 6 ]; then |
976 | compiler="mipspro" | | 976 | compiler="mipspro" |
977 | else | | 977 | else |
978 | compiler="ido" | | 978 | compiler="ido" |
979 | fi | | 979 | fi |
980 | ;; | | 980 | ;; |
981 | SunOS) compiler="sunpro" | | 981 | SunOS) compiler="sunpro" |
982 | ;; | | 982 | ;; |
983 | esac | | 983 | esac |
984 | fi | | 984 | fi |
985 | fi | | 985 | fi |
986 | | | 986 | |
987 | case "$compiler" in | | 987 | case "$compiler" in |
988 | clang|gcc) | | 988 | clang|gcc) |
989 | test -n "$CC" || CC=$compiler | | 989 | test -n "$CC" || CC=$compiler |
990 | ;; | | 990 | ;; |
991 | *) | | 991 | *) |
992 | test -n "$CC" || CC=cc | | 992 | test -n "$CC" || CC=cc |
993 | ;; | | 993 | ;; |
994 | esac | | 994 | esac |
995 | | | 995 | |
996 | has_ssp_support() { | | 996 | has_ssp_support() { |
997 | mkdir_p_early ${wrkdir}/tmp | | 997 | mkdir_p_early ${wrkdir}/tmp |
998 | echo 'int main(void){return 0;}' > ${wrkdir}/tmp/ssp.c | | 998 | echo 'int main(void){return 0;}' > ${wrkdir}/tmp/ssp.c |
999 | ${CC:-cc} -fstack-protector-strong -o ${wrkdir}/tmp/ssp ${wrkdir}/tmp/ssp.c >/dev/null 2>&1 | | 999 | ${CC:-cc} -fstack-protector-strong -o ${wrkdir}/tmp/ssp ${wrkdir}/tmp/ssp.c >/dev/null 2>&1 |
1000 | | | 1000 | |
1001 | if [ $? -eq 0 ]; then | | 1001 | if [ $? -eq 0 ]; then |
1002 | echo yes | | 1002 | echo yes |
1003 | else | | 1003 | else |
1004 | echo no | | 1004 | echo no |
1005 | fi | | 1005 | fi |
1006 | } | | 1006 | } |
1007 | | | 1007 | |
1008 | if [ "$has_ssp" = "" ] && [ x"$check_ssp" = x"yes" ]; then | | 1008 | if [ "$has_ssp" = "" ] && [ x"$check_ssp" = x"yes" ]; then |
1009 | has_ssp=`has_ssp_support` | | 1009 | has_ssp=`has_ssp_support` |
1010 | fi | | 1010 | fi |
1011 | | | 1011 | |
1012 | mkdir_p_early ${wrkdir}/bin | | 1012 | mkdir_p_early ${wrkdir}/bin |
1013 | | | 1013 | |
1014 | # build install-sh | | 1014 | # build install-sh |
1015 | run_cmd "$sedprog -e 's|@DEFAULT_INSTALL_MODE@|'${default_install_mode-0755}'|' $pkgsrcdir/sysutils/install-sh/files/install-sh.in > $wrkdir/bin/install-sh" | | 1015 | run_cmd "$sedprog -e 's|@DEFAULT_INSTALL_MODE@|'${default_install_mode-0755}'|' $pkgsrcdir/sysutils/install-sh/files/install-sh.in > $wrkdir/bin/install-sh" |
1016 | run_cmd "$chmodprog +x $wrkdir/bin/install-sh" | | 1016 | run_cmd "$chmodprog +x $wrkdir/bin/install-sh" |
1017 | install_sh="$shprog $wrkdir/bin/install-sh" | | 1017 | install_sh="$shprog $wrkdir/bin/install-sh" |
1018 | | | 1018 | |
1019 | if [ $unprivileged = "yes" ]; then | | 1019 | if [ $unprivileged = "yes" ]; then |
1020 | user=`$whoamiprog` | | 1020 | user=`$whoamiprog` |
1021 | group=`$groupsprog | $awkprog '{print $1}'` | | 1021 | group=`$groupsprog | $awkprog '{print $1}'` |
1022 | echo_msg "building as unprivileged user $user/$group" | | 1022 | echo_msg "building as unprivileged user $user/$group" |
1023 | | | 1023 | |
1024 | # force bmake install target to use $user and $group | | 1024 | # force bmake install target to use $user and $group |
1025 | echo "BINOWN=$user | | 1025 | echo "BINOWN=$user |
1026 | BINGRP=$group | | 1026 | BINGRP=$group |
1027 | LIBOWN=$user | | 1027 | LIBOWN=$user |
1028 | LIBGRP=$group | | 1028 | LIBGRP=$group |
1029 | MANOWN=$user | | 1029 | MANOWN=$user |
1030 | MANGRP=$group" > ${wrkdir}/Makefile.inc | | 1030 | MANGRP=$group" > ${wrkdir}/Makefile.inc |
1031 | elif is_root; then | | 1031 | elif is_root; then |
1032 | user=$root_user | | 1032 | user=$root_user |
1033 | group=$root_group | | 1033 | group=$root_group |
1034 | else | | 1034 | else |
1035 | die "You must be either root to install bootstrap-pkgsrc or use the --unprivileged option." | | 1035 | die "You must be either root to install bootstrap-pkgsrc or use the --unprivileged option." |
1036 | fi | | 1036 | fi |
1037 | | | 1037 | |
1038 | # export the proper environment | | 1038 | # export the proper environment |
1039 | PATH=$prefix/bin:$prefix/sbin:${PATH}; export PATH | | 1039 | PATH=$prefix/bin:$prefix/sbin:${PATH}; export PATH |
1040 | if [ -d /usr/ccs/bin -a -x /usr/ccs/bin/make ]; then | | 1040 | if [ -d /usr/ccs/bin -a -x /usr/ccs/bin/make ]; then |
1041 | PATH=${PATH}:/usr/ccs/bin; export PATH | | 1041 | PATH=${PATH}:/usr/ccs/bin; export PATH |
1042 | fi | | 1042 | fi |
1043 | PKG_DBDIR=$pkgdbdir; export PKG_DBDIR | | 1043 | PKG_DBDIR=$pkgdbdir; export PKG_DBDIR |
1044 | LOCALBASE=$prefix; export LOCALBASE | | 1044 | LOCALBASE=$prefix; export LOCALBASE |
1045 | VARBASE=$varbase; export VARBASE | | 1045 | VARBASE=$varbase; export VARBASE |
1046 | if [ x"$has_ssp" = x"no" ] && [ x"$check_ssp" = x"yes" ]; then | | 1046 | if [ x"$has_ssp" = x"no" ] && [ x"$check_ssp" = x"yes" ]; then |
1047 | _OPSYS_SUPPORTS_SSP=no; export _OPSYS_SUPPORTS_SSP | | 1047 | _OPSYS_SUPPORTS_SSP=no; export _OPSYS_SUPPORTS_SSP |
1048 | fi | | 1048 | fi |
1049 | | | 1049 | |
1050 | # set up an example mk.conf file | | 1050 | # set up an example mk.conf file |
1051 | TARGET_MKCONF=${wrkdir}/mk.conf.example | | 1051 | TARGET_MKCONF=${wrkdir}/mk.conf.example |
1052 | echo_msg "Creating default mk.conf in ${wrkdir}" | | 1052 | echo_msg "Creating default mk.conf in ${wrkdir}" |
1053 | echo "# Example ${sysconfdir}/mk.conf file produced by bootstrap-pkgsrc" > ${TARGET_MKCONF} | | 1053 | echo "# Example ${sysconfdir}/mk.conf file produced by bootstrap-pkgsrc" > ${TARGET_MKCONF} |
1054 | echo "# `date`" >> ${TARGET_MKCONF} | | 1054 | echo "# `date`" >> ${TARGET_MKCONF} |
1055 | echo "" >> ${TARGET_MKCONF} | | 1055 | echo "" >> ${TARGET_MKCONF} |
1056 | echo ".ifdef BSD_PKG_MK # begin pkgsrc settings" >> ${TARGET_MKCONF} | | 1056 | echo ".ifdef BSD_PKG_MK # begin pkgsrc settings" >> ${TARGET_MKCONF} |
1057 | echo "" >> ${TARGET_MKCONF} | | 1057 | echo "" >> ${TARGET_MKCONF} |
1058 | | | 1058 | |
1059 | # IRIX64 needs to be set to IRIX, for example | | 1059 | # IRIX64 needs to be set to IRIX, for example |
1060 | if [ "$set_opsys" = "yes" ]; then | | 1060 | if [ "$set_opsys" = "yes" ]; then |
1061 | echo "OPSYS= $opsys" >> ${TARGET_MKCONF} | | 1061 | echo "OPSYS= $opsys" >> ${TARGET_MKCONF} |
1062 | fi | | 1062 | fi |
1063 | | | 1063 | |
1064 | if [ -n "$abi" ]; then | | 1064 | if [ -n "$abi" ]; then |
1065 | echo "ABI= $abi" >> ${TARGET_MKCONF} | | 1065 | echo "ABI= $abi" >> ${TARGET_MKCONF} |
1066 | fi | | 1066 | fi |
1067 | if [ "$compiler" != "" ]; then | | 1067 | if [ "$compiler" != "" ]; then |
1068 | echo "PKGSRC_COMPILER= $compiler" >> ${TARGET_MKCONF} | | 1068 | echo "PKGSRC_COMPILER= $compiler" >> ${TARGET_MKCONF} |
1069 | fi | | 1069 | fi |
1070 | case "$compiler" in | | 1070 | case "$compiler" in |
1071 | sunpro) | | 1071 | sunpro) |
1072 | echo "CC= cc" >> ${TARGET_MKCONF} | | 1072 | echo "CC= cc" >> ${TARGET_MKCONF} |
1073 | echo "CXX= CC" >> ${TARGET_MKCONF} | | 1073 | echo "CXX= CC" >> ${TARGET_MKCONF} |
1074 | echo "CPP= \${CC} -E" >> ${TARGET_MKCONF} | | 1074 | echo "CPP= \${CC} -E" >> ${TARGET_MKCONF} |
1075 | ;; | | 1075 | ;; |
1076 | clang) | | 1076 | clang) |
1077 | echo "CC= clang" >> ${TARGET_MKCONF} | | 1077 | echo "CC= clang" >> ${TARGET_MKCONF} |
1078 | echo "CXX= clang++" >> ${TARGET_MKCONF} | | 1078 | echo "CXX= clang++" >> ${TARGET_MKCONF} |
1079 | echo "CPP= \${CC} -E" >> ${TARGET_MKCONF} | | 1079 | echo "CPP= \${CC} -E" >> ${TARGET_MKCONF} |
1080 | if [ -z "$CLANGBASE" -a -f "/usr/bin/clang" ]; then | | 1080 | if [ -z "$CLANGBASE" -a -f "/usr/bin/clang" ]; then |
1081 | CLANGBASE="/usr" | | 1081 | CLANGBASE="/usr" |
1082 | fi | | 1082 | fi |
1083 | if [ -n "$CLANGBASE" -o -f "/bin/clang" ]; then | | 1083 | if [ -n "$CLANGBASE" -o -f "/bin/clang" ]; then |
1084 | echo "CLANGBASE= $CLANGBASE" >> ${TARGET_MKCONF} | | 1084 | echo "CLANGBASE= $CLANGBASE" >> ${TARGET_MKCONF} |
1085 | fi | | 1085 | fi |
1086 | ;; | | 1086 | ;; |
1087 | esac | | 1087 | esac |
1088 | if [ -n "$GCCBASE" ]; then | | 1088 | if [ -n "$GCCBASE" ]; then |
1089 | echo "GCCBASE= $GCCBASE" >> ${TARGET_MKCONF} | | 1089 | echo "GCCBASE= $GCCBASE" >> ${TARGET_MKCONF} |
1090 | fi | | 1090 | fi |
1091 | if [ -n "$SUNWSPROBASE" ]; then | | 1091 | if [ -n "$SUNWSPROBASE" ]; then |
1092 | echo "SUNWSPROBASE= $SUNWSPROBASE" >> ${TARGET_MKCONF} | | 1092 | echo "SUNWSPROBASE= $SUNWSPROBASE" >> ${TARGET_MKCONF} |
1093 | fi | | 1093 | fi |
1094 | echo "" >> ${TARGET_MKCONF} | | 1094 | echo "" >> ${TARGET_MKCONF} |
1095 | | | 1095 | |
1096 | if [ x"$has_ssp" = x"no" ] && [ x"$check_ssp" = x"yes" ]; then | | 1096 | if [ x"$has_ssp" = x"no" ] && [ x"$check_ssp" = x"yes" ]; then |
1097 | echo "_OPSYS_SUPPORTS_SSP= no" >> ${TARGET_MKCONF} | | 1097 | echo "_OPSYS_SUPPORTS_SSP= no" >> ${TARGET_MKCONF} |
1098 | fi | | 1098 | fi |
1099 | | | 1099 | |
1100 | # enable unprivileged builds if not root | | 1100 | # enable unprivileged builds if not root |
1101 | if [ "$unprivileged" = "yes" ]; then | | 1101 | if [ "$unprivileged" = "yes" ]; then |
1102 | echo "UNPRIVILEGED= yes" >> ${TARGET_MKCONF} | | 1102 | echo "UNPRIVILEGED= yes" >> ${TARGET_MKCONF} |
1103 | fi | | 1103 | fi |
1104 | | | 1104 | |
1105 | # save environment in example mk.conf | | 1105 | # save environment in example mk.conf |
1106 | echo "PKG_DBDIR= $pkgdbdir" >> ${TARGET_MKCONF} | | 1106 | echo "PKG_DBDIR= $pkgdbdir" >> ${TARGET_MKCONF} |
1107 | echo "LOCALBASE= $prefix" >> ${TARGET_MKCONF} | | 1107 | echo "LOCALBASE= $prefix" >> ${TARGET_MKCONF} |
1108 | if [ "${sysconfbase}" != "/etc" ]; then | | 1108 | if [ "${sysconfbase}" != "/etc" ]; then |
1109 | echo "SYSCONFBASE= $sysconfbase" >> ${TARGET_MKCONF} | | 1109 | echo "SYSCONFBASE= $sysconfbase" >> ${TARGET_MKCONF} |
1110 | fi | | 1110 | fi |
1111 | echo "VARBASE= $varbase" >> ${TARGET_MKCONF} | | 1111 | echo "VARBASE= $varbase" >> ${TARGET_MKCONF} |
1112 | if [ "${sysconfdir}" != "${prefix}/etc" ]; then | | 1112 | if [ "${sysconfdir}" != "${prefix}/etc" ]; then |
1113 | echo "PKG_SYSCONFBASE= $sysconfdir" >> ${TARGET_MKCONF} | | 1113 | echo "PKG_SYSCONFBASE= $sysconfdir" >> ${TARGET_MKCONF} |
1114 | fi | | 1114 | fi |
1115 | echo "PKG_TOOLS_BIN= $prefix/sbin" >> ${TARGET_MKCONF} | | 1115 | echo "PKG_TOOLS_BIN= $prefix/sbin" >> ${TARGET_MKCONF} |
1116 | echo "PKGINFODIR= $pkginfodir" >> ${TARGET_MKCONF} | | 1116 | echo "PKGINFODIR= $pkginfodir" >> ${TARGET_MKCONF} |
1117 | echo "PKGMANDIR= $pkgmandir" >> ${TARGET_MKCONF} | | 1117 | echo "PKGMANDIR= $pkgmandir" >> ${TARGET_MKCONF} |
1118 | echo "" >> ${TARGET_MKCONF} | | 1118 | echo "" >> ${TARGET_MKCONF} |
1119 | | | 1119 | |
1120 | case $opsys in | | 1120 | case $opsys in |
1121 | Linux) | | 1121 | Linux) |
1122 | # Default to PREFER_PKGSRC=yes unless user specifies --prefer-native=yes | | 1122 | # Default to PREFER_PKGSRC=yes unless user specifies --prefer-native=yes |
1123 | # Linux systems likely have software from other packages managers | | 1123 | # Linux systems likely have software from other packages managers |
1124 | # like yum or apt that can leak into pkgsrc and cause issues as they | | 1124 | # like yum or apt that can leak into pkgsrc and cause issues as they |
1125 | # age, undergo ABI changes, or get added/removed behind our backs. | | 1125 | # age, undergo ABI changes, or get added/removed behind our backs. |
1126 | # Let pkgsrc maintain all dependencies to avoid these problems. | | 1126 | # Let pkgsrc maintain all dependencies to avoid these problems. |
1127 | # The exception here is Elbrus 2000, for which a lot of patches have | | 1127 | # The exception here is Elbrus 2000, for which a lot of patches have |
1128 | # not been upstreamed, so that it is better to use native. | | 1128 | # not been upstreamed, so that it is better to use native. |
1129 | if [ -z "$prefer_pkgsrc" ] && [ "$prefer_native" != "yes" ] && \ | | 1129 | if [ -z "$prefer_pkgsrc" ] && [ "$prefer_native" != "yes" ] && \ |
1130 | [ "$machine_arch" != "e2k" ]; then | | 1130 | [ "$machine_arch" != "e2k" ]; then |
1131 | prefer_pkgsrc="yes" | | 1131 | prefer_pkgsrc="yes" |
1132 | fi | | 1132 | fi |
1133 | ;; | | 1133 | ;; |
1134 | esac | | 1134 | esac |
1135 | | | 1135 | |
1136 | if [ -n "$prefer_pkgsrc" ]; then | | 1136 | if [ -n "$prefer_pkgsrc" ]; then |
1137 | echo "# WARNING: Changing PREFER_* after bootstrap will require rebuilding all" >> ${TARGET_MKCONF} | | 1137 | echo "# WARNING: Changing PREFER_* after bootstrap will require rebuilding all" >> ${TARGET_MKCONF} |
1138 | echo "# packages with a dependency that switched between native/pkgsrc." >> ${TARGET_MKCONF} | | 1138 | echo "# packages with a dependency that switched between native/pkgsrc." >> ${TARGET_MKCONF} |
1139 | echo "PREFER_PKGSRC= $prefer_pkgsrc" >> ${TARGET_MKCONF} | | 1139 | echo "PREFER_PKGSRC= $prefer_pkgsrc" >> ${TARGET_MKCONF} |
1140 | echo "" >> ${TARGET_MKCONF} | | 1140 | echo "" >> ${TARGET_MKCONF} |
1141 | fi | | 1141 | fi |
1142 | if [ -n "$prefer_native" ]; then | | 1142 | if [ -n "$prefer_native" ]; then |
1143 | echo "PREFER_NATIVE= $prefer_native" >> ${TARGET_MKCONF} | | 1143 | echo "PREFER_NATIVE= $prefer_native" >> ${TARGET_MKCONF} |
1144 | echo "" >> ${TARGET_MKCONF} | | 1144 | echo "" >> ${TARGET_MKCONF} |
1145 | fi | | 1145 | fi |
1146 | | | 1146 | |
1147 | BOOTSTRAP_MKCONF=${wrkdir}/mk.conf | | 1147 | BOOTSTRAP_MKCONF=${wrkdir}/mk.conf |
1148 | cp ${TARGET_MKCONF} ${BOOTSTRAP_MKCONF} | | 1148 | cp ${TARGET_MKCONF} ${BOOTSTRAP_MKCONF} |
1149 | | | 1149 | |
1150 | case "$cwrappers" in | | 1150 | case "$cwrappers" in |
1151 | yes|no) | | 1151 | yes|no) |
1152 | echo "USE_CWRAPPERS= $cwrappers" >> ${TARGET_MKCONF} | | 1152 | echo "USE_CWRAPPERS= $cwrappers" >> ${TARGET_MKCONF} |
1153 | echo "USE_CWRAPPERS= $cwrappers" >> ${BOOTSTRAP_MKCONF} | | 1153 | echo "USE_CWRAPPERS= $cwrappers" >> ${BOOTSTRAP_MKCONF} |
1154 | echo "" >> ${TARGET_MKCONF} | | 1154 | echo "" >> ${TARGET_MKCONF} |
1155 | ;; | | 1155 | ;; |
1156 | esac | | 1156 | esac |
1157 | | | 1157 | |
1158 | # On all Debian GNU/kFreeBSD 7, /bin/sh is a symlink to /bin/dash, and | | 1158 | # On all Debian GNU/kFreeBSD 7, /bin/sh is a symlink to /bin/dash, and |
1159 | # use /bin/bash. | | 1159 | # use /bin/bash. |
1160 | # Only needed by legacy wrappers. | | 1160 | # Only needed by legacy wrappers. |
1161 | if [ "$opsys" = "GNUkFreeBSD" -a "$bootstrap_sh_set" != "set" ]; then | | 1161 | if [ "$opsys" = "GNUkFreeBSD" -a "$bootstrap_sh_set" != "set" ]; then |
1162 | echo "TOOLS_PLATFORM.sh?= /bin/bash # instead of /bin/sh" >> ${TARGET_MKCONF} | | 1162 | echo "TOOLS_PLATFORM.sh?= /bin/bash # instead of /bin/sh" >> ${TARGET_MKCONF} |
1163 | echo "TOOLS_PLATFORM.sh?= /bin/bash # instead of /bin/sh" >> ${BOOTSTRAP_MKCONF} | | 1163 | echo "TOOLS_PLATFORM.sh?= /bin/bash # instead of /bin/sh" >> ${BOOTSTRAP_MKCONF} |
1164 | echo $opsys | | 1164 | echo $opsys |
1165 | fi | | 1165 | fi |
1166 | | | 1166 | |
1167 | # sbin is used by pkg_install, share/mk by bootstrap-mk-files | | 1167 | # sbin is used by pkg_install, share/mk by bootstrap-mk-files |
1168 | mkdir_p $wrkdir/sbin $wrkdir/share/mk | | 1168 | mkdir_p $wrkdir/sbin $wrkdir/share/mk |
1169 | mkdir_p_early ${wrkdir} | | 1169 | mkdir_p_early ${wrkdir} |
1170 | | | 1170 | |
1171 | if [ "$need_bsd_install" = "yes" ]; then | | 1171 | if [ "$need_bsd_install" = "yes" ]; then |
1172 | BSTRAP_ENV="INSTALL='$prefix/bin/install-sh -c' $BSTRAP_ENV" | | 1172 | BSTRAP_ENV="INSTALL='$prefix/bin/install-sh -c' $BSTRAP_ENV" |
1173 | if [ "$use_bsdinstall" = "yes" ]; then | | 1173 | if [ "$use_bsdinstall" = "yes" ]; then |
1174 | echo "TOOLS_PLATFORM.install?= $prefix/bin/bsdinstall" >> ${TARGET_MKCONF} | | 1174 | echo "TOOLS_PLATFORM.install?= $prefix/bin/bsdinstall" >> ${TARGET_MKCONF} |
1175 | else | | 1175 | else |
1176 | echo "TOOLS_PLATFORM.install?= $prefix/bin/install-sh" >> ${TARGET_MKCONF} | | 1176 | echo "TOOLS_PLATFORM.install?= $prefix/bin/install-sh" >> ${TARGET_MKCONF} |
1177 | fi | | 1177 | fi |
1178 | echo "TOOLS_PLATFORM.install?= $wrkdir/bin/install-sh" >> ${BOOTSTRAP_MKCONF} | | 1178 | echo "TOOLS_PLATFORM.install?= $wrkdir/bin/install-sh" >> ${BOOTSTRAP_MKCONF} |
1179 | fi | | 1179 | fi |
1180 | | | 1180 | |
1181 | if [ "$need_fixed_strip" = "yes" ] ; then | | 1181 | if [ "$need_fixed_strip" = "yes" ] ; then |
1182 | echo_msg "Installing fixed strip script" | | 1182 | echo_msg "Installing fixed strip script" |
1183 | run_cmd "$install_sh -c -o $user -g $group -m 755 $pkgsrcdir/pkgtools/bootstrap-extras/files/strip-sh $wrkdir/bin/strip" | | 1183 | run_cmd "$install_sh -c -o $user -g $group -m 755 $pkgsrcdir/pkgtools/bootstrap-extras/files/strip-sh $wrkdir/bin/strip" |
1184 | echo "TOOLS_PLATFORM.strip?= $prefix/bin/strip" >> ${TARGET_MKCONF} | | 1184 | echo "TOOLS_PLATFORM.strip?= $prefix/bin/strip" >> ${TARGET_MKCONF} |
1185 | echo "TOOLS_PLATFORM.strip?= $wrkdir/bin/strip" >> ${BOOTSTRAP_MKCONF} | | 1185 | echo "TOOLS_PLATFORM.strip?= $wrkdir/bin/strip" >> ${BOOTSTRAP_MKCONF} |
1186 | need_extras=yes | | 1186 | need_extras=yes |
1187 | fi | | 1187 | fi |
1188 | | | 1188 | |
1189 | if [ "$need_mkdir" = "yes" -a -z "$MKDIR" ]; then | | 1189 | if [ "$need_mkdir" = "yes" -a -z "$MKDIR" ]; then |
1190 | echo_msg "Installing fixed mkdir script \"mkdir-sh\"" | | 1190 | echo_msg "Installing fixed mkdir script \"mkdir-sh\"" |
1191 | run_cmd "$install_sh -c -o $user -g $group -m 755 $pkgsrcdir/pkgtools/bootstrap-extras/files/mkdir-sh $wrkdir/bin/mkdir-sh" | | 1191 | run_cmd "$install_sh -c -o $user -g $group -m 755 $pkgsrcdir/pkgtools/bootstrap-extras/files/mkdir-sh $wrkdir/bin/mkdir-sh" |
1192 | echo "TOOLS_PLATFORM.mkdir?= $prefix/bin/mkdir-sh -p" >> ${TARGET_MKCONF} | | 1192 | echo "TOOLS_PLATFORM.mkdir?= $prefix/bin/mkdir-sh -p" >> ${TARGET_MKCONF} |
1193 | echo "TOOLS_PLATFORM.mkdir?= $wrkdir/bin/mkdir-sh -p" >> ${BOOTSTRAP_MKCONF} | | 1193 | echo "TOOLS_PLATFORM.mkdir?= $wrkdir/bin/mkdir-sh -p" >> ${BOOTSTRAP_MKCONF} |
1194 | need_extras=yes | | 1194 | need_extras=yes |
1195 | fi | | 1195 | fi |
1196 | | | 1196 | |
1197 | if [ "$need_xargs" = "yes" ]; then | | 1197 | if [ "$need_xargs" = "yes" ]; then |
1198 | echo_msg "Installing fixed xargs script" | | 1198 | echo_msg "Installing fixed xargs script" |
1199 | run_cmd "$install_sh -c -o $user -g $group -m 755 $pkgsrcdir/pkgtools/bootstrap-extras/files/xargs-sh $wrkdir/bin/xargs" | | 1199 | run_cmd "$install_sh -c -o $user -g $group -m 755 $pkgsrcdir/pkgtools/bootstrap-extras/files/xargs-sh $wrkdir/bin/xargs" |
1200 | echo "TOOLS_PLATFORM.xargs?= $prefix/bin/xargs" >> ${TARGET_MKCONF} | | 1200 | echo "TOOLS_PLATFORM.xargs?= $prefix/bin/xargs" >> ${TARGET_MKCONF} |
1201 | echo "TOOLS_PLATFORM.xargs?= $wrkdir/bin/xargs" >> ${BOOTSTRAP_MKCONF} | | 1201 | echo "TOOLS_PLATFORM.xargs?= $wrkdir/bin/xargs" >> ${BOOTSTRAP_MKCONF} |
1202 | need_extras=yes | | 1202 | need_extras=yes |
1203 | fi | | 1203 | fi |
1204 | | | 1204 | |
1205 | echo_msg "Bootstrapping mk-files" | | 1205 | echo_msg "Bootstrapping mk-files" |
1206 | run_cmd "(cd ${pkgsrcdir}/pkgtools/bootstrap-mk-files/files && env CP=${cpprog} \ | | 1206 | run_cmd "(cd ${pkgsrcdir}/pkgtools/bootstrap-mk-files/files && env CP=${cpprog} \ |
1207 | OPSYS=${opsys} MK_DST=${wrkdir}/share/mk ROOT_GROUP=${root_group} \ | | 1207 | OPSYS=${opsys} MK_DST=${wrkdir}/share/mk ROOT_GROUP=${root_group} \ |
1208 | ROOT_USER=${root_user} SED=${sedprog} SYSCONFDIR=${sysconfdir} \ | | 1208 | ROOT_USER=${root_user} SED=${sedprog} SYSCONFDIR=${sysconfdir} \ |
1209 | $shprog ./bootstrap.sh)" | | 1209 | $shprog ./bootstrap.sh)" |
1210 | | | 1210 | |
1211 | if [ -n "${bootstrap_sh_set}" ]; then | | 1211 | if [ -n "${bootstrap_sh_set}" ]; then |
1212 | bmakexargs="${bmakexargs} --with-defshell=${bootstrap_sh}" | | 1212 | bmakexargs="${bmakexargs} --with-defshell=${bootstrap_sh}" |
1213 | fi | | 1213 | fi |
1214 | | | 1214 | |
1215 | bootstrap_bmake() { | | 1215 | bootstrap_bmake() { |
1216 | echo_msg "Bootstrapping bmake" | | 1216 | echo_msg "Bootstrapping bmake" |
1217 | copy_src $pkgsrcdir/devel/bmake/files bmake | | 1217 | copy_src $pkgsrcdir/devel/bmake/files bmake |
1218 | run_cmd "(cd $wrkdir/bmake && $shprog configure $configure_quiet_flags --prefix=$wrkdir --with-default-sys-path=$wrkdir/share/mk --with-machine-arch=${machine_arch} $bmakexargs)" | | 1218 | run_cmd "(cd $wrkdir/bmake && $shprog configure $configure_quiet_flags --prefix=$wrkdir --with-default-sys-path=$wrkdir/share/mk --with-machine-arch=${machine_arch} $bmakexargs)" |
1219 | run_cmd "(cd $wrkdir/bmake && $shprog make-bootstrap.sh)" | | 1219 | run_cmd "(cd $wrkdir/bmake && $shprog make-bootstrap.sh)" |
1220 | run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/bmake/bmake $wrkdir/bin/bmake" | | 1220 | run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/bmake/bmake $wrkdir/bin/bmake" |
1221 | } | | 1221 | } |
1222 | bootstrap_bmake | | 1222 | bootstrap_bmake |
1223 | | | 1223 | |
1224 | bmake="$wrkdir/bin/bmake" | | 1224 | bmake="$wrkdir/bin/bmake" |
1225 | | | 1225 | |
1226 | # build libnbcompat | | 1226 | # build libnbcompat |
1227 | echo_msg "Building libnbcompat" | | 1227 | echo_msg "Building libnbcompat" |
1228 | copy_src $pkgsrcdir/pkgtools/libnbcompat/files libnbcompat | | 1228 | copy_src $pkgsrcdir/pkgtools/libnbcompat/files libnbcompat |
1229 | run_cmd "(cd $wrkdir/libnbcompat; $shprog ./configure $configure_quiet_flags -C --prefix=$prefix --infodir=$infodir --mandir=$mandir --sysconfdir=$sysconfdir --enable-bsd-getopt --enable-db && $bmake $make_quiet_flags -j$make_jobs)" | | 1229 | run_cmd "(cd $wrkdir/libnbcompat; $shprog ./configure $configure_quiet_flags -C --prefix=$prefix --infodir=$infodir --mandir=$mandir --sysconfdir=$sysconfdir --enable-bsd-getopt --enable-db && $bmake $make_quiet_flags -j$make_jobs)" |
1230 | | | 1230 | |
1231 | # bootstrap mksh if necessary | | 1231 | # bootstrap mksh if necessary |
1232 | case "$need_mksh" in | | 1232 | case "$need_mksh" in |
1233 | yes) echo_msg "Bootstrapping mksh" | | 1233 | yes) echo_msg "Bootstrapping mksh" |
1234 | copy_src $pkgsrcdir/shells/mksh/files mksh | | 1234 | copy_src $pkgsrcdir/shells/mksh/files mksh |
1235 | run_cmd "(cd $wrkdir/mksh && env $BSTRAP_ENV CC=\"${CC}\" $shprog Build.sh -r)" | | 1235 | run_cmd "(cd $wrkdir/mksh && env $BSTRAP_ENV CC=\"${CC}\" $shprog Build.sh -r)" |
1236 | run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/mksh/mksh $wrkdir/bin/mksh" | | 1236 | run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/mksh/mksh $wrkdir/bin/mksh" |
1237 | echo "TOOLS_PLATFORM.sh?= $prefix/bin/mksh" >> ${TARGET_MKCONF} | | 1237 | echo "TOOLS_PLATFORM.sh?= $prefix/bin/mksh" >> ${TARGET_MKCONF} |
1238 | echo "TOOLS_PLATFORM.sh?= $wrkdir/bin/mksh" >> ${BOOTSTRAP_MKCONF} | | 1238 | echo "TOOLS_PLATFORM.sh?= $wrkdir/bin/mksh" >> ${BOOTSTRAP_MKCONF} |
1239 | echo_msg "Rebootstrapping bmake for mksh" | | 1239 | echo_msg "Rebootstrapping bmake for mksh" |
1240 | bmakexargs="$bmakexargs --with-defshell=$wrkdir/bin/mksh" | | 1240 | bmakexargs="$bmakexargs --with-defshell=$wrkdir/bin/mksh" |
1241 | bootstrap_bmake | | 1241 | bootstrap_bmake |
1242 | ;; | | 1242 | ;; |
1243 | esac | | 1243 | esac |
1244 | | | 1244 | |
1245 | # bootstrap ksh if necessary | | 1245 | # bootstrap ksh if necessary |
1246 | case "$need_ksh" in | | 1246 | case "$need_ksh" in |
1247 | yes) echo_msg "Bootstrapping ksh" | | 1247 | yes) echo_msg "Bootstrapping ksh" |
1248 | copy_src $pkgsrcdir/shells/pdksh/files ksh | | 1248 | copy_src $pkgsrcdir/shells/pdksh/files ksh |
1249 | run_cmd "(cd $wrkdir/ksh && env $BSTRAP_ENV $shprog ./configure $configure_quiet_flags --prefix=$prefix --infodir=$infodir --mandir=$mandir --sysconfdir=$sysconfdir && $bmake $make_quiet_flags -j$make_jobs)" | | 1249 | run_cmd "(cd $wrkdir/ksh && env $BSTRAP_ENV $shprog ./configure $configure_quiet_flags --prefix=$prefix --infodir=$infodir --mandir=$mandir --sysconfdir=$sysconfdir && $bmake $make_quiet_flags -j$make_jobs)" |
1250 | run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/ksh/ksh $wrkdir/bin/pdksh" | | 1250 | run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/ksh/ksh $wrkdir/bin/pdksh" |
1251 | echo "TOOLS_PLATFORM.sh?= $prefix/bin/pdksh" >> ${TARGET_MKCONF} | | 1251 | echo "TOOLS_PLATFORM.sh?= $prefix/bin/pdksh" >> ${TARGET_MKCONF} |
1252 | echo "TOOLS_PLATFORM.sh?= $wrkdir/bin/pdksh" >> ${BOOTSTRAP_MKCONF} | | 1252 | echo "TOOLS_PLATFORM.sh?= $wrkdir/bin/pdksh" >> ${BOOTSTRAP_MKCONF} |
1253 | echo "TOOLS_PLATFORM.ksh?= $prefix/bin/pdksh" >> ${TARGET_MKCONF} | | 1253 | echo "TOOLS_PLATFORM.ksh?= $prefix/bin/pdksh" >> ${TARGET_MKCONF} |
1254 | echo "TOOLS_PLATFORM.ksh?= $wrkdir/bin/pdksh" >> ${BOOTSTRAP_MKCONF} | | 1254 | echo "TOOLS_PLATFORM.ksh?= $wrkdir/bin/pdksh" >> ${BOOTSTRAP_MKCONF} |
1255 | # Now rebootstrap bmake for ksh | | 1255 | # Now rebootstrap bmake for ksh |
1256 | echo_msg "Rebootstrapping bmake for ksh" | | 1256 | echo_msg "Rebootstrapping bmake for ksh" |
1257 | bmakexargs="$bmakexargs --with-defshell=$wrkdir/bin/pdksh" | | 1257 | bmakexargs="$bmakexargs --with-defshell=$wrkdir/bin/pdksh" |
1258 | bootstrap_bmake | | 1258 | bootstrap_bmake |
1259 | ;; | | 1259 | ;; |
1260 | esac | | 1260 | esac |
1261 | | | 1261 | |
1262 | # bootstrap awk if necessary | | 1262 | # bootstrap awk if necessary |
1263 | case "$need_awk" in | | 1263 | case "$need_awk" in |
1264 | yes) echo_msg "Bootstrapping awk" | | 1264 | yes) echo_msg "Bootstrapping awk" |
1265 | copy_src $pkgsrcdir/lang/nawk/files awk | | 1265 | copy_src $pkgsrcdir/lang/nawk/files awk |
1266 | run_cmd "(cd $wrkdir/awk && $bmake $make_quiet_flags -j$make_jobs -f Makefile CC=\"${CC}\" CFLAGS=\"${CFLAGS}\")" | | 1266 | run_cmd "(cd $wrkdir/awk && $bmake $make_quiet_flags -j$make_jobs -f Makefile CC=\"${CC}\" CFLAGS=\"${CFLAGS}\")" |
1267 | run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/awk/a.out $wrkdir/bin/nawk" | | 1267 | run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/awk/a.out $wrkdir/bin/nawk" |
1268 | echo "TOOLS_PLATFORM.awk?= $prefix/bin/nawk" >> ${TARGET_MKCONF} | | 1268 | echo "TOOLS_PLATFORM.awk?= $prefix/bin/nawk" >> ${TARGET_MKCONF} |
1269 | echo "TOOLS_PLATFORM.awk?= $wrkdir/bin/nawk" >> ${BOOTSTRAP_MKCONF} | | 1269 | echo "TOOLS_PLATFORM.awk?= $wrkdir/bin/nawk" >> ${BOOTSTRAP_MKCONF} |
1270 | ;; | | 1270 | ;; |
1271 | esac | | 1271 | esac |
1272 | | | 1272 | |
1273 | # bootstrap sed if necessary | | 1273 | # bootstrap sed if necessary |
1274 | case "$need_sed" in | | 1274 | case "$need_sed" in |
1275 | yes) echo_msg "Bootstrapping sed" | | 1275 | yes) echo_msg "Bootstrapping sed" |
1276 | copy_src $pkgsrcdir/textproc/nbsed/files sed | | 1276 | copy_src $pkgsrcdir/textproc/nbsed/files sed |
1277 | 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 --infodir=$infodir --mandir=$mandir --sysconfdir=$sysconfdir --program-transform-name='s,sed,nbsed,' && $bmake $make_quiet_flags -j$make_jobs)" | | 1277 | 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 --infodir=$infodir --mandir=$mandir --sysconfdir=$sysconfdir --program-transform-name='s,sed,nbsed,' && $bmake $make_quiet_flags -j$make_jobs)" |
1278 | run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/sed/sed $wrkdir/bin/sed" | | 1278 | run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/sed/sed $wrkdir/bin/sed" |
1279 | echo "TOOLS_PLATFORM.sed?= $prefix/bin/nbsed" >> ${TARGET_MKCONF} | | 1279 | echo "TOOLS_PLATFORM.sed?= $prefix/bin/nbsed" >> ${TARGET_MKCONF} |
1280 | echo "TOOLS_PLATFORM.sed?= $wrkdir/bin/sed" >> ${BOOTSTRAP_MKCONF} | | 1280 | echo "TOOLS_PLATFORM.sed?= $wrkdir/bin/sed" >> ${BOOTSTRAP_MKCONF} |
1281 | ;; | | 1281 | ;; |
1282 | esac | | 1282 | esac |
1283 | | | 1283 | |
1284 | # bootstrap pkg_install | | 1284 | # bootstrap pkg_install |
1285 | extra_libarchive_depends() { | | 1285 | extra_libarchive_depends() { |
1286 | $sedprog -n -e 's/Libs.private: //p' $wrkdir/libarchive/build/pkgconfig/libarchive.pc | | 1286 | $sedprog -n -e 's/Libs.private: //p' $wrkdir/libarchive/build/pkgconfig/libarchive.pc |
1287 | } | | 1287 | } |
1288 | | | 1288 | |
1289 | echo_msg "Bootstrapping pkgtools" | | 1289 | echo_msg "Bootstrapping pkgtools" |
1290 | copy_src $pkgsrcdir/archivers/libarchive/files libarchive | | 1290 | copy_src $pkgsrcdir/archivers/libarchive/files libarchive |
1291 | run_cmd "(cd $wrkdir/libarchive; env $BSTRAP_ENV \ | | 1291 | run_cmd "(cd $wrkdir/libarchive; env $BSTRAP_ENV \ |
1292 | $shprog ./configure $configure_quiet_flags --enable-static --disable-shared \ | | 1292 | $shprog ./configure $configure_quiet_flags --enable-static --disable-shared \ |
1293 | --disable-bsdtar --disable-bsdcpio --disable-posix-regex-lib --disable-xattr \ | | 1293 | --disable-bsdtar --disable-bsdcpio --disable-posix-regex-lib --disable-xattr \ |
1294 | --disable-maintainer-mode --disable-acl --without-zlib --without-bz2lib \ | | 1294 | --disable-maintainer-mode --disable-acl --without-zlib --without-bz2lib \ |
1295 | --without-iconv --without-lzma --without-lzo2 --without-lz4 \ | | 1295 | --without-iconv --without-lzma --without-lzo2 --without-lz4 \ |
1296 | --without-nettle --without-openssl --without-xml2 --without-expat --without-zstd \ | | 1296 | --without-nettle --without-openssl --without-xml2 --without-expat --without-zstd \ |
1297 | MAKE=$bmake && $bmake $make_quiet_flags -j$make_jobs)" | | 1297 | MAKE=$bmake && $bmake $make_quiet_flags -j$make_jobs)" |
1298 | copy_src $pkgsrcdir/pkgtools/pkg_install/files pkg_install | | 1298 | copy_src $pkgsrcdir/pkgtools/pkg_install/files pkg_install |
1299 | run_cmd "(cd $wrkdir/pkg_install; env $BSTRAP_ENV \ | | 1299 | run_cmd "(cd $wrkdir/pkg_install; env $BSTRAP_ENV \ |
1300 | CPPFLAGS='$CPPFLAGS -I${wrkdir}/libnbcompat -I${wrkdir}/libarchive/libarchive' \ | | 1300 | CPPFLAGS='$CPPFLAGS -I${wrkdir}/libnbcompat -I${wrkdir}/libarchive/libarchive' \ |
1301 | LDFLAGS='$LDFLAGS -L${wrkdir}/libnbcompat' \ | | 1301 | LDFLAGS='$LDFLAGS -L${wrkdir}/libnbcompat' \ |
1302 | LIBS='$LIBS -lnbcompat' $shprog ./configure $configure_quiet_flags -C \ | | 1302 | LIBS='$LIBS -lnbcompat' $shprog ./configure $configure_quiet_flags -C \ |
1303 | --enable-bootstrap --prefix=$prefix --sysconfdir=$sysconfdir \ | | 1303 | --enable-bootstrap --prefix=$prefix --sysconfdir=$sysconfdir \ |
1304 | --with-pkgdbdir=$pkgdbdir --infodir=$infodir \ | | 1304 | --with-pkgdbdir=$pkgdbdir --infodir=$infodir \ |
1305 | --mandir=$mandir $pkg_install_args && \ | | 1305 | --mandir=$mandir $pkg_install_args && \ |
1306 | STATIC_LIBARCHIVE=$wrkdir/libarchive/.libs/libarchive.a \ | | 1306 | STATIC_LIBARCHIVE=$wrkdir/libarchive/.libs/libarchive.a \ |
1307 | STATIC_LIBARCHIVE_LDADD=`extra_libarchive_depends` \ | | 1307 | STATIC_LIBARCHIVE_LDADD="`extra_libarchive_depends`" \ |
1308 | PKGSRC_MACHINE_ARCH="$machine_arch" $bmake $make_quiet_flags -j$make_jobs)" | | 1308 | PKGSRC_MACHINE_ARCH="$machine_arch" $bmake $make_quiet_flags -j$make_jobs)" |
1309 | run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/add/pkg_add $wrkdir/sbin/pkg_add" | | 1309 | run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/add/pkg_add $wrkdir/sbin/pkg_add" |
1310 | run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/admin/pkg_admin $wrkdir/sbin/pkg_admin" | | 1310 | run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/admin/pkg_admin $wrkdir/sbin/pkg_admin" |
1311 | run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/create/pkg_create $wrkdir/sbin/pkg_create" | | 1311 | run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/create/pkg_create $wrkdir/sbin/pkg_create" |
1312 | run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/info/pkg_info $wrkdir/sbin/pkg_info" | | 1312 | run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/info/pkg_info $wrkdir/sbin/pkg_info" |
1313 | echo "PKG_ADD_CMD?= $wrkdir/sbin/pkg_add" >> ${BOOTSTRAP_MKCONF} | | 1313 | echo "PKG_ADD_CMD?= $wrkdir/sbin/pkg_add" >> ${BOOTSTRAP_MKCONF} |
1314 | echo "PKG_ADMIN_CMD?= $wrkdir/sbin/pkg_admin" >> ${BOOTSTRAP_MKCONF} | | 1314 | echo "PKG_ADMIN_CMD?= $wrkdir/sbin/pkg_admin" >> ${BOOTSTRAP_MKCONF} |
1315 | echo "PKG_CREATE_CMD?= $wrkdir/sbin/pkg_create" >> ${BOOTSTRAP_MKCONF} | | 1315 | echo "PKG_CREATE_CMD?= $wrkdir/sbin/pkg_create" >> ${BOOTSTRAP_MKCONF} |
1316 | echo "PKG_INFO_CMD?= $wrkdir/sbin/pkg_info" >> ${BOOTSTRAP_MKCONF} | | 1316 | echo "PKG_INFO_CMD?= $wrkdir/sbin/pkg_info" >> ${BOOTSTRAP_MKCONF} |
1317 | | | 1317 | |
1318 | MAKECONF=$wrkdir/mk.conf | | 1318 | MAKECONF=$wrkdir/mk.conf |
1319 | export MAKECONF | | 1319 | export MAKECONF |
1320 | | | 1320 | |
1321 | if [ "$bootstrap_sh_set" = "set" ]; then | | 1321 | if [ "$bootstrap_sh_set" = "set" ]; then |
1322 | echo "TOOLS_PLATFORM.sh?= ${bootstrap_sh}" >> ${TARGET_MKCONF} | | 1322 | echo "TOOLS_PLATFORM.sh?= ${bootstrap_sh}" >> ${TARGET_MKCONF} |
1323 | echo "TOOLS_PLATFORM.sh?= ${bootstrap_sh}" >> ${BOOTSTRAP_MKCONF} | | 1323 | echo "TOOLS_PLATFORM.sh?= ${bootstrap_sh}" >> ${BOOTSTRAP_MKCONF} |
1324 | fi | | 1324 | fi |
1325 | | | 1325 | |
1326 | # preserve compiler and tool environment variables settings | | 1326 | # preserve compiler and tool environment variables settings |
1327 | if test -n "$CP"; then | | 1327 | if test -n "$CP"; then |
1328 | echo "TOOLS_PLATFORM.cp?= $CP" >> ${TARGET_MKCONF} | | 1328 | echo "TOOLS_PLATFORM.cp?= $CP" >> ${TARGET_MKCONF} |
1329 | echo "TOOLS_PLATFORM.cp?= $CP" >> ${BOOTSTRAP_MKCONF} | | 1329 | echo "TOOLS_PLATFORM.cp?= $CP" >> ${BOOTSTRAP_MKCONF} |
1330 | fi | | 1330 | fi |
1331 | if test -n "$GREP"; then | | 1331 | if test -n "$GREP"; then |
1332 | echo "TOOLS_PLATFORM.grep?= $GREP" >> ${TARGET_MKCONF} | | 1332 | echo "TOOLS_PLATFORM.grep?= $GREP" >> ${TARGET_MKCONF} |
1333 | echo "TOOLS_PLATFORM.grep?= $GREP" >> ${BOOTSTRAP_MKCONF} | | 1333 | echo "TOOLS_PLATFORM.grep?= $GREP" >> ${BOOTSTRAP_MKCONF} |
1334 | fi | | 1334 | fi |
1335 | if test -n "$EGREP"; then | | 1335 | if test -n "$EGREP"; then |
1336 | echo "TOOLS_PLATFORM.egrep?= $EGREP" >> ${TARGET_MKCONF} | | 1336 | echo "TOOLS_PLATFORM.egrep?= $EGREP" >> ${TARGET_MKCONF} |
1337 | echo "TOOLS_PLATFORM.egrep?= $EGREP" >> ${BOOTSTRAP_MKCONF} | | 1337 | echo "TOOLS_PLATFORM.egrep?= $EGREP" >> ${BOOTSTRAP_MKCONF} |
1338 | fi | | 1338 | fi |
1339 | if test -n "$FGREP"; then | | 1339 | if test -n "$FGREP"; then |
1340 | echo "TOOLS_PLATFORM.fgrep?= $FGREP" >> ${TARGET_MKCONF} | | 1340 | echo "TOOLS_PLATFORM.fgrep?= $FGREP" >> ${TARGET_MKCONF} |
1341 | echo "TOOLS_PLATFORM.fgrep?= $FGREP" >> ${BOOTSTRAP_MKCONF} | | 1341 | echo "TOOLS_PLATFORM.fgrep?= $FGREP" >> ${BOOTSTRAP_MKCONF} |
1342 | fi | | 1342 | fi |
1343 | if test -n "$ID"; then | | 1343 | if test -n "$ID"; then |
1344 | echo "TOOLS_PLATFORM.id?= $ID" >> ${TARGET_MKCONF} | | 1344 | echo "TOOLS_PLATFORM.id?= $ID" >> ${TARGET_MKCONF} |
1345 | echo "TOOLS_PLATFORM.id?= $ID" >> ${BOOTSTRAP_MKCONF} | | 1345 | echo "TOOLS_PLATFORM.id?= $ID" >> ${BOOTSTRAP_MKCONF} |
1346 | fi | | 1346 | fi |
1347 | if test -n "$MKDIR"; then | | 1347 | if test -n "$MKDIR"; then |
1348 | echo "TOOLS_PLATFORM.mkdir?= $MKDIR" >> ${TARGET_MKCONF} | | 1348 | echo "TOOLS_PLATFORM.mkdir?= $MKDIR" >> ${TARGET_MKCONF} |
1349 | echo "TOOLS_PLATFORM.mkdir?= $MKDIR" >> ${BOOTSTRAP_MKCONF} | | 1349 | echo "TOOLS_PLATFORM.mkdir?= $MKDIR" >> ${BOOTSTRAP_MKCONF} |
1350 | fi | | 1350 | fi |
1351 | if test -n "$TEST"; then | | 1351 | if test -n "$TEST"; then |
1352 | echo "TOOLS_PLATFORM.test?= $TEST" >> ${TARGET_MKCONF} | | 1352 | echo "TOOLS_PLATFORM.test?= $TEST" >> ${TARGET_MKCONF} |
1353 | echo "TOOLS_PLATFORM.test?= $TEST" >> ${BOOTSTRAP_MKCONF} | | 1353 | echo "TOOLS_PLATFORM.test?= $TEST" >> ${BOOTSTRAP_MKCONF} |
1354 | fi | | 1354 | fi |
1355 | if test -n "$TOUCH"; then | | 1355 | if test -n "$TOUCH"; then |
1356 | echo "TOOLS_PLATFORM.touch?= $TOUCH" >> ${TARGET_MKCONF} | | 1356 | echo "TOOLS_PLATFORM.touch?= $TOUCH" >> ${TARGET_MKCONF} |
1357 | echo "TOOLS_PLATFORM.touch?= $TOUCH" >> ${BOOTSTRAP_MKCONF} | | 1357 | echo "TOOLS_PLATFORM.touch?= $TOUCH" >> ${BOOTSTRAP_MKCONF} |
1358 | fi | | 1358 | fi |
1359 | if test -n "$XARGS"; then | | 1359 | if test -n "$XARGS"; then |
1360 | echo "TOOLS_PLATFORM.xargs?= $XARGS" >> ${TARGET_MKCONF} | | 1360 | echo "TOOLS_PLATFORM.xargs?= $XARGS" >> ${TARGET_MKCONF} |
1361 | echo "TOOLS_PLATFORM.xargs?= $XARGS" >> ${BOOTSTRAP_MKCONF} | | 1361 | echo "TOOLS_PLATFORM.xargs?= $XARGS" >> ${BOOTSTRAP_MKCONF} |
1362 | fi | | 1362 | fi |
1363 | if test -n "$CFLAGS"; then | | 1363 | if test -n "$CFLAGS"; then |
1364 | echo "CFLAGS+= $CFLAGS" >> ${TARGET_MKCONF} | | 1364 | echo "CFLAGS+= $CFLAGS" >> ${TARGET_MKCONF} |
1365 | echo "DBG= # prevent DBG from adding default optimizer flags" >> ${TARGET_MKCONF} | | 1365 | echo "DBG= # prevent DBG from adding default optimizer flags" >> ${TARGET_MKCONF} |
1366 | echo "DBG= # prevent DBG from adding default optimizer flags" >> ${BOOTSTRAP_MKCONF} | | 1366 | echo "DBG= # prevent DBG from adding default optimizer flags" >> ${BOOTSTRAP_MKCONF} |
1367 | fi | | 1367 | fi |
1368 | if test -n "$CPPFLAGS"; then | | 1368 | if test -n "$CPPFLAGS"; then |
1369 | echo "CPPFLAGS+= $CPPFLAGS" >> ${TARGET_MKCONF} | | 1369 | echo "CPPFLAGS+= $CPPFLAGS" >> ${TARGET_MKCONF} |
1370 | fi | | 1370 | fi |
1371 | if test -n "$LDFLAGS"; then | | 1371 | if test -n "$LDFLAGS"; then |
1372 | echo "LDFLAGS+= $LDFLAGS" >> ${TARGET_MKCONF} | | 1372 | echo "LDFLAGS+= $LDFLAGS" >> ${TARGET_MKCONF} |
1373 | fi | | 1373 | fi |
1374 | if test -n "$LIBS"; then | | 1374 | if test -n "$LIBS"; then |
1375 | echo "LIBS+= $LIBS" >> ${TARGET_MKCONF} | | 1375 | echo "LIBS+= $LIBS" >> ${TARGET_MKCONF} |
1376 | fi | | 1376 | fi |
1377 | | | 1377 | |
1378 | # opsys specific fiddling | | 1378 | # opsys specific fiddling |
1379 | opsys_finish | | 1379 | opsys_finish |
1380 | | | 1380 | |
1381 | echo "WRKOBJDIR= ${wrkdir}/wrk" >> ${BOOTSTRAP_MKCONF} | | 1381 | echo "WRKOBJDIR= ${wrkdir}/wrk" >> ${BOOTSTRAP_MKCONF} |
1382 | | | 1382 | |
1383 | echo "" >> ${TARGET_MKCONF} | | 1383 | echo "" >> ${TARGET_MKCONF} |
1384 | echo "" >> ${BOOTSTRAP_MKCONF} | | 1384 | echo "" >> ${BOOTSTRAP_MKCONF} |
1385 | if test -n "${mk_fragment}"; then | | 1385 | if test -n "${mk_fragment}"; then |
1386 | cat "${mk_fragment}" >> ${TARGET_MKCONF} | | 1386 | cat "${mk_fragment}" >> ${TARGET_MKCONF} |
1387 | echo "" >> ${TARGET_MKCONF} | | 1387 | echo "" >> ${TARGET_MKCONF} |
1388 | fi | | 1388 | fi |
1389 | echo ".endif # end pkgsrc settings" >> ${TARGET_MKCONF} | | 1389 | echo ".endif # end pkgsrc settings" >> ${TARGET_MKCONF} |
1390 | echo ".endif # end pkgsrc settings" >> ${BOOTSTRAP_MKCONF} | | 1390 | echo ".endif # end pkgsrc settings" >> ${BOOTSTRAP_MKCONF} |
1391 | | | 1391 | |
1392 | # build and register packages | | 1392 | # build and register packages |
1393 | # usage: build_package <packagedirectory> | | 1393 | # usage: build_package <packagedirectory> |
1394 | build_package() { | | 1394 | build_package() { |
1395 | run_cmd "(cd $pkgsrcdir/$1 && $bmake $make_quiet_flags MAKE_JOBS=${make_jobs} PKG_COMPRESSION=none -DPKG_PRESERVE PKGSRC_KEEP_BIN_PKGS=no MAKECONF=${BOOTSTRAP_MKCONF} install)" | | 1395 | run_cmd "(cd $pkgsrcdir/$1 && $bmake $make_quiet_flags MAKE_JOBS=${make_jobs} PKG_COMPRESSION=none -DPKG_PRESERVE PKGSRC_KEEP_BIN_PKGS=no MAKECONF=${BOOTSTRAP_MKCONF} install)" |
1396 | } | | 1396 | } |
1397 | build_package_nopreserve() { | | 1397 | build_package_nopreserve() { |
1398 | run_cmd "(cd $pkgsrcdir/$1 && $bmake $make_quiet_flags MAKE_JOBS=${make_jobs} PKG_COMPRESSION=none PKGSRC_KEEP_BIN_PKGS=no MAKECONF=${BOOTSTRAP_MKCONF} install)" | | 1398 | run_cmd "(cd $pkgsrcdir/$1 && $bmake $make_quiet_flags MAKE_JOBS=${make_jobs} PKG_COMPRESSION=none PKGSRC_KEEP_BIN_PKGS=no MAKECONF=${BOOTSTRAP_MKCONF} install)" |
1399 | } | | 1399 | } |
1400 | | | 1400 | |
1401 | # | | 1401 | # |
1402 | # cwrappers is special, we don't want to set it as a BOOTSTRAP_PKG but must | | 1402 | # cwrappers is special, we don't want to set it as a BOOTSTRAP_PKG but must |
1403 | # build it (if required) without -DPKG_PRESERVE set so that it can be deleted. | | 1403 | # build it (if required) without -DPKG_PRESERVE set so that it can be deleted. |
1404 | # | | 1404 | # |
1405 | use_cwrappers=`(cd $pkgsrcdir/devel/bmake && $bmake show-var VARNAME=_USE_CWRAPPERS)` | | 1405 | use_cwrappers=`(cd $pkgsrcdir/devel/bmake && $bmake show-var VARNAME=_USE_CWRAPPERS)` |
1406 | case "$use_cwrappers" in | | 1406 | case "$use_cwrappers" in |
1407 | yes) | | 1407 | yes) |
1408 | build_package_nopreserve "pkgtools/cwrappers" | | 1408 | build_package_nopreserve "pkgtools/cwrappers" |
1409 | ;; | | 1409 | ;; |
1410 | esac | | 1410 | esac |
1411 | | | 1411 | |
1412 | # | | 1412 | # |
1413 | # Please make sure that the following packages and | | 1413 | # Please make sure that the following packages and |
1414 | # only the following packages set BOOTSTRAP_PKG=yes. | | 1414 | # only the following packages set BOOTSTRAP_PKG=yes. |
1415 | # | | 1415 | # |
1416 | echo_msg "Installing packages" | | 1416 | echo_msg "Installing packages" |
1417 | build_package "pkgtools/bootstrap-mk-files" | | 1417 | build_package "pkgtools/bootstrap-mk-files" |
1418 | case "$need_bsd_install" in | | 1418 | case "$need_bsd_install" in |
1419 | yes) | | 1419 | yes) |
1420 | if [ "$use_bsdinstall" = "yes" ]; then | | 1420 | if [ "$use_bsdinstall" = "yes" ]; then |
1421 | build_package "sysutils/bsdinstall" | | 1421 | build_package "sysutils/bsdinstall" |
1422 | else | | 1422 | else |
1423 | build_package "sysutils/install-sh" | | 1423 | build_package "sysutils/install-sh" |
1424 | fi | | 1424 | fi |
1425 | ;; | | 1425 | ;; |
1426 | esac | | 1426 | esac |
1427 | case "$need_mksh" in | | 1427 | case "$need_mksh" in |
1428 | yes) build_package "shells/mksh";; | | 1428 | yes) build_package "shells/mksh";; |
1429 | esac | | 1429 | esac |
1430 | case "$need_ksh" in | | 1430 | case "$need_ksh" in |
1431 | yes) build_package "shells/pdksh";; | | 1431 | yes) build_package "shells/pdksh";; |
1432 | esac | | 1432 | esac |
1433 | build_package "devel/bmake" | | 1433 | build_package "devel/bmake" |
1434 | case "$need_awk" in | | 1434 | case "$need_awk" in |
1435 | yes) build_package "lang/nawk";; | | 1435 | yes) build_package "lang/nawk";; |
1436 | esac | | 1436 | esac |
1437 | case "$need_sed" in | | 1437 | case "$need_sed" in |
1438 | yes) build_package "textproc/nbsed";; | | 1438 | yes) build_package "textproc/nbsed";; |
1439 | esac | | 1439 | esac |
1440 | case "$need_extras" in | | 1440 | case "$need_extras" in |
1441 | yes) build_package "pkgtools/bootstrap-extras";; | | 1441 | yes) build_package "pkgtools/bootstrap-extras";; |
1442 | esac | | 1442 | esac |
1443 | case "$need_pax" in | | 1443 | case "$need_pax" in |
1444 | yes) build_package "archivers/pax" | | 1444 | yes) build_package "archivers/pax" |
1445 | esac | | 1445 | esac |
1446 | build_package "pkgtools/pkg_install" | | 1446 | build_package "pkgtools/pkg_install" |
1447 | | | 1447 | |
1448 | etc_mk_conf="$sysconfdir/mk.conf" | | 1448 | etc_mk_conf="$sysconfdir/mk.conf" |
1449 | | | 1449 | |
1450 | # Install the example mk.conf so that it is used, but only if it doesn't | | 1450 | # Install the example mk.conf so that it is used, but only if it doesn't |
1451 | # exist yet. This can happen with non-default sysconfdir settings. | | 1451 | # exist yet. This can happen with non-default sysconfdir settings. |
1452 | mkdir_p "$sysconfdir" | | 1452 | mkdir_p "$sysconfdir" |
1453 | if [ ! -f "$etc_mk_conf" ]; then | | 1453 | if [ ! -f "$etc_mk_conf" ]; then |
1454 | cp "$TARGET_MKCONF" "$etc_mk_conf" | | 1454 | cp "$TARGET_MKCONF" "$etc_mk_conf" |
1455 | TARGET_MKCONF="$etc_mk_conf" | | 1455 | TARGET_MKCONF="$etc_mk_conf" |
1456 | fi | | 1456 | fi |
1457 | | | 1457 | |
1458 | [ -n "${binary_kit}" ] && mkbinarykit_tar | | 1458 | [ -n "${binary_kit}" ] && mkbinarykit_tar |
1459 | [ -n "${binary_gzip_kit}" ] && mkbinarykit_tgz | | 1459 | [ -n "${binary_gzip_kit}" ] && mkbinarykit_tgz |
1460 | | | 1460 | |
1461 | hline="===========================================================================" | | 1461 | hline="===========================================================================" |
1462 | echo "" | | 1462 | echo "" |
1463 | echo "$hline" | | 1463 | echo "$hline" |
1464 | echo "" | | 1464 | echo "" |
1465 | echo "Please remember to add $prefix/bin to your PATH environment variable" | | 1465 | echo "Please remember to add $prefix/bin to your PATH environment variable" |
1466 | echo "and $mandir to your MANPATH environment variable, if necessary." | | 1466 | echo "and $mandir to your MANPATH environment variable, if necessary." |
1467 | echo "" | | 1467 | echo "" |
1468 | echo "An example mk.conf file with the settings you provided to \"bootstrap\"" | | 1468 | echo "An example mk.conf file with the settings you provided to \"bootstrap\"" |
1469 | echo "has been created for you. It can be found in:" | | 1469 | echo "has been created for you. It can be found in:" |
1470 | echo "" | | 1470 | echo "" |
1471 | echo " ${TARGET_MKCONF}" | | 1471 | echo " ${TARGET_MKCONF}" |
1472 | echo "" | | 1472 | echo "" |
1473 | if [ "$TARGET_MKCONF" != "$etc_mk_conf" ]; then | | 1473 | if [ "$TARGET_MKCONF" != "$etc_mk_conf" ]; then |
1474 | echo "Please copy it to $etc_mk_conf to use it." | | 1474 | echo "Please copy it to $etc_mk_conf to use it." |
1475 | echo "" | | 1475 | echo "" |
1476 | fi | | 1476 | fi |
1477 | echo "You can find extensive documentation of the NetBSD Packages Collection" | | 1477 | echo "You can find extensive documentation of the NetBSD Packages Collection" |
1478 | echo "in $pkgsrcdir/doc/pkgsrc.txt." | | 1478 | echo "in $pkgsrcdir/doc/pkgsrc.txt." |
1479 | echo "" | | 1479 | echo "" |
1480 | echo "Thank you for using pkgsrc!" | | 1480 | echo "Thank you for using pkgsrc!" |
1481 | echo "" | | 1481 | echo "" |
1482 | echo "$hline" | | 1482 | echo "$hline" |
1483 | echo "" | | 1483 | echo "" |
1484 | | | 1484 | |
1485 | echo_msg "bootstrap started: $build_start" | | 1485 | echo_msg "bootstrap started: $build_start" |
1486 | echo_msg "bootstrap ended: `date`" | | 1486 | echo_msg "bootstrap ended: `date`" |
1487 | | | 1487 | |
1488 | exit 0 | | 1488 | exit 0 |