5 # The contents of this file are subject to the terms of the
6 # Common Development and Distribution License (the "License").
7 # You may not use this file except in compliance with the License.
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.
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]
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>
28 # Uses "env.sh" file to set shell variables before spawning a shell for doing a
29 # release-style builds interactively and incrementally.
34 print
-u2 "${progname}: $*"
40 print
-u2 "usage: ${progname} [command [args]]"
44 progname
="$(basename -- "${0}")"
58 # clear environment variables we know to be bad for the build
87 # Setup environment variables
90 # make sure we are not outside of the git checkout when sourcing env.sh; it has
91 # some git commands that rely on that
94 if [[ -f "env.sh" ]]; then
98 'Cannot find env file env.sh\n'
103 # Check if we have sufficient data to continue...
104 [[ -n "${SRCTOP}" ]] || fatal_error
"Error: Variable SRCTOP not set."
105 [[ -d "${SRCTOP}" ]] || fatal_error
"Error: ${SRCTOP} is not a directory."
106 [[ -f "${SRCTOP}/usr/src/Makefile" ]] || fatal_error
"Error: ${SRCTOP}/usr/src/Makefile not found."
109 # have we set RELEASE_DATE in our env file?
110 if [ -z "$RELEASE_DATE" ]; then
111 RELEASE_DATE
=$
(LC_ALL
=C
date +"%B %Y")
113 BUILD_DATE
=$
(LC_ALL
=C
date +%Y-
%b-
%d
)
114 BASEWSDIR
=$
(basename -- "${SRCTOP}")
115 export RELEASE_DATE POUND_SIGN
117 # update build-type variables
118 PKGARCHIVE
="${PKGARCHIVE}"
120 # Set PATH for a build
121 PATH
="/opt/onbld/bin:/opt/onbld/bin/${MACH}:/usr/bin:/usr/sbin:/usr/ucb:/usr/etc:/usr/openwin/bin:/usr/sfw/bin:/opt/sfw/bin:.:/opt/SUNWspro/bin"
123 if [[ -n "${MAKE}" ]]; then
124 if [[ -x "${MAKE}" ]]; then
125 export PATH
="$(dirname -- "${MAKE}"):$PATH"
127 print
"\$MAKE (${MAKE}) is not a valid executible"
133 TOOLS_PROTO
="${TOOLS}/proto/root_${MACH}-nd" ; export TOOLS_PROTO
135 export ONBLD_TOOLS
="${ONBLD_TOOLS:=${TOOLS_PROTO}/opt/onbld}"
137 export STABS
="${TOOLS_PROTO}/opt/onbld/bin/${MACH}/stabs"
138 export CTFSTABS
="${TOOLS_PROTO}/opt/onbld/bin/${MACH}/ctfstabs"
139 export GENOFFSETS
="${TOOLS_PROTO}/opt/onbld/bin/genoffsets"
141 PATH
="${TOOLS_PROTO}/opt/onbld/bin/${MACH}:${PATH}"
142 PATH
="${TOOLS_PROTO}/opt/onbld/bin:${PATH}"
145 export DMAKE_MODE
=${DMAKE_MODE:-parallel}
169 ENVLDLIBS1
="-L$ROOT/lib -L$ROOT/usr/lib"
170 ENVCPPFLAGS1
="-I$ROOT/usr/include"
183 export RELEASE_BUILD
=
191 ENV
=${dir}/ksh.env
exec /bin
/ksh