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
="$?"
79 DEPS_INC
="$WORKSPACE/deps/build/include"
80 DEPS_LIB
="$WORKSPACE/deps/build/lib"
82 export LD_LIBRARY_PATH
="$DEPS_LIB:${LD_LIBRARY_PATH:-}"
83 export CPPFLAGS
="-I$DEPS_INC"
84 export LDFLAGS
="-L$DEPS_LIB"
86 SRCDIR
="$WORKSPACE/src/lttng-ust"
87 TMPDIR
="$WORKSPACE/tmp"
90 # Create tmp directory
95 export CFLAGS
="-g -O2"
97 # Set compiler variables
129 export CXX
=clang
++-3.9
133 export CXX
=clang
++-4.0
137 export CXX
=clang
++-5.0
141 export CXX
=clang
++-6.0
148 if [ "x$cc" != "x" ]; then
154 if [ "x${CC:-}" != "x" ]; then
155 echo "Selected compiler:"
159 # Set platform variables
165 export PYTHON
="python3"
166 export PYTHON_CONFIG
="python3-config"
170 # Enter the source directory
173 # Run bootstrap in the source directory prior to configure
176 # Get source version from configure script
177 eval "$(grep '^PACKAGE_VERSION=' ./configure)"
179 # Set configure options and environment variables for each build
181 CONF_OPTS
=("--prefix=$PREFIX")
184 # Unsupported! liblttng-ust can't pull in it's static (.a) dependencies.
185 echo "Static lib only configuration"
187 CONF_OPTS
+=("--enable-static" "--disable-shared")
191 echo "Java and Python agents configuration"
193 export CLASSPATH
="/usr/share/java/log4j-1.2.jar"
194 CONF_OPTS
+=("--enable-java-agent-all" "--enable-jni-interface" "--enable-python-agent")
198 echo "Enable RCU sanity checks for debugging"
199 export CPPFLAGS
="${CPPFLAGS} -DDEBUG_RCU"
203 echo "Standard configuration"
208 # oot : out-of-tree build
209 # dist : build via make dist
210 # oot-dist: build via make dist out-of-tree
211 # * : normal tree build
213 # Make sure to move to the build directory and run configure
217 echo "Out of tree build"
219 # Create and enter a temporary build directory
220 builddir
=$
(mktemp
-d)
223 "$SRCDIR/configure" "${CONF_OPTS[@]}"
227 echo "Distribution in-tree build"
229 # Run configure and generate the tar file
230 # in the source directory
234 # Create and enter a temporary build directory
235 builddir
=$
(mktemp
-d)
238 # Extract the distribution tar in the build directory,
239 # ignore the first directory level
240 $TAR xvf
"$SRCDIR"/*.
tar.
* --strip 1
242 # Build in extracted source tree
243 .
/configure
"${CONF_OPTS[@]}"
247 echo "Distribution out of tree build"
249 # Create and enter a temporary build directory
250 builddir
=$
(mktemp
-d)
253 # Run configure out of tree and generate the tar file
257 dist_srcdir
="$(mktemp -d)"
260 # Extract the distribution tar in the new source directory,
261 # ignore the first directory level
262 $TAR xvf
"$builddir"/*.
tar.
* --strip 1
264 # Create and enter a second temporary build directory
265 builddir
="$(mktemp -d)"
268 # Run configure from the extracted distribution tar,
269 # out of the source tree
270 "$dist_srcdir/configure" "${CONF_OPTS[@]}"
274 echo "Standard in-tree build"
275 .
/configure
"${CONF_OPTS[@]}"
279 # We are now inside a configured build directory
282 $MAKE -j "$($NPROC)" V
=1
284 # Install in the workspace
285 $MAKE install DESTDIR
="$WORKSPACE"
287 # Run tests, don't fail now, we want to run the archiving steps
289 $MAKE --keep-going check
293 # Copy tap logs for the jenkins tap parser before cleaning the build dir
294 rsync
-a --exclude 'test-suite.log' --include '*/' --include '*.log' --exclude='*' tests
/ "$WORKSPACE/tap"
296 # Clean the build directory
299 # Cleanup rpath in executables and shared libraries
300 find "$WORKSPACE/$PREFIX/bin" -type f
-perm -0500 -exec chrpath
--delete {} \
;
301 find "$WORKSPACE/$PREFIX/lib" -name "*.so" -exec chrpath
--delete {} \
;
303 # Remove libtool .la files
304 find "$WORKSPACE/$PREFIX/lib" -name "*.la" -exec rm -f {} \
;
306 # Exit with the return code of the test suite
This page took 0.048057 seconds and 5 git commands to generate.