1 #
   2 # CDDL HEADER START
   3 #
   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.
   7 #
   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.
  12 #
  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]
  18 #
  19 # CDDL HEADER END
  20 #
  21 
  22 #
  23 # Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  24 # Copyright 2012 Joshua M. Clulow <josh@sysmgr.org>
  25 # Copyright 2017 Nexenta Systems, Inc.
  26 #
  27 
  28 # Configuration variables for the runtime environment of the nightly
  29 # build script and other tools for construction and packaging of
  30 # releases.
  31 # This example is suitable for developer builds of nza-kernel.
  32 # It sets NIGHTLY_OPTIONS to make nightly do:
  33 #       DEBUG build only (-D, -F)
  34 #       do not bringover from the parent (-n)
  35 #       runs 'make check' (-C)
  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)
  41 #
  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.
  46 #
  47 export NIGHTLY_OPTIONS='-FCDlnprt'
  48 
  49 # CODEMGR_WS - where is your workspace (or what should nightly name it)
  50 export CODEMGR_WS=`git rev-parse --show-toplevel`
  51 
  52 # This is a variable for the rest of the script - GATE doesn't matter to
  53 # nightly itself.
  54 GATE=`basename ${CODEMGR_WS}`
  55 
  56 # Maximum number of dmake jobs.  The recommended number is 2 + NCPUS,
  57 # where NCPUS is the number of logical CPUs on your build system.
  58 # export DMAKE_MAX_JOBS=4  (use default from $HOME/.make.machines)
  59 
  60 # PARENT_WS is used to determine the parent of this workspace. This is
  61 # for the options that deal with the parent workspace (such as where the
  62 # proto area will go).
  63 export PARENT_WS=''
  64 
  65 # CLONE_WS is the workspace nightly should do a bringover from.
  66 export CLONE_WS=''
  67 
  68 # The bringover, if any, is done as STAFFER.
  69 # Set STAFFER to your own login as gatekeeper or developer
  70 # The point is to use group "staff" and avoid referencing the parent
  71 # workspace as root.
  72 # Some scripts optionally send mail messages to MAILTO.
  73 #
  74 export STAFFER="$LOGNAME"
  75 export MAILTO="$STAFFER"
  76 
  77 # If you wish the mail messages to be From: an arbitrary address, export
  78 # MAILFROM.
  79 #export MAILFROM="user@example.com"
  80 
  81 # The project (see project(4)) under which to run this build.  If not
  82 # specified, the build is simply run in a new task in the current project.
  83 export BUILD_PROJECT=''
  84 
  85 # You should not need to change the next three lines
  86 export ATLOG="$CODEMGR_WS/log"
  87 export LOGFILE="$ATLOG/nightly.log"
  88 export MACH="$(uname -p)"
  89 
  90 #
  91 #  The following macro points to the closed binaries.  Once illumos has
  92 #  totally freed itself, we can remove this reference.
  93 #
  94 # Location of encumbered binaries.
  95 if [ -d /opt/onbld/closed ]; then
  96         export ON_CLOSED_BINS="/opt/onbld/closed"
  97 else
  98         export ON_CLOSED_BINS="$CODEMGR_WS/closed"
  99 fi
 100 
 101 #
 102 # REF_PROTO_LIST - for comparing the list of stuff in your proto area
 103 # with. Generally this should be left alone, since you want to see differences
 104 # from your parent (the gate).
 105 #
 106 export REF_PROTO_LIST="$PARENT_WS/usr/src/proto_list_${MACH}"
 107 
 108 export ROOT="$CODEMGR_WS/proto/root_${MACH}"
 109 export SRC="$CODEMGR_WS/usr/src"
 110 export MULTI_PROTO="no"
 111 
 112 #
 113 # Build environment variables, including version info for mcs, motd,
 114 # motd, uname and boot messages. Mostly you shouldn't change this except
 115 # when a release name changes, etc.
 116 #
 117 # With modern SCM systems like git, one typically wants the
 118 # change set ID (hash) in the version sring.
 119 GIT_REV=`git rev-parse --short=10 HEAD`
 120 export VERSION="${GATE}:${GIT_REV}"
 121 export ONNV_BUILDNUM=152
 122 
 123 if [ -x /usr/bin/dpkg ]; then
 124     export PKGTYPE=deb
 125     export DEB_VERSION=`dpkg -l sunwcs | awk '/sunwcs/ {
 126         split($3, nsver, "-");
 127         nsver[3]++;
 128         printf("%s-%s-%s\n", nsver[1], nsver[2], nsver[3]);
 129     }'`
 130 fi
 131 
 132 #
 133 # the RELEASE and RELEASE_DATE variables are set in Makefile.master;
 134 # there might be special reasons to override them here.
 135 #
 136 # export RELEASE='5.11'
 137 # export RELEASE_DATE='October 2007'
 138 
 139 # Override RELEASE_CM, DEV_CM used for mcs processing
 140 # For developer builds, include the WS basename & date.
 141 # Note that in a release build only RELEASE_CM goes in,
 142 # and in a developer build, BOTH comments are used.
 143 DATE=`date +%Y-%m-%d`;
 144 RELEASE_CM='"@(#)SunOS '$RELEASE' '$VERSION' '$RELEASE_DATE'"'
 145 DEV_CM='"@(#)SunOS Developer: '$LOGNAME' '$GATE' '$DATE'"'
 146 export RELEASE_CM DEV_CM
 147 
 148 # proto area in parent for optionally depositing a copy of headers and
 149 # libraries corresponding to the protolibs target
 150 # not applicable given the NIGHTLY_OPTIONS
 151 #
 152 export PARENT_ROOT="$PARENT_WS/proto/root_$MACH"
 153 export PARENT_TOOLS_ROOT="$PARENT_WS/usr/src/tools/proto/root_$MACH-nd"
 154 
 155 # Package creation variables.  You probably shouldn't change these,
 156 # either.
 157 #
 158 # PKGARCHIVE determines where the repository will be created.
 159 #
 160 # PKGPUBLISHER_REDIST controls the publisher setting for the repository.
 161 #
 162 export PKGARCHIVE="${CODEMGR_WS}/packages/${MACH}/nightly"
 163 # export PKGPUBLISHER_REDIST='on-redist'
 164 
 165 # Package manifest format version.
 166 export PKGFMT_OUTPUT='v1'
 167 
 168 # we want make to do as much as it can, just in case there's more than
 169 # one problem.
 170 export MAKEFLAGS='k'
 171 
 172 # Magic variable to prevent the devpro compilers/teamware from sending
 173 # mail back to devpro on every use.
 174 export UT_NO_USAGE_TRACKING='1'
 175 
 176 # Build tools - don't change these unless you know what you're doing.  These
 177 # variables allows you to get the compilers and onbld files locally or
 178 # through cachefs.  Set BUILD_TOOLS to pull everything from one location.
 179 # Alternately, you can set ONBLD_TOOLS to where you keep the contents of
 180 # SUNWonbld and SPRO_ROOT to where you keep the compilers.  SPRO_VROOT
 181 # exists to make it easier to test new versions of the compiler.
 182 export BUILD_TOOLS='/opt'
 183 #export ONBLD_TOOLS='/opt/onbld'
 184 export SPRO_ROOT='/opt/SUNWspro'
 185 export SPRO_VROOT="$SPRO_ROOT"
 186 
 187 # path to onbld tool binaries
 188 ONBLD_BIN="${ONBLD_TOOLS}/bin"
 189 
 190 # Set JAVA_ROOT to point to a JDK7 implementation. The build system expects
 191 # it in /usr/java, but if /usr/jdk/instances/openjdk7 exists it will be used
 192 # instead.
 193 if [ -d /usr/jdk/instances/openjdk1.7.0 ]; then
 194         export JAVA_ROOT=/usr/jdk/instances/openjdk1.7.0
 195 fi
 196 
 197 # help lint find the proper note.h file
 198 export ONLY_LINT_DEFS=-I${SPRO_ROOT}/sunstudio12.1/prod/include/lint
 199 
 200 # Causes GCC to be used as the main compiler
 201 export __GNUC=""
 202 
 203 # Check for customized GCC location and set GCC_ROOT accordingly.
 204 if [ -d /opt/gcc-4.4.4 ] ; then
 205         export GCC_ROOT=/opt/gcc-4.4.4
 206 fi
 207 
 208 # Turns off shadow compiler when set to 1
 209 export CW_NO_SHADOW=1
 210 
 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"
 217 
 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'
 221 
 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'
 225 
 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=
 229 
 230 # Uncomment this to disable support for SMB printing.
 231 export ENABLE_SMB_PRINTING='#'
 232 
 233 # Uncomment this to disable support for IPP printing.
 234 export ENABLE_IPP_PRINTING='#'
 235 
 236 # Detect the values to match the perl version used for building.
 237 # This code can be avoided by setting the variables here.
 238 if [ -z "$PERL_VERSION" ] ; then
 239         for d in 5.16.1 5.16 5.14 5.12 5.10.0 5.10 ; do
 240                 if [ -d /usr/perl5/$d ] ; then
 241                         export PERL_VERSION=$d
 242                         break
 243                 fi
 244         done
 245 fi
 246 
 247 if [ -z "$PERL_VERSION" ] ; then
 248         echo "No perl?" 1>&2
 249         exit 1
 250 fi
 251 
 252 if [ -z "$PERL_PKGVERS" ] ; then
 253         PERL_PKGVERS=-$(echo $PERL_VERSION | tr -d '.')
 254         export PERL_PKGVERS=$PERL_PKGVERS
 255 fi
 256 
 257 # Now PERL_ARCH.
 258 if [ -z "$PERL_ARCH" ] ; then
 259         for a in i86pc-solaris-64int i86pc-solaris-thread-multi-64int \
 260             i86pc-solaris-thread-multi-64 ; do
 261                 if [ -d ${ADJUNCT_PROTO}/usr/perl5/$PERL_VERSION/lib/$a ] ; then
 262                         export PERL_ARCH=$a
 263                         break
 264                 fi
 265         done
 266 fi