3 # Synfig Studio Bootstrap Script
4 # $Id: bootstrap,v 1.2 2005/01/10 08:13:44 darco Exp $
6 # This script creates the configure script and Makefile.in files,
7 # and also fixes a few things in both to ensure a smooth build
8 # on all compilers and platforms.
11 # Grab the current directory and move to our own
15 # Environment Variables
16 BOOTSTRAP_NAME=$(basename $0)
17 CONFIG_DIR=$(pwd)/config
19 . $CONFIG_DIR/build.cfg
22 s/@PACKAGE@/$PACKAGE/g;
23 s/@PACKAGE_NAME@/$PACKAGE_NAME/g;
24 s/@PACKAGE_BUGREPORT@/$PACKAGE_BUGREPORT/g;
25 s/@PACKAGE_TARNAME@/$PACKAGE_TARNAME/g;
26 s/@PACKAGE_VERSION@/$PACKAGE_VERSION/g;
27 s|@SVN_REPOSITORY@|$SVN_REPOSITORY|g;
28 s/@VERSION@/$VERSION/g;
29 s/@VERSION_MAJ@/$VERSION_MAJ/g;
30 s/@VERSION_MIN@/$VERSION_MIN/g;
31 s/@VERSION_REV@/$VERSION_REV/g;
32 s/@VERSION_REL@/$VERSION_REL/g;
36 # Required automake and autoconf versions
40 export WANT_AUTOMAKE=1.8
41 export WANT_AUTOCONF_2_5=1
44 INTLTOOLIZE=intltoolize
50 # Define the output function
52 echo $BOOTSTRAP_NAME: $*
55 # Define the cleanup function
58 rm -fr config.cache autom4te*.cache configure.in $TEMPFILE
61 output Prepairing build environment for $PACKAGE-$VERSION...
63 # Look for the CVS directory. If we don't find it, we need to
64 # ask the user if they know what they are doing.
65 ( test -d CVS || test -d .svn ) ||
68 $BOOTSTRAP_NAME: warning: This shell script is intended for those
69 $BOOTSTRAP_NAME: warning: who either know what they are doing or
70 $BOOTSTRAP_NAME: warning: or downloaded this program from the CVS
71 $BOOTSTRAP_NAME: warning: repository. See README for more details.
72 $BOOTSTRAP_NAME: warning: To avoid seeing this message in the future,
73 $BOOTSTRAP_NAME: warning: create an empty directory called 'CVS'."
74 echo Waiting for 15 seconds...
78 # Create the temporary file
79 output Creating temporary file...
80 TEMPFILE=`mktemp /tmp/$BOOTSTRAP_NAME.XXXXXX` ||
82 output ERROR: Unable to create temporary file!
87 (which autoconf > /dev/null 2>&1 ) ||
89 output error: 'Could not find GNU autoconf!'
90 output You need to download and install GNU autoconf v2.52 or higher.
91 output '<ftp://ftp.gnu.org/gnu/autoconf>'
96 # Check autoconf version
97 output Using $(autoconf --version | grep utoconf)
98 autoconf --version | grep -q "$AUTOCONF_VERSION" || echo \
99 "$BOOTSTRAP_NAME: warning: Unexpected version of GNU Autoconf (expected $AUTOCONF_VERSION)
100 $BOOTSTRAP_NAME: warning: *** Bootstrap process may fail!"
103 (which automake > /dev/null 2>&1 ) ||
105 output error: 'Could not find GNU automake!'
106 output You need to download and install GNU automake v1.5 or higher.
107 output '<ftp://ftp.gnu.org/gnu/automake>'
112 # Check automake version
113 output Using $(automake --version | grep utomake)
114 automake --version | grep -q "$AUTOMAKE_VERSION" || echo \
115 "$BOOTSTRAP_NAME: warning: Unexpected version of GNU Automake (expected $AUTOMAKE_VERSION)
116 $BOOTSTRAP_NAME: warning: *** Bootstrap process may fail!"
119 (which libtool > /dev/null 2>&1 ) ||
121 output error: 'Could not find GNU libtool!'
122 output You need to download and install GNU libtool v1.4 or higher.
123 output '<ftp://ftp.gnu.org/gnu/libtool>'
127 # Check libtool version
128 output Using $(libtoolize --version | grep ibtool)
129 libtoolize --version | grep -q "$LIBTOOL_VERSION" || echo \
130 "$BOOTSTRAP_NAME: warning: Unexpected version of GNU Libtool (expected $LIBTOOL_VERSION)
131 $BOOTSTRAP_NAME: warning: *** Bootstrap process may fail!"
136 s:${srcdir}/intltool:${ac_aux_dir}/intltool:g;
137 s.printf ("\\t%s @ %ld ;\\n", erva+name_rva, 1+ i);.printf ("\\t\\"%s\\" @ %ld ;\\n", erva+name_rva, 1+ i);.;
138 ' < aclocal.m4 > $TEMPFILE &&
140 mv $TEMPFILE aclocal.m4
143 for FILENAME in project.spec ; do {
144 output Creating $FILENAME...
145 sed "$SED_SCRIPT" < $CONFIG_DIR/$FILENAME.in > $FILENAME;
148 output Renaming project.spec to $PACKAGE.spec...
149 mv project.spec "$PACKAGE.spec"
151 output Finishing up $PACKAGE.spec...
152 echo %changelog >> "$PACKAGE.spec"
153 cat ChangeLog >> "$PACKAGE.spec"
155 output Creating configure.in from configure.ac...
156 sed "$SED_SCRIPT" < $CONFIG_DIR/configure.ac > configure.in;
158 output Setting up build environment...
160 # Set the shell to output what we are doing
163 # Create all of the build environment files
167 $ACLOCAL -I $CONFIG_DIR $ACLOCAL_FLAGS &&
170 $AUTOMAKE --foreign --add-missing --copy --include-deps &&
171 $AUTOCONF -o configure &&
175 # Something went wrong...
182 # Turn off echoing of commands
185 #output Patching configure script to look for gcc3...
187 #s/g++ c++/g++3 g++ c++/;
188 #s/gcc cc/gcc3 gcc cc/;
189 #s:"'${prefix}/include'":"'${prefix}/include/synfig'":;
190 #s:PREFIX/include:PREFIX/include/ETL:;
191 #" < configure > $TEMPFILE
192 #cp $TEMPFILE configure
194 # Patch the Makefile.in files
195 for filename in $(find Makefile.in src -name Makefile.in) ; do {
196 echo $BOOTSTRAP_NAME: Patching $filename
198 cp $filename $TEMPFILE &&
201 s;-I"'$(srcdir)'" ;-I"'$(top_srcdir)'" ;
202 s;configure.in;config/configure.ac;
203 " < $TEMPFILE > $filename
207 output Failure. Unable to patch $filename.
213 output Creating Makefile...
216 ./configure --enable-maintainer-mode
220 ./configure --enable-maintainer-mode
224 ./configure --enable-maintainer-mode
228 ./configure --enable-maintainer-mode
232 ./configure --enable-maintainer-mode
235 TAG=${PACKAGE_TARNAME}_${VERSION_MAJ}_${VERSION_MIN}_${VERSION_REV}
238 -svn delete $SVN_REPOSITORY/tags/stable -m \"Stabe Tag: Removing old tag\"
239 svn mkdir $SVN_REPOSITORY/tags/stable -m \"Stable Tag: Creating new directory\"
240 svn copy . $SVN_REPOSITORY/tags/stable -m \"Stable Tag: Copying everyhting over\"
243 svn mkdir $SVN_REPOSITORY/tags/\$(TAG) -m \"Release Tag: Making directory\"
244 svn copy . $SVN_REPOSITORY/tags/\$(TAG) -m \"Release \$(TAG)\"
248 echo $BOOTSTRAP_NAME: Complete.
252 # Move back to the current directory