Merge packaging scripts from master branch
[lttng-ci.git] / lttng-tools / lttng-tools-stable-2.6.sh
CommitLineData
aab8dc1c
JR
1# Create build directory
2rm -rf $WORKSPACE/build
3mkdir -p $WORKSPACE/build
4
5# liburcu
6URCU_INCS="$WORKSPACE/dependencies/liburcu/build/include/"
7URCU_LIBS="$WORKSPACE/dependencies/liburcu/build/lib/"
8
9# lttng-ust
10UST_INCS="$WORKSPACE/dependencies/lttng-ust/build/include/"
11UST_LIBS="$WORKSPACE/dependencies/lttng-ust/build/lib/"
12
13# babeltrace
14BABEL_INCS="$WORKSPACE/dependencies/babeltrace/build/include/"
15BABEL_LIBS="$WORKSPACE/dependencies/babeltrace/build/lib/"
16
17PREFIX="$WORKSPACE/build"
18
19if [ "$conf" = "no_ust" ]
20then
21 export CPPFLAGS="-I$URCU_INCS"
22 export LDFLAGS="-L$URCU_LIBS"
23 export LD_LIBRARY_PATH="$URCU_LIBS:$BABEL_LIBS:$LD_LIBRARY_PATH"
24else
25 export CPPFLAGS="-I$URCU_INCS -I$UST_INCS"
26 export LDFLAGS="-L$URCU_LIBS -L$UST_LIBS"
27 export LD_LIBRARY_PATH="$URCU_LIBS:$UST_LIBS:$BABEL_LIBS:$LD_LIBRARY_PATH"
28fi
29
30./bootstrap
31
32CONF_OPTS=""
33case "$conf" in
34# Currently disabled, ust doesn't seem to be built right for static linking.
35#static)
36# echo "Static build"
37# CONF_OPTS="--enable-static --disable-shared"
38# ;;
39python_bindings)
40 echo "Build with python bindings"
41 # We only support bindings built with Python 3
42 export PYTHON="python3"
43 export PYTHON_CONFIG="/usr/bin/python3-config"
44 CONF_OPTS="--enable-python-bindings"
45 ;;
46no_ust)
47 echo "Build without UST support"
48 CONF_OPTS="--disable-lttng-ust"
49 ;;
50*)
51 echo "Standard build"
52 CONF_OPTS=""
53 ;;
54esac
55
b1fe9891
JR
56# Build type
57# oot : out-of-tree build
58# dist: build via make dist
59# * : normal tree build
60#
61# Make sure to move to the build_path and configure
62# before continuing
63
64BUILD_PATH=$WORKSPACE
65case "$build" in
66 oot)
67 echo "Out of tree build"
68 BUILD_PATH=$WORKSPACE/oot
69 mkdir -p $BUILD_PATH
70 cd $BUILD_PATH
71 $WORKSPACE/configure --prefix=$PREFIX $CONF_OPTS
72 ;;
73 dist)
74 echo "Distribution out of tree build"
75 BUILD_PATH=`mktemp -d`
76
77 # Initial configure and generate tarball
78 ./configure
79 make dist
80
81 mkdir -p $BUILD_PATH
82 cp *.tar.* $BUILD_PATH/
83 cd $BUILD_PATH
84
85 # Ignore level 1 of tar
86 tar xvf *.tar.* --strip 1
87
88 $BUILD_PATH/configure --prefix=$PREFIX $CONF_OPTS
89 ;;
90 *)
91 BUILD_PATH=$WORKSPACE
92 echo "Standard tree build"
93 $WORKSPACE/configure --prefix=$PREFIX $CONF_OPTS
94 ;;
95esac
96
aab8dc1c
JR
97
98make
99make install
100
101# Run tests
102# Allow core dumps
103ulimit -c unlimited
104
105chmod +x $WORKSPACE/dependencies/babeltrace/build/bin/babeltrace
106export PATH="$PATH:$WORKSPACE/dependencies/babeltrace/build/bin"
107
108rm -rf $WORKSPACE/tap
109mkdir -p $WORKSPACE/tap
110mkdir -p $WORKSPACE/tap/unit
111mkdir -p $WORKSPACE/tap/fast_regression
112mkdir -p $WORKSPACE/tap/with_bindings_regression
113
b1fe9891 114cd $BUILD_PATH/tests
aab8dc1c
JR
115
116if [ "$conf" = "std" ]
117then
b1fe9891
JR
118 prove --merge --exec '' - < $BUILD_PATH/tests/unit_tests --archive $WORKSPACE/tap/unit/ || true
119 prove --merge --exec '' - < $BUILD_PATH/tests/fast_regression --archive $WORKSPACE/tap/fast_regression/ || true
aab8dc1c
JR
120fi
121
122if [ "$conf" = "no_ust" ]
123then
124 # Regression is disabled for now, we need to adjust the testsuite for no ust builds.
125 echo "Testsuite disabled. See job configuration for more info."
126fi
127
128if [ "$conf" = "python_bindings" ]
129then
130 # Disabled due to race conditions in tests
131 echo "Testsuite disabled. See job configuration for more info."
b1fe9891
JR
132 prove --merge --exec '' - < $BUILD_PATH/tests/unit_tests --archive $WORKSPACE/tap/unit/ || true
133 prove --merge --exec '' - < $BUILD_PATH/tests/fast_regression --archive $WORKSPACE/tap/fast_regression/ || true
134 prove --merge --exec '' - < $BUILD_PATH/tests/with_bindings_regression --archive $WORKSPACE/tap/with_bindings_regression/ || true
aab8dc1c
JR
135fi
136
137# TAP plugin is having a hard time with .yml files.
138rm -f $WORKSPACE/tap/unit/meta.yml
139rm -f $WORKSPACE/tap/fast_regression/meta.yml
140rm -f $WORKSPACE/tap/with_bindings_regression/meta.yml
141
142# And also with files without extension, so rename all result to *.tap
143find $WORKSPACE/tap/unit/ -type f -exec mv {} {}.tap \;
144find $WORKSPACE/tap/fast_regression/ -type f -exec mv {} {}.tap \;
145find $WORKSPACE/tap/with_bindings_regression/ -type f -exec mv {} {}.tap \;
146
147# Cleanup
148make clean
149
150# Cleanup rpath and libtool .la files
151find $WORKSPACE/build/bin -executable -type f -exec chrpath --delete {} \;
152find $WORKSPACE/build/lib -name "*.so" -exec chrpath --delete {} \;
153find $WORKSPACE/build/lib -name "*.la" -exec rm -f {} \;
b1fe9891
JR
154
155# Clean temp dir for dist build
156if [ $build = "dist" ]; then
157 rm -rf $BUILD_PATH
158fi
This page took 0.032757 seconds and 4 git commands to generate.