-tla register-archive guile-gnome-devel@gnu.org--2004 \
- http://people.debian.org/~rotty/arch/guile-gnome-devel@gnu.org/2004/ || true
-rm -rf guile-gnome
-tla get guile-gnome-devel@gnu.org--2004/dists--dev guile-gnome
-cd guile-gnome
-tla build-config -r configs/gnu.org/dev
-cd src
-
-## 6. get the gnome canvas module
-tla get guile-gnome-devel@gnu.org--2004/libgnomecanvas--dev libgnomecanvas
-
-rm -rf $OPT/guile-gnome
-sh autogen.sh --noconfigure
-mkdir ../=build
-cd ../=build
-
-export GUILE_LOAD_PATH=$OPT/g-wrap/share/guile/site:$GUILE_LOAD_PATH
-export LD_LIBRARY_PATH=$OPT/g-wrap/lib:$LD_LIBRARY_PATH
-PKG_CONFIG_PATH=$OPT/g-wrap/lib/pkgconfig:$PKG_CONFIG_PATH
-
-../src/configure --prefix=$OPT/guile-gnome
-make install CC=$GCC G_WRAP_MODULE_DIR=$OPT/g-wrap/share/guile/site
-
-GUILE_LOAD_PATH=$OPT/guile-gnome/share/guile:$GUILE_LOAD_PATH
-LD_LIBRARY_PATH=$OPT/guile-gnome/lib:$LD_LIBRARY_PATH
-
-# simple test
-guile -s ../src/libgnomecanvas/examples/canvas.scm
+if ! pkg-config --atleast-version=$GGVERSION guile-gnome-glib; then
+ if [ -n "$BLOEDIGE_RAND" ]; then
+
+ if false; then # rotty
+ tla register-archive guile-gnome-devel@gnu.org--2004 \
+ http://people.debian.org/~rotty/arch/guile-gnome-devel@gnu.org/2004/ || true
+ tla get guile-gnome-devel@gnu.org--2004/dists--dev guile-gnome
+ cd guile-gnome
+ tla build-config -r configs/gnu.org/dev
+ cd src
+
+ # 5a. get extra modules (gnome canvas)
+ for i in $EXTRA; do
+ tla get guile-gnome-devel@gnu.org--2004/$i--dev $i
+ done
+ else # andy
+ tla register-archive wingo@pobox.com--2004-main \
+ http://ambient.2y.net/wingo/arch/wingo@pobox.com--2004-main || true
+
+ tla get wingo@pobox.com--2004-main/guile-gnome-dists--release guile-gnome
+ cd guile-gnome
+ tla build-config -r configs/gnu.org/guile-gnome-platform-$GGVERSION
+ cd src
+ EXTRA="pkg atk defs glib gstreamer gtk gtksourceview libgda libglade libgnome libgnomeui pango libgnomecanvas"
+ EXTRA=
+
+ # 5a. get extra modules (gnome canvas)
+ for i in $EXTRA; do
+ tla get wingo@pobox.com--2004-main/guile-gnome-$i--release $i
+ done
+
+ cd libgnomecanvas
+ cd ..
+ fi
+
+ if [ ! -f configure ]; then
+ sh autogen.sh --noconfigure
+ fi
+ cd ..
+ srcdir="../src"
+ else
+ #$WGET http://download.gna.org/guile-gnome/releases/guile-gnome-platform-$GGVERSION.tar.gz
+ $WGET ftp://ftp.gnu.org/gnu/guile-gnome/guile-gnome-platform/guile-gnome-platform-$GGVERSION.tar.gz
+ tar xzf $download/guile-gnome-platform-$GGVERSION.tar.gz
+ ln -s guile-gnome-platform-$GGVERSION guile-gnome
+ cd guile-gnome
+ srcdir="../"
+ fi
+
+ rm -rf $OPT/guile-gnome
+ mkdir =build
+ cd =build
+
+# Using libtool < 1.6.0 together with gcc-3.4 may trigger this problem:
+#
+# If a tag has not been given, and we're using a compiler which is
+# not one of the ones with which libtool was built, attempt to
+# infer the compiler from the first word of the command line passed
+# to libtool.
+#
+ if [ -z "$GCC34" ]; then
+ # Use libtool-1.5.6, gcc-3.{2,3} without -O2,
+ CFLAGS='-O -g' $srcdir/configure --prefix=$OPT/guile-gnome --enable-maintainer-mode
+ else
+ # or use gcc-3.4 with libtool-1.6.0
+ CC=$GCC34 $srcdir/configure --prefix=$OPT/guile-gnome --enable-maintainer-mode
+ fi
+ make all install G_WRAP_MODULE_DIR=$OPT/g-wrap/share/guile/site
+ PKG_CONFIG_PATH=$OPT/guile-gnome/lib/pkgconfig:$PKG_CONFIG_PATH
+ LD_LIBRARY_PATH=$OPT/guile-gnome/lib:$LD_LIBRARY_PATH
+ GUILE_LOAD_PATH=$OPT/guile-gnome/share/guile:$GUILE_LOAD_PATH
+fi
+
+cat <<EOF
+***********************************************************************
+Before using with Lily, do
+
+ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH
+ export GUILE_LOAD_PATH=$GUILE_LOAD_PATH
+ export PKG_CONFIG_PATH=$PKG_CONFIG_PATH
+EOF
+
+# simple test -- fails atm
+# guile -s ../src/libgnomecanvas/examples/canvas.scm