#!/bin/bash -x set -o errexit set -o nounset # todo: safe temp dir creation INSTDIR="/tmp/jens-delme" mkdir "$INSTDIR" INSTPREFIX="/tmp/jens-delme/usr" MAKE="dmake" ./configure --prefix="$INSTPREFIX" # todo: at the moment running make dist on clean source does not work $MAKE #$MAKE distcheck $MAKE dist $MAKE install echo "OK: library and code generator compiled and installed" VERSION="0.1" TARFILE="libt2n-$VERSION.tar.gz" cp "$TARFILE" "$INSTDIR" EXAMPLE_LIBUSAGE="example-libusage" cp -af "$EXAMPLE_LIBUSAGE" "$INSTDIR" # now build example-client using installed libt2n cd "$INSTDIR" function append() { if [ "x$1" = "x" ]; then echo "$2" else echo "$1:$2" fi } # adjust some environment variables # (this is needed because we installed in non-standard directories) # temporarily disable nounset set +o nounset export PATH=$(append "$PATH" "$INSTPREFIX/bin") export LD_LIBRARY_PATH=$(append "$LD_LIBRARY_PATH" "$INSTPREFIX/lib") export PKG_CONFIG_PATH=$(append "$PKG_CONFIG_PATH" "$INSTPREFIX/lib/pkgconfig") set -o nounset tar xzvf "$TARFILE" mv "libt2n-$VERSION/example-codegen" . cd example-codegen autoreconf -f -i -M "$INSTDIR/usr/share/aclocal" ./configure --prefix="$INSTPREFIX" # todo: at the moment running make dist on clean source does not work $MAKE $MAKE distcheck $MAKE install cd .. echo "OK: example using installed libt2n works" # now compile client using the installed default lib cd "$EXAMPLE_LIBUSAGE" autoreconf -f -i -M "$INSTDIR/usr/share/aclocal" ./configure --prefix="$INSTPREFIX" $MAKE distcheck echo "OK: example using installed example lib works"