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, Version 1.0 only
6 # (the "License"). You may not use this file except in compliance
7 # with the License.
8 #
9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 # or http://www.opensolaris.org/os/licensing.
11 # See the License for the specific language governing permissions
12 # and limitations under the License.
13 #
14 # When distributing Covered Code, include this CDDL HEADER in each
15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 # If applicable, add the following below this CDDL HEADER, with the
17 # fields enclosed by brackets "[]" replaced with your own identifying
18 # information: Portions Copyright [yyyy] [name of copyright owner]
19 #
20 # CDDL HEADER END
21 #
22 #
23 # Copyright 2016 OmniTI Computer Consulting, Inc. All rights reserved.
24 # Copyright (c) 2015 by Delphix. All rights reserved.
25 #
26 #############################################################################
27 # Configuration for the build system
28 #############################################################################
29
30 # Default branch
31 RELVER=151021
32 PVER=0.$RELVER
33
34 # Which server to fetch files from.
35 # If $MIRROR begins with a '/', it is treated as a local directory.
36 MIRROR=mirrors.omniti.com
37
38 # Default prefix for packages (may be overridden)
39 PREFIX=/usr
40
41 # Temporary directories
42 # TMPDIR is used for source archives and build directories
43 # to avoid collision on shared build systems,
44 # TMPDIR includes a username
45 # DTMPDIR is used for constructing the DESTDIR path
46 # Let the environment override TMPDIR.
47 if [[ -z $TMPDIR ]]; then
48 TMPDIR=/tmp/build_$USER
49 fi
50 DTMPDIR=$TMPDIR
51
52 # Log file for all output
53 LOGFILE=$PWD/build.log
54
55 # Default patches dir
56 PATCHDIR=patches
57
58 # Do we create isaexec stubs for scripts and other non-binaries (default yes)
59 NOSCRIPTSTUB=
60
61 #############################################################################
62 # The version of certain software that's *installed* matters. We don't yet
63 # have a sophisticated build-certain-things-first bootstrap for omnios-build.
64 # We must sometimes determine or even hardcode things about our build system.
65 #############################################################################
66
67 # libffi --> use pkg(5) to determine what we're running:
68 FFIVERS=`pkg list libffi | grep libffi | awk '{print $2}' | \
69 awk -F- '{print $1}'`
70
71
72 #############################################################################
73 # Perl stuff
74 #############################################################################
75
76 # Perl versions we currently build against
77 PERLVERLIST="5.16.1"
78
79 # Full paths to bins
80 PERL32=/usr/perl5/5.16.1/bin/$ISAPART/perl
81 PERL64=/usr/perl5/5.16.1/bin/$ISAPART64/perl
82
83 # Default Makefile.PL options
84 PERL_MAKEFILE_OPTS="INSTALLSITEBIN=$PREFIX/bin/_ARCHBIN_ \
85 INSTALLSITESCRIPT=$PREFIX/bin/_ARCHBIN_ \
86 INSTALLSITEMAN1DIR=$PREFIX/share/man/man1 \
87 INSTALLSITEMAN3DIR=$PREFIX/share/man/man3 \
88 INSTALLDIRS=site"
89
90 # Accept MakeMaker defaults so as not to stall build scripts
91 export PERL_MM_USE_DEFAULT=true
92
93 # When building perl modules, run make test
94 # Unset in a build script to skip tests
95 PERL_MAKE_TEST=1
96
97
98 #############################################################################
99 # Python -- NOTE, these can be changed at runtime via set_python_version().
100 #############################################################################
101 : ${PYTHONVER:=2.6}
102 : ${PYTHONPKGVER:=`echo $PYTHONVER | sed 's/\.//g'`}
103 PYTHONPATH=/usr
104 PYTHON=$PYTHONPATH/bin/python$PYTHONVER
105 PYTHONLIB=$PYTHONPATH/lib
106
107
108 #############################################################################
109 # Paths to common tools
110 #############################################################################
111 WGET=wget
112 PATCH=gpatch
113 MAKE=gmake
114 TAR=tar
115 GZIP=gzip
116 BUNZIP2=bunzip2
117 XZCAT=xzcat
118 UNZIP=unzip
119 AWK=gawk
120
121 # Figure out number of logical CPUs for use with parallel gmake jobs (-j)
122 # Default to 1.5*nCPUs as we assume the build machine is 100% devoted to
123 # compiling.
124 # A build script may serialize make by setting NO_PARALLEL_MAKE
125 LCPUS=`psrinfo | wc -l`
126 MJOBS="$[ $LCPUS + ($LCPUS / 2) ]"
127 if [ "$MJOBS" == "0" ]; then
128 MJOBS=2
129 fi
130 MAKE_JOBS="-j $MJOBS"
131 NO_PARALLEL_MAKE=
132
133 # Remove install or packaging files by default. You can set this in a build
134 # script when testing to speed up building a package
135 DONT_REMOVE_INSTALL_DIR=
136
137 #############################################################################
138 # C compiler options - these can be overriden by a build script
139 #############################################################################
140 # isaexec(3C) variants
141 # These variables will be passed to the build to construct multi-arch
142 # binary and lib directories in DESTDIR
143
144 ISAPART=i386
145 ISAPART64=amd64
146
147 # For OmniOS we (almost) always want GCC
148 CC=gcc
149 CXX=g++
150
151 # CFLAGS applies to both builds, 32/64 only gets applied to the respective
152 # build
153 CFLAGS=""
154 CFLAGS32=""
155 CFLAGS64="-m64"
156
157 # Linker flags
158 LDFLAGS=""
159 LDFLAGS32=""
160 LDFLAGS64="-m64"
161
162 # C pre-processor flags
163 CPPFLAGS=""
164 CPPFLAGS32=""
165 CPPFLAGS64=""
166
167 # C++ flags
168 CXXFLAGS=""
169 CXXFLAGS32=""
170 CXXFLAGS64="-m64"
171
172 #############################################################################
173 # Configuration of the packaged software
174 #############################################################################
175 # Default configure command - almost always sufficient
176 CONFIGURE_CMD="./configure"
177
178 # Default configure options - replace/add to as needed
179 # This is a function so it can be called again if you change $PREFIX
180 # This is far from ideal, but works
181 reset_configure_opts() {
182 # If it's the global default (/usr), we want sysconfdir to be /etc
183 # otherwise put it under PREFIX
184 if [[ $PREFIX == "/usr" ]]; then
185 SYSCONFDIR=/etc
186 else
187 SYSCONFDIR=$PREFIX/etc
188 fi
189 CONFIGURE_OPTS_32="--prefix=$PREFIX
190 --sysconfdir=$SYSCONFDIR
191 --includedir=$PREFIX/include
192 --bindir=$PREFIX/bin/$ISAPART
193 --sbindir=$PREFIX/sbin/$ISAPART
194 --libdir=$PREFIX/lib
195 --libexecdir=$PREFIX/libexec"
196
197 CONFIGURE_OPTS_64="--prefix=$PREFIX
198 --sysconfdir=$SYSCONFDIR
199 --includedir=$PREFIX/include
200 --bindir=$PREFIX/bin/$ISAPART64
201 --sbindir=$PREFIX/sbin/$ISAPART64
202 --libdir=$PREFIX/lib/$ISAPART64
203 --libexecdir=$PREFIX/libexec/$ISAPART64"
204 }
205 reset_configure_opts
206
207 # Configure options to apply to both builds - this is the one you usually want
208 # to change for things like --enable-feature
209 CONFIGURE_OPTS=""
210
211 # Vim hints
212 # vim:ts=4:sw=4:et: