Release ETL_0_04_10_rc2
[synfig.git] / ETL / tags / ETL_0_04_10_rc2 / bootstrap
diff --git a/ETL/tags/ETL_0_04_10_rc2/bootstrap b/ETL/tags/ETL_0_04_10_rc2/bootstrap
new file mode 100755 (executable)
index 0000000..549b442
--- /dev/null
@@ -0,0 +1,220 @@
+#! /bin/sh
+#
+# Extended Template Library Bootstrap Script
+# $Id$
+# 
+# This script creates the configure script and Makefile.in files,
+# and also fixes a few things in both to ensure a smooth build
+# on all compilers and platforms.
+#
+
+# Grab the current directory and move to our own
+CURR_DIR="$(pwd)"
+cd "$(dirname $0)"
+
+# Environment Variables
+BOOTSTRAP_NAME="$(basename $0)"
+
+CONFIG_DIR="config"
+
+[ -x /bin/cygpath ] && CONFIG_DIR="`cygpath -m -s "$CONFIG_DIR"`"
+[ -x /bin/cygpath ] && CONFIG_DIR="`cygpath -u "$CONFIG_DIR"`"
+[ -x /bin/cygpath ] && CURR_DIR="`cygpath -m -s "$CURR_DIR"`"
+[ -x /bin/cygpath ] && CURR_DIR="`cygpath -u "$CURR_DIR"`"
+
+. "$CONFIG_DIR/build.cfg"
+
+SED_SCRIPT="
+s/@PACKAGE@/$PACKAGE/g;
+s/@PACKAGE_NAME@/$PACKAGE_NAME/g;
+s/@PACKAGE_BUGREPORT@/$PACKAGE_BUGREPORT/g;
+s/@PACKAGE_TARNAME@/$PACKAGE_TARNAME/g;
+s/@PACKAGE_VERSION@/$PACKAGE_VERSION/g;
+s/@VERSION@/$VERSION/g;
+s/@VERSION_MAJ@/$VERSION_MAJ/g;
+s/@VERSION_MIN@/$VERSION_MIN/g;
+s/@VERSION_REV@/$VERSION_REV/g;
+s/@VERSION_REL@/$VERSION_REL/g;
+s'@SVN_REPOSITORY@'$SVN_REPOSITORY'g;
+s/@CFLAGS@//g;
+"
+
+# Required automake and autoconf versions
+AUTOCONF_VERSION=2.5
+AUTOMAKE_VERSION=1.6
+LIBTOOL_VERSION=1.4
+export WANT_AUTOMAKE=1.6;
+export WANT_AUTOCONF_2_5=1;
+
+# Define the output function
+output () {
+       echo $BOOTSTRAP_NAME: $*
+}
+
+# Define the cleanup function
+cleanup () {
+       output Cleaning up...
+       rm -fr config.cache autom4te.cache configure.in $TEMPFILE
+}
+
+output Preparing build environment for $PACKAGE-$VERSION...
+
+# Look for the CVS directory. If we don't find it, we need to
+# ask the user if they know what they are doing.
+( test -d CVS || test -d .svn ) ||
+{
+       echo "
+$BOOTSTRAP_NAME: warning: This shell script is intended for those
+$BOOTSTRAP_NAME: warning: who either know what they are doing or
+$BOOTSTRAP_NAME: warning: or downloaded this program from the CVS
+$BOOTSTRAP_NAME: warning: repository. See README for more details.
+$BOOTSTRAP_NAME: warning: To avoid seeing this message in the future,
+$BOOTSTRAP_NAME: warning: create an empty directory called 'CVS'."
+       echo Waiting for 15 seconds...
+       sleep 15
+}
+
+# Create the temporary file
+output Creating temporary file...
+TEMPFILE=`mktemp /tmp/$BOOTSTRAP_NAME.XXXXXX` ||
+{
+       output ERROR: Unable to create temporary file!
+       exit 1
+}
+
+# Check for autoconf
+(which autoconf > /dev/null 2>&1 ) ||
+{
+       output error: 'Could not find GNU autoconf!'
+       output You need to download and install GNU autoconf v2.52 or higher.
+       output '<ftp://ftp.gnu.org/gnu/autoconf>'
+       cleanup;
+       exit 1
+}
+
+# Check autoconf version
+output Using $(autoconf --version | grep utoconf)
+autoconf --version | grep -q "$AUTOCONF_VERSION" || echo \
+"$BOOTSTRAP_NAME: warning: Unexpected version of GNU Autoconf (expected $AUTOCONF_VERSION)
+$BOOTSTRAP_NAME: warning: *** Bootstrap process may fail!"
+
+# Check for automake
+(which automake > /dev/null 2>&1 ) ||
+{
+       output error: 'Could not find GNU automake!'
+       output You need to download and install GNU automake v1.5 or higher.
+       output '<ftp://ftp.gnu.org/gnu/automake>'
+       cleanup;
+       exit 1
+}
+
+# Check automake version
+output Using $(automake --version | grep utomake)
+automake --version | grep -q "$AUTOMAKE_VERSION" || echo \
+"$BOOTSTRAP_NAME: warning: Unexpected version of GNU Automake (expected $AUTOMAKE_VERSION)
+$BOOTSTRAP_NAME: warning: *** Bootstrap process may fail!"
+
+for FILENAME in doxygen.cfg pkgconfig.pc project.spec ; do {
+output Creating $FILENAME...
+sed "$SED_SCRIPT" < "$CONFIG_DIR/$FILENAME.in" > $FILENAME;
+} ; done
+
+output Renaming pkgconfig.pc to $PACKAGE_TARNAME.pc.in...
+mv pkgconfig.pc "$PACKAGE_TARNAME.pc.in"
+
+output Renaming project.spec to $PACKAGE.spec...
+mv project.spec "$PACKAGE.spec"
+
+output Finishing up $PACKAGE.spec...
+echo %changelog >> "$PACKAGE.spec"
+cat NEWS >> "$PACKAGE.spec"
+
+output Creating configure.in from configure.ac...
+sed "$SED_SCRIPT" < "$CONFIG_DIR/configure.ac" > configure.in;
+
+output Generating ChangeLog from SVN
+if test x != "x$VERSION_REL" ; then export REVISION="--revision $VERSION_REL" ; fi
+test -f ChangeLog || svn2cl --include-rev $REVISION $SVN_REPOSITORY/trunk/ || touch ChangeLog
+
+output Setting up build environment...
+
+# Set the shell to output what we are doing
+set -x
+
+# Create all of the build environment files
+(
+       aclocal -I "$CONFIG_DIR" $ACLOCAL_FLAGS &&
+       autoheader &&
+       autoconf -o configure &&
+       automake --force-missing --add-missing --include-deps 
+) ||
+{
+       # Something went wrong...
+       set +x
+       echo $BOOTSTRAP_NAME: Failure.
+       cleanup;
+       exit 1
+}
+
+# Turn off echoing of commands
+set +x
+
+#output Patching configure script to look for gcc3...
+#sed "
+#s/g++ c++/g++3 g++ c++/;
+#s/gcc cc/gcc3 gcc cc/;
+#s:PREFIX/include:PREFIX/include/ETL:;
+#" < configure > $TEMPFILE
+#cp $TEMPFILE configure
+
+# Patch the Makefile.am files
+for filename in $(find Makefile.in ETL test -name Makefile.in) ; do {
+       echo $BOOTSTRAP_NAME: Patching $filename
+       (
+               cp $filename $TEMPFILE &&
+               sed "
+                       s;-I. ;;
+                       s;-I"'$(srcdir)'" ;-I"'$(top_srcdir)'" ;
+                       s;configure.in;config/configure.ac;
+               " < $TEMPFILE > $filename
+       ) ||
+       {
+               # Patch failure
+               echo $BOOTSTRAP_NAME: Failure. Unable to patch $filename.
+               cleanup;
+               exit 1
+       }
+}; done
+
+echo $BOOTSTRAP_NAME: Creating Makefile...
+( echo "
+all:
+       ./configure --enable-maintainer-mode
+       make all
+       
+install:
+       ./configure --enable-maintainer-mode
+       make install
+       
+check:
+       ./configure --enable-maintainer-mode
+       make check
+
+distcheck:
+       ./configure --enable-maintainer-mode
+       make check
+       
+dist:
+       ./configure --enable-maintainer-mode
+       make dist
+
+docs: doxygen.cfg
+       doxygen doxygen.cfg
+" ) > Makefile
+
+echo $BOOTSTRAP_NAME: Complete.
+
+cleanup;
+
+# Move back to the current directory
+cd "$CURR_DIR"