Print this page
10063 basic support for smatch
10153 checkpaths shouldn't check packaging exceptions
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 (c) 2018, 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
↓ open down ↓ |
73 lines elided |
↑ open up ↑ |
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
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 SHADOW_CCS=gcc7,/usr/gcc/7/bin/gcc,gnu
82 82 export SHADOW_CCCS=gcc7,/usr/gcc/7/bin/g++,gnu
83 83
84 +# uncomment to enable smatch
85 +#export ENABLE_SMATCH=1
86 +
84 87 # Comment this out to disable support for SMB printing, i.e. if you
85 88 # don't want to bother providing the CUPS headers this needs.
86 89 export ENABLE_SMB_PRINTING=
87 90
88 91 # If your distro uses certain versions of Perl, make sure either Makefile.master
89 92 # contains your new defaults OR your .env file sets them.
90 93 # These are how you would override for building on OmniOS r151028, for example.
91 94 #export PERL_VERSION=5.28
92 95 #export PERL_ARCH=i86pc-solaris-thread-multi-64int
93 96 #export PERL_PKGVERS=
94 97
95 98 # If your distro uses certain versions of Python, make sure either
96 99 # Makefile.master contains your new defaults OR your .env file sets them.
97 100 #export PYTHON_VERSION=2.7
98 101 #export PYTHON_PKGVERS=-27
99 102 #export PYTHON_SUFFIX=
100 103 #export PYTHON3_VERSION=3.5
101 104 #export PYTHON3_PKGVERS=-35
102 105 #export PYTHON3_SUFFIX=m
103 106
104 107 # To disable building with either Python2 or Python 3 (or both), uncomment
105 108 # these lines:
106 109 #export BUILDPY2='#'
107 110 #export BUILDPY3='#'
108 111
109 112 # Set if your distribution has different package versioning
110 113 #export PKGVERS_BRANCH=2018.0.0.17900
111 114
112 115 # Skip Java 8 builds on distributions that don't support it
113 116 #export BLD_JAVA_8=
114 117
115 118 # POST_NIGHTLY can be any command to be run at the end of nightly. See
116 119 # nightly(1) for interactions between environment variables and this command.
117 120 #POST_NIGHTLY=
118 121
119 122 # -----------------------------------------------------------------------------
120 123 # You are less likely to need to modify parameters below.
121 124 # -----------------------------------------------------------------------------
122 125
123 126 # Maximum number of dmake jobs. The recommended number is 2 + NCPUS,
124 127 # where NCPUS is the number of logical CPUs on your build system.
125 128 function maxjobs
126 129 {
127 130 nameref maxjobs=$1
128 131 integer ncpu
129 132 integer -r min_mem_per_job=512 # minimum amount of memory for a job
130 133
131 134 ncpu=$(builtin getconf ; getconf 'NPROCESSORS_ONLN')
132 135 (( maxjobs=ncpu + 2 ))
133 136
134 137 # Throttle number of parallel jobs launched by dmake to a value which
135 138 # gurantees that all jobs have enough memory. This was added to avoid
136 139 # excessive paging/swapping in cases of virtual machine installations
137 140 # which have lots of CPUs but not enough memory assigned to handle
138 141 # that many parallel jobs
139 142 if [[ $(/usr/sbin/prtconf 2>'/dev/null') == ~(E)Memory\ size:\ ([[:digit:]]+)\ Megabytes ]] ; then
140 143 integer max_jobs_per_memory # parallel jobs which fit into physical memory
141 144 integer physical_memory # physical memory installed
142 145
143 146 # The array ".sh.match" contains the contents of capturing
144 147 # brackets in the last regex, .sh.match[1] will contain
145 148 # the value matched by ([[:digit:]]+), i.e. the amount of
146 149 # memory installed
147 150 physical_memory="10#${.sh.match[1]}"
148 151
149 152 ((
150 153 max_jobs_per_memory=round(physical_memory/min_mem_per_job) ,
151 154 maxjobs=fmax(2, fmin(maxjobs, max_jobs_per_memory))
152 155 ))
153 156 fi
154 157
155 158 return 0
156 159 }
157 160
158 161 maxjobs DMAKE_MAX_JOBS # "DMAKE_MAX_JOBS" passed as ksh(1) name reference
159 162 export DMAKE_MAX_JOBS
160 163
161 164 # path to onbld tool binaries
162 165 ONBLD_BIN='/opt/onbld/bin'
163 166
164 167 # PARENT_WS is used to determine the parent of this workspace. This is
165 168 # for the options that deal with the parent workspace (such as where the
166 169 # proto area will go).
167 170 export PARENT_WS=''
168 171
169 172 # CLONE_WS is the workspace nightly should do a bringover from.
170 173 # The bringover, if any, is done as STAFFER.
171 174 export CLONE_WS='ssh://anonhg@hg.illumos.org/illumos-gate'
172 175
173 176 # Set STAFFER to your own login as gatekeeper or developer
174 177 # The point is to use group "staff" and avoid referencing the parent
175 178 # workspace as root.
176 179 export STAFFER="$LOGNAME"
177 180 export MAILTO="${MAILTO:-$STAFFER}"
178 181
179 182 # If you wish the mail messages to be From: an arbitrary address, export
180 183 # MAILFROM.
181 184 #export MAILFROM="user@example.com"
182 185
183 186 # The project (see project(4)) under which to run this build. If not
184 187 # specified, the build is simply run in a new task in the current project.
185 188 export BUILD_PROJECT=''
186 189
187 190 # You should not need to change the next three lines
188 191 export ATLOG="$CODEMGR_WS/log"
189 192 export LOGFILE="$ATLOG/nightly.log"
190 193 export MACH="$(uname -p)"
191 194
192 195 #
193 196 # The following macro points to the closed binaries. Once illumos has
194 197 # totally freed itself, we can remove this reference.
195 198 #
196 199 # Location of encumbered binaries.
197 200 export ON_CLOSED_BINS="$CODEMGR_WS/closed"
198 201
199 202 # REF_PROTO_LIST - for comparing the list of stuff in your proto area
200 203 # with. Generally this should be left alone, since you want to see differences
201 204 # from your parent (the gate).
202 205 #
203 206 export REF_PROTO_LIST="$PARENT_WS/usr/src/proto_list_${MACH}"
204 207
205 208
206 209 export ROOT="$CODEMGR_WS/proto/root_${MACH}"
207 210 export SRC="$CODEMGR_WS/usr/src"
208 211 export MULTI_PROTO="no"
209 212
210 213 #
211 214 # build environment variables, including version info for mcs, motd,
212 215 # motd, uname and boot messages. Mostly you shouldn't change this except
213 216 # when the release slips (nah) or you move an environment file to a new
214 217 # release
215 218 #
216 219 export VERSION="`git describe --long --all HEAD | cut -d/ -f2-`"
217 220
218 221 #
219 222 # the RELEASE and RELEASE_DATE variables are set in Makefile.master;
220 223 # there might be special reasons to override them here, but that
221 224 # should not be the case in general
222 225 #
223 226 # export RELEASE='5.11'
224 227 # export RELEASE_DATE='October 2007'
225 228
226 229 # proto area in parent for optionally depositing a copy of headers and
227 230 # libraries corresponding to the protolibs target
228 231 # not applicable given the NIGHTLY_OPTIONS
229 232 #
230 233 export PARENT_ROOT="$PARENT_WS/proto/root_$MACH"
231 234 export PARENT_TOOLS_ROOT="$PARENT_WS/usr/src/tools/proto/root_$MACH-nd"
232 235
233 236 # Package creation variables. You probably shouldn't change these,
234 237 # either.
235 238 #
236 239 # PKGARCHIVE determines where the repository will be created.
237 240 #
238 241 # PKGPUBLISHER_REDIST controls the publisher setting for the repository.
239 242 #
240 243 export PKGARCHIVE="${CODEMGR_WS}/packages/${MACH}/nightly"
241 244 # export PKGPUBLISHER_REDIST='on-redist'
242 245
243 246 # Package manifest format version.
244 247 export PKGFMT_OUTPUT='v1'
245 248
246 249 # we want make to do as much as it can, just in case there's more than
247 250 # one problem.
248 251 export MAKEFLAGS='k'
249 252
250 253 # Magic variables to prevent the devpro compilers/teamware from checking
251 254 # for updates or sending mail back to devpro on every use.
252 255 export SUNW_NO_UPDATE_NOTIFY='1'
253 256 export UT_NO_USAGE_TRACKING='1'
254 257
255 258 # Build tools - don't change these unless you know what you're doing. These
256 259 # variables allows you to get the compilers and onbld files locally.
257 260 # Set BUILD_TOOLS to pull everything from one location.
258 261 # Alternately, you can set ONBLD_TOOLS to where you keep the contents of
259 262 # SUNWonbld and SPRO_ROOT to where you keep the compilers. SPRO_VROOT
260 263 # exists to make it easier to test new versions of the compiler.
261 264 export BUILD_TOOLS='/opt'
262 265 #export ONBLD_TOOLS='/opt/onbld'
263 266 export SPRO_ROOT='/opt/SUNWspro'
264 267 export SPRO_VROOT="$SPRO_ROOT"
265 268
↓ open down ↓ |
172 lines elided |
↑ open up ↑ |
266 269 # This goes along with lint - it is a series of the form "A [y|n]" which
267 270 # means "go to directory A and run 'make lint'" Then mail me (y) the
268 271 # difference in the lint output. 'y' should only be used if the area you're
269 272 # linting is actually lint clean or you'll get lots of mail.
270 273 # You shouldn't need to change this though.
271 274 #export LINTDIRS="$SRC y"
272 275
273 276 # Set this flag to 'n' to disable the use of 'checkpaths'. The default,
274 277 # if the 'N' option is not specified, is to run this test.
275 278 #CHECK_PATHS='y'
279 +
280 +if [[ "$ENABLE_SMATCH" = "1" ]]; then
281 + SMATCHBIN=$CODEMGR_WS/usr/src/tools/proto/root_$MACH-nd/opt/onbld/bin/$MACH/smatch
282 + export SHADOW_CCS="$SHADOW_CCS smatch,$SMATCHBIN,smatch"
283 +fi
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX