Print this page
11462 enable smatch by default
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/tools/env/illumos.sh
+++ new/usr/src/tools/env/illumos.sh
1 1 #
2 2 # CDDL HEADER START
3 3 #
4 4 # The contents of this file are subject to the terms of the
5 5 # Common Development and Distribution License (the "License").
6 6 # You may not use this file except in compliance with the License.
7 7 #
8 8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 # or http://www.opensolaris.org/os/licensing.
10 10 # See the License for the specific language governing permissions
11 11 # and limitations under the License.
12 12 #
13 13 # When distributing Covered Code, include this CDDL HEADER in each
14 14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 # If applicable, add the following below this CDDL HEADER, with the
16 16 # fields enclosed by brackets "[]" replaced with your own identifying
17 17 # information: Portions Copyright [yyyy] [name of copyright owner]
18 18 #
19 19 # CDDL HEADER END
20 20 #
21 21 # Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
22 22 # Copyright 2015 Nexenta Systems, Inc. All rights reserved.
23 23 # Copyright 2012 Joshua M. Clulow <josh@sysmgr.org>
24 24 # Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved.
25 25 # Copyright 2018 OmniOS Community Edition (OmniOSce) Association.
26 26 # Copyright 2019, Joyent, Inc.
27 27 #
28 28 # - This file is sourced by "bldenv.sh" and "nightly.sh" and should not
29 29 # be executed directly.
30 30 # - This script is only interpreted by ksh93 and explicitly allows the
31 31 # use of ksh93 language extensions.
32 32
33 33
34 34 # -----------------------------------------------------------------------------
35 35 # Parameters you are likely to want to change
36 36 # -----------------------------------------------------------------------------
37 37
38 38 # DEBUG build only (-D, -F)
39 39 # do not bringover from the parent (-n)
40 40 # runs 'make check' (-C)
41 41 # checks for new interfaces in libraries (-A)
42 42 # sends mail on completion (-m and the MAILTO variable)
43 43 # creates packages for PIT/RE (-p)
44 44 # checks for changes in ELF runpaths (-r)
45 45 # build and use this workspace's tools in $SRC/tools (-t)
46 46 export NIGHTLY_OPTIONS='-FnCDAmprt'
47 47
48 48 # Some scripts optionally send mail messages to MAILTO.
49 49 #export MAILTO=
50 50
51 51 # CODEMGR_WS - where is your workspace at
52 52 export CODEMGR_WS="`git rev-parse --show-toplevel`"
53 53
54 54 # Compilers may be specified using the following variables:
55 55 # PRIMARY_CC - primary C compiler
56 56 # PRIMARY_CCC - primary C++ compiler
57 57 #
58 58 # SHADOW_CCS - list of shadow C compilers
59 59 # SHADOW_CCCS - list of shadow C++ compilers
60 60 #
61 61 # Each entry has the form <name>,<path to binary>,<style> where name is a
62 62 # free-form name (possibly used in the makefiles to guard options), path is
63 63 # the path to the executable. style is the 'style' of command line taken by
64 64 # the compiler, currently either gnu (or gcc) or sun (or cc), which is also
65 65 # used by Makefiles to guard options.
66 66 #
67 67 # __SUNC and __GNUC must still be set to reflect the style of the primary
68 68 # compiler (and to influence the default primary, otherwise)
69 69 #
70 70 # for example:
71 71 # export PRIMARY_CC=gcc4,/opt/gcc/4.4.4/bin/gcc,gnu
72 72 # export PRIMARY_CCC=gcc4,/opt/gcc/4.4.4/bin/g++,gnu
73 73 # export SHADOW_CCS=studio12,/opt/SUNWspro/bin/cc,sun
74 74 # export SHADOW_CCCS=studio12,/opt/SUNWspro/bin/CC,sun
75 75 #
76 76 # There can be several space-separated entries in SHADOW_* to run multiple
↓ open down ↓ |
76 lines elided |
↑ open up ↑ |
77 77 # shadow compilers.
78 78 #
79 79 # To disable shadow compilation, unset SHADOW_* or set them to the empty string.
80 80 #
81 81 export GNUC_ROOT=/usr/gcc/7
82 82 export PRIMARY_CCS=gcc7,$GNUC_ROOT/bin/gcc,gnu
83 83 export PRIMARY_CCCS=gcc7,$GNUC_ROOT/bin/g++,gnu
84 84 export SHADOW_CCS=gcc4,/opt/gcc/4.4.4/bin/gcc,gnu
85 85 export SHADOW_CCCS=gcc4,/opt/gcc/4.4.4/bin/g++,gnu
86 86
87 -# uncomment to enable smatch
88 -#export ENABLE_SMATCH=1
87 +# comment to disable smatch
88 +export ENABLE_SMATCH=1
89 89
90 90 # Comment this out to disable support for SMB printing, i.e. if you
91 91 # don't want to bother providing the CUPS headers this needs.
92 92 export ENABLE_SMB_PRINTING=
93 93
94 94 # If your distro uses certain versions of Perl, make sure either Makefile.master
95 95 # contains your new defaults OR your .env file sets them.
96 96 # These are how you would override for building on OmniOS r151028, for example.
97 97 #export PERL_VERSION=5.28
98 98 #export PERL_ARCH=i86pc-solaris-thread-multi-64int
99 99 #export PERL_PKGVERS=
100 100
101 101 # If your distro uses certain versions of Python, make sure either
102 102 # Makefile.master contains your new defaults OR your .env file sets them.
103 103 #export PYTHON_VERSION=2.7
104 104 #export PYTHON_PKGVERS=-27
105 105 #export PYTHON_SUFFIX=
106 106 #export PYTHON3_VERSION=3.5
107 107 #export PYTHON3_PKGVERS=-35
108 108 #export PYTHON3_SUFFIX=m
109 109
110 110 # To disable building with either Python2 or Python 3 (or both), uncomment
111 111 # these lines:
112 112 #export BUILDPY2='#'
113 113 #export BUILDPY3='#'
114 114
115 115 # Set console color scheme either by build type:
116 116 #
117 117 #export RELEASE_CONSOLE_COLOR="-DDEFAULT_ANSI_FOREGROUND=ANSI_COLOR_BLACK \
118 118 # -DDEFAULT_ANSI_BACKGROUND=ANSI_COLOR_WHITE"
119 119 #
120 120 #export DEBUG_CONSOLE_COLOR="-DDEFAULT_ANSI_FOREGROUND=ANSI_COLOR_RED \
121 121 # -DDEFAULT_ANSI_BACKGROUND=ANSI_COLOR_WHITE"
122 122 #
123 123 # or just one for any build type:
124 124 #
125 125 #export DEFAULT_CONSOLE_COLOR="-DDEFAULT_ANSI_FOREGROUND=ANSI_COLOR_BLACK \
126 126 # -DDEFAULT_ANSI_BACKGROUND=ANSI_COLOR_WHITE"
127 127
128 128 # Set if your distribution has different package versioning
129 129 #export PKGVERS_BRANCH=2018.0.0.17900
130 130
131 131 # Skip Java 8 builds on distributions that don't support it
132 132 #export BLD_JAVA_8=
133 133
134 134 # POST_NIGHTLY can be any command to be run at the end of nightly. See
135 135 # nightly(1) for interactions between environment variables and this command.
136 136 #POST_NIGHTLY=
137 137
138 138 # -----------------------------------------------------------------------------
139 139 # You are less likely to need to modify parameters below.
140 140 # -----------------------------------------------------------------------------
141 141
142 142 # Maximum number of dmake jobs. The recommended number is 2 + NCPUS,
143 143 # where NCPUS is the number of logical CPUs on your build system.
144 144 function maxjobs
145 145 {
146 146 nameref maxjobs=$1
147 147 integer ncpu
148 148 integer -r min_mem_per_job=512 # minimum amount of memory for a job
149 149
150 150 ncpu=$(builtin getconf ; getconf 'NPROCESSORS_ONLN')
151 151 (( maxjobs=ncpu + 2 ))
152 152
153 153 # Throttle number of parallel jobs launched by dmake to a value which
154 154 # gurantees that all jobs have enough memory. This was added to avoid
155 155 # excessive paging/swapping in cases of virtual machine installations
156 156 # which have lots of CPUs but not enough memory assigned to handle
157 157 # that many parallel jobs
158 158 if [[ $(/usr/sbin/prtconf 2>'/dev/null') == ~(E)Memory\ size:\ ([[:digit:]]+)\ Megabytes ]] ; then
159 159 integer max_jobs_per_memory # parallel jobs which fit into physical memory
160 160 integer physical_memory # physical memory installed
161 161
162 162 # The array ".sh.match" contains the contents of capturing
163 163 # brackets in the last regex, .sh.match[1] will contain
164 164 # the value matched by ([[:digit:]]+), i.e. the amount of
165 165 # memory installed
166 166 physical_memory="10#${.sh.match[1]}"
167 167
168 168 ((
169 169 max_jobs_per_memory=round(physical_memory/min_mem_per_job) ,
170 170 maxjobs=fmax(2, fmin(maxjobs, max_jobs_per_memory))
171 171 ))
172 172 fi
173 173
174 174 return 0
175 175 }
176 176
177 177 maxjobs DMAKE_MAX_JOBS # "DMAKE_MAX_JOBS" passed as ksh(1) name reference
178 178 export DMAKE_MAX_JOBS
179 179
180 180 # path to onbld tool binaries
181 181 ONBLD_BIN='/opt/onbld/bin'
182 182
183 183 # PARENT_WS is used to determine the parent of this workspace. This is
184 184 # for the options that deal with the parent workspace (such as where the
185 185 # proto area will go).
186 186 export PARENT_WS=''
187 187
188 188 # CLONE_WS is the workspace nightly should do a bringover from.
189 189 # The bringover, if any, is done as STAFFER.
190 190 export CLONE_WS='ssh://anonhg@hg.illumos.org/illumos-gate'
191 191
192 192 # Set STAFFER to your own login as gatekeeper or developer
193 193 # The point is to use group "staff" and avoid referencing the parent
194 194 # workspace as root.
195 195 export STAFFER="$LOGNAME"
196 196 export MAILTO="${MAILTO:-$STAFFER}"
197 197
198 198 # If you wish the mail messages to be From: an arbitrary address, export
199 199 # MAILFROM.
200 200 #export MAILFROM="user@example.com"
201 201
202 202 # The project (see project(4)) under which to run this build. If not
203 203 # specified, the build is simply run in a new task in the current project.
204 204 export BUILD_PROJECT=''
205 205
206 206 # You should not need to change the next three lines
207 207 export ATLOG="$CODEMGR_WS/log"
208 208 export LOGFILE="$ATLOG/nightly.log"
209 209 export MACH="$(uname -p)"
210 210
211 211 #
212 212 # The following macro points to the closed binaries. Once illumos has
213 213 # totally freed itself, we can remove this reference.
214 214 #
215 215 # Location of encumbered binaries.
216 216 export ON_CLOSED_BINS="$CODEMGR_WS/closed"
217 217
218 218 # REF_PROTO_LIST - for comparing the list of stuff in your proto area
219 219 # with. Generally this should be left alone, since you want to see differences
220 220 # from your parent (the gate).
221 221 #
222 222 export REF_PROTO_LIST="$PARENT_WS/usr/src/proto_list_${MACH}"
223 223
224 224
225 225 export ROOT="$CODEMGR_WS/proto/root_${MACH}"
226 226 export SRC="$CODEMGR_WS/usr/src"
227 227 export MULTI_PROTO="no"
228 228
229 229 #
230 230 # build environment variables, including version info for mcs, motd,
231 231 # motd, uname and boot messages. Mostly you shouldn't change this except
232 232 # when the release slips (nah) or you move an environment file to a new
233 233 # release
234 234 #
235 235 export VERSION="`git describe --long --all HEAD | cut -d/ -f2-`"
236 236
237 237 #
238 238 # the RELEASE and RELEASE_DATE variables are set in Makefile.master;
239 239 # there might be special reasons to override them here, but that
240 240 # should not be the case in general
241 241 #
242 242 # export RELEASE='5.11'
243 243 # export RELEASE_DATE='October 2007'
244 244
245 245 # proto area in parent for optionally depositing a copy of headers and
246 246 # libraries corresponding to the protolibs target
247 247 # not applicable given the NIGHTLY_OPTIONS
248 248 #
249 249 export PARENT_ROOT="$PARENT_WS/proto/root_$MACH"
250 250 export PARENT_TOOLS_ROOT="$PARENT_WS/usr/src/tools/proto/root_$MACH-nd"
251 251
252 252 # Package creation variables. You probably shouldn't change these,
253 253 # either.
254 254 #
255 255 # PKGARCHIVE determines where the repository will be created.
256 256 #
257 257 # PKGPUBLISHER_REDIST controls the publisher setting for the repository.
258 258 #
259 259 export PKGARCHIVE="${CODEMGR_WS}/packages/${MACH}/nightly"
260 260 # export PKGPUBLISHER_REDIST='on-redist'
261 261
262 262 # Package manifest format version.
263 263 export PKGFMT_OUTPUT='v1'
264 264
265 265 # we want make to do as much as it can, just in case there's more than
266 266 # one problem.
267 267 export MAKEFLAGS='k'
268 268
269 269 # Magic variables to prevent the devpro compilers/teamware from checking
270 270 # for updates or sending mail back to devpro on every use.
271 271 export SUNW_NO_UPDATE_NOTIFY='1'
272 272 export UT_NO_USAGE_TRACKING='1'
273 273
274 274 # Build tools - don't change these unless you know what you're doing. These
275 275 # variables allows you to get the compilers and onbld files locally.
276 276 # Set BUILD_TOOLS to pull everything from one location.
277 277 # Alternately, you can set ONBLD_TOOLS to where you keep the contents of
278 278 # SUNWonbld and SPRO_ROOT to where you keep the compilers. SPRO_VROOT
279 279 # exists to make it easier to test new versions of the compiler.
280 280 export BUILD_TOOLS='/opt'
281 281 #export ONBLD_TOOLS='/opt/onbld'
282 282 export SPRO_ROOT='/opt/SUNWspro'
283 283 export SPRO_VROOT="$SPRO_ROOT"
284 284
285 285 # Set this flag to 'n' to disable the use of 'checkpaths'. The default,
286 286 # if the 'N' option is not specified, is to run this test.
287 287 #CHECK_PATHS='y'
288 288
289 289 if [[ "$ENABLE_SMATCH" = "1" ]]; then
290 290 SMATCHBIN=$CODEMGR_WS/usr/src/tools/proto/root_$MACH-nd/opt/onbld/bin/$MACH/smatch
291 291 export SHADOW_CCS="$SHADOW_CCS smatch,$SMATCHBIN,smatch"
292 292 fi
↓ open down ↓ |
194 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX