Fixed a typo.
[synfig.git] / synfig-core / trunk / bootstrap
index c1d8b51..f2398d2 100755 (executable)
@@ -1,7 +1,7 @@
 #! /bin/sh
 #
-# Sinfg Bootstrap Script
-# $Id: bootstrap,v 1.2 2005/01/10 07:40:26 darco Exp $
+# Synfig 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
@@ -9,13 +9,17 @@
 #
 
 # Grab the current directory and move to our own
-CURR_DIR=$(pwd)
-cd $(dirname $0)
+CURR_DIR="$(pwd)"
+cd "$(dirname $0)"
 
 # Environment Variables
-BOOTSTRAP_NAME=$(basename $0)
-CONFIG_DIR=$(pwd)/config
+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"`"
 # Automake,Autoconf, and Libtool versions that we require
 #AUTOCONF_VERSION=2.5
 #AUTOMAKE_VERSION=1.6
@@ -25,7 +29,7 @@ export WANT_AUTOMAKE=1.8
 export WANT_AUTOCONF_2_5=1
 export WANT_AUTOCONF=2.5
 
-. $CONFIG_DIR/build.cfg
+. "$CONFIG_DIR/build.cfg"
 
 SED_SCRIPT="
 s/@PACKAGE@/$PACKAGE/g;
@@ -33,6 +37,7 @@ 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|@SVN_REPOSITORY@|$SVN_REPOSITORY|g;
 s/@VERSION@/$VERSION/g;
 s/@API_VERSION@/$API_VERSION/g;
 s/@VERSION_MAJ@/$VERSION_MAJ/g;
@@ -53,11 +58,11 @@ cleanup () {
        rm -fr config.cache autom4te*.cache configure.in $TEMPFILE
 }
 
-output Prepairing build environment for $PACKAGE-$VERSION...
+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 CVS || test -d .svn ) ||
 {
        output warning: This shell script is intended for those
        output warning: who either know what they are doing or
@@ -138,21 +143,21 @@ RECONFIG_LTDL=1
 
 for FILENAME in doxygen.cfg pkgconfig.pc project.spec ; do {
 output Creating $FILENAME...
-sed "$SED_SCRIPT" < $CONFIG_DIR/$FILENAME.in > $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-$VERSION.spec...
-mv project.spec "$PACKAGE-$VERSION.spec"
+output Renaming project.spec to $PACKAGE.spec...
+mv project.spec "$PACKAGE.spec"
 
-output Finishing up $PACKAGE-$VERSION.spec...
-echo %changelog >> "$PACKAGE-$VERSION.spec"
-cat NEWS >> "$PACKAGE-$VERSION.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;
+sed "$SED_SCRIPT" < "$CONFIG_DIR/configure.ac" > configure.in;
 
 output Setting up build environment...
 
@@ -162,7 +167,7 @@ set -x
 # Create all of the build environment files
 (
        libtoolize -c -f --ltdl &&
-       aclocal -I $CONFIG_DIR $ACLOCAL_FLAGS &&
+       aclocal -I "$CONFIG_DIR" $ACLOCAL_FLAGS &&
        autoheader &&
        autoconf -o configure &&
        automake --foreign --add-missing --copy --include-deps &&
@@ -186,7 +191,7 @@ set +x
        (
                cd libltdl &&
                ( echo "AC_CONFIG_AUX_DIR(../config)" >> configure.[ai][cn] ) &&
-               aclocal -I $CONFIG_DIR &&
+               aclocal -I "../$CONFIG_DIR" &&
                autoheader &&
                autoconf &&
                automake --foreign --add-missing --copy
@@ -215,8 +220,20 @@ set +x
        " < libltdl/ltdl.h > $TEMPFILE && cp $TEMPFILE libltdl/ltdl.h
 )
 
+(
+output Patching libtool...
+patch config/ltmain.sh config/ltmain.patch
+) || true
+false && {
+       # Something went wrong...
+       set +x
+       output Failure.
+       cleanup;
+       exit 1
+}
+
 #echo '#define LTDL_SHLIB_EXT  ".so"' >> libltdl/config-h.in
-echo '
+#echo '
 #ifdef WIN32
 #define LTDL_SHLIB_EXT ".dll"
 #else
@@ -231,7 +248,7 @@ echo '
 # sed "
 # s/g++ c++/g++3 g++ c++/;
 # s/gcc cc/gcc3 gcc cc/;
-# s:"'${prefix}/include'":"'${prefix}/include/sinfg'":;
+# s:"'${prefix}/include'":"'${prefix}/include/synfig'":;
 # s:PREFIX/include:PREFIX/include/ETL:;
 # " < configure > $TEMPFILE
 # cp $TEMPFILE configure
@@ -293,4 +310,6 @@ output Complete.
 cleanup;
 
 # Move back to the current directory
-cd $CURR_DIR
+cd "$CURR_DIR"
+
+make -C src/synfig/proto