5092 env files don't need to define LOCKNAME by default
[unleashed.git] / usr / src / tools / env / illumos.sh
blobecfec4d7955c5d9d27ec3fa814164905a253f91d
2 # CDDL HEADER START
4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 # or http://www.opensolaris.org/os/licensing.
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
19 # CDDL HEADER END
21 # Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
22 # Copyright 2010, 2011 Nexenta Systems, Inc. All rights reserved.
23 # Copyright 2012 Joshua M. Clulow <josh@sysmgr.org>
26 # Configuration variables for the runtime environment of the nightly
27 # build script and other tools for construction and packaging of
28 # releases.
29 # This example is suitable for building an illumos workspace, which
30 # will contain the resulting archives. It is based off the onnv
31 # release. It sets NIGHTLY_OPTIONS to make nightly do:
32 # DEBUG build only (-D, -F)
33 # do not bringover from the parent (-n)
34 # runs 'make check' (-C)
35 # checks for new interfaces in libraries (-A)
36 # runs lint in usr/src (-l plus the LINTDIRS variable)
37 # sends mail on completion (-m and the MAILTO variable)
38 # creates packages for PIT/RE (-p)
39 # checks for changes in ELF runpaths (-r)
40 # build and use this workspace's tools in $SRC/tools (-t)
42 # - This file is sourced by "bldenv.sh" and "nightly.sh" and should not
43 # be executed directly.
44 # - This script is only interpreted by ksh93 and explicitly allows the
45 # use of ksh93 language extensions.
47 export NIGHTLY_OPTIONS='-FnCDAlmprt'
50 # -- PLEASE READ THIS --
52 # The variables GATE and CODEMGR_WS must always be customised to
53 # match your workspace/gate location!!
55 # -- PLEASE READ THIS --
58 # This is a variable for the rest of the script - GATE doesn't matter to
59 # nightly itself
60 export GATE='testws'
62 # CODEMGR_WS - where is your workspace at (or what should nightly name it)
63 export CODEMGR_WS="$HOME/ws/$GATE"
65 # Maximum number of dmake jobs. The recommended number is 2 + NCPUS,
66 # where NCPUS is the number of logical CPUs on your build system.
67 function maxjobs
69 nameref maxjobs=$1
70 integer ncpu
71 integer -r min_mem_per_job=512 # minimum amount of memory for a job
73 ncpu=$(builtin getconf ; getconf 'NPROCESSORS_ONLN')
74 (( maxjobs=ncpu + 2 ))
76 # Throttle number of parallel jobs launched by dmake to a value which
77 # gurantees that all jobs have enough memory. This was added to avoid
78 # excessive paging/swapping in cases of virtual machine installations
79 # which have lots of CPUs but not enough memory assigned to handle
80 # that many parallel jobs
81 if [[ $(/usr/sbin/prtconf 2>'/dev/null') == ~(E)Memory\ size:\ ([[:digit:]]+)\ Megabytes ]] ; then
82 integer max_jobs_per_memory # parallel jobs which fit into physical memory
83 integer physical_memory # physical memory installed
85 # The array ".sh.match" contains the contents of capturing
86 # brackets in the last regex, .sh.match[1] will contain
87 # the value matched by ([[:digit:]]+), i.e. the amount of
88 # memory installed
89 physical_memory="10#${.sh.match[1]}"
92 max_jobs_per_memory=round(physical_memory/min_mem_per_job) ,
93 maxjobs=fmax(2, fmin(maxjobs, max_jobs_per_memory))
97 return 0
100 maxjobs DMAKE_MAX_JOBS # "DMAKE_MAX_JOBS" passed as ksh(1) name reference
101 export DMAKE_MAX_JOBS
103 # path to onbld tool binaries
104 ONBLD_BIN='/opt/onbld/bin'
106 # PARENT_WS is used to determine the parent of this workspace. This is
107 # for the options that deal with the parent workspace (such as where the
108 # proto area will go).
109 export PARENT_WS=''
111 # CLONE_WS is the workspace nightly should do a bringover from.
112 export CLONE_WS='ssh://anonhg@hg.illumos.org/illumos-gate'
114 # The bringover, if any, is done as STAFFER.
115 # Set STAFFER to your own login as gatekeeper or developer
116 # The point is to use group "staff" and avoid referencing the parent
117 # workspace as root.
118 # Some scripts optionally send mail messages to MAILTO.
120 export STAFFER="$LOGNAME"
121 export MAILTO="$STAFFER"
123 # If you wish the mail messages to be From: an arbitrary address, export
124 # MAILFROM.
125 #export MAILFROM="user@example.com"
127 # The project (see project(4)) under which to run this build. If not
128 # specified, the build is simply run in a new task in the current project.
129 export BUILD_PROJECT=''
131 # You should not need to change the next three lines
132 export ATLOG="$CODEMGR_WS/log"
133 export LOGFILE="$ATLOG/nightly.log"
134 export MACH="$(uname -p)"
137 # The following two macros are the closed/crypto binaries. Once
138 # Illumos has totally freed itself, we can remove these references.
140 # Location of encumbered binaries.
141 export ON_CLOSED_BINS="$CODEMGR_WS/closed"
142 # Location of signed cryptographic binaries.
143 export ON_CRYPTO_BINS="$CODEMGR_WS/on-crypto.$MACH.tar.bz2"
145 # REF_PROTO_LIST - for comparing the list of stuff in your proto area
146 # with. Generally this should be left alone, since you want to see differences
147 # from your parent (the gate).
149 export REF_PROTO_LIST="$PARENT_WS/usr/src/proto_list_${MACH}"
152 export ROOT="$CODEMGR_WS/proto/root_${MACH}"
153 export SRC="$CODEMGR_WS/usr/src"
154 export MULTI_PROTO="no"
157 # build environment variables, including version info for mcs, motd,
158 # motd, uname and boot messages. Mostly you shouldn't change this except
159 # when the release slips (nah) or you move an environment file to a new
160 # release
162 export VERSION="$GATE"
165 # the RELEASE and RELEASE_DATE variables are set in Makefile.master;
166 # there might be special reasons to override them here, but that
167 # should not be the case in general
169 # export RELEASE='5.11'
170 # export RELEASE_DATE='October 2007'
172 # proto area in parent for optionally depositing a copy of headers and
173 # libraries corresponding to the protolibs target
174 # not applicable given the NIGHTLY_OPTIONS
176 export PARENT_ROOT="$PARENT_WS/proto/root_$MACH"
177 export PARENT_TOOLS_ROOT="$PARENT_WS/usr/src/tools/proto/root_$MACH-nd"
179 # Package creation variables. You probably shouldn't change these,
180 # either.
182 # PKGARCHIVE determines where the repository will be created.
184 # PKGPUBLISHER_REDIST controls the publisher setting for the repository.
186 export PKGARCHIVE="${CODEMGR_WS}/packages/${MACH}/nightly"
187 # export PKGPUBLISHER_REDIST='on-redist'
189 # Package manifest format version.
190 export PKGFMT_OUTPUT='v1'
192 # we want make to do as much as it can, just in case there's more than
193 # one problem.
194 export MAKEFLAGS='k'
196 # Magic variable to prevent the devpro compilers/teamware from sending
197 # mail back to devpro on every use.
198 export UT_NO_USAGE_TRACKING='1'
200 # Build tools - don't change these unless you know what you're doing. These
201 # variables allows you to get the compilers and onbld files locally or
202 # through cachefs. Set BUILD_TOOLS to pull everything from one location.
203 # Alternately, you can set ONBLD_TOOLS to where you keep the contents of
204 # SUNWonbld and SPRO_ROOT to where you keep the compilers. SPRO_VROOT
205 # exists to make it easier to test new versions of the compiler.
206 export BUILD_TOOLS='/opt'
207 #export ONBLD_TOOLS='/opt/onbld'
208 export SPRO_ROOT='/opt/SUNWspro'
209 export SPRO_VROOT="$SPRO_ROOT"
211 # This goes along with lint - it is a series of the form "A [y|n]" which
212 # means "go to directory A and run 'make lint'" Then mail me (y) the
213 # difference in the lint output. 'y' should only be used if the area you're
214 # linting is actually lint clean or you'll get lots of mail.
215 # You shouldn't need to change this though.
216 #export LINTDIRS="$SRC y"
218 # Set this flag to 'n' to disable the automatic validation of the dmake
219 # version in use. The default is to check it.
220 #CHECK_DMAKE='y'
222 # Set this flag to 'n' to disable the use of 'checkpaths'. The default,
223 # if the 'N' option is not specified, is to run this test.
224 #CHECK_PATHS='y'
226 # POST_NIGHTLY can be any command to be run at the end of nightly. See
227 # nightly(1) for interactions between environment variables and this command.
228 #POST_NIGHTLY=
230 # Uncomment this to disable support for SMB printing.
231 # export ENABLE_SMB_PRINTING='#'