Commit | Line | Data |
---|---|---|
56162e2a JRJ |
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 | tls_fallback) | |
17 | echo "Using pthread_getspecific() to emulate TLS" | |
18 | CONF_OPTS="--disable-compiler-tls" | |
19 | ;; | |
20 | *) | |
21 | echo "Standard build" | |
22 | CONF_OPTS="" | |
23 | ;; | |
24 | esac | |
25 | ||
595a34c7 JR |
26 | # Build type |
27 | # oot : out-of-tree build | |
28 | # dist: build via make dist | |
29 | # * : normal tree build | |
30 | # | |
31 | # Make sure to move to the build_path and configure | |
32 | # before continuing | |
56162e2a | 33 | |
595a34c7 JR |
34 | BUILD_PATH=$WORKSPACE |
35 | case "$build" in | |
36 | oot) | |
37 | echo "Out of tree build" | |
38 | BUILD_PATH=$WORKSPACE/oot | |
39 | mkdir -p $BUILD_PATH | |
8a804acc JR |
40 | cd $BUILD_PATH |
41 | $WORKSPACE/configure --prefix=$PREFIX $CONF_OPTS | |
595a34c7 JR |
42 | ;; |
43 | dist) | |
44 | echo "Distribution out of tree build" | |
45 | BUILD_PATH=`mktemp -d` | |
46 | ||
47 | # Initial configure and generate tarball | |
48 | ./configure | |
49 | make dist | |
50 | ||
51 | mkdir -p $BUILD_PATH | |
52 | cp *.tar.* $BUILD_PATH/ | |
53 | cd $BUILD_PATH | |
54 | ||
55 | # Ignore level 1 of tar | |
8a804acc | 56 | tar xvf *.tar.* --strip 1 |
595a34c7 JR |
57 | |
58 | $BUILD_PATH/configure --prefix=$PREFIX $CONF_OPTS | |
59 | ;; | |
60 | *) | |
595a34c7 | 61 | BUILD_PATH=$WORKSPACE |
8a804acc JR |
62 | echo "Standard tree build" |
63 | $WORKSPACE/configure --prefix=$PREFIX $CONF_OPTS | |
64 | ;; | |
595a34c7 JR |
65 | esac |
66 | ||
cdcf7df4 | 67 | make |
56162e2a JRJ |
68 | make install |
69 | make clean | |
70 | ||
71 | # Cleanup rpath and libtool .la files | |
72 | find $WORKSPACE/build/lib -name "*.so" -exec chrpath --delete {} \; | |
73 | find $WORKSPACE/build/lib -name "*.la" -exec rm -f {} \; | |
595a34c7 | 74 | |
cdcf7df4 | 75 | # Cleanup temp directory of dist build |
4f686830 | 76 | if [ $build = "dist" ]; then |
595a34c7 JR |
77 | rm -rf $BUILD_PATH |
78 | fi |