3 # Synfig Studio Bootstrap Script
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)
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/@API_VERSION@/$API_VERSION/g;
30 s/@VERSION_MAJ@/$VERSION_MAJ/g;
31 s/@VERSION_MIN@/$VERSION_MIN/g;
32 s/@VERSION_REV@/$VERSION_REV/g;
33 s/@VERSION_REL@/$VERSION_REL/g;
37 # Required automake and autoconf versions
41 export WANT_AUTOMAKE=1.8
42 export WANT_AUTOCONF_2_5=1
45 INTLTOOLIZE=intltoolize
51 # Define the output function
53 echo $BOOTSTRAP_NAME: $*
56 # Define the cleanup function
59 rm -fr config.cache autom4te*.cache configure.in $TEMPFILE
62 output Preparing build environment for $PACKAGE-$VERSION...
64 # Look for the CVS directory. If we don't find it, we need to
65 # ask the user if they know what they are doing.
66 ( test -d CVS || test -d .svn ) ||
69 $BOOTSTRAP_NAME: warning: This shell script is intended for those
70 $BOOTSTRAP_NAME: warning: who either know what they are doing or
71 $BOOTSTRAP_NAME: warning: or downloaded this program from the CVS
72 $BOOTSTRAP_NAME: warning: repository. See README for more details.
73 $BOOTSTRAP_NAME: warning: To avoid seeing this message in the future,
74 $BOOTSTRAP_NAME: warning: create an empty directory called 'CVS'."
75 echo Waiting for 15 seconds...
79 # Create the temporary file
80 output Creating temporary file...
81 TEMPFILE=`mktemp /tmp/$BOOTSTRAP_NAME.XXXXXX` ||
83 output ERROR: Unable to create temporary file!
88 (which autoconf > /dev/null 2>&1 ) ||
90 output error: 'Could not find GNU autoconf!'
91 output You need to download and install GNU autoconf v2.52 or higher.
92 output '<ftp://ftp.gnu.org/gnu/autoconf>'
97 # Check autoconf version
98 output Using $(autoconf --version | grep utoconf)
99 autoconf --version | grep -q "$AUTOCONF_VERSION" || echo \
100 "$BOOTSTRAP_NAME: warning: Unexpected version of GNU Autoconf (expected $AUTOCONF_VERSION)
101 $BOOTSTRAP_NAME: warning: *** Bootstrap process may fail!"
104 (which automake > /dev/null 2>&1 ) ||
106 output error: 'Could not find GNU automake!'
107 output You need to download and install GNU automake v1.5 or higher.
108 output '<ftp://ftp.gnu.org/gnu/automake>'
113 # Check automake version
114 output Using $(automake --version | grep utomake)
115 automake --version | grep -q "$AUTOMAKE_VERSION" || echo \
116 "$BOOTSTRAP_NAME: warning: Unexpected version of GNU Automake (expected $AUTOMAKE_VERSION)
117 $BOOTSTRAP_NAME: warning: *** Bootstrap process may fail!"
120 (which libtool > /dev/null 2>&1 ) ||
122 output error: 'Could not find GNU libtool!'
123 output You need to download and install GNU libtool v1.4 or higher.
124 output '<ftp://ftp.gnu.org/gnu/libtool>'
128 # Check libtool version
129 output Using $(libtoolize --version | grep ibtool)
130 libtoolize --version | grep -q "$LIBTOOL_VERSION" || echo \
131 "$BOOTSTRAP_NAME: warning: Unexpected version of GNU Libtool (expected $LIBTOOL_VERSION)
132 $BOOTSTRAP_NAME: warning: *** Bootstrap process may fail!"
137 s:${srcdir}/intltool:${ac_aux_dir}/intltool:g;
138 s.printf ("\\t%s @ %ld ;\\n", erva+name_rva, 1+ i);.printf ("\\t\\"%s\\" @ %ld ;\\n", erva+name_rva, 1+ i);.;
139 ' < aclocal.m4 > $TEMPFILE &&
141 mv $TEMPFILE aclocal.m4
144 for FILENAME in project.spec ; do {
145 output Creating $FILENAME...
146 sed "$SED_SCRIPT" < "$CONFIG_DIR/$FILENAME.in" > "$FILENAME";
149 output Renaming project.spec to $PACKAGE.spec...
150 mv project.spec "$PACKAGE.spec"
152 output Finishing up $PACKAGE.spec...
153 echo %changelog >> "$PACKAGE.spec"
154 cat NEWS >> "$PACKAGE.spec"
156 output Creating configure.in from configure.ac...
157 sed "$SED_SCRIPT" < "$CONFIG_DIR/configure.ac" > configure.in;
159 output Generating ChangeLog from SVN
160 if test x != "x$VERSION_REL" ; then export REVISION="--revision $VERSION_REL" ; fi
161 test -f ChangeLog || svn2cl --include-rev $REVISION $SVN_REPOSITORY/trunk/ || touch ChangeLog
163 output Setting up build environment...
165 # Set the shell to output what we are doing
168 # Create all of the build environment files
172 $ACLOCAL -I "$CONFIG_DIR" $ACLOCAL_FLAGS &&
175 $AUTOCONF -o configure &&
176 $AUTOMAKE --force-missing --add-missing --include-deps &&
180 # Something went wrong...
187 # Turn off echoing of commands
190 #output Patching configure script to look for gcc3...
192 #s/g++ c++/g++3 g++ c++/;
193 #s/gcc cc/gcc3 gcc cc/;
194 #s:"'${prefix}/include'":"'${prefix}/include/synfig'":;
195 #s:PREFIX/include:PREFIX/include/ETL:;
196 #" < configure > $TEMPFILE
197 #cp $TEMPFILE configure
199 # Patch the Makefile.in files
200 for filename in $(find Makefile.in src -name Makefile.in) ; do {
201 echo $BOOTSTRAP_NAME: Patching $filename
203 cp $filename $TEMPFILE &&
206 s;-I"'$(srcdir)'" ;-I"'$(top_srcdir)'" ;
207 s;configure.in;config/configure.ac;
208 " < $TEMPFILE > $filename
212 output Failure. Unable to patch $filename.
218 output Creating Makefile...
221 ./configure --enable-maintainer-mode
225 ./configure --enable-maintainer-mode
229 ./configure --enable-maintainer-mode
233 ./configure --enable-maintainer-mode
237 ./configure --enable-maintainer-mode
240 TAG=${PACKAGE_TARNAME}_${VERSION_MAJ}_${VERSION_MIN}_${VERSION_REV}
243 -svn delete $SVN_REPOSITORY/tags/stable -m \"Stabe Tag: Removing old tag\"
244 svn mkdir $SVN_REPOSITORY/tags/stable -m \"Stable Tag: Creating new directory\"
245 svn copy . $SVN_REPOSITORY/tags/stable -m \"Stable Tag: Copying everyhting over\"
248 svn mkdir $SVN_REPOSITORY/tags/\$(TAG) -m \"Release Tag: Making directory\"
249 svn copy . $SVN_REPOSITORY/tags/\$(TAG) -m \"Release \$(TAG)\"
253 echo $BOOTSTRAP_NAME: Complete.
257 # Move back to the current directory