Merge packaging scripts from master branch
[lttng-ci.git] / lttng-ust / lttng-ust-stable-2.6.sh
CommitLineData
def48d5b
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 ;;
30*)
31 echo "Standard build"
32 CONF_OPTS=""
33 ;;
34esac
35
8bd5f3b6
JR
36# Build type
37# oot : out-of-tree build
38# dist: build via make dist
39# * : normal tree build
40#
41# Make sure to move to the build_path and configure
42# before continuing
43
44BUILD_PATH=$WORKSPACE
45case "$build" in
46 oot)
47 echo "Out of tree build"
48 BUILD_PATH=$WORKSPACE/oot
49 mkdir -p $BUILD_PATH
50 cd $BUILD_PATH
51 $WORKSPACE/configure --prefix=$PREFIX $CONF_OPTS
52 ;;
53 dist)
54 echo "Distribution out of tree build"
55 BUILD_PATH=`mktemp -d`
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
67
68 $BUILD_PATH/configure --prefix=$PREFIX $CONF_OPTS
69 ;;
70 *)
71 BUILD_PATH=$WORKSPACE
72 echo "Standard tree build"
73 $WORKSPACE/configure --prefix=$PREFIX $CONF_OPTS
74 ;;
75esac
76
def48d5b
JRJ
77make V=1
78make install
79
80# Run tests
81rm -rf $WORKSPACE/tap
82mkdir -p $WORKSPACE/tap/unit
83
8bd5f3b6 84cd $BUILD_PATH/tests
def48d5b 85
9501712d 86prove --merge --exec '' - < $BUILD_PATH/tests/unit_tests --archive $WORKSPACE/tap/unit/ || true
def48d5b
JRJ
87
88# TAP plugin is having a hard time with .yml files.
89rm -f $WORKSPACE/tap/unit/meta.yml
90
91# And also with files without extension, so rename all result to *.tap
92find $WORKSPACE/tap/unit/ -type f -exec mv {} {}.tap \;
93
94# Cleanup
95make clean
96
97# Cleanup rpath and libtool .la files
98find $WORKSPACE/build/lib -name "*.so" -exec chrpath --delete {} \;
99find $WORKSPACE/build/lib -name "*.la" -exec rm -f {} \;
8bd5f3b6
JR
100
101# Clean temp dir for dist build
102if [ $build = "dist" ]; then
103 rm -rf $BUILD_PATH
104fi
This page took 0.026261 seconds and 4 git commands to generate.