X-Git-Url: http://developer.intra2net.com/git/?p=libt2n;a=blobdiff_plain;f=test-build-install-use;h=7f9a23a2eb95ea2605ce73b83fbfdbee68a50da4;hp=fde6bdcca3419234b1c421ffbbc3606259915f3f;hb=2e525d6f028017cfefb23046b2655b591348b663;hpb=53b891edf1f624b1c90eef94185a142cd067bdf8 diff --git a/test-build-install-use b/test-build-install-use index fde6bdc..7f9a23a 100755 --- a/test-build-install-use +++ b/test-build-install-use @@ -2,28 +2,19 @@ set -o errexit set -o nounset +# where is the source? (todo: we could checkout from svn) + +LIBT2NSRC="$PWD/../libt2n" +LIBT2N_EXAMPLES="$PWD/lib2n-example" + +# general settings + # 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 @@ -34,30 +25,39 @@ function append() { } -# adjust some environment variables -# (this is needed because we installed in non-standard directories) +# 1. build and install lib and codegen +cd "$LIBT2NSRC" +./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" + +# prepare environment to use installed libt2n and code generator in non-standard directory # 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 +# 2. build example-codegen +cd "$LIBT2N_EXAMPLES/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" +# 3. compile client using the installed default lib +cd "$EXAMPLE_LIBUSAGE/example-libusage" autoreconf -f -i -M "$INSTDIR/usr/share/aclocal" ./configure --prefix="$INSTPREFIX" $MAKE distcheck