xref: /titanic_54/usr/src/tools/env/illumos.sh (revision eb8f03cde11ee9fc86ee179ef61fc5861756b1c6)
1*eb8f03cdSGarrett D'Amore#
2*eb8f03cdSGarrett D'Amore# CDDL HEADER START
3*eb8f03cdSGarrett D'Amore#
4*eb8f03cdSGarrett D'Amore# The contents of this file are subject to the terms of the
5*eb8f03cdSGarrett D'Amore# Common Development and Distribution License (the "License").
6*eb8f03cdSGarrett D'Amore# You may not use this file except in compliance with the License.
7*eb8f03cdSGarrett D'Amore#
8*eb8f03cdSGarrett D'Amore# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*eb8f03cdSGarrett D'Amore# or http://www.opensolaris.org/os/licensing.
10*eb8f03cdSGarrett D'Amore# See the License for the specific language governing permissions
11*eb8f03cdSGarrett D'Amore# and limitations under the License.
12*eb8f03cdSGarrett D'Amore#
13*eb8f03cdSGarrett D'Amore# When distributing Covered Code, include this CDDL HEADER in each
14*eb8f03cdSGarrett D'Amore# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*eb8f03cdSGarrett D'Amore# If applicable, add the following below this CDDL HEADER, with the
16*eb8f03cdSGarrett D'Amore# fields enclosed by brackets "[]" replaced with your own identifying
17*eb8f03cdSGarrett D'Amore# information: Portions Copyright [yyyy] [name of copyright owner]
18*eb8f03cdSGarrett D'Amore#
19*eb8f03cdSGarrett D'Amore# CDDL HEADER END
20*eb8f03cdSGarrett D'Amore#
21*eb8f03cdSGarrett D'Amore# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
22*eb8f03cdSGarrett D'Amore#
23*eb8f03cdSGarrett D'Amore
24*eb8f03cdSGarrett D'Amore#	Configuration variables for the runtime environment of the nightly
25*eb8f03cdSGarrett D'Amore# build script and other tools for construction and packaging of releases.
26*eb8f03cdSGarrett D'Amore# This script is sourced by 'nightly' and 'bldenv' to set up the environment
27*eb8f03cdSGarrett D'Amore# for the build. This example is suitable for building an OpenSolaris
28*eb8f03cdSGarrett D'Amore# workspace, which will contain the resulting archives. It is based
29*eb8f03cdSGarrett D'Amore# off the onnv release. It sets NIGHTLY_OPTIONS to make nightly do:
30*eb8f03cdSGarrett D'Amore#	DEBUG build only (-D, -F)
31*eb8f03cdSGarrett D'Amore#	do not bringover from the parent (-n)
32*eb8f03cdSGarrett D'Amore#	runs 'make check' (-C)
33*eb8f03cdSGarrett D'Amore#	runs lint in usr/src (-l plus the LINTDIRS variable)
34*eb8f03cdSGarrett D'Amore#	sends mail on completion (-m and the MAILTO variable)
35*eb8f03cdSGarrett D'Amore#	creates packages for PIT/RE (-p)
36*eb8f03cdSGarrett D'Amore#	checks for changes in ELF runpaths (-r)
37*eb8f03cdSGarrett D'Amore#	build and use this workspace's tools in $SRC/tools (-t)
38*eb8f03cdSGarrett D'Amore#
39*eb8f03cdSGarrett D'AmoreNIGHTLY_OPTIONS="-FnCDlmprt";		export NIGHTLY_OPTIONS
40*eb8f03cdSGarrett D'Amore
41*eb8f03cdSGarrett D'Amore# This is a variable for the rest of the script - GATE doesn't matter to
42*eb8f03cdSGarrett D'Amore# nightly itself
43*eb8f03cdSGarrett D'AmoreGATE=testws;			export GATE
44*eb8f03cdSGarrett D'Amore
45*eb8f03cdSGarrett D'Amore# CODEMGR_WS - where is your workspace at (or what should nightly name it)
46*eb8f03cdSGarrett D'AmoreCODEMGR_WS="/export/$GATE";			export CODEMGR_WS
47*eb8f03cdSGarrett D'Amore
48*eb8f03cdSGarrett D'Amore#
49*eb8f03cdSGarrett D'Amore#  The following two macros are the closed/crypto binaries.  Once
50*eb8f03cdSGarrett D'Amore#  Illumos has totally freed itself, we can remove these references.
51*eb8f03cdSGarrett D'Amore#
52*eb8f03cdSGarrett D'Amore# Location of encumbered binaries.
53*eb8f03cdSGarrett D'AmoreON_CLOSED_BINS="$CODEMGR_WS/closed";		export ON_CLOSED_BINS
54*eb8f03cdSGarrett D'Amore# Location of signed cryptographic binaries.
55*eb8f03cdSGarrett D'AmoreON_CRYPTO_BINS="$CODEMGR_WS/on-crypto.$MACH.tar.bz2" export ON_CRYPTO_BINS
56*eb8f03cdSGarrett D'Amore
57*eb8f03cdSGarrett D'Amore
58*eb8f03cdSGarrett D'Amore# Maximum number of dmake jobs.  The recommended number is 2 + (2 *
59*eb8f03cdSGarrett D'Amore# NCPUS), where NCPUS is the number of CPUs on your build system.
60*eb8f03cdSGarrett D'Amoremaxjobs() {
61*eb8f03cdSGarrett D'Amore	ncpu=`/usr/sbin/psrinfo -p`
62*eb8f03cdSGarrett D'Amore	expr $ncpu \* 2 + 2
63*eb8f03cdSGarrett D'Amore}
64*eb8f03cdSGarrett D'AmoreDMAKE_MAX_JOBS=`maxjobs`;			export DMAKE_MAX_JOBS
65*eb8f03cdSGarrett D'Amore
66*eb8f03cdSGarrett D'Amore# path to onbld tool binaries
67*eb8f03cdSGarrett D'AmoreONBLD_BIN="/opt/onbld/bin"
68*eb8f03cdSGarrett D'Amore
69*eb8f03cdSGarrett D'Amore# PARENT_WS is used to determine the parent of this workspace. This is
70*eb8f03cdSGarrett D'Amore# for the options that deal with the parent workspace (such as where the
71*eb8f03cdSGarrett D'Amore# proto area will go).
72*eb8f03cdSGarrett D'AmorePARENT_WS="";			export PARENT_WS
73*eb8f03cdSGarrett D'Amore
74*eb8f03cdSGarrett D'Amore# CLONE_WS is the workspace nightly should do a bringover from.
75*eb8f03cdSGarrett D'AmoreCLONE_WS="http://hg.illumos.org/illumos-gate"
76*eb8f03cdSGarrett D'Amoreexport CLONE_WS
77*eb8f03cdSGarrett D'Amore
78*eb8f03cdSGarrett D'Amore# The bringover, if any, is done as STAFFER.
79*eb8f03cdSGarrett D'Amore# Set STAFFER to your own login as gatekeeper or developer
80*eb8f03cdSGarrett D'Amore# The point is to use group "staff" and avoid referencing the parent
81*eb8f03cdSGarrett D'Amore# workspace as root.
82*eb8f03cdSGarrett D'Amore# Some scripts optionally send mail messages to MAILTO.
83*eb8f03cdSGarrett D'Amore#
84*eb8f03cdSGarrett D'AmoreSTAFFER=nobody;				export STAFFER
85*eb8f03cdSGarrett D'AmoreMAILTO=$STAFFER;			export MAILTO
86*eb8f03cdSGarrett D'Amore
87*eb8f03cdSGarrett D'Amore# The project (see project(4)) under which to run this build.  If not
88*eb8f03cdSGarrett D'Amore# specified, the build is simply run in a new task in the current project.
89*eb8f03cdSGarrett D'AmoreBUILD_PROJECT=;				export BUILD_PROJECT
90*eb8f03cdSGarrett D'Amore
91*eb8f03cdSGarrett D'Amore# You should not need to change the next four lines
92*eb8f03cdSGarrett D'AmoreLOCKNAME="`basename $CODEMGR_WS`_nightly.lock"; export LOCKNAME
93*eb8f03cdSGarrett D'AmoreATLOG="$CODEMGR_WS/log";			export ATLOG
94*eb8f03cdSGarrett D'AmoreLOGFILE="$ATLOG/nightly.log";			export LOGFILE
95*eb8f03cdSGarrett D'AmoreMACH=`uname -p`;				export MACH
96*eb8f03cdSGarrett D'Amore
97*eb8f03cdSGarrett D'Amore# REF_PROTO_LIST - for comparing the list of stuff in your proto area
98*eb8f03cdSGarrett D'Amore# with. Generally this should be left alone, since you want to see differences
99*eb8f03cdSGarrett D'Amore# from your parent (the gate).
100*eb8f03cdSGarrett D'Amore#
101*eb8f03cdSGarrett D'AmoreREF_PROTO_LIST=$PARENT_WS/usr/src/proto_list_${MACH}; export REF_PROTO_LIST
102*eb8f03cdSGarrett D'Amore
103*eb8f03cdSGarrett D'Amore#
104*eb8f03cdSGarrett D'Amore#	build environment variables, including version info for mcs, motd,
105*eb8f03cdSGarrett D'Amore# motd, uname and boot messages. Mostly you shouldn't change this except
106*eb8f03cdSGarrett D'Amore# when the release slips (nah) or you move an environment file to a new
107*eb8f03cdSGarrett D'Amore# release
108*eb8f03cdSGarrett D'Amore#
109*eb8f03cdSGarrett D'AmoreROOT="$CODEMGR_WS/proto/root_${MACH}";	export ROOT
110*eb8f03cdSGarrett D'AmoreSRC="$CODEMGR_WS/usr/src";         	export SRC
111*eb8f03cdSGarrett D'AmoreVERSION="$GATE";			export VERSION
112*eb8f03cdSGarrett D'Amore
113*eb8f03cdSGarrett D'Amore#
114*eb8f03cdSGarrett D'Amore# the RELEASE and RELEASE_DATE variables are set in Makefile.master;
115*eb8f03cdSGarrett D'Amore# there might be special reasons to override them here, but that
116*eb8f03cdSGarrett D'Amore# should not be the case in general
117*eb8f03cdSGarrett D'Amore#
118*eb8f03cdSGarrett D'Amore# RELEASE="5.11";			export RELEASE
119*eb8f03cdSGarrett D'Amore# RELEASE_DATE="October 2007";		export RELEASE_DATE
120*eb8f03cdSGarrett D'Amore
121*eb8f03cdSGarrett D'Amore# proto area in parent for optionally depositing a copy of headers and
122*eb8f03cdSGarrett D'Amore# libraries corresponding to the protolibs target
123*eb8f03cdSGarrett D'Amore# not applicable given the NIGHTLY_OPTIONS
124*eb8f03cdSGarrett D'Amore#
125*eb8f03cdSGarrett D'AmorePARENT_ROOT=$PARENT_WS/proto/root_$MACH; export PARENT_ROOT
126*eb8f03cdSGarrett D'AmorePARENT_TOOLS_ROOT=$PARENT_WS/usr/src/tools/proto/root_$MACH-nd; export PARENT_TOOLS_ROOT
127*eb8f03cdSGarrett D'Amore
128*eb8f03cdSGarrett D'Amore# Package creation variables.  You probably shouldn't change these,
129*eb8f03cdSGarrett D'Amore# either.
130*eb8f03cdSGarrett D'Amore#
131*eb8f03cdSGarrett D'Amore# PKGARCHIVE determines where the repository will be created.
132*eb8f03cdSGarrett D'Amore#
133*eb8f03cdSGarrett D'Amore# PKGPUBLISHER_REDIST controls the publisher setting for the repository.
134*eb8f03cdSGarrett D'Amore#
135*eb8f03cdSGarrett D'AmorePKGARCHIVE="${CODEMGR_WS}/packages/${MACH}/nightly";	export PKGARCHIVE
136*eb8f03cdSGarrett D'Amore# PKGPUBLISHER_REDIST="on-redist";			export PKGPUBLISHER_REDIST
137*eb8f03cdSGarrett D'Amore
138*eb8f03cdSGarrett D'Amore# we want make to do as much as it can, just in case there's more than
139*eb8f03cdSGarrett D'Amore# one problem.
140*eb8f03cdSGarrett D'AmoreMAKEFLAGS=k;	export MAKEFLAGS
141*eb8f03cdSGarrett D'Amore
142*eb8f03cdSGarrett D'Amore# Magic variable to prevent the devpro compilers/teamware from sending
143*eb8f03cdSGarrett D'Amore# mail back to devpro on every use.
144*eb8f03cdSGarrett D'AmoreUT_NO_USAGE_TRACKING="1"; export UT_NO_USAGE_TRACKING
145*eb8f03cdSGarrett D'Amore
146*eb8f03cdSGarrett D'Amore# Build tools - don't change these unless you know what you're doing.  These
147*eb8f03cdSGarrett D'Amore# variables allows you to get the compilers and onbld files locally or
148*eb8f03cdSGarrett D'Amore# through cachefs.  Set BUILD_TOOLS to pull everything from one location.
149*eb8f03cdSGarrett D'Amore# Alternately, you can set ONBLD_TOOLS to where you keep the contents of
150*eb8f03cdSGarrett D'Amore# SUNWonbld and SPRO_ROOT to where you keep the compilers.  SPRO_VROOT
151*eb8f03cdSGarrett D'Amore# exists to make it easier to test new versions of the compiler.
152*eb8f03cdSGarrett D'AmoreBUILD_TOOLS=/opt;				export BUILD_TOOLS
153*eb8f03cdSGarrett D'Amore#ONBLD_TOOLS=/opt/onbld;			export ONBLD_TOOLS
154*eb8f03cdSGarrett D'AmoreSPRO_ROOT=/opt/SUNWspro;			export SPRO_ROOT
155*eb8f03cdSGarrett D'AmoreSPRO_VROOT=$SPRO_ROOT;				export SPRO_VROOT
156*eb8f03cdSGarrett D'Amore
157*eb8f03cdSGarrett D'Amore# This goes along with lint - it is a series of the form "A [y|n]" which
158*eb8f03cdSGarrett D'Amore# means "go to directory A and run 'make lint'" Then mail me (y) the
159*eb8f03cdSGarrett D'Amore# difference in the lint output. 'y' should only be used if the area you're
160*eb8f03cdSGarrett D'Amore# linting is actually lint clean or you'll get lots of mail.
161*eb8f03cdSGarrett D'Amore# You shouldn't need to change this though.
162*eb8f03cdSGarrett D'Amore#LINTDIRS="$SRC y";	export LINTDIRS
163*eb8f03cdSGarrett D'Amore
164*eb8f03cdSGarrett D'Amore# Set this flag to 'n' to disable the automatic validation of the dmake
165*eb8f03cdSGarrett D'Amore# version in use.  The default is to check it.
166*eb8f03cdSGarrett D'Amore#CHECK_DMAKE=y
167*eb8f03cdSGarrett D'Amore
168*eb8f03cdSGarrett D'Amore# Set this flag to 'n' to disable the use of 'checkpaths'.  The default,
169*eb8f03cdSGarrett D'Amore# if the 'N' option is not specified, is to run this test.
170*eb8f03cdSGarrett D'Amore#CHECK_PATHS=y
171*eb8f03cdSGarrett D'Amore
172*eb8f03cdSGarrett D'Amore# POST_NIGHTLY can be any command to be run at the end of nightly.  See
173*eb8f03cdSGarrett D'Amore# nightly(1) for interactions between environment variables and this command.
174*eb8f03cdSGarrett D'Amore#POST_NIGHTLY=
175