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