fm/ipmitopo: fix 64-bit compilation
[unleashed.git] / tools / env.sh
blobaa14132d34ebe2ff9471607278f598234b9024d9
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 2015 Nexenta Systems, Inc. All rights reserved.
23 # Copyright 2012 Joshua M. Clulow <josh@sysmgr.org>
24 # Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved.
27 # SRCTOP - where is your workspace at
28 #export SRCTOP="$HOME/ws/illumos-gate"
29 [ -z "$SRCTOP" ] && SRCTOP="`git rev-parse --show-toplevel`"
30 export SRCTOP
32 # Maximum number of dmake jobs. The recommended number is 2 + NCPUS,
33 # where NCPUS is the number of logical CPUs on your build system.
34 maxjobs()
36 njobs=1
37 min_mem_per_job=512 # minimum amount of memory for a job
39 ncpu=$(/usr/bin/getconf 'NPROCESSORS_ONLN')
40 njobs=$(( ncpu + 2 ))
42 # Throttle number of parallel jobs launched by dmake to a value which
43 # gurantees that all jobs have enough memory. This was added to avoid
44 # excessive paging/swapping in cases of virtual machine installations
45 # which have lots of CPUs but not enough memory assigned to handle
46 # that many parallel jobs
47 /usr/sbin/prtconf 2>/dev/null | awk "BEGIN { mem_per_job = $min_mem_per_job; njobs = $njobs; } "'
48 /^Memory size: .* Megabytes/ {
49 mem = $3;
50 njobs_mem = int(mem/mem_per_job);
51 if (njobs < njobs_mem) print(njobs);
52 else print(njobs_mem);
56 export DMAKE_MAX_JOBS=$(maxjobs)
58 export MACH="$(uname -p)"
59 if [ "$MACH" = "amd64" ]; then
60 MACH=i386
63 export ROOT="$SRCTOP/proto/root_${MACH}"
64 export SRC="$SRCTOP/usr/src"
67 # build environment variables, including version info for mcs, motd,
68 # motd, uname and boot messages. Mostly you shouldn't change this except
69 # when the release slips (nah) or you move an environment file to a new
70 # release
72 [ -z "$VERSION" ] && VERSION="`git describe --dirty`"
73 export VERSION
75 # Package creation variables. You probably shouldn't change these,
76 # either.
78 # PKGARCHIVE determines where the repository will be created.
80 # PKGPUBLISHER controls the publisher setting for the repository.
82 export PKGARCHIVE="${SRCTOP}/packages/${MACH}/nightly"
83 #export PKGPUBLISHER='unleashed'
85 # Package manifest format version.
86 export PKGFMT_OUTPUT='v1'
88 # Don't build python 3 versions of libs.
89 export BUILDPY3='#'
90 export BUILDPY3TOOLS='#'