| @@ -1,1508 +1,1507 @@ | | | @@ -1,1508 +1,1507 @@ |
1 | #! /bin/sh | | 1 | #! /bin/sh |
2 | | | 2 | |
3 | # $NetBSD: bootstrap,v 1.312 2022/06/16 22:12:20 charlotte Exp $ | | 3 | # $NetBSD: bootstrap,v 1.313 2022/09/09 10:58:15 jperkin 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 | | | |
591 | check_compiler=yes | | 590 | check_compiler=yes |
592 | | | 591 | |
593 | # Combine major.minor product version for simpler numerical tests. | | 592 | # Combine major.minor product version for simpler numerical tests. |
594 | macos_version=`sw_vers -productVersion | \ | | 593 | macos_version=`sw_vers -productVersion | \ |
595 | awk -F. '{ printf("%02d%02d", $1, $2) }'` | | 594 | awk -F. '{ printf("%02d%02d", $1, $2) }'` |
596 | | | 595 | |
597 | # Since 10.9, native sed exits when called on files with UTF-8 | | 596 | # Since 10.9, native sed exits when called on files with UTF-8 |
598 | # or other apparently-binary content. | | 597 | # or other apparently-binary content. |
599 | if [ $macos_version -ge 1008 ]; then | | 598 | if [ $macos_version -ge 1008 ]; then |
600 | need_awk=yes | | 599 | need_awk=yes |
601 | need_sed=yes | | 600 | need_sed=yes |
602 | fi | | 601 | fi |
603 | | | 602 | |
604 | # Avoid system shells on macOS versions that enable System Integrity | | 603 | # Avoid system shells on macOS versions that enable System Integrity |
605 | # Protection (SIP) as it affects packages that rely on variables such | | 604 | # Protection (SIP) as it affects packages that rely on variables such |
606 | # as LD_LIBRARY_PATH. SIP unsets any variables that may affect | | 605 | # as LD_LIBRARY_PATH. SIP unsets any variables that may affect |
607 | # 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 |
608 | # non-system shell is unaffected, at least for now. | | 607 | # non-system shell is unaffected, at least for now. |
609 | if [ $macos_version -ge 1011 ]; then | | 608 | if [ $macos_version -ge 1011 ]; then |
610 | need_mksh=yes | | 609 | need_mksh=yes |
611 | fi | | 610 | fi |
612 | | | 611 | |
613 | unset macos_version | | 612 | unset macos_version |
614 | ;; | | 613 | ;; |
615 | DragonFly) | | 614 | DragonFly) |
616 | root_group=wheel | | 615 | root_group=wheel |
617 | check_prog tarprog tar | | 616 | check_prog tarprog tar |
618 | machine_arch=`uname -p` | | 617 | machine_arch=`uname -p` |
619 | ;; | | 618 | ;; |
620 | FreeBSD) | | 619 | FreeBSD) |
621 | root_group=wheel | | 620 | root_group=wheel |
622 | machine_arch=`uname -p` | | 621 | machine_arch=`uname -p` |
623 | check_compiler=yes | | 622 | check_compiler=yes |
624 | ;; | | 623 | ;; |
625 | FreeMiNT) | | 624 | FreeMiNT) |
626 | root_group=root | | 625 | root_group=root |
627 | machine_arch=m68k | | 626 | machine_arch=m68k |
628 | ;; | | 627 | ;; |
629 | GNUkFreeBSD) | | 628 | GNUkFreeBSD) |
630 | root_group=root | | 629 | root_group=root |
631 | need_awk=yes | | 630 | need_awk=yes |
632 | machine_arch=`uname -m` | | 631 | machine_arch=`uname -m` |
633 | ;; | | 632 | ;; |
634 | Haiku) | | 633 | Haiku) |
635 | root_user=`id -un` | | 634 | root_user=`id -un` |
636 | root_group=root | | 635 | root_group=root |
637 | case `uname -m` in | | 636 | case `uname -m` in |
638 | BeMac) | | 637 | BeMac) |
639 | machine_arch=powerpc | | 638 | machine_arch=powerpc |
640 | ;; | | 639 | ;; |
641 | BePC) | | 640 | BePC) |
642 | machine_arch=i386 | | 641 | machine_arch=i386 |
643 | ;; | | 642 | ;; |
644 | *) | | 643 | *) |
645 | machine_arch=`uname -p` | | 644 | machine_arch=`uname -p` |
646 | ;; | | 645 | ;; |
647 | esac | | 646 | esac |
648 | ;; | | 647 | ;; |
649 | HPUX) | | 648 | HPUX) |
650 | root_group=sys | | 649 | root_group=sys |
651 | need_bsd_install=yes | | 650 | need_bsd_install=yes |
652 | need_awk=yes | | 651 | need_awk=yes |
653 | need_sed=yes | | 652 | need_sed=yes |
654 | machine_arch=`uname -m | sed 's/^9000.*$/hppa/'` | | 653 | machine_arch=`uname -m | sed 's/^9000.*$/hppa/'` |
655 | ;; | | 654 | ;; |
656 | Interix) | | 655 | Interix) |
657 | is_root () { | | 656 | is_root () { |
658 | if id -G | grep -q 131616; then | | 657 | if id -G | grep -q 131616; then |
659 | return 0 | | 658 | return 0 |
660 | fi | | 659 | fi |
661 | return 1 | | 660 | return 1 |
662 | } | | 661 | } |
663 | mkdir_p () { | | 662 | mkdir_p () { |
664 | mkdir -p "$@" # allows umask to take effect | | 663 | mkdir -p "$@" # allows umask to take effect |
665 | } | | 664 | } |
666 | default_install_mode=0775 | | 665 | default_install_mode=0775 |
667 | root_user=`id -un` | | 666 | root_user=`id -un` |
668 | root_group=+Administrators | | 667 | root_group=+Administrators |
669 | case `uname -r` in | | 668 | case `uname -r` in |
670 | 3.* | 5.*) | | 669 | 3.* | 5.*) |
671 | need_bsd_install=yes | | 670 | need_bsd_install=yes |
672 | need_awk=yes | | 671 | need_awk=yes |
673 | need_sed=yes | | 672 | need_sed=yes |
674 | need_xargs=yes | | 673 | need_xargs=yes |
675 | ;; | | 674 | ;; |
676 | esac | | 675 | esac |
677 | # only used for unprivileged builds | | 676 | # only used for unprivileged builds |
678 | groupsprog="id -gn" | | 677 | groupsprog="id -gn" |
679 | # for bootstrap only; pkgsrc uses CPPFLAGS | | 678 | # for bootstrap only; pkgsrc uses CPPFLAGS |
680 | CC="gcc -D_ALL_SOURCE"; export CC | | 679 | CC="gcc -D_ALL_SOURCE"; export CC |
681 | 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 |
682 | ac_cv_func_poll=no; export ac_cv_func_poll | | 681 | ac_cv_func_poll=no; export ac_cv_func_poll |
683 | ;; | | 682 | ;; |
684 | IRIX*) | | 683 | IRIX*) |
685 | if [ -d "/usr/freeware/bin" ]; then | | 684 | if [ -d "/usr/freeware/bin" ]; then |
686 | overpath="/usr/freeware/bin:$overpath" | | 685 | overpath="/usr/freeware/bin:$overpath" |
687 | fi | | 686 | fi |
688 | if [ -d "/usr/bsd" ]; then | | 687 | if [ -d "/usr/bsd" ]; then |
689 | overpath="/usr/bsd:$overpath" | | 688 | overpath="/usr/bsd:$overpath" |
690 | fi | | 689 | fi |
691 | if [ -d "/usr/bsd/bin" ]; then | | 690 | if [ -d "/usr/bsd/bin" ]; then |
692 | overpath="/usr/bsd/bin:$overpath" | | 691 | overpath="/usr/bsd/bin:$overpath" |
693 | fi | | 692 | fi |
694 | root_group=sys | | 693 | root_group=sys |
695 | need_bsd_install=yes | | 694 | need_bsd_install=yes |
696 | get_abi "IRIX" | | 695 | get_abi "IRIX" |
697 | opsys=IRIX | | 696 | opsys=IRIX |
698 | need_awk=yes | | 697 | need_awk=yes |
699 | need_sed=yes | | 698 | need_sed=yes |
700 | set_opsys=yes | | 699 | set_opsys=yes |
701 | machine_arch=mipseb | | 700 | machine_arch=mipseb |
702 | check_compiler=yes | | 701 | check_compiler=yes |
703 | if [ `uname -r` -lt 6 ]; then | | 702 | if [ `uname -r` -lt 6 ]; then |
704 | # 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 |
705 | # option an already existing directory | | 704 | # option an already existing directory |
706 | need_mkdir=yes | | 705 | need_mkdir=yes |
707 | fi | | 706 | fi |
708 | ;; | | 707 | ;; |
709 | Linux) | | 708 | Linux) |
710 | if [ -f /etc/ssdlinux_version ]; then | | 709 | if [ -f /etc/ssdlinux_version ]; then |
711 | root_group=wheel | | 710 | root_group=wheel |
712 | else | | 711 | else |
713 | root_group=root | | 712 | root_group=root |
714 | fi | | 713 | fi |
715 | # Debian/Ubuntu's awk is mawk, and mawk does not understand | | 714 | # Debian/Ubuntu's awk is mawk, and mawk does not understand |
716 | # some regexp used in pkgsrc/mk. | | 715 | # some regexp used in pkgsrc/mk. |
717 | if [ -f /etc/debian_version ]; then | | 716 | if [ -f /etc/debian_version ]; then |
718 | need_awk=yes | | 717 | need_awk=yes |
719 | # 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 |
720 | # anymore. | | 719 | # anymore. |
721 | elif [ -f /etc/arch-release ]; then | | 720 | elif [ -f /etc/arch-release ]; then |
722 | need_awk=yes | | 721 | need_awk=yes |
723 | need_pax=yes | | 722 | need_pax=yes |
724 | elif grep -sq '^CHROMEOS_RELEASE_NAME' /etc/lsb-release; then | | 723 | elif grep -sq '^CHROMEOS_RELEASE_NAME' /etc/lsb-release; then |
725 | need_awk=yes | | 724 | need_awk=yes |
726 | need_sed=yes | | 725 | need_sed=yes |
727 | fi | | 726 | fi |
728 | machine_arch=`uname -m` | | 727 | machine_arch=`uname -m` |
729 | # Override machine_arch where required. | | 728 | # Override machine_arch where required. |
730 | case "$machine_arch" in | | 729 | case "$machine_arch" in |
731 | i?86) machine_arch=i386 ;; | | 730 | i?86) machine_arch=i386 ;; |
732 | ppc64le) machine_arch=powerpc64le ;; | | 731 | ppc64le) machine_arch=powerpc64le ;; |
733 | esac | | 732 | esac |
734 | ;; | | 733 | ;; |
735 | MidnightBSD) | | 734 | MidnightBSD) |
736 | root_group=wheel | | 735 | root_group=wheel |
737 | machine_arch=`uname -p` | | 736 | machine_arch=`uname -p` |
738 | check_compiler=yes | | 737 | check_compiler=yes |
739 | ;; | | 738 | ;; |
740 | Minix) | | 739 | Minix) |
741 | root_group=wheel | | 740 | root_group=wheel |
742 | machine_arch=`uname -p` | | 741 | machine_arch=`uname -p` |
743 | check_compiler=yes | | 742 | check_compiler=yes |
744 | ;; | | 743 | ;; |
745 | MirBSD) | | 744 | MirBSD) |
746 | root_group=wheel | | 745 | root_group=wheel |
747 | need_pax=yes | | 746 | need_pax=yes |
748 | machine_arch=`arch -s` | | 747 | machine_arch=`arch -s` |
749 | # there is no /usr/bin/cc, so use mgcc if unset | | 748 | # there is no /usr/bin/cc, so use mgcc if unset |
750 | test -n "$CC" || { CC=mgcc; export CC; } | | 749 | test -n "$CC" || { CC=mgcc; export CC; } |
751 | # get some variables from the native make if unset | | 750 | # get some variables from the native make if unset |
752 | for var in CFLAGS CPPFLAGS LDFLAGS; do | | 751 | for var in CFLAGS CPPFLAGS LDFLAGS; do |
753 | # check if variable is already set | | 752 | # check if variable is already set |
754 | eval _tmp=\"\$$var\" | | 753 | eval _tmp=\"\$$var\" |
755 | [ "x$_tmp" != x ] && continue | | 754 | [ "x$_tmp" != x ] && continue |
756 | # ask the native make (EXPERIMENTAL = don't add -Werror) | | 755 | # ask the native make (EXPERIMENTAL = don't add -Werror) |
757 | # the -I${.CURDIR} dance is to prevent junk in CPPFLAGS | | 756 | # the -I${.CURDIR} dance is to prevent junk in CPPFLAGS |
758 | _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' \ |
759 | $var'+=-I${.CURDIR}' printf $var $var':S/-I${.CURDIR}//' \ | | 758 | $var'+=-I${.CURDIR}' printf $var $var':S/-I${.CURDIR}//' \ |
760 | EXPERIMENTAL=yes '.include <bsd.prog.mk>' | \ | | 759 | EXPERIMENTAL=yes '.include <bsd.prog.mk>' | \ |
761 | (unset MAKECONF; /usr/bin/make -f - all 2>/dev/null) | \ | | 760 | (unset MAKECONF; /usr/bin/make -f - all 2>/dev/null) | \ |
762 | sed 's/^x//'` | | 761 | sed 's/^x//'` |
763 | eval $_tmp | | 762 | eval $_tmp |
764 | eval export $var | | 763 | eval export $var |
765 | done | | 764 | done |
766 | ;; | | 765 | ;; |
767 | NetBSD) | | 766 | NetBSD) |
768 | root_group=wheel | | 767 | root_group=wheel |
769 | machine_arch=`uname -p` | | 768 | machine_arch=`uname -p` |
770 | ;; | | 769 | ;; |
771 | OpenBSD) | | 770 | OpenBSD) |
772 | root_group=wheel | | 771 | root_group=wheel |
773 | machine_arch=`arch -s` | | 772 | machine_arch=`arch -s` |
774 | CC=${CC:-cc}; export CC | | 773 | CC=${CC:-cc}; export CC |
775 | check_compiler=yes | | 774 | check_compiler=yes |
776 | ;; | | 775 | ;; |
777 | OSF1) | | 776 | OSF1) |
778 | root_group=system | | 777 | root_group=system |
779 | need_bsd_install=yes | | 778 | need_bsd_install=yes |
780 | need_awk=yes | | 779 | need_awk=yes |
781 | need_sed=yes | | 780 | need_sed=yes |
782 | need_mksh=yes | | 781 | need_mksh=yes |
783 | shprog=/bin/ksh | | 782 | shprog=/bin/ksh |
784 | machine_arch=`uname -p` | | 783 | machine_arch=`uname -p` |
785 | ;; | | 784 | ;; |
786 | QNX) | | 785 | QNX) |
787 | root_group=root | | 786 | root_group=root |
788 | need_bsd_install=yes | | 787 | need_bsd_install=yes |
789 | need_awk=yes | | 788 | need_awk=yes |
790 | need_sed=yes | | 789 | need_sed=yes |
791 | groupsprog="id -gn" | | 790 | groupsprog="id -gn" |
792 | whoamiprog="id -un" | | 791 | whoamiprog="id -un" |
793 | machine_arch=`uname -p | sed -e 's/x86/i386/'` | | 792 | machine_arch=`uname -p | sed -e 's/x86/i386/'` |
794 | # libarchive checks for "rm -f" with no arguments being accepted. This | | 793 | # libarchive checks for "rm -f" with no arguments being accepted. This |
795 | # does not work on QNX. Interestingly, libarchive doesn't seem to | | 794 | # does not work on QNX. Interestingly, libarchive doesn't seem to |
796 | # actually need it during the build. | | 795 | # actually need it during the build. |
797 | export ACCEPT_INFERIOR_RM_PROGRAM=yes | | 796 | export ACCEPT_INFERIOR_RM_PROGRAM=yes |
798 | ;; | | 797 | ;; |
799 | SCO_SV) | | 798 | SCO_SV) |
800 | root_group=root | | 799 | root_group=root |
801 | need_awk=yes | | 800 | need_awk=yes |
802 | need_bsd_install=yes | | 801 | need_bsd_install=yes |
803 | need_sed=yes | | 802 | need_sed=yes |
804 | if [ -x "/usr/bin/bash" ]; then | | 803 | if [ -x "/usr/bin/bash" ]; then |
805 | bootstrap_sh=${SH:-/usr/bin/bash} | | 804 | bootstrap_sh=${SH:-/usr/bin/bash} |
806 | bootstrap_sh_set=set | | 805 | bootstrap_sh_set=set |
807 | else | | 806 | else |
808 | need_mksh=yes | | 807 | need_mksh=yes |
809 | fi | | 808 | fi |
810 | whoamiprog='id -u' | | 809 | whoamiprog='id -u' |
811 | groupsprog='id -g' | | 810 | groupsprog='id -g' |
812 | # /bin/sh under OpenServer 5.0.7/3.2 breaks bmake tests. | | 811 | # /bin/sh under OpenServer 5.0.7/3.2 breaks bmake tests. |
813 | #bmakexargs="$bmakexargs --with-defshell=/bin/ksh" | | 812 | #bmakexargs="$bmakexargs --with-defshell=/bin/ksh" |
814 | ;; | | 813 | ;; |
815 | SunOS) | | 814 | SunOS) |
816 | root_group=root | | 815 | root_group=root |
817 | need_bsd_install=yes | | 816 | need_bsd_install=yes |
818 | use_bsdinstall=yes | | 817 | use_bsdinstall=yes |
819 | if [ ! -x "/usr/gnu/bin/awk" ]; then | | 818 | if [ ! -x "/usr/gnu/bin/awk" ]; then |
820 | need_awk=yes | | 819 | need_awk=yes |
821 | fi | | 820 | fi |
822 | if [ ! -x "/usr/gnu/bin/sed" ]; then | | 821 | if [ ! -x "/usr/gnu/bin/sed" ]; then |
823 | need_sed=yes | | 822 | need_sed=yes |
824 | fi | | 823 | fi |
825 | if [ -x "/usr/bin/bash" ]; then | | 824 | if [ -x "/usr/bin/bash" ]; then |
826 | bootstrap_sh=${SH:-/usr/bin/bash} | | 825 | bootstrap_sh=${SH:-/usr/bin/bash} |
827 | bootstrap_sh_set=set | | 826 | bootstrap_sh_set=set |
828 | else | | 827 | else |
829 | need_mksh=yes | | 828 | need_mksh=yes |
830 | fi | | 829 | fi |
831 | idprog="/usr/xpg4/bin/id" | | 830 | idprog="/usr/xpg4/bin/id" |
832 | groupsprog="${idprog} -gn" | | 831 | groupsprog="${idprog} -gn" |
833 | whoamiprog="${idprog} -un" | | 832 | whoamiprog="${idprog} -un" |
834 | machine_arch=`isainfo -k` | | 833 | machine_arch=`isainfo -k` |
835 | check_compiler=yes | | 834 | check_compiler=yes |
836 | check_ssp=yes | | 835 | check_ssp=yes |
837 | ;; | | 836 | ;; |
838 | UnixWare) | | 837 | UnixWare) |
839 | root_group=sys | | 838 | root_group=sys |
840 | BSTRAP_ENV="INSTALL=/usr/ucb/install $BSTRAP_ENV" | | 839 | BSTRAP_ENV="INSTALL=/usr/ucb/install $BSTRAP_ENV" |
841 | need_mkdir=yes | | 840 | need_mkdir=yes |
842 | need_awk=yes | | 841 | need_awk=yes |
843 | need_sed=yes | | 842 | need_sed=yes |
844 | if [ -x "/usr/bin/bash" ]; then | | 843 | if [ -x "/usr/bin/bash" ]; then |
845 | bootstrap_sh=${SH:-/usr/bin/bash} | | 844 | bootstrap_sh=${SH:-/usr/bin/bash} |
846 | bootstrap_sh_set=set | | 845 | bootstrap_sh_set=set |
847 | else | | 846 | else |
848 | need_mksh=yes | | 847 | need_mksh=yes |
849 | fi | | 848 | fi |
850 | whoamiprog=/usr/ucb/whoami | | 849 | whoamiprog=/usr/ucb/whoami |
851 | machine_arch=`uname -m` | | 850 | machine_arch=`uname -m` |
852 | CC="gcc -DUNIXWARE"; export CC | | 851 | CC="gcc -DUNIXWARE"; export CC |
853 | ;; | | 852 | ;; |
854 | *) | | 853 | *) |
855 | echo "This platform ($opsys) is untried - good luck, and thanks for using pkgsrc" | | 854 | echo "This platform ($opsys) is untried - good luck, and thanks for using pkgsrc" |
856 | root_group=wheel | | 855 | root_group=wheel |
857 | need_bsd_install=yes | | 856 | need_bsd_install=yes |
858 | need_awk=yes | | 857 | need_awk=yes |
859 | need_sed=yes | | 858 | need_sed=yes |
860 | ;; | | 859 | ;; |
861 | esac | | 860 | esac |
862 | | | 861 | |
863 | # Override if the user explicitly requests it. | | 862 | # Override if the user explicitly requests it. |
864 | if [ -n "${march}" ]; then | | 863 | if [ -n "${march}" ]; then |
865 | machine_arch="${march}" | | 864 | machine_arch="${march}" |
866 | fi | | 865 | fi |
867 | | | 866 | |
868 | # Fixup MACHINE_ARCH to use canonical pkgsrc variants, and support multiarch | | 867 | # Fixup MACHINE_ARCH to use canonical pkgsrc variants, and support multiarch |
869 | # systems via --abi, setting a default $abi based on MACHINE_ARCH if not set. | | 868 | # systems via --abi, setting a default $abi based on MACHINE_ARCH if not set. |
870 | # | | 869 | # |
871 | case "$machine_arch/$abi" in | | 870 | case "$machine_arch/$abi" in |
872 | # "amd64" translates to "x86_64", defaults to 64-bit | | 871 | # "amd64" translates to "x86_64", defaults to 64-bit |
873 | amd64/32) abi=32 machine_arch=i386 ;; | | 872 | amd64/32) abi=32 machine_arch=i386 ;; |
874 | amd64/*) abi=64 machine_arch=x86_64 ;; | | 873 | amd64/*) abi=64 machine_arch=x86_64 ;; |
875 | # XXX: hppa untested | | 874 | # XXX: hppa untested |
876 | hppa/64) abi=64 machine_arch=hppa64 ;; | | 875 | hppa/64) abi=64 machine_arch=hppa64 ;; |
877 | hppa/*) abi=32 machine_arch=hppa ;; | | 876 | hppa/*) abi=32 machine_arch=hppa ;; |
878 | hppa64/32) abi=32 machine_arch=hppa ;; | | 877 | hppa64/32) abi=32 machine_arch=hppa ;; |
879 | hppa64/*) abi=64 machine_arch=hppa64 ;; | | 878 | hppa64/*) abi=64 machine_arch=hppa64 ;; |
880 | # "i386" can support 64-bit, e.g. SunOS, defaults to 32-bit. | | 879 | # "i386" can support 64-bit, e.g. SunOS, defaults to 32-bit. |
881 | i386/64) abi=64 machine_arch=x86_64 ;; | | 880 | i386/64) abi=64 machine_arch=x86_64 ;; |
882 | i386/*) abi=32 machine_arch=i386 ;; | | 881 | i386/*) abi=32 machine_arch=i386 ;; |
883 | # XXX: powerpc untested | | 882 | # XXX: powerpc untested |
884 | powerpc/64) abi=64 machine_arch=powerpc64 ;; | | 883 | powerpc/64) abi=64 machine_arch=powerpc64 ;; |
885 | powerpc/*) abi=32 machine_arch=powerpc ;; | | 884 | powerpc/*) abi=32 machine_arch=powerpc ;; |
886 | powerpc64/32) abi=32 machine_arch=powerpc ;; | | 885 | powerpc64/32) abi=32 machine_arch=powerpc ;; |
887 | powerpc64/*) abi=64 machine_arch=powerpc64 ;; | | 886 | powerpc64/*) abi=64 machine_arch=powerpc64 ;; |
888 | powerpc64le/*) abi=64 machine_arch=powerpc64le;; | | 887 | powerpc64le/*) abi=64 machine_arch=powerpc64le;; |
889 | # sparc/sparcv9 support 32-bit/64-bit, default to native. | | 888 | # sparc/sparcv9 support 32-bit/64-bit, default to native. |
890 | sparcv9/32) abi=32 machine_arch=sparc ;; | | 889 | sparcv9/32) abi=32 machine_arch=sparc ;; |
891 | sparcv9/*) abi=64 machine_arch=sparc64 ;; | | 890 | sparcv9/*) abi=64 machine_arch=sparc64 ;; |
892 | sparc/64) abi=64 machine_arch=sparc64 ;; | | 891 | sparc/64) abi=64 machine_arch=sparc64 ;; |
893 | sparc/*) abi=32 machine_arch=sparc ;; | | 892 | sparc/*) abi=32 machine_arch=sparc ;; |
894 | # x86_64 supports 32-bit/64-bit, defaults to 64-bit. | | 893 | # x86_64 supports 32-bit/64-bit, defaults to 64-bit. |
895 | x86_64/32) abi=32 machine_arch=i386 ;; | | 894 | x86_64/32) abi=32 machine_arch=i386 ;; |
896 | x86_64/*) abi=64 machine_arch=x86_64 ;; | | 895 | x86_64/*) abi=64 machine_arch=x86_64 ;; |
897 | esac | | 896 | esac |
898 | | | 897 | |
899 | # If "--full" is specified, then install all of the platform-independent | | 898 | # If "--full" is specified, then install all of the platform-independent |
900 | # bootstrap software. | | 899 | # bootstrap software. |
901 | # | | 900 | # |
902 | case "$full" in | | 901 | case "$full" in |
903 | yes) | | 902 | yes) |
904 | need_bsd_install=yes | | 903 | need_bsd_install=yes |
905 | need_awk=yes | | 904 | need_awk=yes |
906 | need_sed=yes | | 905 | need_sed=yes |
907 | need_mksh=yes | | 906 | need_mksh=yes |
908 | ;; | | 907 | ;; |
909 | esac | | 908 | esac |
910 | | | 909 | |
911 | # mksh and ksh are mutually exclusive, prefer mksh while we transition to it. | | 910 | # mksh and ksh are mutually exclusive, prefer mksh while we transition to it. |
912 | case "$need_mksh" in | | 911 | case "$need_mksh" in |
913 | yes) need_ksh=no ;; | | 912 | yes) need_ksh=no ;; |
914 | esac | | 913 | esac |
915 | | | 914 | |
916 | case "$quiet" in | | 915 | case "$quiet" in |
917 | yes) | | 916 | yes) |
918 | configure_quiet_flags="--quiet" | | 917 | configure_quiet_flags="--quiet" |
919 | make_quiet_flags="-s" | | 918 | make_quiet_flags="-s" |
920 | ;; | | 919 | ;; |
921 | no) | | 920 | no) |
922 | configure_quiet_flags="" | | 921 | configure_quiet_flags="" |
923 | make_quiet_flags="" | | 922 | make_quiet_flags="" |
924 | esac | | 923 | esac |
925 | | | 924 | |
926 | test ${make_jobs} -gt 0 2>/dev/null | | 925 | test ${make_jobs} -gt 0 2>/dev/null |
927 | if [ $? -ne 0 ]; then | | 926 | if [ $? -ne 0 ]; then |
928 | die "ERROR: --make-jobs must be a positive integer argument" | | 927 | die "ERROR: --make-jobs must be a positive integer argument" |
929 | fi | | 928 | fi |
930 | | | 929 | |
931 | # export MACHINE_ARCH and OPSYS for bmake and pkg_install. | | 930 | # export MACHINE_ARCH and OPSYS for bmake and pkg_install. |
932 | MACHINE_ARCH=${machine_arch}; export MACHINE_ARCH | | 931 | MACHINE_ARCH=${machine_arch}; export MACHINE_ARCH |
933 | OPSYS=${opsys}; export OPSYS | | 932 | OPSYS=${opsys}; export OPSYS |
934 | | | 933 | |
935 | if [ "x$preserve_path" != "xyes" ]; then | | 934 | if [ "x$preserve_path" != "xyes" ]; then |
936 | PATH="$overpath:$PATH" | | 935 | PATH="$overpath:$PATH" |
937 | fi | | 936 | fi |
938 | | | 937 | |
939 | check_prog awkprog awk | | 938 | check_prog awkprog awk |
940 | check_prog chmodprog chmod | | 939 | check_prog chmodprog chmod |
941 | if [ -n "$CP" ]; then | | 940 | if [ -n "$CP" ]; then |
942 | cpprog="$CP" | | 941 | cpprog="$CP" |
943 | else | | 942 | else |
944 | check_prog cpprog cp | | 943 | check_prog cpprog cp |
945 | fi | | 944 | fi |
946 | if [ -n "$ID" ]; then | | 945 | if [ -n "$ID" ]; then |
947 | idprog="$ID" | | 946 | idprog="$ID" |
948 | else | | 947 | else |
949 | check_prog idprog id | | 948 | check_prog idprog id |
950 | fi | | 949 | fi |
951 | check_prog groupsprog groups | | 950 | check_prog groupsprog groups |
952 | check_prog lnprog ln | | 951 | check_prog lnprog ln |
953 | check_prog lsprog ls | | 952 | check_prog lsprog ls |
954 | check_prog rmdirprog rmdir | | 953 | check_prog rmdirprog rmdir |
955 | check_prog sedprog sed | | 954 | check_prog sedprog sed |
956 | check_prog shprog sh | | 955 | check_prog shprog sh |
957 | check_prog whoamiprog whoami | | 956 | check_prog whoamiprog whoami |
958 | | | 957 | |
959 | if [ -d "${wrkdir}" ] || [ -f "${wrkdir}" ]; then | | 958 | if [ -d "${wrkdir}" ] || [ -f "${wrkdir}" ]; then |
960 | die "\"${wrkdir}\" already exists, please remove it or use --workdir" | | 959 | die "\"${wrkdir}\" already exists, please remove it or use --workdir" |
961 | fi | | 960 | fi |
962 | | | 961 | |
963 | if [ -f "${prefix}/share/mk/sys.mk" ]; then | | 962 | if [ -f "${prefix}/share/mk/sys.mk" ]; then |
964 | die "\"${prefix}\" already in use, remove it or use a different --prefix" | | 963 | die "\"${prefix}\" already in use, remove it or use a different --prefix" |
965 | fi | | 964 | fi |
966 | | | 965 | |
967 | if [ -d "${pkgdbdir}/bootstrap-mk-files-"* ]; then | | 966 | if [ -d "${pkgdbdir}/bootstrap-mk-files-"* ]; then |
968 | die "\"${pkgdbdir}\" already in use, remove it or use a different --pkgdbdir" | | 967 | die "\"${pkgdbdir}\" already in use, remove it or use a different --pkgdbdir" |
969 | fi | | 968 | fi |
970 | | | 969 | |
971 | mkdir_p_early ${wrkdir} | | 970 | mkdir_p_early ${wrkdir} |
972 | if touch ${wrkdir}/.writeable; then | | 971 | if touch ${wrkdir}/.writeable; then |
973 | : | | 972 | : |
974 | else | | 973 | else |
975 | die "\"${wrkdir}\" is not writeable. Try $0 -h" | | 974 | die "\"${wrkdir}\" is not writeable. Try $0 -h" |
976 | fi | | 975 | fi |
977 | echo "Working directory is: ${wrkdir}" | | 976 | echo "Working directory is: ${wrkdir}" |
978 | | | 977 | |
979 | if [ "$compiler" = "" ] && [ x"$check_compiler" = x"yes" ]; then | | 978 | if [ "$compiler" = "" ] && [ x"$check_compiler" = x"yes" ]; then |
980 | get_compiler | | 979 | get_compiler |
981 | # Clang pretends to be GCC, so we have to check it first. | | 980 | # Clang pretends to be GCC, so we have to check it first. |
982 | if [ $compiler_is_clang -gt 0 ]; then | | 981 | if [ $compiler_is_clang -gt 0 ]; then |
983 | compiler="clang" | | 982 | compiler="clang" |
984 | elif [ $compiler_is_gnu -gt 0 ]; then | | 983 | elif [ $compiler_is_gnu -gt 0 ]; then |
985 | compiler="gcc" | | 984 | compiler="gcc" |
986 | else | | 985 | else |
987 | case "$opsys" in | | 986 | case "$opsys" in |
988 | IRIX) | | 987 | IRIX) |
989 | if [ `uname -r` -ge 6 ]; then | | 988 | if [ `uname -r` -ge 6 ]; then |
990 | compiler="mipspro" | | 989 | compiler="mipspro" |
991 | else | | 990 | else |
992 | compiler="ido" | | 991 | compiler="ido" |
993 | fi | | 992 | fi |
994 | ;; | | 993 | ;; |
995 | SunOS) compiler="sunpro" | | 994 | SunOS) compiler="sunpro" |
996 | ;; | | 995 | ;; |
997 | esac | | 996 | esac |
998 | fi | | 997 | fi |
999 | fi | | 998 | fi |
1000 | | | 999 | |
1001 | case "$compiler" in | | 1000 | case "$compiler" in |
1002 | clang|gcc) | | 1001 | clang|gcc) |
1003 | test -n "$CC" || CC=$compiler | | 1002 | test -n "$CC" || CC=$compiler |
1004 | ;; | | 1003 | ;; |
1005 | *) | | 1004 | *) |
1006 | test -n "$CC" || CC=cc | | 1005 | test -n "$CC" || CC=cc |
1007 | ;; | | 1006 | ;; |
1008 | esac | | 1007 | esac |
1009 | | | 1008 | |
1010 | has_ssp_support() { | | 1009 | has_ssp_support() { |
1011 | mkdir_p_early ${wrkdir}/tmp | | 1010 | mkdir_p_early ${wrkdir}/tmp |
1012 | echo 'int main(void){return 0;}' > ${wrkdir}/tmp/ssp.c | | 1011 | echo 'int main(void){return 0;}' > ${wrkdir}/tmp/ssp.c |
1013 | ${CC:-cc} -fstack-protector-strong -o ${wrkdir}/tmp/ssp ${wrkdir}/tmp/ssp.c >/dev/null 2>&1 | | 1012 | ${CC:-cc} -fstack-protector-strong -o ${wrkdir}/tmp/ssp ${wrkdir}/tmp/ssp.c >/dev/null 2>&1 |
1014 | | | 1013 | |
1015 | if [ $? -eq 0 ]; then | | 1014 | if [ $? -eq 0 ]; then |
1016 | echo yes | | 1015 | echo yes |
1017 | else | | 1016 | else |
1018 | echo no | | 1017 | echo no |
1019 | fi | | 1018 | fi |
1020 | } | | 1019 | } |
1021 | | | 1020 | |
1022 | if [ "$has_ssp" = "" ] && [ x"$check_ssp" = x"yes" ]; then | | 1021 | if [ "$has_ssp" = "" ] && [ x"$check_ssp" = x"yes" ]; then |
1023 | has_ssp=`has_ssp_support` | | 1022 | has_ssp=`has_ssp_support` |
1024 | fi | | 1023 | fi |
1025 | | | 1024 | |
1026 | mkdir_p_early ${wrkdir}/bin | | 1025 | mkdir_p_early ${wrkdir}/bin |
1027 | | | 1026 | |
1028 | # build install-sh | | 1027 | # build install-sh |
1029 | run_cmd "$sedprog -e 's|@DEFAULT_INSTALL_MODE@|'${default_install_mode-0755}'|' $pkgsrcdir/sysutils/install-sh/files/install-sh.in > $wrkdir/bin/install-sh" | | 1028 | run_cmd "$sedprog -e 's|@DEFAULT_INSTALL_MODE@|'${default_install_mode-0755}'|' $pkgsrcdir/sysutils/install-sh/files/install-sh.in > $wrkdir/bin/install-sh" |
1030 | run_cmd "$chmodprog +x $wrkdir/bin/install-sh" | | 1029 | run_cmd "$chmodprog +x $wrkdir/bin/install-sh" |
1031 | install_sh="$shprog $wrkdir/bin/install-sh" | | 1030 | install_sh="$shprog $wrkdir/bin/install-sh" |
1032 | | | 1031 | |
1033 | if [ $unprivileged = "yes" ]; then | | 1032 | if [ $unprivileged = "yes" ]; then |
1034 | user=`$whoamiprog` | | 1033 | user=`$whoamiprog` |
1035 | group=`$groupsprog | $awkprog '{print $1}'` | | 1034 | group=`$groupsprog | $awkprog '{print $1}'` |
1036 | echo_msg "building as unprivileged user $user/$group" | | 1035 | echo_msg "building as unprivileged user $user/$group" |
1037 | | | 1036 | |
1038 | # force bmake install target to use $user and $group | | 1037 | # force bmake install target to use $user and $group |
1039 | echo "BINOWN=$user | | 1038 | echo "BINOWN=$user |
1040 | BINGRP=$group | | 1039 | BINGRP=$group |
1041 | LIBOWN=$user | | 1040 | LIBOWN=$user |
1042 | LIBGRP=$group | | 1041 | LIBGRP=$group |
1043 | MANOWN=$user | | 1042 | MANOWN=$user |
1044 | MANGRP=$group" > ${wrkdir}/Makefile.inc | | 1043 | MANGRP=$group" > ${wrkdir}/Makefile.inc |
1045 | elif is_root; then | | 1044 | elif is_root; then |
1046 | user=$root_user | | 1045 | user=$root_user |
1047 | group=$root_group | | 1046 | group=$root_group |
1048 | else | | 1047 | else |
1049 | die "You must be either root to install bootstrap-pkgsrc or use the --unprivileged option." | | 1048 | die "You must be either root to install bootstrap-pkgsrc or use the --unprivileged option." |
1050 | fi | | 1049 | fi |
1051 | | | 1050 | |
1052 | # export the proper environment | | 1051 | # export the proper environment |
1053 | PATH=$prefix/bin:$prefix/sbin:${PATH}; export PATH | | 1052 | PATH=$prefix/bin:$prefix/sbin:${PATH}; export PATH |
1054 | if [ -d /usr/ccs/bin -a -x /usr/ccs/bin/make ]; then | | 1053 | if [ -d /usr/ccs/bin -a -x /usr/ccs/bin/make ]; then |
1055 | PATH=${PATH}:/usr/ccs/bin; export PATH | | 1054 | PATH=${PATH}:/usr/ccs/bin; export PATH |
1056 | fi | | 1055 | fi |
1057 | PKG_DBDIR=$pkgdbdir; export PKG_DBDIR | | 1056 | PKG_DBDIR=$pkgdbdir; export PKG_DBDIR |
1058 | LOCALBASE=$prefix; export LOCALBASE | | 1057 | LOCALBASE=$prefix; export LOCALBASE |
1059 | VARBASE=$varbase; export VARBASE | | 1058 | VARBASE=$varbase; export VARBASE |
1060 | if [ x"$has_ssp" = x"no" ] && [ x"$check_ssp" = x"yes" ]; then | | 1059 | if [ x"$has_ssp" = x"no" ] && [ x"$check_ssp" = x"yes" ]; then |
1061 | _OPSYS_SUPPORTS_SSP=no; export _OPSYS_SUPPORTS_SSP | | 1060 | _OPSYS_SUPPORTS_SSP=no; export _OPSYS_SUPPORTS_SSP |
1062 | fi | | 1061 | fi |
1063 | | | 1062 | |
1064 | # set up an example mk.conf file | | 1063 | # set up an example mk.conf file |
1065 | TARGET_MKCONF=${wrkdir}/mk.conf.example | | 1064 | TARGET_MKCONF=${wrkdir}/mk.conf.example |
1066 | echo_msg "Creating default mk.conf in ${wrkdir}" | | 1065 | echo_msg "Creating default mk.conf in ${wrkdir}" |
1067 | echo "# Example ${sysconfdir}/mk.conf file produced by bootstrap-pkgsrc" > ${TARGET_MKCONF} | | 1066 | echo "# Example ${sysconfdir}/mk.conf file produced by bootstrap-pkgsrc" > ${TARGET_MKCONF} |
1068 | echo "# `date`" >> ${TARGET_MKCONF} | | 1067 | echo "# `date`" >> ${TARGET_MKCONF} |
1069 | echo "" >> ${TARGET_MKCONF} | | 1068 | echo "" >> ${TARGET_MKCONF} |
1070 | echo ".ifdef BSD_PKG_MK # begin pkgsrc settings" >> ${TARGET_MKCONF} | | 1069 | echo ".ifdef BSD_PKG_MK # begin pkgsrc settings" >> ${TARGET_MKCONF} |
1071 | echo "" >> ${TARGET_MKCONF} | | 1070 | echo "" >> ${TARGET_MKCONF} |
1072 | | | 1071 | |
1073 | # IRIX64 needs to be set to IRIX, for example | | 1072 | # IRIX64 needs to be set to IRIX, for example |
1074 | if [ "$set_opsys" = "yes" ]; then | | 1073 | if [ "$set_opsys" = "yes" ]; then |
1075 | echo "OPSYS= $opsys" >> ${TARGET_MKCONF} | | 1074 | echo "OPSYS= $opsys" >> ${TARGET_MKCONF} |
1076 | fi | | 1075 | fi |
1077 | | | 1076 | |
1078 | if [ -n "$abi" ]; then | | 1077 | if [ -n "$abi" ]; then |
1079 | echo "ABI= $abi" >> ${TARGET_MKCONF} | | 1078 | echo "ABI= $abi" >> ${TARGET_MKCONF} |
1080 | fi | | 1079 | fi |
1081 | if [ "$compiler" != "" ]; then | | 1080 | if [ "$compiler" != "" ]; then |
1082 | echo "PKGSRC_COMPILER= $compiler" >> ${TARGET_MKCONF} | | 1081 | echo "PKGSRC_COMPILER= $compiler" >> ${TARGET_MKCONF} |
1083 | fi | | 1082 | fi |
1084 | case "$compiler" in | | 1083 | case "$compiler" in |
1085 | sunpro) | | 1084 | sunpro) |
1086 | echo "CC= cc" >> ${TARGET_MKCONF} | | 1085 | echo "CC= cc" >> ${TARGET_MKCONF} |
1087 | echo "CXX= CC" >> ${TARGET_MKCONF} | | 1086 | echo "CXX= CC" >> ${TARGET_MKCONF} |
1088 | echo "CPP= \${CC} -E" >> ${TARGET_MKCONF} | | 1087 | echo "CPP= \${CC} -E" >> ${TARGET_MKCONF} |
1089 | ;; | | 1088 | ;; |
1090 | clang) | | 1089 | clang) |
1091 | echo "CC= clang" >> ${TARGET_MKCONF} | | 1090 | echo "CC= clang" >> ${TARGET_MKCONF} |
1092 | echo "CXX= clang++" >> ${TARGET_MKCONF} | | 1091 | echo "CXX= clang++" >> ${TARGET_MKCONF} |
1093 | echo "CPP= \${CC} -E" >> ${TARGET_MKCONF} | | 1092 | echo "CPP= \${CC} -E" >> ${TARGET_MKCONF} |
1094 | if [ -z "$CLANGBASE" -a -f "/usr/bin/clang" ]; then | | 1093 | if [ -z "$CLANGBASE" -a -f "/usr/bin/clang" ]; then |
1095 | CLANGBASE="/usr" | | 1094 | CLANGBASE="/usr" |
1096 | fi | | 1095 | fi |
1097 | if [ -n "$CLANGBASE" -o -f "/bin/clang" ]; then | | 1096 | if [ -n "$CLANGBASE" -o -f "/bin/clang" ]; then |
1098 | echo "CLANGBASE= $CLANGBASE" >> ${TARGET_MKCONF} | | 1097 | echo "CLANGBASE= $CLANGBASE" >> ${TARGET_MKCONF} |
1099 | fi | | 1098 | fi |
1100 | ;; | | 1099 | ;; |
1101 | esac | | 1100 | esac |
1102 | if [ -n "$GCCBASE" ]; then | | 1101 | if [ -n "$GCCBASE" ]; then |
1103 | echo "GCCBASE= $GCCBASE" >> ${TARGET_MKCONF} | | 1102 | echo "GCCBASE= $GCCBASE" >> ${TARGET_MKCONF} |
1104 | fi | | 1103 | fi |
1105 | if [ -n "$SUNWSPROBASE" ]; then | | 1104 | if [ -n "$SUNWSPROBASE" ]; then |
1106 | echo "SUNWSPROBASE= $SUNWSPROBASE" >> ${TARGET_MKCONF} | | 1105 | echo "SUNWSPROBASE= $SUNWSPROBASE" >> ${TARGET_MKCONF} |
1107 | fi | | 1106 | fi |
1108 | echo "" >> ${TARGET_MKCONF} | | 1107 | echo "" >> ${TARGET_MKCONF} |
1109 | | | 1108 | |
1110 | if [ x"$has_ssp" = x"no" ] && [ x"$check_ssp" = x"yes" ]; then | | 1109 | if [ x"$has_ssp" = x"no" ] && [ x"$check_ssp" = x"yes" ]; then |
1111 | echo "_OPSYS_SUPPORTS_SSP= no" >> ${TARGET_MKCONF} | | 1110 | echo "_OPSYS_SUPPORTS_SSP= no" >> ${TARGET_MKCONF} |
1112 | fi | | 1111 | fi |
1113 | | | 1112 | |
1114 | # enable unprivileged builds if not root | | 1113 | # enable unprivileged builds if not root |
1115 | if [ "$unprivileged" = "yes" ]; then | | 1114 | if [ "$unprivileged" = "yes" ]; then |
1116 | echo "UNPRIVILEGED= yes" >> ${TARGET_MKCONF} | | 1115 | echo "UNPRIVILEGED= yes" >> ${TARGET_MKCONF} |
1117 | fi | | 1116 | fi |
1118 | | | 1117 | |
1119 | # save environment in example mk.conf | | 1118 | # save environment in example mk.conf |
1120 | echo "PKG_DBDIR= $pkgdbdir" >> ${TARGET_MKCONF} | | 1119 | echo "PKG_DBDIR= $pkgdbdir" >> ${TARGET_MKCONF} |
1121 | echo "LOCALBASE= $prefix" >> ${TARGET_MKCONF} | | 1120 | echo "LOCALBASE= $prefix" >> ${TARGET_MKCONF} |
1122 | if [ "${sysconfbase}" != "/etc" ]; then | | 1121 | if [ "${sysconfbase}" != "/etc" ]; then |
1123 | echo "SYSCONFBASE= $sysconfbase" >> ${TARGET_MKCONF} | | 1122 | echo "SYSCONFBASE= $sysconfbase" >> ${TARGET_MKCONF} |
1124 | fi | | 1123 | fi |
1125 | echo "VARBASE= $varbase" >> ${TARGET_MKCONF} | | 1124 | echo "VARBASE= $varbase" >> ${TARGET_MKCONF} |
1126 | if [ "${sysconfdir}" != "${prefix}/etc" ]; then | | 1125 | if [ "${sysconfdir}" != "${prefix}/etc" ]; then |
1127 | echo "PKG_SYSCONFBASE= $sysconfdir" >> ${TARGET_MKCONF} | | 1126 | echo "PKG_SYSCONFBASE= $sysconfdir" >> ${TARGET_MKCONF} |
1128 | fi | | 1127 | fi |
1129 | echo "PKG_TOOLS_BIN= $prefix/sbin" >> ${TARGET_MKCONF} | | 1128 | echo "PKG_TOOLS_BIN= $prefix/sbin" >> ${TARGET_MKCONF} |
1130 | echo "PKGINFODIR= $pkginfodir" >> ${TARGET_MKCONF} | | 1129 | echo "PKGINFODIR= $pkginfodir" >> ${TARGET_MKCONF} |
1131 | echo "PKGMANDIR= $pkgmandir" >> ${TARGET_MKCONF} | | 1130 | echo "PKGMANDIR= $pkgmandir" >> ${TARGET_MKCONF} |
1132 | echo "" >> ${TARGET_MKCONF} | | 1131 | echo "" >> ${TARGET_MKCONF} |
1133 | | | 1132 | |
1134 | case $opsys in | | 1133 | case $opsys in |
1135 | OpenBSD) | | 1134 | OpenBSD) |
1136 | # Use PREFER_PKGSRC=yes to work around libressl compatibility problem | | 1135 | # Use PREFER_PKGSRC=yes to work around libressl compatibility problem |
1137 | if [ -z "$prefer_pkgsrc" ] && [ "$prefer_native" != "yes" ]; then | | 1136 | if [ -z "$prefer_pkgsrc" ] && [ "$prefer_native" != "yes" ]; then |
1138 | prefer_pkgsrc="yes" | | 1137 | prefer_pkgsrc="yes" |
1139 | fi | | 1138 | fi |
1140 | ;; | | 1139 | ;; |
1141 | Linux) | | 1140 | Linux) |
1142 | # Default to PREFER_PKGSRC=yes unless user specifies --prefer-native=yes | | 1141 | # Default to PREFER_PKGSRC=yes unless user specifies --prefer-native=yes |
1143 | # Linux systems likely have software from other packages managers | | 1142 | # Linux systems likely have software from other packages managers |
1144 | # like yum or apt that can leak into pkgsrc and cause issues as they | | 1143 | # like yum or apt that can leak into pkgsrc and cause issues as they |
1145 | # age, undergo ABI changes, or get added/removed behind our backs. | | 1144 | # age, undergo ABI changes, or get added/removed behind our backs. |
1146 | # Let pkgsrc maintain all dependencies to avoid these problems. | | 1145 | # Let pkgsrc maintain all dependencies to avoid these problems. |
1147 | # The exception here is Elbrus 2000, for which a lot of patches have | | 1146 | # The exception here is Elbrus 2000, for which a lot of patches have |
1148 | # not been upstreamed, so that it is better to use native. | | 1147 | # not been upstreamed, so that it is better to use native. |
1149 | if [ -z "$prefer_pkgsrc" ] && [ "$prefer_native" != "yes" ] && \ | | 1148 | if [ -z "$prefer_pkgsrc" ] && [ "$prefer_native" != "yes" ] && \ |
1150 | [ "$machine_arch" != "e2k" ]; then | | 1149 | [ "$machine_arch" != "e2k" ]; then |
1151 | prefer_pkgsrc="yes" | | 1150 | prefer_pkgsrc="yes" |
1152 | fi | | 1151 | fi |
1153 | ;; | | 1152 | ;; |
1154 | esac | | 1153 | esac |
1155 | | | 1154 | |
1156 | if [ -n "$prefer_pkgsrc" ]; then | | 1155 | if [ -n "$prefer_pkgsrc" ]; then |
1157 | echo "# WARNING: Changing PREFER_* after bootstrap will require rebuilding all" >> ${TARGET_MKCONF} | | 1156 | echo "# WARNING: Changing PREFER_* after bootstrap will require rebuilding all" >> ${TARGET_MKCONF} |
1158 | echo "# packages with a dependency that switched between native/pkgsrc." >> ${TARGET_MKCONF} | | 1157 | echo "# packages with a dependency that switched between native/pkgsrc." >> ${TARGET_MKCONF} |
1159 | echo "PREFER_PKGSRC= $prefer_pkgsrc" >> ${TARGET_MKCONF} | | 1158 | echo "PREFER_PKGSRC= $prefer_pkgsrc" >> ${TARGET_MKCONF} |
1160 | echo "" >> ${TARGET_MKCONF} | | 1159 | echo "" >> ${TARGET_MKCONF} |
1161 | fi | | 1160 | fi |
1162 | if [ -n "$prefer_native" ]; then | | 1161 | if [ -n "$prefer_native" ]; then |
1163 | echo "PREFER_NATIVE= $prefer_native" >> ${TARGET_MKCONF} | | 1162 | echo "PREFER_NATIVE= $prefer_native" >> ${TARGET_MKCONF} |
1164 | echo "" >> ${TARGET_MKCONF} | | 1163 | echo "" >> ${TARGET_MKCONF} |
1165 | fi | | 1164 | fi |
1166 | | | 1165 | |
1167 | BOOTSTRAP_MKCONF=${wrkdir}/mk.conf | | 1166 | BOOTSTRAP_MKCONF=${wrkdir}/mk.conf |
1168 | cp ${TARGET_MKCONF} ${BOOTSTRAP_MKCONF} | | 1167 | cp ${TARGET_MKCONF} ${BOOTSTRAP_MKCONF} |
1169 | | | 1168 | |
1170 | case "$cwrappers" in | | 1169 | case "$cwrappers" in |
1171 | yes|no) | | 1170 | yes|no) |
1172 | echo "USE_CWRAPPERS= $cwrappers" >> ${TARGET_MKCONF} | | 1171 | echo "USE_CWRAPPERS= $cwrappers" >> ${TARGET_MKCONF} |
1173 | echo "USE_CWRAPPERS= $cwrappers" >> ${BOOTSTRAP_MKCONF} | | 1172 | echo "USE_CWRAPPERS= $cwrappers" >> ${BOOTSTRAP_MKCONF} |
1174 | echo "" >> ${TARGET_MKCONF} | | 1173 | echo "" >> ${TARGET_MKCONF} |
1175 | ;; | | 1174 | ;; |
1176 | esac | | 1175 | esac |
1177 | | | 1176 | |
1178 | # On all Debian GNU/kFreeBSD 7, /bin/sh is a symlink to /bin/dash, and | | 1177 | # On all Debian GNU/kFreeBSD 7, /bin/sh is a symlink to /bin/dash, and |
1179 | # use /bin/bash. | | 1178 | # use /bin/bash. |
1180 | # Only needed by legacy wrappers. | | 1179 | # Only needed by legacy wrappers. |
1181 | if [ "$opsys" = "GNUkFreeBSD" -a "$bootstrap_sh_set" != "set" ]; then | | 1180 | if [ "$opsys" = "GNUkFreeBSD" -a "$bootstrap_sh_set" != "set" ]; then |
1182 | echo "TOOLS_PLATFORM.sh?= /bin/bash # instead of /bin/sh" >> ${TARGET_MKCONF} | | 1181 | echo "TOOLS_PLATFORM.sh?= /bin/bash # instead of /bin/sh" >> ${TARGET_MKCONF} |
1183 | echo "TOOLS_PLATFORM.sh?= /bin/bash # instead of /bin/sh" >> ${BOOTSTRAP_MKCONF} | | 1182 | echo "TOOLS_PLATFORM.sh?= /bin/bash # instead of /bin/sh" >> ${BOOTSTRAP_MKCONF} |
1184 | echo $opsys | | 1183 | echo $opsys |
1185 | fi | | 1184 | fi |
1186 | | | 1185 | |
1187 | # sbin is used by pkg_install, share/mk by bootstrap-mk-files | | 1186 | # sbin is used by pkg_install, share/mk by bootstrap-mk-files |
1188 | mkdir_p $wrkdir/sbin $wrkdir/share/mk | | 1187 | mkdir_p $wrkdir/sbin $wrkdir/share/mk |
1189 | mkdir_p_early ${wrkdir} | | 1188 | mkdir_p_early ${wrkdir} |
1190 | | | 1189 | |
1191 | if [ "$need_bsd_install" = "yes" ]; then | | 1190 | if [ "$need_bsd_install" = "yes" ]; then |
1192 | BSTRAP_ENV="INSTALL='$prefix/bin/install-sh -c' $BSTRAP_ENV" | | 1191 | BSTRAP_ENV="INSTALL='$prefix/bin/install-sh -c' $BSTRAP_ENV" |
1193 | if [ "$use_bsdinstall" = "yes" ]; then | | 1192 | if [ "$use_bsdinstall" = "yes" ]; then |
1194 | echo "TOOLS_PLATFORM.install?= $prefix/bin/bsdinstall" >> ${TARGET_MKCONF} | | 1193 | echo "TOOLS_PLATFORM.install?= $prefix/bin/bsdinstall" >> ${TARGET_MKCONF} |
1195 | else | | 1194 | else |
1196 | echo "TOOLS_PLATFORM.install?= $prefix/bin/install-sh" >> ${TARGET_MKCONF} | | 1195 | echo "TOOLS_PLATFORM.install?= $prefix/bin/install-sh" >> ${TARGET_MKCONF} |
1197 | fi | | 1196 | fi |
1198 | echo "TOOLS_PLATFORM.install?= $wrkdir/bin/install-sh" >> ${BOOTSTRAP_MKCONF} | | 1197 | echo "TOOLS_PLATFORM.install?= $wrkdir/bin/install-sh" >> ${BOOTSTRAP_MKCONF} |
1199 | fi | | 1198 | fi |
1200 | | | 1199 | |
1201 | if [ "$need_fixed_strip" = "yes" ] ; then | | 1200 | if [ "$need_fixed_strip" = "yes" ] ; then |
1202 | echo_msg "Installing fixed strip script" | | 1201 | echo_msg "Installing fixed strip script" |
1203 | run_cmd "$install_sh -c -o $user -g $group -m 755 $pkgsrcdir/pkgtools/bootstrap-extras/files/strip-sh $wrkdir/bin/strip" | | 1202 | run_cmd "$install_sh -c -o $user -g $group -m 755 $pkgsrcdir/pkgtools/bootstrap-extras/files/strip-sh $wrkdir/bin/strip" |
1204 | echo "TOOLS_PLATFORM.strip?= $prefix/bin/strip" >> ${TARGET_MKCONF} | | 1203 | echo "TOOLS_PLATFORM.strip?= $prefix/bin/strip" >> ${TARGET_MKCONF} |
1205 | echo "TOOLS_PLATFORM.strip?= $wrkdir/bin/strip" >> ${BOOTSTRAP_MKCONF} | | 1204 | echo "TOOLS_PLATFORM.strip?= $wrkdir/bin/strip" >> ${BOOTSTRAP_MKCONF} |
1206 | need_extras=yes | | 1205 | need_extras=yes |
1207 | fi | | 1206 | fi |
1208 | | | 1207 | |
1209 | if [ "$need_mkdir" = "yes" -a -z "$MKDIR" ]; then | | 1208 | if [ "$need_mkdir" = "yes" -a -z "$MKDIR" ]; then |
1210 | echo_msg "Installing fixed mkdir script \"mkdir-sh\"" | | 1209 | echo_msg "Installing fixed mkdir script \"mkdir-sh\"" |
1211 | run_cmd "$install_sh -c -o $user -g $group -m 755 $pkgsrcdir/pkgtools/bootstrap-extras/files/mkdir-sh $wrkdir/bin/mkdir-sh" | | 1210 | run_cmd "$install_sh -c -o $user -g $group -m 755 $pkgsrcdir/pkgtools/bootstrap-extras/files/mkdir-sh $wrkdir/bin/mkdir-sh" |
1212 | echo "TOOLS_PLATFORM.mkdir?= $prefix/bin/mkdir-sh -p" >> ${TARGET_MKCONF} | | 1211 | echo "TOOLS_PLATFORM.mkdir?= $prefix/bin/mkdir-sh -p" >> ${TARGET_MKCONF} |
1213 | echo "TOOLS_PLATFORM.mkdir?= $wrkdir/bin/mkdir-sh -p" >> ${BOOTSTRAP_MKCONF} | | 1212 | echo "TOOLS_PLATFORM.mkdir?= $wrkdir/bin/mkdir-sh -p" >> ${BOOTSTRAP_MKCONF} |
1214 | need_extras=yes | | 1213 | need_extras=yes |
1215 | fi | | 1214 | fi |
1216 | | | 1215 | |
1217 | if [ "$need_xargs" = "yes" ]; then | | 1216 | if [ "$need_xargs" = "yes" ]; then |
1218 | echo_msg "Installing fixed xargs script" | | 1217 | echo_msg "Installing fixed xargs script" |
1219 | run_cmd "$install_sh -c -o $user -g $group -m 755 $pkgsrcdir/pkgtools/bootstrap-extras/files/xargs-sh $wrkdir/bin/xargs" | | 1218 | run_cmd "$install_sh -c -o $user -g $group -m 755 $pkgsrcdir/pkgtools/bootstrap-extras/files/xargs-sh $wrkdir/bin/xargs" |
1220 | echo "TOOLS_PLATFORM.xargs?= $prefix/bin/xargs" >> ${TARGET_MKCONF} | | 1219 | echo "TOOLS_PLATFORM.xargs?= $prefix/bin/xargs" >> ${TARGET_MKCONF} |
1221 | echo "TOOLS_PLATFORM.xargs?= $wrkdir/bin/xargs" >> ${BOOTSTRAP_MKCONF} | | 1220 | echo "TOOLS_PLATFORM.xargs?= $wrkdir/bin/xargs" >> ${BOOTSTRAP_MKCONF} |
1222 | need_extras=yes | | 1221 | need_extras=yes |
1223 | fi | | 1222 | fi |
1224 | | | 1223 | |
1225 | echo_msg "Bootstrapping mk-files" | | 1224 | echo_msg "Bootstrapping mk-files" |
1226 | run_cmd "(cd ${pkgsrcdir}/pkgtools/bootstrap-mk-files/files && env CP=${cpprog} \ | | 1225 | run_cmd "(cd ${pkgsrcdir}/pkgtools/bootstrap-mk-files/files && env CP=${cpprog} \ |
1227 | OPSYS=${opsys} MK_DST=${wrkdir}/share/mk ROOT_GROUP=${root_group} \ | | 1226 | OPSYS=${opsys} MK_DST=${wrkdir}/share/mk ROOT_GROUP=${root_group} \ |
1228 | ROOT_USER=${root_user} SED=${sedprog} SYSCONFDIR=${sysconfdir} \ | | 1227 | ROOT_USER=${root_user} SED=${sedprog} SYSCONFDIR=${sysconfdir} \ |
1229 | $shprog ./bootstrap.sh)" | | 1228 | $shprog ./bootstrap.sh)" |
1230 | | | 1229 | |
1231 | if [ -n "${bootstrap_sh_set}" ]; then | | 1230 | if [ -n "${bootstrap_sh_set}" ]; then |
1232 | bmakexargs="${bmakexargs} --with-defshell=${bootstrap_sh}" | | 1231 | bmakexargs="${bmakexargs} --with-defshell=${bootstrap_sh}" |
1233 | fi | | 1232 | fi |
1234 | | | 1233 | |
1235 | bootstrap_bmake() { | | 1234 | bootstrap_bmake() { |
1236 | echo_msg "Bootstrapping bmake" | | 1235 | echo_msg "Bootstrapping bmake" |
1237 | copy_src $pkgsrcdir/devel/bmake/files bmake | | 1236 | copy_src $pkgsrcdir/devel/bmake/files bmake |
1238 | 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)" | | 1237 | 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)" |
1239 | run_cmd "(cd $wrkdir/bmake && $shprog make-bootstrap.sh)" | | 1238 | run_cmd "(cd $wrkdir/bmake && $shprog make-bootstrap.sh)" |
1240 | run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/bmake/bmake $wrkdir/bin/bmake" | | 1239 | run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/bmake/bmake $wrkdir/bin/bmake" |
1241 | } | | 1240 | } |
1242 | bootstrap_bmake | | 1241 | bootstrap_bmake |
1243 | | | 1242 | |
1244 | bmake="$wrkdir/bin/bmake" | | 1243 | bmake="$wrkdir/bin/bmake" |
1245 | | | 1244 | |
1246 | # build libnbcompat | | 1245 | # build libnbcompat |
1247 | echo_msg "Building libnbcompat" | | 1246 | echo_msg "Building libnbcompat" |
1248 | copy_src $pkgsrcdir/pkgtools/libnbcompat/files libnbcompat | | 1247 | copy_src $pkgsrcdir/pkgtools/libnbcompat/files libnbcompat |
1249 | 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)" | | 1248 | 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)" |
1250 | | | 1249 | |
1251 | # bootstrap mksh if necessary | | 1250 | # bootstrap mksh if necessary |
1252 | case "$need_mksh" in | | 1251 | case "$need_mksh" in |
1253 | yes) echo_msg "Bootstrapping mksh" | | 1252 | yes) echo_msg "Bootstrapping mksh" |
1254 | copy_src $pkgsrcdir/shells/mksh/files mksh | | 1253 | copy_src $pkgsrcdir/shells/mksh/files mksh |
1255 | run_cmd "(cd $wrkdir/mksh && env $BSTRAP_ENV CC=\"${CC}\" $shprog Build.sh -r)" | | 1254 | run_cmd "(cd $wrkdir/mksh && env $BSTRAP_ENV CC=\"${CC}\" $shprog Build.sh -r)" |
1256 | run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/mksh/mksh $wrkdir/bin/mksh" | | 1255 | run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/mksh/mksh $wrkdir/bin/mksh" |
1257 | echo "TOOLS_PLATFORM.sh?= $prefix/bin/mksh" >> ${TARGET_MKCONF} | | 1256 | echo "TOOLS_PLATFORM.sh?= $prefix/bin/mksh" >> ${TARGET_MKCONF} |
1258 | echo "TOOLS_PLATFORM.sh?= $wrkdir/bin/mksh" >> ${BOOTSTRAP_MKCONF} | | 1257 | echo "TOOLS_PLATFORM.sh?= $wrkdir/bin/mksh" >> ${BOOTSTRAP_MKCONF} |
1259 | echo_msg "Rebootstrapping bmake for mksh" | | 1258 | echo_msg "Rebootstrapping bmake for mksh" |
1260 | bmakexargs="$bmakexargs --with-defshell=$wrkdir/bin/mksh" | | 1259 | bmakexargs="$bmakexargs --with-defshell=$wrkdir/bin/mksh" |
1261 | bootstrap_bmake | | 1260 | bootstrap_bmake |
1262 | ;; | | 1261 | ;; |
1263 | esac | | 1262 | esac |
1264 | | | 1263 | |
1265 | # bootstrap ksh if necessary | | 1264 | # bootstrap ksh if necessary |
1266 | case "$need_ksh" in | | 1265 | case "$need_ksh" in |
1267 | yes) echo_msg "Bootstrapping ksh" | | 1266 | yes) echo_msg "Bootstrapping ksh" |
1268 | copy_src $pkgsrcdir/shells/pdksh/files ksh | | 1267 | copy_src $pkgsrcdir/shells/pdksh/files ksh |
1269 | 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)" | | 1268 | 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)" |
1270 | run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/ksh/ksh $wrkdir/bin/pdksh" | | 1269 | run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/ksh/ksh $wrkdir/bin/pdksh" |
1271 | echo "TOOLS_PLATFORM.sh?= $prefix/bin/pdksh" >> ${TARGET_MKCONF} | | 1270 | echo "TOOLS_PLATFORM.sh?= $prefix/bin/pdksh" >> ${TARGET_MKCONF} |
1272 | echo "TOOLS_PLATFORM.sh?= $wrkdir/bin/pdksh" >> ${BOOTSTRAP_MKCONF} | | 1271 | echo "TOOLS_PLATFORM.sh?= $wrkdir/bin/pdksh" >> ${BOOTSTRAP_MKCONF} |
1273 | echo "TOOLS_PLATFORM.ksh?= $prefix/bin/pdksh" >> ${TARGET_MKCONF} | | 1272 | echo "TOOLS_PLATFORM.ksh?= $prefix/bin/pdksh" >> ${TARGET_MKCONF} |
1274 | echo "TOOLS_PLATFORM.ksh?= $wrkdir/bin/pdksh" >> ${BOOTSTRAP_MKCONF} | | 1273 | echo "TOOLS_PLATFORM.ksh?= $wrkdir/bin/pdksh" >> ${BOOTSTRAP_MKCONF} |
1275 | # Now rebootstrap bmake for ksh | | 1274 | # Now rebootstrap bmake for ksh |
1276 | echo_msg "Rebootstrapping bmake for ksh" | | 1275 | echo_msg "Rebootstrapping bmake for ksh" |
1277 | bmakexargs="$bmakexargs --with-defshell=$wrkdir/bin/pdksh" | | 1276 | bmakexargs="$bmakexargs --with-defshell=$wrkdir/bin/pdksh" |
1278 | bootstrap_bmake | | 1277 | bootstrap_bmake |
1279 | ;; | | 1278 | ;; |
1280 | esac | | 1279 | esac |
1281 | | | 1280 | |
1282 | # bootstrap awk if necessary | | 1281 | # bootstrap awk if necessary |
1283 | case "$need_awk" in | | 1282 | case "$need_awk" in |
1284 | yes) echo_msg "Bootstrapping awk" | | 1283 | yes) echo_msg "Bootstrapping awk" |
1285 | copy_src $pkgsrcdir/lang/nawk/files awk | | 1284 | copy_src $pkgsrcdir/lang/nawk/files awk |
1286 | run_cmd "(cd $wrkdir/awk && $bmake $make_quiet_flags -j$make_jobs -f Makefile CC=\"${CC}\" CFLAGS=\"${CFLAGS}\")" | | 1285 | run_cmd "(cd $wrkdir/awk && $bmake $make_quiet_flags -j$make_jobs -f Makefile CC=\"${CC}\" CFLAGS=\"${CFLAGS}\")" |
1287 | run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/awk/a.out $wrkdir/bin/nawk" | | 1286 | run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/awk/a.out $wrkdir/bin/nawk" |
1288 | echo "TOOLS_PLATFORM.awk?= $prefix/bin/nawk" >> ${TARGET_MKCONF} | | 1287 | echo "TOOLS_PLATFORM.awk?= $prefix/bin/nawk" >> ${TARGET_MKCONF} |
1289 | echo "TOOLS_PLATFORM.awk?= $wrkdir/bin/nawk" >> ${BOOTSTRAP_MKCONF} | | 1288 | echo "TOOLS_PLATFORM.awk?= $wrkdir/bin/nawk" >> ${BOOTSTRAP_MKCONF} |
1290 | ;; | | 1289 | ;; |
1291 | esac | | 1290 | esac |
1292 | | | 1291 | |
1293 | # bootstrap sed if necessary | | 1292 | # bootstrap sed if necessary |
1294 | case "$need_sed" in | | 1293 | case "$need_sed" in |
1295 | yes) echo_msg "Bootstrapping sed" | | 1294 | yes) echo_msg "Bootstrapping sed" |
1296 | copy_src $pkgsrcdir/textproc/nbsed/files sed | | 1295 | copy_src $pkgsrcdir/textproc/nbsed/files sed |
1297 | 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)" | | 1296 | 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)" |
1298 | run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/sed/sed $wrkdir/bin/sed" | | 1297 | run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/sed/sed $wrkdir/bin/sed" |
1299 | echo "TOOLS_PLATFORM.sed?= $prefix/bin/nbsed" >> ${TARGET_MKCONF} | | 1298 | echo "TOOLS_PLATFORM.sed?= $prefix/bin/nbsed" >> ${TARGET_MKCONF} |
1300 | echo "TOOLS_PLATFORM.sed?= $wrkdir/bin/sed" >> ${BOOTSTRAP_MKCONF} | | 1299 | echo "TOOLS_PLATFORM.sed?= $wrkdir/bin/sed" >> ${BOOTSTRAP_MKCONF} |
1301 | ;; | | 1300 | ;; |
1302 | esac | | 1301 | esac |
1303 | | | 1302 | |
1304 | # bootstrap pkg_install | | 1303 | # bootstrap pkg_install |
1305 | extra_libarchive_depends() { | | 1304 | extra_libarchive_depends() { |
1306 | $sedprog -n -e 's/Libs.private: //p' $wrkdir/libarchive/build/pkgconfig/libarchive.pc | | 1305 | $sedprog -n -e 's/Libs.private: //p' $wrkdir/libarchive/build/pkgconfig/libarchive.pc |
1307 | } | | 1306 | } |
1308 | | | 1307 | |
1309 | echo_msg "Bootstrapping pkgtools" | | 1308 | echo_msg "Bootstrapping pkgtools" |
1310 | copy_src $pkgsrcdir/archivers/libarchive/files libarchive | | 1309 | copy_src $pkgsrcdir/archivers/libarchive/files libarchive |
1311 | run_cmd "(cd $wrkdir/libarchive; env $BSTRAP_ENV CONFIG_SHELL=$shprog \ | | 1310 | run_cmd "(cd $wrkdir/libarchive; env $BSTRAP_ENV CONFIG_SHELL=$shprog \ |
1312 | $shprog ./configure $configure_quiet_flags --enable-static --disable-shared \ | | 1311 | $shprog ./configure $configure_quiet_flags --enable-static --disable-shared \ |
1313 | --disable-bsdtar --disable-bsdcpio --disable-posix-regex-lib --disable-xattr \ | | 1312 | --disable-bsdtar --disable-bsdcpio --disable-posix-regex-lib --disable-xattr \ |
1314 | --disable-maintainer-mode --disable-acl --without-zlib --without-bz2lib \ | | 1313 | --disable-maintainer-mode --disable-acl --without-zlib --without-bz2lib \ |
1315 | --without-iconv --without-lzma --without-lzo2 --without-lz4 \ | | 1314 | --without-iconv --without-lzma --without-lzo2 --without-lz4 \ |
1316 | --without-nettle --without-openssl --without-xml2 --without-expat --without-zstd \ | | 1315 | --without-nettle --without-openssl --without-xml2 --without-expat --without-zstd \ |
1317 | MAKE=$bmake && $bmake $make_quiet_flags -j$make_jobs)" | | 1316 | MAKE=$bmake && $bmake $make_quiet_flags -j$make_jobs)" |
1318 | copy_src $pkgsrcdir/pkgtools/pkg_install/files pkg_install | | 1317 | copy_src $pkgsrcdir/pkgtools/pkg_install/files pkg_install |
1319 | run_cmd "(cd $wrkdir/pkg_install; env $BSTRAP_ENV \ | | 1318 | run_cmd "(cd $wrkdir/pkg_install; env $BSTRAP_ENV \ |
1320 | CPPFLAGS='$CPPFLAGS -I${wrkdir}/libnbcompat -I${wrkdir}/libarchive/libarchive' \ | | 1319 | CPPFLAGS='$CPPFLAGS -I${wrkdir}/libnbcompat -I${wrkdir}/libarchive/libarchive' \ |
1321 | LDFLAGS='$LDFLAGS -L${wrkdir}/libnbcompat' \ | | 1320 | LDFLAGS='$LDFLAGS -L${wrkdir}/libnbcompat' \ |
1322 | LIBS='$LIBS -lnbcompat' $shprog ./configure $configure_quiet_flags -C \ | | 1321 | LIBS='$LIBS -lnbcompat' $shprog ./configure $configure_quiet_flags -C \ |
1323 | --enable-bootstrap --prefix=$prefix --sysconfdir=$sysconfdir \ | | 1322 | --enable-bootstrap --prefix=$prefix --sysconfdir=$sysconfdir \ |
1324 | --with-pkgdbdir=$pkgdbdir --infodir=$infodir \ | | 1323 | --with-pkgdbdir=$pkgdbdir --infodir=$infodir \ |
1325 | --mandir=$mandir $pkg_install_args && \ | | 1324 | --mandir=$mandir $pkg_install_args && \ |
1326 | STATIC_LIBARCHIVE=$wrkdir/libarchive/.libs/libarchive.a \ | | 1325 | STATIC_LIBARCHIVE=$wrkdir/libarchive/.libs/libarchive.a \ |
1327 | STATIC_LIBARCHIVE_LDADD='`extra_libarchive_depends`' \ | | 1326 | STATIC_LIBARCHIVE_LDADD='`extra_libarchive_depends`' \ |
1328 | PKGSRC_MACHINE_ARCH="$machine_arch" $bmake $make_quiet_flags -j$make_jobs)" | | 1327 | PKGSRC_MACHINE_ARCH="$machine_arch" $bmake $make_quiet_flags -j$make_jobs)" |
1329 | run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/add/pkg_add $wrkdir/sbin/pkg_add" | | 1328 | run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/add/pkg_add $wrkdir/sbin/pkg_add" |
1330 | run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/admin/pkg_admin $wrkdir/sbin/pkg_admin" | | 1329 | run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/admin/pkg_admin $wrkdir/sbin/pkg_admin" |
1331 | run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/create/pkg_create $wrkdir/sbin/pkg_create" | | 1330 | run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/create/pkg_create $wrkdir/sbin/pkg_create" |
1332 | run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/info/pkg_info $wrkdir/sbin/pkg_info" | | 1331 | run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/info/pkg_info $wrkdir/sbin/pkg_info" |
1333 | echo "PKG_ADD_CMD?= $wrkdir/sbin/pkg_add" >> ${BOOTSTRAP_MKCONF} | | 1332 | echo "PKG_ADD_CMD?= $wrkdir/sbin/pkg_add" >> ${BOOTSTRAP_MKCONF} |
1334 | echo "PKG_ADMIN_CMD?= $wrkdir/sbin/pkg_admin" >> ${BOOTSTRAP_MKCONF} | | 1333 | echo "PKG_ADMIN_CMD?= $wrkdir/sbin/pkg_admin" >> ${BOOTSTRAP_MKCONF} |
1335 | echo "PKG_CREATE_CMD?= $wrkdir/sbin/pkg_create" >> ${BOOTSTRAP_MKCONF} | | 1334 | echo "PKG_CREATE_CMD?= $wrkdir/sbin/pkg_create" >> ${BOOTSTRAP_MKCONF} |
1336 | echo "PKG_INFO_CMD?= $wrkdir/sbin/pkg_info" >> ${BOOTSTRAP_MKCONF} | | 1335 | echo "PKG_INFO_CMD?= $wrkdir/sbin/pkg_info" >> ${BOOTSTRAP_MKCONF} |
1337 | | | 1336 | |
1338 | MAKECONF=$wrkdir/mk.conf | | 1337 | MAKECONF=$wrkdir/mk.conf |
1339 | export MAKECONF | | 1338 | export MAKECONF |
1340 | | | 1339 | |
1341 | if [ "$bootstrap_sh_set" = "set" ]; then | | 1340 | if [ "$bootstrap_sh_set" = "set" ]; then |
1342 | echo "TOOLS_PLATFORM.sh?= ${bootstrap_sh}" >> ${TARGET_MKCONF} | | 1341 | echo "TOOLS_PLATFORM.sh?= ${bootstrap_sh}" >> ${TARGET_MKCONF} |
1343 | echo "TOOLS_PLATFORM.sh?= ${bootstrap_sh}" >> ${BOOTSTRAP_MKCONF} | | 1342 | echo "TOOLS_PLATFORM.sh?= ${bootstrap_sh}" >> ${BOOTSTRAP_MKCONF} |
1344 | fi | | 1343 | fi |
1345 | | | 1344 | |
1346 | # preserve compiler and tool environment variables settings | | 1345 | # preserve compiler and tool environment variables settings |
1347 | if test -n "$CP"; then | | 1346 | if test -n "$CP"; then |
1348 | echo "TOOLS_PLATFORM.cp?= $CP" >> ${TARGET_MKCONF} | | 1347 | echo "TOOLS_PLATFORM.cp?= $CP" >> ${TARGET_MKCONF} |
1349 | echo "TOOLS_PLATFORM.cp?= $CP" >> ${BOOTSTRAP_MKCONF} | | 1348 | echo "TOOLS_PLATFORM.cp?= $CP" >> ${BOOTSTRAP_MKCONF} |
1350 | fi | | 1349 | fi |
1351 | if test -n "$GREP"; then | | 1350 | if test -n "$GREP"; then |
1352 | echo "TOOLS_PLATFORM.grep?= $GREP" >> ${TARGET_MKCONF} | | 1351 | echo "TOOLS_PLATFORM.grep?= $GREP" >> ${TARGET_MKCONF} |
1353 | echo "TOOLS_PLATFORM.grep?= $GREP" >> ${BOOTSTRAP_MKCONF} | | 1352 | echo "TOOLS_PLATFORM.grep?= $GREP" >> ${BOOTSTRAP_MKCONF} |
1354 | fi | | 1353 | fi |
1355 | if test -n "$EGREP"; then | | 1354 | if test -n "$EGREP"; then |
1356 | echo "TOOLS_PLATFORM.egrep?= $EGREP" >> ${TARGET_MKCONF} | | 1355 | echo "TOOLS_PLATFORM.egrep?= $EGREP" >> ${TARGET_MKCONF} |
1357 | echo "TOOLS_PLATFORM.egrep?= $EGREP" >> ${BOOTSTRAP_MKCONF} | | 1356 | echo "TOOLS_PLATFORM.egrep?= $EGREP" >> ${BOOTSTRAP_MKCONF} |
1358 | fi | | 1357 | fi |
1359 | if test -n "$FGREP"; then | | 1358 | if test -n "$FGREP"; then |
1360 | echo "TOOLS_PLATFORM.fgrep?= $FGREP" >> ${TARGET_MKCONF} | | 1359 | echo "TOOLS_PLATFORM.fgrep?= $FGREP" >> ${TARGET_MKCONF} |
1361 | echo "TOOLS_PLATFORM.fgrep?= $FGREP" >> ${BOOTSTRAP_MKCONF} | | 1360 | echo "TOOLS_PLATFORM.fgrep?= $FGREP" >> ${BOOTSTRAP_MKCONF} |
1362 | fi | | 1361 | fi |
1363 | if test -n "$ID"; then | | 1362 | if test -n "$ID"; then |
1364 | echo "TOOLS_PLATFORM.id?= $ID" >> ${TARGET_MKCONF} | | 1363 | echo "TOOLS_PLATFORM.id?= $ID" >> ${TARGET_MKCONF} |
1365 | echo "TOOLS_PLATFORM.id?= $ID" >> ${BOOTSTRAP_MKCONF} | | 1364 | echo "TOOLS_PLATFORM.id?= $ID" >> ${BOOTSTRAP_MKCONF} |
1366 | fi | | 1365 | fi |
1367 | if test -n "$MKDIR"; then | | 1366 | if test -n "$MKDIR"; then |
1368 | echo "TOOLS_PLATFORM.mkdir?= $MKDIR" >> ${TARGET_MKCONF} | | 1367 | echo "TOOLS_PLATFORM.mkdir?= $MKDIR" >> ${TARGET_MKCONF} |
1369 | echo "TOOLS_PLATFORM.mkdir?= $MKDIR" >> ${BOOTSTRAP_MKCONF} | | 1368 | echo "TOOLS_PLATFORM.mkdir?= $MKDIR" >> ${BOOTSTRAP_MKCONF} |
1370 | fi | | 1369 | fi |
1371 | if test -n "$TEST"; then | | 1370 | if test -n "$TEST"; then |
1372 | echo "TOOLS_PLATFORM.test?= $TEST" >> ${TARGET_MKCONF} | | 1371 | echo "TOOLS_PLATFORM.test?= $TEST" >> ${TARGET_MKCONF} |
1373 | echo "TOOLS_PLATFORM.test?= $TEST" >> ${BOOTSTRAP_MKCONF} | | 1372 | echo "TOOLS_PLATFORM.test?= $TEST" >> ${BOOTSTRAP_MKCONF} |
1374 | fi | | 1373 | fi |
1375 | if test -n "$TOUCH"; then | | 1374 | if test -n "$TOUCH"; then |
1376 | echo "TOOLS_PLATFORM.touch?= $TOUCH" >> ${TARGET_MKCONF} | | 1375 | echo "TOOLS_PLATFORM.touch?= $TOUCH" >> ${TARGET_MKCONF} |
1377 | echo "TOOLS_PLATFORM.touch?= $TOUCH" >> ${BOOTSTRAP_MKCONF} | | 1376 | echo "TOOLS_PLATFORM.touch?= $TOUCH" >> ${BOOTSTRAP_MKCONF} |
1378 | fi | | 1377 | fi |
1379 | if test -n "$XARGS"; then | | 1378 | if test -n "$XARGS"; then |
1380 | echo "TOOLS_PLATFORM.xargs?= $XARGS" >> ${TARGET_MKCONF} | | 1379 | echo "TOOLS_PLATFORM.xargs?= $XARGS" >> ${TARGET_MKCONF} |
1381 | echo "TOOLS_PLATFORM.xargs?= $XARGS" >> ${BOOTSTRAP_MKCONF} | | 1380 | echo "TOOLS_PLATFORM.xargs?= $XARGS" >> ${BOOTSTRAP_MKCONF} |
1382 | fi | | 1381 | fi |
1383 | if test -n "$CFLAGS"; then | | 1382 | if test -n "$CFLAGS"; then |
1384 | echo "CFLAGS+= $CFLAGS" >> ${TARGET_MKCONF} | | 1383 | echo "CFLAGS+= $CFLAGS" >> ${TARGET_MKCONF} |
1385 | echo "DBG= # prevent DBG from adding default optimizer flags" >> ${TARGET_MKCONF} | | 1384 | echo "DBG= # prevent DBG from adding default optimizer flags" >> ${TARGET_MKCONF} |
1386 | echo "DBG= # prevent DBG from adding default optimizer flags" >> ${BOOTSTRAP_MKCONF} | | 1385 | echo "DBG= # prevent DBG from adding default optimizer flags" >> ${BOOTSTRAP_MKCONF} |
1387 | fi | | 1386 | fi |
1388 | if test -n "$CPPFLAGS"; then | | 1387 | if test -n "$CPPFLAGS"; then |
1389 | echo "CPPFLAGS+= $CPPFLAGS" >> ${TARGET_MKCONF} | | 1388 | echo "CPPFLAGS+= $CPPFLAGS" >> ${TARGET_MKCONF} |
1390 | fi | | 1389 | fi |
1391 | if test -n "$LDFLAGS"; then | | 1390 | if test -n "$LDFLAGS"; then |
1392 | echo "LDFLAGS+= $LDFLAGS" >> ${TARGET_MKCONF} | | 1391 | echo "LDFLAGS+= $LDFLAGS" >> ${TARGET_MKCONF} |
1393 | fi | | 1392 | fi |
1394 | if test -n "$LIBS"; then | | 1393 | if test -n "$LIBS"; then |
1395 | echo "LIBS+= $LIBS" >> ${TARGET_MKCONF} | | 1394 | echo "LIBS+= $LIBS" >> ${TARGET_MKCONF} |
1396 | fi | | 1395 | fi |
1397 | | | 1396 | |
1398 | # opsys specific fiddling | | 1397 | # opsys specific fiddling |
1399 | opsys_finish | | 1398 | opsys_finish |
1400 | | | 1399 | |
1401 | echo "WRKOBJDIR= ${wrkdir}/wrk" >> ${BOOTSTRAP_MKCONF} | | 1400 | echo "WRKOBJDIR= ${wrkdir}/wrk" >> ${BOOTSTRAP_MKCONF} |
1402 | | | 1401 | |
1403 | echo "" >> ${TARGET_MKCONF} | | 1402 | echo "" >> ${TARGET_MKCONF} |
1404 | echo "" >> ${BOOTSTRAP_MKCONF} | | 1403 | echo "" >> ${BOOTSTRAP_MKCONF} |
1405 | if test -n "${mk_fragment}"; then | | 1404 | if test -n "${mk_fragment}"; then |
1406 | cat "${mk_fragment}" >> ${TARGET_MKCONF} | | 1405 | cat "${mk_fragment}" >> ${TARGET_MKCONF} |
1407 | echo "" >> ${TARGET_MKCONF} | | 1406 | echo "" >> ${TARGET_MKCONF} |
1408 | fi | | 1407 | fi |
1409 | echo ".endif # end pkgsrc settings" >> ${TARGET_MKCONF} | | 1408 | echo ".endif # end pkgsrc settings" >> ${TARGET_MKCONF} |
1410 | echo ".endif # end pkgsrc settings" >> ${BOOTSTRAP_MKCONF} | | 1409 | echo ".endif # end pkgsrc settings" >> ${BOOTSTRAP_MKCONF} |
1411 | | | 1410 | |
1412 | # build and register packages | | 1411 | # build and register packages |
1413 | # usage: build_package <packagedirectory> | | 1412 | # usage: build_package <packagedirectory> |
1414 | build_package() { | | 1413 | build_package() { |
1415 | 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)" | | 1414 | 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)" |
1416 | } | | 1415 | } |
1417 | build_package_nopreserve() { | | 1416 | build_package_nopreserve() { |
1418 | 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)" | | 1417 | 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)" |
1419 | } | | 1418 | } |
1420 | | | 1419 | |
1421 | # | | 1420 | # |
1422 | # cwrappers is special, we don't want to set it as a BOOTSTRAP_PKG but must | | 1421 | # cwrappers is special, we don't want to set it as a BOOTSTRAP_PKG but must |
1423 | # build it (if required) without -DPKG_PRESERVE set so that it can be deleted. | | 1422 | # build it (if required) without -DPKG_PRESERVE set so that it can be deleted. |
1424 | # | | 1423 | # |
1425 | use_cwrappers=`(cd $pkgsrcdir/devel/bmake && $bmake show-var VARNAME=_USE_CWRAPPERS)` | | 1424 | use_cwrappers=`(cd $pkgsrcdir/devel/bmake && $bmake show-var VARNAME=_USE_CWRAPPERS)` |
1426 | case "$use_cwrappers" in | | 1425 | case "$use_cwrappers" in |
1427 | yes) | | 1426 | yes) |
1428 | build_package_nopreserve "pkgtools/cwrappers" | | 1427 | build_package_nopreserve "pkgtools/cwrappers" |
1429 | ;; | | 1428 | ;; |
1430 | esac | | 1429 | esac |
1431 | | | 1430 | |
1432 | # | | 1431 | # |
1433 | # Please make sure that the following packages and | | 1432 | # Please make sure that the following packages and |
1434 | # only the following packages set BOOTSTRAP_PKG=yes. | | 1433 | # only the following packages set BOOTSTRAP_PKG=yes. |
1435 | # | | 1434 | # |
1436 | echo_msg "Installing packages" | | 1435 | echo_msg "Installing packages" |
1437 | build_package "pkgtools/bootstrap-mk-files" | | 1436 | build_package "pkgtools/bootstrap-mk-files" |
1438 | case "$need_bsd_install" in | | 1437 | case "$need_bsd_install" in |
1439 | yes) | | 1438 | yes) |
1440 | if [ "$use_bsdinstall" = "yes" ]; then | | 1439 | if [ "$use_bsdinstall" = "yes" ]; then |
1441 | build_package "sysutils/bsdinstall" | | 1440 | build_package "sysutils/bsdinstall" |
1442 | else | | 1441 | else |
1443 | build_package "sysutils/install-sh" | | 1442 | build_package "sysutils/install-sh" |
1444 | fi | | 1443 | fi |
1445 | ;; | | 1444 | ;; |
1446 | esac | | 1445 | esac |
1447 | case "$need_mksh" in | | 1446 | case "$need_mksh" in |
1448 | yes) build_package "shells/mksh";; | | 1447 | yes) build_package "shells/mksh";; |
1449 | esac | | 1448 | esac |
1450 | case "$need_ksh" in | | 1449 | case "$need_ksh" in |
1451 | yes) build_package "shells/pdksh";; | | 1450 | yes) build_package "shells/pdksh";; |
1452 | esac | | 1451 | esac |
1453 | build_package "devel/bmake" | | 1452 | build_package "devel/bmake" |
1454 | case "$need_awk" in | | 1453 | case "$need_awk" in |
1455 | yes) build_package "lang/nawk";; | | 1454 | yes) build_package "lang/nawk";; |
1456 | esac | | 1455 | esac |
1457 | case "$need_sed" in | | 1456 | case "$need_sed" in |
1458 | yes) build_package "textproc/nbsed";; | | 1457 | yes) build_package "textproc/nbsed";; |
1459 | esac | | 1458 | esac |
1460 | case "$need_extras" in | | 1459 | case "$need_extras" in |
1461 | yes) build_package "pkgtools/bootstrap-extras";; | | 1460 | yes) build_package "pkgtools/bootstrap-extras";; |
1462 | esac | | 1461 | esac |
1463 | case "$need_pax" in | | 1462 | case "$need_pax" in |
1464 | yes) build_package "archivers/pax" | | 1463 | yes) build_package "archivers/pax" |
1465 | esac | | 1464 | esac |
1466 | build_package "pkgtools/pkg_install" | | 1465 | build_package "pkgtools/pkg_install" |
1467 | | | 1466 | |
1468 | etc_mk_conf="$sysconfdir/mk.conf" | | 1467 | etc_mk_conf="$sysconfdir/mk.conf" |
1469 | | | 1468 | |
1470 | # Install the example mk.conf so that it is used, but only if it doesn't | | 1469 | # Install the example mk.conf so that it is used, but only if it doesn't |
1471 | # exist yet. This can happen with non-default sysconfdir settings. | | 1470 | # exist yet. This can happen with non-default sysconfdir settings. |
1472 | mkdir_p "$sysconfdir" | | 1471 | mkdir_p "$sysconfdir" |
1473 | if [ ! -f "$etc_mk_conf" ]; then | | 1472 | if [ ! -f "$etc_mk_conf" ]; then |
1474 | cp "$TARGET_MKCONF" "$etc_mk_conf" | | 1473 | cp "$TARGET_MKCONF" "$etc_mk_conf" |
1475 | TARGET_MKCONF="$etc_mk_conf" | | 1474 | TARGET_MKCONF="$etc_mk_conf" |
1476 | fi | | 1475 | fi |
1477 | | | 1476 | |
1478 | [ -n "${binary_kit}" ] && mkbinarykit_tar | | 1477 | [ -n "${binary_kit}" ] && mkbinarykit_tar |
1479 | [ -n "${binary_gzip_kit}" ] && mkbinarykit_tgz | | 1478 | [ -n "${binary_gzip_kit}" ] && mkbinarykit_tgz |
1480 | | | 1479 | |
1481 | hline="===========================================================================" | | 1480 | hline="===========================================================================" |
1482 | echo "" | | 1481 | echo "" |
1483 | echo "$hline" | | 1482 | echo "$hline" |
1484 | echo "" | | 1483 | echo "" |
1485 | echo "Please remember to add $prefix/bin to your PATH environment variable" | | 1484 | echo "Please remember to add $prefix/bin to your PATH environment variable" |
1486 | echo "and $mandir to your MANPATH environment variable, if necessary." | | 1485 | echo "and $mandir to your MANPATH environment variable, if necessary." |
1487 | echo "" | | 1486 | echo "" |
1488 | echo "An example mk.conf file with the settings you provided to \"bootstrap\"" | | 1487 | echo "An example mk.conf file with the settings you provided to \"bootstrap\"" |
1489 | echo "has been created for you. It can be found in:" | | 1488 | echo "has been created for you. It can be found in:" |
1490 | echo "" | | 1489 | echo "" |
1491 | echo " ${TARGET_MKCONF}" | | 1490 | echo " ${TARGET_MKCONF}" |
1492 | echo "" | | 1491 | echo "" |
1493 | if [ "$TARGET_MKCONF" != "$etc_mk_conf" ]; then | | 1492 | if [ "$TARGET_MKCONF" != "$etc_mk_conf" ]; then |
1494 | echo "Please copy it to $etc_mk_conf to use it." | | 1493 | echo "Please copy it to $etc_mk_conf to use it." |
1495 | echo "" | | 1494 | echo "" |
1496 | fi | | 1495 | fi |
1497 | echo "You can find extensive documentation of the NetBSD Packages Collection" | | 1496 | echo "You can find extensive documentation of the NetBSD Packages Collection" |
1498 | echo "in $pkgsrcdir/doc/pkgsrc.txt." | | 1497 | echo "in $pkgsrcdir/doc/pkgsrc.txt." |
1499 | echo "" | | 1498 | echo "" |
1500 | echo "Thank you for using pkgsrc!" | | 1499 | echo "Thank you for using pkgsrc!" |
1501 | echo "" | | 1500 | echo "" |
1502 | echo "$hline" | | 1501 | echo "$hline" |
1503 | echo "" | | 1502 | echo "" |
1504 | | | 1503 | |
1505 | echo_msg "bootstrap started: $build_start" | | 1504 | echo_msg "bootstrap started: $build_start" |
1506 | echo_msg "bootstrap ended: `date`" | | 1505 | echo_msg "bootstrap ended: `date`" |
1507 | | | 1506 | |
1508 | exit 0 | | 1507 | exit 0 |