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
91 if [[ -f "$env" ]]; then
95 'Cannot find env file "%s"\n' "$env"
99 # Check if we have sufficient data to continue...
100 [[ -n "${SRCTOP}" ]] || fatal_error
"Error: Variable SRCTOP not set."
101 [[ -d "${SRCTOP}" ]] || fatal_error
"Error: ${SRCTOP} is not a directory."
102 [[ -f "${SRCTOP}/usr/src/Makefile" ]] || fatal_error
"Error: ${SRCTOP}/usr/src/Makefile not found."
105 # have we set RELEASE_DATE in our env file?
106 if [ -z "$RELEASE_DATE" ]; then
107 RELEASE_DATE
=$
(LC_ALL
=C
date +"%B %Y")
109 BUILD_DATE
=$
(LC_ALL
=C
date +%Y-
%b-
%d
)
110 BASEWSDIR
=$
(basename -- "${SRCTOP}")
111 export RELEASE_DATE POUND_SIGN
113 # update build-type variables
114 PKGARCHIVE
="${PKGARCHIVE}"
116 # Set PATH for a build
117 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"
119 if [[ -n "${MAKE}" ]]; then
120 if [[ -x "${MAKE}" ]]; then
121 export PATH
="$(dirname -- "${MAKE}"):$PATH"
123 print
"\$MAKE (${MAKE}) is not a valid executible"
129 TOOLS_PROTO
="${TOOLS}/proto/root_${MACH}-nd" ; export TOOLS_PROTO
131 export ONBLD_TOOLS
="${ONBLD_TOOLS:=${TOOLS_PROTO}/opt/onbld}"
133 export STABS
="${TOOLS_PROTO}/opt/onbld/bin/${MACH}/stabs"
134 export CTFSTABS
="${TOOLS_PROTO}/opt/onbld/bin/${MACH}/ctfstabs"
135 export GENOFFSETS
="${TOOLS_PROTO}/opt/onbld/bin/genoffsets"
137 PATH
="${TOOLS_PROTO}/opt/onbld/bin/${MACH}:${PATH}"
138 PATH
="${TOOLS_PROTO}/opt/onbld/bin:${PATH}"
141 export DMAKE_MODE
=${DMAKE_MODE:-parallel}
165 ENVLDLIBS1
="-L$ROOT/lib -L$ROOT/usr/lib"
166 ENVCPPFLAGS1
="-I$ROOT/usr/include"
179 export RELEASE_BUILD
=
187 ENV
=${dir}/ksh.env
exec /bin
/ksh