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
31 # newer autoreconf (autoconf) versions don't have the -M option and no real replacement :-(
32 # (you can only set ACLOCAL_AMFLAGS in the Makefile.am)
33 # todo: this IMHO should be filed as bug against autoconf
35 autoreconf -f -i $@ || { aclocal --force $(echo "$@"|sed 's,-M,-I,') && libtoolize --copy --force && autoconf --force && automake --add-missing --copy --force-missing; }
36 ./configure --prefix="$INSTPREFIX"
39 ./configure --prefix="$INSTPREFIX"
41 # ensure make clean works twice (did not work at some point)
44 # todo: at the moment distcheck does not work on a distclean source
53 # 1. build and install lib and codegen
56 echo "OK: library and code generator compiled and installed"
58 # prepare environment to use installed libt2n and code generator in non-standard directory
59 # temporarily disable nounset
62 export PATH=$(prepend "$PATH" "$INSTPREFIX/bin")
63 export LD_LIBRARY_PATH=$(prepend "$LD_LIBRARY_PATH" "$INSTPREFIX/lib")
64 export PKG_CONFIG_PATH=$(prepend "$PKG_CONFIG_PATH" "$INSTPREFIX/lib/pkgconfig")
67 for EXAMPLE in $(seq 1 $EXAMPLES); do
71 cp -af "$LIBT2N_EXAMPLES/example$EXAMPLE" "$BUILDDIR"
72 cd "$BUILDDIR/example$EXAMPLE"
73 build -M "$INSTPREFIX/share/aclocal"
74 echo "OK: example $EXAMPLE using installed libt2n works"
76 # 3. compile client using the now installed default lib
77 cp -af "$LIBT2N_EXAMPLES/example$EXAMPLE-client" "$BUILDDIR"
78 cd "$BUILDDIR/example$EXAMPLE-client"
79 build -M "$INSTPREFIX/share/aclocal"
80 echo "OK: example $EXAMPLE using installed example lib works"
82 # 4. test installed server and client
83 libt2n-example$EXAMPLE-server &
87 if libt2n-example$EXAMPLE-client; then
88 echo "installed client and server work"
91 echo "installed client and server don't work"
95 if [ "$RET" = "1" ]; then
100 echo Everything is fine