moved examples out of libt2n into libt2n-example
authorJens Thiele <jens.thiele@intra2net.com>
Mon, 11 Dec 2006 12:36:26 +0000 (12:36 +0000)
committerJens Thiele <jens.thiele@intra2net.com>
Mon, 11 Dec 2006 12:36:26 +0000 (12:36 +0000)
Makefile.am
configure.in
test-build-install-use

index 139f678..1fc3516 100644 (file)
@@ -2,7 +2,7 @@
 # have all needed files, that a GNU package needs
 AUTOMAKE_OPTIONS = foreign 1.4
 
-SUBDIRS = src doc test examples codegen example-codegen
+SUBDIRS = src doc test examples codegen
 
 # Install the pkg-config file:
 pkgconfigdir = $(libdir)/pkgconfig
index 1b30c42..fde7f94 100644 (file)
@@ -28,10 +28,10 @@ AC_SUBST(XMLPP_CFLAGS)
 AC_SUBST(XMLPP_LIBS)
 
 dnl fake installed libt2n (codegen) for example-codegen
-LIBT2N_CFLAGS="-I\$(top_srcdir)/src @BOOST_CPPFLAGS@ @CPPUNIT_CFLAGS@ -I\$(top_srcdir)/codegen"
-LIBT2N_LIBS="\$(top_builddir)/src/libt2n.la @BOOST_SERIALIZATION_LIB@ @BOOST_LDFLAGS@"
-LIBT2N_CODEGEN="\$(top_builddir)/codegen/libt2n-codegen"
-LIBT2N_CLIENT_PCTEMPLATE="\$(top_srcdir)/codegen/clientlib.pc.in"
+dnl LIBT2N_CFLAGS="-I\$(top_srcdir)/src @BOOST_CPPFLAGS@ @CPPUNIT_CFLAGS@ -I\$(top_srcdir)/codegen"
+dnl LIBT2N_LIBS="\$(top_builddir)/src/libt2n.la @BOOST_SERIALIZATION_LIB@ @BOOST_LDFLAGS@"
+dnl LIBT2N_CODEGEN="\$(top_builddir)/codegen/libt2n-codegen"
+dnl LIBT2N_CLIENT_PCTEMPLATE="\$(top_srcdir)/codegen/clientlib.pc.in"
 
 AC_SUBST(LIBT2N_CFLAGS)
 AC_SUBST(LIBT2N_LIBS)
@@ -41,4 +41,4 @@ AC_SUBST(LIBT2N_CLIENT_PCTEMPLATE)
 dnl todo: do not create .pc file in configure but in make
 dnl see also autoconf manual "Installation Directory Variables"
          
-AC_OUTPUT(Makefile doc/Doxyfile doc/Makefile src/Makefile libt2n.pc libt2n.spec test/Makefile examples/Makefile codegen/Makefile example-codegen/Makefile)
+AC_OUTPUT(Makefile doc/Doxyfile doc/Makefile src/Makefile libt2n.pc libt2n.spec test/Makefile examples/Makefile codegen/Makefile)
index 66954cc..7f9a23a 100755 (executable)
@@ -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