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 DEPS_INC
="$WORKSPACE/deps/build/include"
82 DEPS_LIB
="$WORKSPACE/deps/build/lib"
84 export LD_LIBRARY_PATH
="$DEPS_LIB:${LD_LIBRARY_PATH:-}"
85 export CPPFLAGS
="-I$DEPS_INC"
86 export LDFLAGS
="-L$DEPS_LIB"
88 SRCDIR
="$WORKSPACE/src/lttng-ust"
89 TMPDIR
="$WORKSPACE/tmp"
92 # Create tmp directory
97 export CFLAGS
="-g -O2"
99 # Set compiler variables
131 export CXX
=clang
++-3.9
135 export CXX
=clang
++-4.0
139 export CXX
=clang
++-5.0
143 export CXX
=clang
++-6.0
150 if [ "x$cc" != "x" ]; then
156 if [ "x${CC:-}" != "x" ]; then
157 echo "Selected compiler:"
161 # Set platform variables
167 export PYTHON
="python3"
168 export PYTHON_CONFIG
="python3-config"
172 # Enter the source directory
175 # Run bootstrap in the source directory prior to configure
178 # Get source version from configure script
179 eval "$(grep '^PACKAGE_VERSION=' ./configure)"
181 # Set configure options and environment variables for each build
183 CONF_OPTS
=("--prefix=$PREFIX")
186 # Unsupported! liblttng-ust can't pull in it's static (.a) dependencies.
187 echo "Static lib only configuration"
189 CONF_OPTS
+=("--enable-static" "--disable-shared")
193 echo "Java and Python agents configuration"
195 export CLASSPATH
="/usr/share/java/log4j-1.2.jar"
196 CONF_OPTS
+=("--enable-java-agent-all" "--enable-jni-interface" "--enable-python-agent")
200 echo "Enable RCU sanity checks for debugging"
201 export CPPFLAGS
="${CPPFLAGS} -DDEBUG_RCU"
205 echo "Standard configuration"
210 # oot : out-of-tree build
211 # dist : build via make dist
212 # oot-dist: build via make dist out-of-tree
213 # * : normal tree build
215 # Make sure to move to the build directory and run configure
219 echo "Out of tree build"
221 # Create and enter a temporary build directory
222 builddir
=$
(mktemp
-d)
225 "$SRCDIR/configure" "${CONF_OPTS[@]}"
229 echo "Distribution in-tree build"
231 # Run configure and generate the tar file
232 # in the source directory
236 # Create and enter a temporary build directory
237 builddir
=$
(mktemp
-d)
240 # Extract the distribution tar in the build directory,
241 # ignore the first directory level
242 $TAR xvf
"$SRCDIR"/*.
tar.
* --strip 1
244 # Build in extracted source tree
245 .
/configure
"${CONF_OPTS[@]}"
249 echo "Distribution out of tree build"
251 # Create and enter a temporary build directory
252 builddir
=$
(mktemp
-d)
255 # Run configure out of tree and generate the tar file
259 dist_srcdir
="$(mktemp -d)"
262 # Extract the distribution tar in the new source directory,
263 # ignore the first directory level
264 $TAR xvf
"$builddir"/*.
tar.
* --strip 1
266 # Create and enter a second temporary build directory
267 builddir
="$(mktemp -d)"
270 # Run configure from the extracted distribution tar,
271 # out of the source tree
272 "$dist_srcdir/configure" "${CONF_OPTS[@]}"
276 echo "Standard in-tree build"
277 .
/configure
"${CONF_OPTS[@]}"
281 # We are now inside a configured build directory
284 $MAKE -j "$($NPROC)" V
=1
286 # Install in the workspace
287 $MAKE install DESTDIR
="$WORKSPACE"
289 # Run tests, don't fail now, we want to run the archiving steps
291 $MAKE --keep-going check
295 # Copy tap logs for the jenkins tap parser before cleaning the build dir
296 rsync
-a --exclude 'test-suite.log' --include '*/' --include '*.log' --exclude='*' tests
/ "$WORKSPACE/tap"
298 # Clean the build directory
301 # Cleanup rpath in executables and shared libraries
302 find "$WORKSPACE/$PREFIX/bin" -type f
-perm -0500 -exec chrpath
--delete {} \
;
303 find "$WORKSPACE/$PREFIX/lib" -name "*.so" -exec chrpath
--delete {} \
;
305 # Remove libtool .la files
306 find "$WORKSPACE/$PREFIX/lib" -name "*.la" -exec rm -f {} \
;
308 # Exit with the return code of the test suite
This page took 0.035221 seconds and 4 git commands to generate.