5 # where is the source? (todo: we could checkout from svn)
8 LIBT2N_EXAMPLES="$PWD/examples-codegen"
13 # todo: safe temp dir creation
14 INSTDIR="/tmp/jens-delme"
15 BUILDDIR="$INSTDIR/build"
18 INSTPREFIX="$INSTDIR/usr"
23 if [ "x$1" = "x" ]; then
32 ./configure --prefix="$INSTPREFIX"
35 ./configure --prefix="$INSTPREFIX"
37 # ensure make clean works twice (did not work at some point)
40 # todo: at the moment distcheck does not work on a distclean source
49 # 1. build and install lib and codegen
52 echo "OK: library and code generator compiled and installed"
54 # prepare environment to use installed libt2n and code generator in non-standard directory
55 # temporarily disable nounset
58 export PATH=$(prepend "$PATH" "$INSTPREFIX/bin")
59 export LD_LIBRARY_PATH=$(prepend "$LD_LIBRARY_PATH" "$INSTPREFIX/lib")
60 export PKG_CONFIG_PATH=$(prepend "$PKG_CONFIG_PATH" "$INSTPREFIX/lib/pkgconfig")
63 for EXAMPLE in $(seq 1 $EXAMPLES); do
67 cp -af "$LIBT2N_EXAMPLES/example$EXAMPLE" "$BUILDDIR"
68 cd "$BUILDDIR/example$EXAMPLE"
69 build -M "$INSTPREFIX/share/aclocal"
70 echo "OK: example $EXAMPLE using installed libt2n works"
72 # 3. compile client using the now installed default lib
73 cp -af "$LIBT2N_EXAMPLES/example$EXAMPLE-client" "$BUILDDIR"
74 cd "$BUILDDIR/example$EXAMPLE-client"
75 build -M "$INSTPREFIX/share/aclocal"
76 echo "OK: example $EXAMPLE using installed example lib works"
78 # 4. test installed server and client
79 libt2n-example$EXAMPLE-server &
83 if libt2n-example$EXAMPLE-client; then
84 echo "installed client and server work"
87 echo "installed client and server don't work"
91 if [ "$RET" = "1" ]; then
96 echo Everything is fine