Out-of-tree build via make dist
[lttng-ci.git] / lttng-ust / lttng-ust-master.sh
CommitLineData
047da710
JRJ
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
9export CPPFLAGS="-I$URCU_INCS"
10export LDFLAGS="-L$URCU_LIBS"
11export LD_LIBRARY_PATH="$URCU_LIBS:$LD_LIBRARY_PATH"
12
13PREFIX="$WORKSPACE/build"
14
15./bootstrap
16
17CONF_OPTS=""
18
19case "$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# ;;
25java-agent)
26 echo "Java agent build"
27 export CLASSPATH="/usr/share/java/log4j-1.2.jar"
28 CONF_OPTS="--enable-java-agent-all"
29 ;;
394e01b4
JR
30python-agent)
31 echo "Python agent build"
32 CONF_OPTS="--enable-python-agent"
1fe5a885 33 ;;
047da710
JRJ
34*)
35 echo "Standard build"
36 CONF_OPTS=""
37 ;;
38esac
39
db6ef590
JR
40# Build type
41# oot : out-of-tree build
42# dist: build via make dist
43# * : normal tree build
e9d51536
JR
44#
45# Make sure to move to the build_path before continuing
46
47BUILD_PATH=$WORKSPACE
db6ef590
JR
48case "$build" in
49 oot)
50 BUILD_PATH=$WORKSPACE/oot
51 mkdir -p $BUILD_PATH
52 cd $BUILD_PATH
53 ;;
54 dist)
e9d51536
JR
55 BUILD_PATH=/tmp/dist
56
57 # Initial configure and generate tarball
58 ./configure
59 make dist
60
61 mkdir -p $BUILD_PATH
62 cp *.tar.* $BUILD_PATH/
63 cd $BUILD_PATH
64
65 # Ignore level 1 of tar
66 tar xvf *.tar.* --strip 1
db6ef590
JR
67 ;;
68 *)
e9d51536 69 BUILD_PATH=$WORKSPACE
db6ef590
JR
70 ;;
71esac
72
e9d51536 73$BUILD_PATH/configure --prefix=$PREFIX $CONF_OPTS
047da710
JRJ
74make V=1
75make install
76
77# Run tests
78rm -rf $WORKSPACE/tap
79mkdir -p $WORKSPACE/tap/unit
80
3b28c859 81cd $BUILD_PATH/tests
047da710 82
db6ef590 83prove --merge --exec '' - < $BUILD_PATH/tests/unit_tests --archive $WORKSPACE/tap/unit/ || true
047da710
JRJ
84
85# TAP plugin is having a hard time with .yml files.
86rm -f $WORKSPACE/tap/unit/meta.yml
87
88# And also with files without extension, so rename all result to *.tap
89find $WORKSPACE/tap/unit/ -type f -exec mv {} {}.tap \;
90
91# Cleanup
92make clean
93
94# Cleanup rpath and libtool .la files
95find $WORKSPACE/build/lib -name "*.so" -exec chrpath --delete {} \;
96find $WORKSPACE/build/lib -name "*.la" -exec rm -f {} \;
This page took 0.027397 seconds and 4 git commands to generate.