7 # You may not use this file except in compliance with the License.
8 #
9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 # or http://www.opensolaris.org/os/licensing.
11 # See the License for the specific language governing permissions
12 # and limitations under the License.
13 #
14 # When distributing Covered Code, include this CDDL HEADER in each
15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 # If applicable, add the following below this CDDL HEADER, with the
17 # fields enclosed by brackets "[]" replaced with your own identifying
18 # information: Portions Copyright [yyyy] [name of copyright owner]
19 #
20 # CDDL HEADER END
21 #
22
23 #
24 # Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
25 # Copyright 2011 Nexenta Systems, Inc. All rights reserved.
26 # Copyright 2014 Garrett D'Amore <garrett@damore.org>
27 # Copyright 2018 Joyent, Inc.
28 #
29 # Uses supplied "env" file, based on /opt/onbld/etc/env, to set shell variables
30 # before spawning a shell for doing a release-style builds interactively
31 # and incrementally.
32 #
33
34 function fatal_error
35 {
36 print -u2 "${progname}: $*"
37 exit 1
38 }
39
40 function usage
41 {
42 OPTIND=0
43 getopts -a "${progname}" "${USAGE}" OPT '-?'
44 exit 2
45 }
46
47 typeset -r USAGE=$'+
204 fi
205
206 if [[ -f "$1" ]]; then
207 if [[ "$1" == */* ]]; then
208 source "$1"
209 else
210 source "./$1"
211 fi
212 else
213 if [[ -f "/opt/onbld/env/$1" ]]; then
214 source "/opt/onbld/env/$1"
215 else
216 printf \
217 'Cannot find env file as either %s or /opt/onbld/env/%s\n' \
218 "$1" "$1"
219 exit 1
220 fi
221 fi
222 shift
223
224 # contents of stdenv.sh inserted after next line:
225 # STDENV_START
226 # STDENV_END
227
228 # Check if we have sufficient data to continue...
229 [[ -v CODEMGR_WS ]] || fatal_error "Error: Variable CODEMGR_WS not set."
230 [[ -d "${CODEMGR_WS}" ]] || fatal_error "Error: ${CODEMGR_WS} is not a directory."
231 [[ -f "${CODEMGR_WS}/usr/src/Makefile" ]] || fatal_error "Error: ${CODEMGR_WS}/usr/src/Makefile not found."
232
233 # must match the getopts in nightly.sh
234 OPTIND=1
235 NIGHTLY_OPTIONS="-${NIGHTLY_OPTIONS#-}"
236 while getopts '+0ABCDdFfGIilMmNnpRrtUuwW' FLAG $NIGHTLY_OPTIONS
237 do
238 case "$FLAG" in
239 t) flags.t=true ;;
240 +t) flags.t=false ;;
241 F) flags.DF_build=true ;;
242 *) ;;
243 esac
244 done
245
246 # DEBUG is a little bit complicated. First, bldenv -d/+d over-rides
247 # the env file. Otherwise, we'll default to DEBUG iff we are *not*
248 # building non-DEBUG bits at all.
249 if [ "${flags.d_set}" != "true" ] && "${flags.DF_build}"; then
250 flags.d=true
251 fi
252
253 POUND_SIGN="#"
|
7 # You may not use this file except in compliance with the License.
8 #
9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 # or http://www.opensolaris.org/os/licensing.
11 # See the License for the specific language governing permissions
12 # and limitations under the License.
13 #
14 # When distributing Covered Code, include this CDDL HEADER in each
15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 # If applicable, add the following below this CDDL HEADER, with the
17 # fields enclosed by brackets "[]" replaced with your own identifying
18 # information: Portions Copyright [yyyy] [name of copyright owner]
19 #
20 # CDDL HEADER END
21 #
22
23 #
24 # Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
25 # Copyright 2011 Nexenta Systems, Inc. All rights reserved.
26 # Copyright 2014 Garrett D'Amore <garrett@damore.org>
27 # Copyright 2020 Joyent, Inc.
28 #
29 # Uses supplied "env" file, based on /opt/onbld/etc/env, to set shell variables
30 # before spawning a shell for doing a release-style builds interactively
31 # and incrementally.
32 #
33
34 function fatal_error
35 {
36 print -u2 "${progname}: $*"
37 exit 1
38 }
39
40 function usage
41 {
42 OPTIND=0
43 getopts -a "${progname}" "${USAGE}" OPT '-?'
44 exit 2
45 }
46
47 typeset -r USAGE=$'+
204 fi
205
206 if [[ -f "$1" ]]; then
207 if [[ "$1" == */* ]]; then
208 source "$1"
209 else
210 source "./$1"
211 fi
212 else
213 if [[ -f "/opt/onbld/env/$1" ]]; then
214 source "/opt/onbld/env/$1"
215 else
216 printf \
217 'Cannot find env file as either %s or /opt/onbld/env/%s\n' \
218 "$1" "$1"
219 exit 1
220 fi
221 fi
222 shift
223
224 # Check if we have sufficient data to continue...
225 [[ -v CODEMGR_WS ]] || fatal_error "Error: Variable CODEMGR_WS not set."
226 [[ -d "${CODEMGR_WS}" ]] || fatal_error "Error: ${CODEMGR_WS} is not a directory."
227 [[ -f "${CODEMGR_WS}/usr/src/Makefile" ]] || fatal_error "Error: ${CODEMGR_WS}/usr/src/Makefile not found."
228
229 # must match the getopts in nightly
230 OPTIND=1
231 NIGHTLY_OPTIONS="-${NIGHTLY_OPTIONS#-}"
232 while getopts '+0ABCDdFfGIilMmNnpRrtUuwW' FLAG $NIGHTLY_OPTIONS
233 do
234 case "$FLAG" in
235 t) flags.t=true ;;
236 +t) flags.t=false ;;
237 F) flags.DF_build=true ;;
238 *) ;;
239 esac
240 done
241
242 # DEBUG is a little bit complicated. First, bldenv -d/+d over-rides
243 # the env file. Otherwise, we'll default to DEBUG iff we are *not*
244 # building non-DEBUG bits at all.
245 if [ "${flags.d_set}" != "true" ] && "${flags.DF_build}"; then
246 flags.d=true
247 fi
248
249 POUND_SIGN="#"
|