3 # Copyright (C) 2015 Jonathan Rajotte-Julien <jonathan.rajotte-julien@efficios.com>
4 # 2016-2019 Michael Jeanson <mjeanson@efficios.com>
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 # Version compare functions
22 if [[ "$1" == "$2" ]]; then
26 local i ver1
=($1) ver2
=($2)
27 # fill empty fields in ver1 with zeros
28 for ((i
=${#ver1[@]}; i
<${#ver2[@]}; i
++)); do
31 for ((i
=0; i
<${#ver1[@]}; i
++)); do
32 if [[ -z ${ver2[i]} ]]; then
33 # fill empty fields in ver2 with zeros
36 if ((10#${ver1[i]} > 10#${ver2[i]})); then
39 if ((10#${ver1[i]} < 10#${ver2[i]})); then
48 vercomp
"$1" "$2"; local res
="$?"
49 [ "$res" -eq "0" ] ||
[ "$res" -eq "2" ]
53 vercomp
"$1" "$2"; local res
="$?"
58 vercomp
"$1" "$2"; local res
="$?"
59 [ "$res" -eq "0" ] ||
[ "$res" -eq "1" ]
63 vercomp
"$1" "$2"; local res
="$?"
68 vercomp
"$1" "$2"; local res
="$?"
73 WORKSPACE
=${WORKSPACE:-}
81 SRCDIR
="$WORKSPACE/src/liburcu"
82 TMPDIR
="$WORKSPACE/tmp"
85 # Create tmp directory
90 export CFLAGS
="-g -O2"
92 # Set compiler variables
124 export CXX
=clang
++-3.9
128 export CXX
=clang
++-4.0
132 export CXX
=clang
++-5.0
136 export CXX
=clang
++-6.0
143 if [ "x$cc" != "x" ]; then
149 if [ "x${CC:-}" != "x" ]; then
150 echo "Selected compiler:"
154 # Set platform variables
160 export PATH
="/opt/csw/bin:/usr/ccs/bin:$PATH"
161 export CPPFLAGS
="-I/opt/csw/include"
162 export LDFLAGS
="-L/opt/csw/lib -R/opt/csw/lib"
163 export PKG_CONFIG_PATH
="/opt/csw/lib/pkgconfig"
164 export PYTHON
="python3"
165 export PYTHON_CONFIG
="python3-config"
172 export PATH
="/opt/csw/bin:$PATH:/usr/perl5/bin"
173 export LD_ALTEXEC
=/usr
/bin
/gld
174 export LD
=/usr
/bin
/gld
175 export PYTHON
="python3"
176 export PYTHON_CONFIG
="python3-config"
177 export PKG_CONFIG_PATH
="/usr/lib/pkgconfig"
183 export NPROC
="getconf _NPROCESSORS_ONLN"
184 export PATH
="/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
185 export CPPFLAGS
="-I/opt/local/include"
186 export LDFLAGS
="-L/opt/local/lib"
187 export PYTHON
="python3"
188 export PYTHON_CONFIG
="python3-config"
195 export PYTHON
="python3"
196 export PYTHON_CONFIG
="python3-config"
200 # Enter the source directory
203 # Run bootstrap in the source directory prior to configure
206 # Get source version from configure script
207 eval "$(grep '^PACKAGE_VERSION=' ./configure)"
208 PACKAGE_VERSION
=${PACKAGE_VERSION//\-pre*/}
210 # Set configure options and environment variables for each build
212 CONF_OPTS
=("--prefix=$PREFIX")
215 echo "Static lib only configuration"
217 CONF_OPTS
+=("--enable-static" "--disable-shared")
221 echo "Using pthread_getspecific() to emulate TLS"
222 CONF_OPTS
+=("--disable-compiler-tls")
226 echo "Enable RCU sanity checks for debugging"
227 if vergte
"$PACKAGE_VERSION" "0.10"; then
228 CONF_OPTS
+=("--enable-rcu-debug")
230 export CFLAGS
="$CFLAGS -DDEBUG_RCU"
233 echo "Enable iterator sanity validator"
234 if vergte
"$PACKAGE_VERSION" "0.11"; then
235 CONF_OPTS
+=("--enable-cds-lfht-iter-debug")
240 echo "Standard configuration"
245 # oot : out-of-tree build
246 # dist : build via make dist
247 # oot-dist: build via make dist out-of-tree
248 # * : normal tree build
250 # Make sure to move to the build directory and run configure
254 echo "Out of tree build"
256 # Create and enter a temporary build directory
257 builddir
=$
(mktemp
-d)
260 "$SRCDIR/configure" "${CONF_OPTS[@]}"
264 echo "Distribution in-tree build"
266 # Run configure and generate the tar file
267 # in the source directory
271 # Create and enter a temporary build directory
272 builddir
=$
(mktemp
-d)
275 # Extract the distribution tar in the build directory,
276 # ignore the first directory level
277 $TAR xvf
"$SRCDIR"/*.
tar.
* --strip 1
279 # Build in extracted source tree
280 .
/configure
"${CONF_OPTS[@]}"
284 echo "Distribution out of tree build"
286 # Create and enter a temporary build directory
287 builddir
=$
(mktemp
-d)
290 # Run configure out of tree and generate the tar file
294 dist_srcdir
="$(mktemp -d)"
297 # Extract the distribution tar in the new source directory,
298 # ignore the first directory level
299 $TAR xvf
"$builddir"/*.
tar.
* --strip 1
301 # Create and enter a second temporary build directory
302 builddir
="$(mktemp -d)"
305 # Run configure from the extracted distribution tar,
306 # out of the source tree
307 "$dist_srcdir/configure" "${CONF_OPTS[@]}"
311 echo "Standard in-tree build"
312 .
/configure
"${CONF_OPTS[@]}"
316 # We are now inside a configured build directory
319 $MAKE -j "$($NPROC)" V
=1
321 # Install in the workspace
322 $MAKE install DESTDIR
="$WORKSPACE"
324 # Run tests, don't fail now, we want to run the archiving steps
326 $MAKE --keep-going check || failed_tests
=1
327 # Only run regtest for 0.9 and up
328 if vergte
"$PACKAGE_VERSION" "0.9"; then
329 $MAKE --keep-going regtest || failed_tests
=1
332 # Copy tap logs for the jenkins tap parser before cleaning the build dir
333 rsync
-a --exclude 'test-suite.log' --include '*/' --include '*.log' --exclude='*' tests
/ "$WORKSPACE/tap"
335 # The test suite prior to 0.11 did not produce TAP logs
336 if verlt
"$PACKAGE_VERSION" "0.11"; then
337 mkdir
-p "$WORKSPACE/tap/no-log"
338 echo "1..1" > "$WORKSPACE/tap/no-log/tests.log"
339 echo "ok 1 - Test suite doesn't support logging" >> "$WORKSPACE/tap/no-log/tests.log"
342 # Clean the build directory
345 # Cleanup rpath in executables and shared libraries
346 #find "$WORKSPACE/$PREFIX/bin" -type f -perm -0500 -exec chrpath --delete {} \;
347 find "$WORKSPACE/$PREFIX/lib" -name "*.so" -exec chrpath
--delete {} \
;
349 # Remove libtool .la files
350 find "$WORKSPACE/$PREFIX/lib" -name "*.la" -exec rm -f {} \
;
352 # Exit with failure if any of the tests failed
This page took 0.051389 seconds and 4 git commands to generate.