Fix: use temp directory to build when doing dist build_type
[lttng-ci.git] / lttng-ust / lttng-ust-master.sh
1 # Create build directory
2 rm -rf $WORKSPACE/build
3 mkdir -p $WORKSPACE/build
4
5 # liburcu
6 URCU_INCS="$WORKSPACE/dependencies/liburcu/build/include/"
7 URCU_LIBS="$WORKSPACE/dependencies/liburcu/build/lib/"
8
9 export CPPFLAGS="-I$URCU_INCS"
10 export LDFLAGS="-L$URCU_LIBS"
11 export LD_LIBRARY_PATH="$URCU_LIBS:$LD_LIBRARY_PATH"
12
13 PREFIX="$WORKSPACE/build"
14
15 ./bootstrap
16
17 CONF_OPTS=""
18
19 case "$conf" in
20 # Unsupported! liblttng-ust can't pull in it's static (.a) dependencies.
21 #static)
22 # echo "Static build"
23 # CONF_OPTS="--enable-static --disable-shared"
24 # ;;
25 java-agent)
26 echo "Java agent build"
27 export CLASSPATH="/usr/share/java/log4j-1.2.jar"
28 CONF_OPTS="--enable-java-agent-all"
29 ;;
30 python-agent)
31 echo "Python agent build"
32 CONF_OPTS="--enable-python-agent"
33 ;;
34 *)
35 echo "Standard build"
36 CONF_OPTS=""
37 ;;
38 esac
39
40 # Build type
41 # oot : out-of-tree build
42 # dist: build via make dist
43 # * : normal tree build
44 #
45 # Make sure to move to the build_path and configure
46 # before continuing
47
48 BUILD_PATH=$WORKSPACE
49 case "$build" in
50 oot)
51 BUILD_PATH=$WORKSPACE/oot
52 mkdir -p $BUILD_PATH
53 cd $BUILD_PATH
54 $WORKSPACE/configure --prefix=$PREFIX $CONF_OPTS
55 ;;
56 dist)
57 BUILD_PATH=`mktemp -d`
58
59 # Initial configure and generate tarball
60 ./configure
61 make dist
62
63 mkdir -p $BUILD_PATH
64 cp *.tar.* $BUILD_PATH/
65 cd $BUILD_PATH
66
67 # Ignore level 1 of tar
68 tar xvf *.tar.* --strip 1
69
70 $BUILD_PATH/configure --prefix=$PREFIX $CONF_OPTS
71 ;;
72 *)
73 BUILD_PATH=$WORKSPACE
74 $WORKSPACE/configure --prefix=$PREFIX $CONF_OPTS
75 ;;
76 esac
77
78 make V=1
79 make install
80
81 # Run tests
82 rm -rf $WORKSPACE/tap
83 mkdir -p $WORKSPACE/tap/unit
84
85 cd $BUILD_PATH/tests
86
87 prove --merge --exec '' - < $BUILD_PATH/tests/unit_tests --archive $WORKSPACE/tap/unit/ || true
88
89 # TAP plugin is having a hard time with .yml files.
90 rm -f $WORKSPACE/tap/unit/meta.yml
91
92 # And also with files without extension, so rename all result to *.tap
93 find $WORKSPACE/tap/unit/ -type f -exec mv {} {}.tap \;
94
95 # Cleanup
96 make clean
97
98 # Cleanup rpath and libtool .la files
99 find $WORKSPACE/build/lib -name "*.so" -exec chrpath --delete {} \;
100 find $WORKSPACE/build/lib -name "*.la" -exec rm -f {} \;
101
102 if [ $build = "dist" ] then
103 rm -rf $BUILD_PATH
104 fi
This page took 0.038954 seconds and 5 git commands to generate.