* m4/libtool.m4 (_LT_PROG_CXX, _LT_PROG_F77): New macros to work
[libtool.git] / bootstrap
blob21f70b30f437b8544eaac5a458f3ee79a4c044d1
1 #! /bin/sh
2 # bootstrap -- Helps bootstrapping libtool, when checked out from CVS.
4 # Copyright (C) 2003, 2004 Free Software Foundation
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; see the file COPYING. If not, write to
18 # the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 # Boston, MA 02111-1307, USA.
21 # It is okay for the bootstrap process to require unreleased autoconf
22 # or automake, as long as any released libtool will work with at least
23 # the newest stable versions of each. Generally, newer versions offer
24 # better features, and configure.ac documents oldest version of each
25 # required for bootstrap (AC_PREREQ, and AM_INIT_AUTOMAKE).
27 test -f ./configure.ac || {
28 echo "bootstrap: can't find ./configure.ac, please rerun from top_srcdir"
29 exit 1
32 # Upgrade caveat:
33 cat <<'EOF'
34 WARNING: If bootstrapping with this script fails, it may be due to an
35 WARNING: incompatible installed `libtool.m4' being pulled in to
36 WARNING: `aclocal.m4'. The best way to work around such a problem is to
37 WARNING: uninstall your system libtool files, or failing that, overwrite
38 WARNING: them with all m4 file as shipped with this distribution (except
39 WARNING: `lt~obsolete.m4'). After that, retry this bootstrap.
40 EOF
42 rm -rf `find . -path './{arch}' -prune -o \( -name autom4te.cache -o -name libtool \) -print`
44 # Delete stale files from previous libtool versions.
45 rm -f acinclude.m4 config/ltmain.sh libltdl/config.h
47 if test -z "$reconfdirs"; then
48 reconfdirs=". `ls -1d tests/*demo tests/*demo[0-9]`"
51 # Extract the package name and version number from configure.ac:
52 set -- `sed '/AC_INIT/{s/[][,()]/ /g; p;};d' configure.ac`
54 # Building distributed files from configure is bad for automake, so we
55 # generate them here, and have Makefile rules to keep them up to date.
56 # We don't have all the substitution values to build ltmain.sh from this
57 # script yet, but we need config/ltmain.sh for the libtool commands in
58 # configure, and ltversion.m4 to generate configure in the first place:
59 rm -f ./config/ltmain.sh ./m4/ltversion.m4
60 test -f Makefile || { makefile=Makefile; cp Makefile.am $makefile; }
61 make ./config/ltmain.sh ./m4/ltversion.m4 ./libtoolize.in ./tests/defs.in \
62 top_srcdir=. PACKAGE="$2" VERSION="$3" M4SH="autom4te -l m4sh"
63 test -z "$makefile" || rm -f "$makefile"
65 # Make a dummy libtoolize script for autoreconf:
66 cat > ./config/libtoolize <<'EOF'
67 #! /bin/sh
68 # This is a dummy file for bootstrapping CVS libtool.
69 echo "$0: Bootstrap detected, no files installed." | sed 's,^.*/,,g'
70 exit 0
71 EOF
72 chmod 755 ./config/libtoolize
74 # Running the installed `libtoolize' will trash the local (newer) libtool.m4
75 # among others. Call the dummy script we made earlier.
76 LIBTOOLIZE=`pwd`/config/libtoolize
77 export LIBTOOLIZE
79 for sub in $reconfdirs; do
80 autoreconf --force --verbose --install $sub
81 done
83 # Remove our dummy libtoolize
84 rm -f ./config/libtoolize
86 # These files can cause an infinite configure loop if left behind.
87 rm -f Makefile libltdl/Makefile libtool vcl.tmp
89 # This file is misgenerated earlier in bootstrap to satisfy automake 1.9.1
90 # and earlier, but has a new enough timestamp to not be updated. Force it
91 # to be regenerated at make-time with proper substitutions in place:
92 touch config/ltmain.in
94 exit 0