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/>.
19 # Version compare functions
21 [ "$1" = "`printf '%s\n%s' $1 $2 | sort -V | head -n1`" ]
25 [ "$1" = "$2" ] && return 1 || verlte
$1 $2
29 [ "$1" = "`printf '%s\n%s' $1 $2 | sort -V | tail -n1`" ]
33 [ "$1" = "$2" ] && return 1 || vergte
$1 $2
37 # Create build directory
38 rm -rf $WORKSPACE/build
39 mkdir
-p $WORKSPACE/build
42 URCU_INCS
="$WORKSPACE/deps/liburcu/build/include/"
43 URCU_LIBS
="$WORKSPACE/deps/liburcu/build/lib/"
46 UST_INCS
="$WORKSPACE/deps/lttng-ust/build/include/"
47 UST_LIBS
="$WORKSPACE/deps/lttng-ust/build/lib/"
48 UST_JAVA
="$WORKSPACE/deps/lttng-ust/build/share/java/"
51 BABEL_INCS
="$WORKSPACE/deps/babeltrace/build/include/"
52 BABEL_LIBS
="$WORKSPACE/deps/babeltrace/build/lib/"
53 BABEL_BINS
="$WORKSPACE/deps/babeltrace/build/bin/"
55 PREFIX
="$WORKSPACE/build"
57 # Set platform variables
65 CFLAGS
="-D_XOPEN_SOURCE=1 -D_XOPEN_SOURCE_EXTENDED=1 -D__EXTENSIONS__=1"
73 BISON
="/opt/csw/bin/bison"
75 CFLAGS
="-D_XOPEN_SOURCE=1 -D_XOPEN_SOURCE_EXTENDED=1 -D__EXTENSIONS__=1"
78 export PATH
="$PATH:/usr/perl5/bin"
93 P2_VERSION
=$
($PYTHON2 -c "import sys;print(sys.version[:3])")
94 P3_VERSION
=$
($PYTHON3 -c "import sys;print(sys.version[:3])")
96 UST_PYTHON2
="$WORKSPACE/deps/lttng-ust/build/lib/python$P2_VERSION/site-packages"
97 UST_PYTHON3
="$WORKSPACE/deps/lttng-ust/build/lib/python$P3_VERSION/site-packages"
102 # Run bootstrap prior to configure
105 # Get source version from configure script
106 eval `grep '^PACKAGE_VERSION=' ./configure`
112 export CPPFLAGS
="-I$URCU_INCS"
113 export LDFLAGS
="-L$URCU_LIBS"
114 export LD_LIBRARY_PATH
="$URCU_LIBS:$BABEL_LIBS:${LD_LIBRARY_PATH:-}"
118 export CPPFLAGS
="-I$URCU_INCS -I$UST_INCS"
119 export LDFLAGS
="-L$URCU_LIBS -L$UST_LIBS"
120 export LD_LIBRARY_PATH
="$URCU_LIBS:$UST_LIBS:$BABEL_LIBS:${LD_LIBRARY_PATH:-}"
124 # The switch to build without UST changed in 2.8
125 if vergte
"$PACKAGE_VERSION" "2.8"; then
126 NO_UST
="--without-lttng-ust"
128 NO_UST
="--disable-lttng-ust"
131 # Set configure options for each build configuration
136 CONF_OPTS
="--enable-static --disable-shared"
140 echo "Build with python bindings"
141 # We only support bindings built with Python 3
142 export PYTHON
="python3"
143 export PYTHON_CONFIG
="/usr/bin/python3-config"
144 CONF_OPTS
="--enable-python-bindings"
148 echo "Build without UST support"
153 echo "Build with Java Agents"
154 export JAVA_HOME
="/usr/lib/jvm/default-java"
155 export CLASSPATH
="$UST_JAVA/*:/usr/share/java/*"
156 CONF_OPTS
="--enable-test-java-agent-all"
160 echo "Build with python agents"
161 export PYTHONPATH
="$UST_PYTHON2:$UST_PYTHON3"
162 CONF_OPTS
="--enable-test-python-agent-all"
166 echo "Build relayd only"
167 CONF_OPTS
="--disable-bin-lttng --disable-bin-lttng-consumerd --disable-bin-lttng-crash --disable-bin-lttng-sessiond --disable-extras $NO_UST"
171 echo "Standard build"
178 # oot : out-of-tree build
179 # dist: build via make dist
180 # * : normal tree build
182 # Make sure to move to the build_path and run configure
184 BUILD_PATH
=$WORKSPACE
187 echo "Out of tree build"
188 BUILD_PATH
=$WORKSPACE/oot
191 MAKE
=$MAKE BISON
="$BISON" YACC
="$YACC" CFLAGS
="$CFLAGS" $WORKSPACE/configure
--prefix=$PREFIX $CONF_OPTS
195 echo "Distribution out of tree build"
196 BUILD_PATH
=`mktemp -d`
198 # Initial configure and generate tarball
199 MAKE
=$MAKE BISON
="$BISON" YACC
="$YACC" CFLAGS
="$CFLAGS" .
/configure
$CONF_OPTS
203 cp *.
tar.
* $BUILD_PATH/
206 # Ignore level 1 of tar
207 $TAR xvf
*.
tar.
* --strip 1
209 MAKE
=$MAKE BISON
="$BISON" YACC
="$YACC" CFLAGS
="$CFLAGS" $BUILD_PATH/configure
--prefix=$PREFIX $CONF_OPTS
213 BUILD_PATH
=$WORKSPACE
214 echo "Standard tree build"
215 MAKE
=$MAKE BISON
="$BISON" YACC
="$YACC" CFLAGS
="$CFLAGS" $WORKSPACE/configure
--prefix=$PREFIX $CONF_OPTS
220 $MAKE -j `$NPROC` V
=1
224 if [ "$RUN_TESTS" = "yes" ]; then
228 # Add 'babeltrace' binary to PATH
229 chmod +x
$BABEL_BINS/babeltrace
230 export PATH
="$PATH:$BABEL_BINS"
232 # Prepare tap output dirs
233 rm -rf $WORKSPACE/tap
234 mkdir
-p $WORKSPACE/tap
235 mkdir
-p $WORKSPACE/tap
/unit
236 mkdir
-p $WORKSPACE/tap
/fast_regression
237 mkdir
-p $WORKSPACE/tap
/with_bindings_regression
241 # Run 'unit_tests' and 'fast_regression' test suites for all configs except 'no-ust'
242 if [ "$conf" != "no-ust" ]; then
243 prove
--merge -v --exec '' - < $BUILD_PATH/tests
/unit_tests
--archive $WORKSPACE/tap
/unit
/ || true
244 prove
--merge -v --exec '' - < $BUILD_PATH/tests
/fast_regression
--archive $WORKSPACE/tap
/fast_regression
/ || true
246 # Regression is disabled for now, we need to adjust the testsuite for no ust builds.
247 echo "Testsuite disabled for 'no-ust'. See job configuration for more info."
250 # Run 'with_bindings_regression' test suite for 'python-bindings' config
251 if [ "$conf" = "python-bindings" ]; then
252 prove
--merge -v --exec '' - < $WORKSPACE/tests
/with_bindings_regression
--archive $WORKSPACE/tap
/with_bindings_regression
/ || true
255 # TAP plugin is having a hard time with .yml files.
256 rm -f $WORKSPACE/tap
/unit
/meta.yml
257 rm -f $WORKSPACE/tap
/fast_regression
/meta.yml
258 rm -f $WORKSPACE/tap
/with_bindings_regression
/meta.yml
260 # And also with files without extension, so rename all result to *.tap
261 find $WORKSPACE/tap
/unit
/ -type f
-exec mv {} {}.tap \
;
262 find $WORKSPACE/tap
/fast_regression
/ -type f
-exec mv {} {}.tap \
;
263 find $WORKSPACE/tap
/with_bindings_regression
/ -type f
-exec mv {} {}.tap \
;
269 # Cleanup rpath in executables and shared libraries
270 find $WORKSPACE/build
/bin
-type f
-perm -0500 -exec chrpath
--delete {} \
;
271 find $WORKSPACE/build
/lib
-name "*.so" -exec chrpath
--delete {} \
;
273 # Remove libtool .la files
274 find $WORKSPACE/build
/lib
-name "*.la" -exec rm -f {} \
;
276 # Clean temp dir for dist build
277 if [ "$build" = "dist" ]; then
This page took 0.057032 seconds and 4 git commands to generate.