Add build tree configuration for babeltrace
[lttng-ci.git] / babeltrace / babeltrace-master.sh
CommitLineData
275b59d2
JRJ
1# Create build directory
2rm -rf $WORKSPACE/build
3mkdir -p $WORKSPACE/build
4
5PREFIX="$WORKSPACE/build"
6
7./bootstrap
8
9CONF_OPTS=""
10
11case "$conf" in
12static)
13 echo "Static build"
14 CONF_OPTS="--enable-static --disable-shared"
15 ;;
16python_bindings)
17 echo "Build with python bindings"
18 # We only support bindings built with Python 3
19 export PYTHON="python3"
20 export PYTHON_CONFIG="/usr/bin/python3-config"
21 CONF_OPTS="--enable-python-bindings"
22 ;;
23*)
24 echo "Standard build"
25 CONF_OPTS=""
26 ;;
27esac
28
aad6ac90
JR
29# Build type
30# oot : out-of-tree build
31# dist: build via make dist
32# * : normal tree build
33#
34# Make sure to move to the build_path and configure
35# before continuing
275b59d2 36
aad6ac90
JR
37BUILD_PATH=$WORKSPACE
38case "$build" in
39 oot)
40 echo "Out of tree build"
41 BUILD_PATH=$WORKSPACE/oot
42 mkdir -p $BUILD_PATH
43 cd $BUILD_PATH
44 $WORKSPACE/configure --prefix=$PREFIX $CONF_OPTS
45 ;;
46 dist)
47 echo "Distribution out of tree build"
48 BUILD_PATH=`mktemp -d`
49
50 # Initial configure and generate tarball
51 ./configure
52 make dist
53
54 mkdir -p $BUILD_PATH
55 cp *.tar.* $BUILD_PATH/
56 cd $BUILD_PATH
57
58 # Ignore level 1 of tar
59 tar xvf *.tar.* --strip 1
60
61 $BUILD_PATH/configure --prefix=$PREFIX $CONF_OPTS
62 ;;
63 *)
64 BUILD_PATH=$WORKSPACE
65 echo "Standard tree build"
66 $WORKSPACE/configure --prefix=$PREFIX $CONF_OPTS
67 ;;
68esac
69
70make V=1
275b59d2
JRJ
71make install
72
73rm -rf $WORKSPACE/tap
74mkdir -p $WORKSPACE/tap
75
aad6ac90 76cd $BUILD_PATH/tests
275b59d2
JRJ
77
78# Run make check tests
aad6ac90 79prove --merge --exec '' - < $BUILD_PATH/tests/tests --archive $WORKSPACE/tap/ || true
275b59d2
JRJ
80
81# TAP plugin is having a hard time with .yml files.
82rm -f $WORKSPACE/tap/meta.yml
83
84# And also with files without extension, so rename all result to *.tap
85find $WORKSPACE/tap/ -type f -exec mv {} {}.tap \;
86
87make clean
88
89# Cleanup rpath and libtool .la files
90find $WORKSPACE/build/bin -executable -type f -exec chrpath --delete {} \;
91find $WORKSPACE/build/lib -name "*.so" -exec chrpath --delete {} \;
92find $WORKSPACE/build/lib -name "*.la" -exec rm -f {} \;
aad6ac90
JR
93
94if [ $build = "dist" ]; then
95 rm -rf $BUILD_PATH
96fi
This page took 0.026149 seconds and 4 git commands to generate.