3 # Copyright (C) 2015 - Jonathan Rajotte-Julien <jonathan.rajotte-julien@efficios.com>
4 # 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/>.
20 # Create build directory
21 rm -rf $WORKSPACE/build
22 mkdir
-p $WORKSPACE/build
27 P2_VERSION
=$
($PYTHON2 -c "import sys;print(sys.version[:3])")
28 P3_VERSION
=$
($PYTHON3 -c "import sys;print(sys.version[:3])")
31 URCU_INCS
="$WORKSPACE/deps/liburcu/build/include/"
32 URCU_LIBS
="$WORKSPACE/deps/liburcu/build/lib/"
35 UST_INCS
="$WORKSPACE/deps/lttng-ust/build/include/"
36 UST_LIBS
="$WORKSPACE/deps/lttng-ust/build/lib/"
37 UST_JAVA
="$WORKSPACE/deps/lttng-ust/build/share/java/"
38 UST_PYTHON2
="$WORKSPACE/deps/lttng-ust/build/lib/python$P2_VERSION/site-packages"
39 UST_PYTHON3
="$WORKSPACE/deps/lttng-ust/build/lib/python$P3_VERSION/site-packages"
42 BABEL_INCS
="$WORKSPACE/deps/babeltrace/build/include/"
43 BABEL_LIBS
="$WORKSPACE/deps/babeltrace/build/lib/"
44 BABEL_BINS
="$WORKSPACE/deps/babeltrace/build/bin/"
46 PREFIX
="$WORKSPACE/build"
48 if [ "$conf" = "no-ust" ]
50 export CPPFLAGS
="-I$URCU_INCS"
51 export LDFLAGS
="-L$URCU_LIBS"
52 export LD_LIBRARY_PATH
="$URCU_LIBS:$BABEL_LIBS:${LD_LIBRARY_PATH:-}"
54 export CPPFLAGS
="-I$URCU_INCS -I$UST_INCS"
55 export LDFLAGS
="-L$URCU_LIBS -L$UST_LIBS"
56 export LD_LIBRARY_PATH
="$URCU_LIBS:$UST_LIBS:$BABEL_LIBS:${LD_LIBRARY_PATH:-}"
65 CONF_OPTS
="--enable-static --disable-shared"
69 echo "Build with python bindings"
70 # We only support bindings built with Python 3
71 export PYTHON
="python3"
72 export PYTHON_CONFIG
="/usr/bin/python3-config"
73 CONF_OPTS
="--enable-python-bindings"
77 echo "Build without UST support"
78 CONF_OPTS
="--disable-lttng-ust"
82 echo "Build with Java Agents"
83 export JAVA_HOME
="/usr/lib/jvm/default-java"
84 export CLASSPATH
="$UST_JAVA/*:/usr/share/java/*"
85 CONF_OPTS
="--enable-test-java-agent-all"
89 echo "Build with python agents"
90 export PYTHONPATH
="$UST_PYTHON2:$UST_PYTHON3"
91 CONF_OPTS
="--enable-test-python-agent-all"
101 # oot : out-of-tree build
102 # dist: build via make dist
103 # * : normal tree build
105 # Make sure to move to the build_path and configure
108 BUILD_PATH
=$WORKSPACE
111 echo "Out of tree build"
112 BUILD_PATH
=$WORKSPACE/oot
115 $WORKSPACE/configure
--prefix=$PREFIX $CONF_OPTS
119 echo "Distribution out of tree build"
120 BUILD_PATH
=`mktemp -d`
122 # Initial configure and generate tarball
123 .
/configure
$CONF_OPTS
127 cp *.
tar.
* $BUILD_PATH/
130 # Ignore level 1 of tar
131 tar xvf
*.
tar.
* --strip 1
133 $BUILD_PATH/configure
--prefix=$PREFIX $CONF_OPTS
137 BUILD_PATH
=$WORKSPACE
138 echo "Standard tree build"
139 $WORKSPACE/configure
--prefix=$PREFIX $CONF_OPTS
151 # Add 'babeltrace' binary to PATH
152 chmod +x
$BABEL_BINS/babeltrace
153 export PATH
="$PATH:$BABEL_BINS"
155 # Prepare tap output dirs
156 rm -rf $WORKSPACE/tap
157 mkdir
-p $WORKSPACE/tap
158 mkdir
-p $WORKSPACE/tap
/unit
159 mkdir
-p $WORKSPACE/tap
/fast_regression
160 mkdir
-p $WORKSPACE/tap
/with_bindings_regression
164 # Run 'unit_tests' and 'fast_regression' test suites for all configs except 'no-ust'
165 if [ "$conf" != "no-ust" ]; then
166 prove
--merge -v --exec '' - < $BUILD_PATH/tests
/unit_tests
--archive $WORKSPACE/tap
/unit
/ || true
167 prove
--merge -v --exec '' - < $BUILD_PATH/tests
/fast_regression
--archive $WORKSPACE/tap
/fast_regression
/ || true
169 # Regression is disabled for now, we need to adjust the testsuite for no ust builds.
170 echo "Testsuite disabled for 'no-ust'. See job configuration for more info."
173 # Run 'with_bindings_regression' test suite for 'python-bindings' config
174 if [ "$conf" = "python-bindings" ]
176 prove
--merge -v --exec '' - < $WORKSPACE/tests
/with_bindings_regression
--archive $WORKSPACE/tap
/with_bindings_regression
/ || true
179 # TAP plugin is having a hard time with .yml files.
180 rm -f $WORKSPACE/tap
/unit
/meta.yml
181 rm -f $WORKSPACE/tap
/fast_regression
/meta.yml
182 rm -f $WORKSPACE/tap
/with_bindings_regression
/meta.yml
184 # And also with files without extension, so rename all result to *.tap
185 find $WORKSPACE/tap
/unit
/ -type f
-exec mv {} {}.tap \
;
186 find $WORKSPACE/tap
/fast_regression
/ -type f
-exec mv {} {}.tap \
;
187 find $WORKSPACE/tap
/with_bindings_regression
/ -type f
-exec mv {} {}.tap \
;
192 # Cleanup rpath and libtool .la files
193 find $WORKSPACE/build
/bin
-executable -type f
-exec chrpath
--delete {} \
;
194 find $WORKSPACE/build
/lib
-name "*.so" -exec chrpath
--delete {} \
;
195 find $WORKSPACE/build
/lib
-name "*.la" -exec rm -f {} \
;
197 # Clean temp dir for dist build
198 if [ $build = "dist" ]; then
This page took 0.052991 seconds and 4 git commands to generate.