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