Commit | Line | Data |
---|---|---|
ad17f523 JT |
1 | #!/bin/bash -x |
2 | set -o errexit | |
3 | set -o nounset | |
4 | ||
2e525d6f JT |
5 | # where is the source? (todo: we could checkout from svn) |
6 | ||
7 | LIBT2NSRC="$PWD/../libt2n" | |
8 | LIBT2N_EXAMPLES="$PWD/lib2n-example" | |
9 | ||
10 | # general settings | |
11 | ||
ad17f523 JT |
12 | # todo: safe temp dir creation |
13 | INSTDIR="/tmp/jens-delme" | |
14 | mkdir "$INSTDIR" | |
15 | INSTPREFIX="/tmp/jens-delme/usr" | |
7f435356 | 16 | MAKE="dmake" |
ad17f523 | 17 | VERSION="0.1" |
ad17f523 JT |
18 | |
19 | function append() { | |
20 | if [ "x$1" = "x" ]; then | |
21 | echo "$2" | |
22 | else | |
23 | echo "$1:$2" | |
24 | fi | |
25 | } | |
26 | ||
27 | ||
2e525d6f JT |
28 | # 1. build and install lib and codegen |
29 | cd "$LIBT2NSRC" | |
30 | ./configure --prefix="$INSTPREFIX" | |
31 | # todo: at the moment running make dist on clean source does not work | |
32 | $MAKE | |
33 | $MAKE distcheck | |
34 | #$MAKE dist | |
35 | $MAKE install | |
36 | ||
37 | echo "OK: library and code generator compiled and installed" | |
ad17f523 | 38 | |
2e525d6f JT |
39 | |
40 | # prepare environment to use installed libt2n and code generator in non-standard directory | |
ad17f523 | 41 | # temporarily disable nounset |
2e525d6f | 42 | |
ad17f523 JT |
43 | set +o nounset |
44 | export PATH=$(append "$PATH" "$INSTPREFIX/bin") | |
45 | export LD_LIBRARY_PATH=$(append "$LD_LIBRARY_PATH" "$INSTPREFIX/lib") | |
46 | export PKG_CONFIG_PATH=$(append "$PKG_CONFIG_PATH" "$INSTPREFIX/lib/pkgconfig") | |
47 | set -o nounset | |
48 | ||
2e525d6f JT |
49 | # 2. build example-codegen |
50 | cd "$LIBT2N_EXAMPLES/example-codegen" | |
ad17f523 | 51 | autoreconf -f -i -M "$INSTDIR/usr/share/aclocal" |
7f435356 | 52 | ./configure --prefix="$INSTPREFIX" |
ad17f523 JT |
53 | # todo: at the moment running make dist on clean source does not work |
54 | $MAKE | |
55 | $MAKE distcheck | |
7f435356 | 56 | $MAKE install |
7f435356 JT |
57 | echo "OK: example using installed libt2n works" |
58 | ||
2e525d6f JT |
59 | # 3. compile client using the installed default lib |
60 | cd "$EXAMPLE_LIBUSAGE/example-libusage" | |
7f435356 JT |
61 | autoreconf -f -i -M "$INSTDIR/usr/share/aclocal" |
62 | ./configure --prefix="$INSTPREFIX" | |
63 | $MAKE distcheck | |
53b891ed | 64 | echo "OK: example using installed example lib works" |