Reorganisation of the repo and cleanup
[lttng-ci.git] / scripts / babeltrace / babeltrace-stable-1.2.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 case "$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 ;;
68 esac
69
70 make
71 make install
72
73 rm -rf $WORKSPACE/tap
74 mkdir -p $WORKSPACE/tap
75
76 cd $BUILD_PATH/tests
77
78 # Run make check tests
79 if [ -e $BUILD_PATH/tests/tests ]; then
80 prove --merge --exec '' - < $BUILD_PATH/tests/tests --archive $WORKSPACE/tap/ || true
81 else
82 echo "Missing test plan"
83 exit 1
84 fi
85
86 # TAP plugin is having a hard time with .yml files.
87 rm -f $WORKSPACE/tap/meta.yml
88
89 # And also with files without extension, so rename all result to *.tap
90 find $WORKSPACE/tap/ -type f -exec mv {} {}.tap \;
91
92 make clean
93
94 # Cleanup rpath and libtool .la files
95 find $WORKSPACE/build/bin -executable -type f -exec chrpath --delete {} \;
96 find $WORKSPACE/build/lib -name "*.so" -exec chrpath --delete {} \;
97 find $WORKSPACE/build/lib -name "*.la" -exec rm -f {} \;
98
99 if [ $build = "dist" ]; then
100 rm -rf $BUILD_PATH
101 fi
This page took 0.036617 seconds and 4 git commands to generate.