3 # Extended Template Library Bootstrap Script
4 # $Id: bootstrap,v 1.2 2005/01/04 01:54:14 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/@VERSION@/$VERSION/g;
28 s/@VERSION_MAJ@/$VERSION_MAJ/g;
29 s/@VERSION_MIN@/$VERSION_MIN/g;
30 s/@VERSION_REV@/$VERSION_REV/g;
31 s/@VERSION_REL@/$VERSION_REL/g;
35 # Required automake and autoconf versions
39 export WANT_AUTOMAKE=1.6;
40 export WANT_AUTOCONF_2_5=1;
42 # Define the output function
44 echo $BOOTSTRAP_NAME: $*
47 # Define the cleanup function
50 rm -fr config.cache autom4te.cache configure.in $TEMPFILE
53 output Prepairing build environment for $PACKAGE-$VERSION...
55 # Look for the CVS directory. If we don't find it, we need to
56 # ask the user if they know what they are doing.
60 $BOOTSTRAP_NAME: warning: This shell script is intended for those
61 $BOOTSTRAP_NAME: warning: who either know what they are doing or
62 $BOOTSTRAP_NAME: warning: or downloaded this program from the CVS
63 $BOOTSTRAP_NAME: warning: repository. See README for more details.
64 $BOOTSTRAP_NAME: warning: To avoid seeing this message in the future,
65 $BOOTSTRAP_NAME: warning: create an empty directory called 'CVS'."
66 echo Waiting for 15 seconds...
70 # Create the temporary file
71 output Creating temporary file...
72 TEMPFILE=`mktemp /tmp/$BOOTSTRAP_NAME.XXXXXX` ||
74 output ERROR: Unable to create temporary file!
79 (which autoconf > /dev/null 2>&1 ) ||
81 output error: 'Could not find GNU autoconf!'
82 output You need to download and install GNU autoconf v2.52 or higher.
83 output '<ftp://ftp.gnu.org/gnu/autoconf>'
88 # Check autoconf version
89 output Using $(autoconf --version | grep utoconf)
90 autoconf --version | grep -q "$AUTOCONF_VERSION" || echo \
91 "$BOOTSTRAP_NAME: warning: Unexpected version of GNU Autoconf (expected $AUTOCONF_VERSION)
92 $BOOTSTRAP_NAME: warning: *** Bootstrap process may fail!"
95 (which automake > /dev/null 2>&1 ) ||
97 output error: 'Could not find GNU automake!'
98 output You need to download and install GNU automake v1.5 or higher.
99 output '<ftp://ftp.gnu.org/gnu/automake>'
104 # Check automake version
105 output Using $(automake --version | grep utomake)
106 automake --version | grep -q "$AUTOMAKE_VERSION" || echo \
107 "$BOOTSTRAP_NAME: warning: Unexpected version of GNU Automake (expected $AUTOMAKE_VERSION)
108 $BOOTSTRAP_NAME: warning: *** Bootstrap process may fail!"
110 for FILENAME in doxygen.cfg pkgconfig.pc project.spec ; do {
111 output Creating $FILENAME...
112 sed "$SED_SCRIPT" < $CONFIG_DIR/$FILENAME.in > $FILENAME;
115 output Renaming pkgconfig.pc to $PACKAGE_TARNAME.pc.in...
116 mv pkgconfig.pc "$PACKAGE_TARNAME.pc.in"
118 output Renaming project.spec to $PACKAGE-$VERSION.spec...
119 mv project.spec "$PACKAGE-$VERSION.spec"
121 output Finishing up $PACKAGE-$VERSION.spec...
122 echo %changelog >> "$PACKAGE-$VERSION.spec"
123 cat ChangeLog >> "$PACKAGE-$VERSION.spec"
125 output Creating configure.in from configure.ac...
126 sed "$SED_SCRIPT" < $CONFIG_DIR/configure.ac > configure.in;
128 output Setting up build environment...
130 # Set the shell to output what we are doing
133 # Create all of the build environment files
135 aclocal -I $CONFIG_DIR $ACLOCAL_FLAGS &&
137 autoconf -o configure &&
138 automake --foreign --add-missing --copy --include-deps
141 # Something went wrong...
143 echo $BOOTSTRAP_NAME: Failure.
148 # Turn off echoing of commands
151 #output Patching configure script to look for gcc3...
153 #s/g++ c++/g++3 g++ c++/;
154 #s/gcc cc/gcc3 gcc cc/;
155 #s:PREFIX/include:PREFIX/include/ETL:;
156 #" < configure > $TEMPFILE
157 #cp $TEMPFILE configure
159 # Patch the Makefile.am files
160 for filename in $(find Makefile.in ETL test -name Makefile.in) ; do {
161 echo $BOOTSTRAP_NAME: Patching $filename
163 cp $filename $TEMPFILE &&
166 s;-I"'$(srcdir)'" ;-I"'$(top_srcdir)'" ;
167 s;configure.in;config/configure.ac;
168 " < $TEMPFILE > $filename
172 echo $BOOTSTRAP_NAME: Failure. Unable to patch $filename.
178 echo $BOOTSTRAP_NAME: Creating Makefile...
181 ./configure --enable-maintainer-mode
185 ./configure --enable-maintainer-mode
189 ./configure --enable-maintainer-mode
193 ./configure --enable-maintainer-mode
197 ./configure --enable-maintainer-mode
204 echo $BOOTSTRAP_NAME: Complete.
208 # Move back to the current directory