Commit | Line | Data |
---|---|---|
047da710 JRJ |
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 | ;; | |
394e01b4 JR |
30 | python-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 | ;; | |
38 | esac | |
39 | ||
db6ef590 JR |
40 | # Build type |
41 | # oot : out-of-tree build | |
42 | # dist: build via make dist | |
43 | # * : normal tree build | |
e9d51536 | 44 | # |
58d447bc JR |
45 | # Make sure to move to the build_path and configure |
46 | # before continuing | |
e9d51536 JR |
47 | |
48 | BUILD_PATH=$WORKSPACE | |
db6ef590 JR |
49 | case "$build" in |
50 | oot) | |
371b695f | 51 | echo "Out of tree build" |
db6ef590 JR |
52 | BUILD_PATH=$WORKSPACE/oot |
53 | mkdir -p $BUILD_PATH | |
54 | cd $BUILD_PATH | |
58d447bc | 55 | $WORKSPACE/configure --prefix=$PREFIX $CONF_OPTS |
db6ef590 JR |
56 | ;; |
57 | dist) | |
371b695f | 58 | echo "Distribution out of tree build" |
b091cfed | 59 | BUILD_PATH=`mktemp -d` |
e9d51536 JR |
60 | |
61 | # Initial configure and generate tarball | |
62 | ./configure | |
63 | make dist | |
64 | ||
65 | mkdir -p $BUILD_PATH | |
66 | cp *.tar.* $BUILD_PATH/ | |
67 | cd $BUILD_PATH | |
68 | ||
69 | # Ignore level 1 of tar | |
70 | tar xvf *.tar.* --strip 1 | |
3801bff5 JR |
71 | |
72 | $BUILD_PATH/configure --prefix=$PREFIX $CONF_OPTS | |
db6ef590 JR |
73 | ;; |
74 | *) | |
e9d51536 | 75 | BUILD_PATH=$WORKSPACE |
371b695f | 76 | echo "Standard tree build" |
58d447bc | 77 | $WORKSPACE/configure --prefix=$PREFIX $CONF_OPTS |
db6ef590 JR |
78 | ;; |
79 | esac | |
80 | ||
047da710 JRJ |
81 | make V=1 |
82 | make install | |
83 | ||
84 | # Run tests | |
85 | rm -rf $WORKSPACE/tap | |
86 | mkdir -p $WORKSPACE/tap/unit | |
87 | ||
3b28c859 | 88 | cd $BUILD_PATH/tests |
047da710 | 89 | |
9501712d | 90 | prove --merge --exec '' - < $BUILD_PATH/tests/unit_tests --archive $WORKSPACE/tap/unit/ || true |
047da710 JRJ |
91 | |
92 | # TAP plugin is having a hard time with .yml files. | |
93 | rm -f $WORKSPACE/tap/unit/meta.yml | |
94 | ||
95 | # And also with files without extension, so rename all result to *.tap | |
96 | find $WORKSPACE/tap/unit/ -type f -exec mv {} {}.tap \; | |
97 | ||
98 | # Cleanup | |
99 | make clean | |
100 | ||
101 | # Cleanup rpath and libtool .la files | |
102 | find $WORKSPACE/build/lib -name "*.so" -exec chrpath --delete {} \; | |
103 | find $WORKSPACE/build/lib -name "*.la" -exec rm -f {} \; | |
b091cfed | 104 | |
8bd5f3b6 | 105 | # Clean temp dir for dist build |
4f686830 | 106 | if [ $build = "dist" ]; then |
b091cfed JR |
107 | rm -rf $BUILD_PATH |
108 | fi |