eb75863e32fcf2ca0ffdce1c69aba9c318372c3e
[lttng-ci.git] / babeltrace / babeltrace-master.sh
1 # Create build directory
2 rm -rf $WORKSPACE/build
3 mkdir -p $WORKSPACE/build
4
5 PREFIX="$WORKSPACE/build"
6
7 ./bootstrap
8
9 CONF_OPTS=""
10
11 case "$conf" in
12 static)
13 echo "Static build"
14 CONF_OPTS="--enable-static --disable-shared"
15 ;;
16 python_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 ;;
27 esac
28
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
36
37 BUILD_PATH=$WORKSPACE
38 TEST_PLAN_PATH=$WORKSPACE
39
40 case "$build" in
41 oot)
42 echo "Out of tree build"
43 BUILD_PATH=$WORKSPACE/oot
44 mkdir -p $BUILD_PATH
45 cd $BUILD_PATH
46 $WORKSPACE/configure --prefix=$PREFIX $CONF_OPTS
47 ;;
48 dist)
49 echo "Distribution out of tree build"
50 BUILD_PATH=`mktemp -d`
51
52 # Initial configure and generate tarball
53 ./configure
54 make dist
55
56 mkdir -p $BUILD_PATH
57 cp *.tar.* $BUILD_PATH/
58 cd $BUILD_PATH
59
60 # Ignore level 1 of tar
61 tar xvf *.tar.* --strip 1
62
63 $BUILD_PATH/configure --prefix=$PREFIX $CONF_OPTS
64
65 # Set test plan to dist tar
66 TEST_PLAN_PATH=$BUILD_PATH
67 ;;
68 *)
69 echo "Standard tree build"
70 $WORKSPACE/configure --prefix=$PREFIX $CONF_OPTS
71 ;;
72 esac
73
74 make
75 make install
76
77 rm -rf $WORKSPACE/tap
78 mkdir -p $WORKSPACE/tap
79
80 cd $BUILD_PATH/tests
81
82 # Run make check tests
83 if [ -e $TEST_PLAN_PATH/tests/tests ]; then
84 prove --merge --exec '' - < $TEST_PLAN_PATH/tests/tests --archive $WORKSPACE/tap/ || true
85 else
86 echo "Missing test plan"
87 exit 1
88 fi
89
90 # TAP plugin is having a hard time with .yml files.
91 rm -f $WORKSPACE/tap/meta.yml
92
93 # And also with files without extension, so rename all result to *.tap
94 find $WORKSPACE/tap/ -type f -exec mv {} {}.tap \;
95
96 make clean
97
98 # Cleanup rpath and libtool .la files
99 find $WORKSPACE/build/bin -executable -type f -exec chrpath --delete {} \;
100 find $WORKSPACE/build/lib -name "*.so" -exec chrpath --delete {} \;
101 find $WORKSPACE/build/lib -name "*.la" -exec rm -f {} \;
102
103 if [ $build = "dist" ]; then
104 rm -rf $BUILD_PATH
105 fi
This page took 0.046814 seconds and 3 git commands to generate.