b327896bc477273e944d04a8ca4309b79784c375
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
="$?"
78 SRCDIR
="$WORKSPACE/src/liburcu"
79 TMPDIR
="$WORKSPACE/tmp"
80 PREFIX
="$WORKSPACE/build"
82 # The build dir defaults to the source dir
85 # Create build and tmp directories
86 rm -rf "$PREFIX" "$TMPDIR"
87 mkdir
-p "$PREFIX" "$TMPDIR"
90 export CFLAGS
="-g -O2"
92 # Set platform variables
99 export YACC
="$BISON -y"
100 export PATH
="/opt/csw/bin:/usr/ccs/bin:$PATH"
101 export CPPFLAGS
="-I/opt/csw/include"
102 export LDFLAGS
="-L/opt/csw/lib -R/opt/csw/lib"
103 export PKG_CONFIG_PATH
="/opt/csw/lib/pkgconfig"
109 export PATH
="$PATH:/usr/perl5/bin"
110 #export LD_ALTEXEC=/usr/sfw/bin/gld
111 #export LD=/usr/sfw/bin/gld
116 export NPROC
="getconf _NPROCESSORS_ONLN"
118 export YACC
="$BISON -y"
119 export LDFLAGS
="-L/opt/local/lib"
120 export CFLAGS
="$CFLAGS -I/opt/local/include"
121 export PATH
="/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
131 # Enter the source directory
134 # Run bootstrap in the source directory prior to configure
137 # Get source version from configure script
138 eval "$(grep '^PACKAGE_VERSION=' ./configure)"
140 # Set configure options and environment variables for each build
146 CONF_OPTS
="--enable-static --disable-shared"
150 echo "Using pthread_getspecific() to emulate TLS"
151 CONF_OPTS
="--disable-compiler-tls"
155 echo "Enable RCU sanity checks for debugging"
156 if vergte
"$PACKAGE_VERSION" "0.10"; then
157 CONF_OPTS
="--enable-rcu-debug"
159 export CFLAGS
="$CFLAGS -DDEBUG_RCU"
162 echo "Enable iterator sanity validator"
163 if vergte
"$PACKAGE_VERSION" "0.11"; then
164 CONF_OPTS
+=" --enable-cds-lfht-iter-debug"
169 echo "Standard build"
175 # oot : out-of-tree build
176 # dist: build via make dist
177 # * : normal tree build
179 # Make sure to move to the build dir and run configure
183 echo "Out of tree build"
185 BUILDDIR
=$WORKSPACE/oot
189 "$SRCDIR/configure" --prefix="$PREFIX" $CONF_OPTS
193 echo "Distribution out of tree build"
195 tar_file
="userspace-rcu-$PACKAGE_VERSION.tar.bz2"
197 # Initial configure in src dir and tarball generation
201 BUILDDIR
=$
(mktemp
-d)
205 # Ignore level 1 of tar
206 $TAR xvf
"$SRCDIR/$tar_file" --strip 1
208 .
/configure
--prefix="$PREFIX" $CONF_OPTS
211 echo "Standard in-tree build"
212 .
/configure
--prefix="$PREFIX" $CONF_OPTS
217 $MAKE -j "$($NPROC)" V
=1
221 $MAKE --keep-going check
222 # Only run regtest for 0.9 and up
223 if vergte
"$PACKAGE_VERSION" "0.9"; then
224 $MAKE --keep-going regtest
227 # Copy tap logs for the jenkins tap parser
228 rsync
-a --exclude 'test-suite.log' --include '*/' --include '*.log' --exclude='*' tests
/ "$WORKSPACE/tap"
233 # Cleanup rpath in executables and shared libraries
234 find "$PREFIX/lib" -name "*.so" -exec chrpath
--delete {} \
;
236 # Remove libtool .la files
237 find "$PREFIX/lib" -name "*.la" -exec rm -f {} \
;
239 # Cleanup temp directory of dist build
240 if [ "$build" = "dist" ]; then
This page took 0.03431 seconds and 4 git commands to generate.