libtool/bootstrap
Gary V. Vaughan fd13e4f5ca Add some new tests for Libtool's support of Automake
subdir-objects builds.  This marks the beginning of a move to an
Autotest driven test framework, which will eventually allow us to
trim away many of the generated files in the current test demo
subdirectories:

* configure.ac (AC_CONFIG_TESTDIR): Re-enable commented out
Autotest macros.
(AUTOTEST, M4SH): Use --language long hand.
* bootstrap: Generate tests/testsuite, and by implication
tests/package.m4.
* Makefile.am (edit): Add substitutions needed to generate
tests/package.m4 from bootstrap.
(check-recursive): Add tests/testsuite.
(TESTSUITE): The new Autotest testsuite target.
(TESTSUITE_AT): The Autotest sources.
(EXTRA_DIST): Distribute the generated testsuite and sources.
(tests/package.m4): Use $(edit) to propagate package metadata to
the new tests.
(tests/testsuite): Build the testsuite.
(tests/atconfig): How to regenerate the file.
(check-local): Hook Autotest into `make check'.
(installcheck-local): Run the testsuite on the installed tree.
(clean-local): Tidy our file droppings.
* tests/Makefile.am: Remove bitrotted code from Autotest
experiments in Autoconf 2.52 era.  Updated the rest and moved into
Makefile.am.
* tests/testsuite.at: New container for Autotest test groups.
* tests/am-subdir.at: New test group for compatibility with
Automake's subdir-objects builds.  Currently holds two tests, one
for a C project and another similar project in C++.
* TODO: Add an entry to remind us that these new tests expose a
bug in libtool.
* NEWS: Updated.
2004-10-16 14:43:48 +00:00

112 lines
4.4 KiB
Bash
Executable File

#! /bin/sh
# bootstrap -- Helps bootstrapping libtool, when checked out from CVS.
#
# Copyright (C) 2003, 2004 Free Software Foundation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
# It is okay for the bootstrap process to require unreleased autoconf
# or automake, as long as any released libtool will work with at least
# the newest stable versions of each. Generally, newer versions offer
# better features, and configure.ac documents oldest version of each
# required for bootstrap (AC_PREREQ, and AM_INIT_AUTOMAKE).
test -f ./configure.ac || {
echo "bootstrap: can't find ./configure.ac, please rerun from top_srcdir"
exit 1
}
# Upgrade caveat:
cat <<'EOF'
WARNING: If bootstrapping with this script fails, it may be due to an
WARNING: incompatible installed `libtool.m4' being pulled in to
WARNING: `aclocal.m4'. The best way to work around such a problem is to
WARNING: uninstall your system libtool files, or failing that, overwrite
WARNING: them with all m4 file as shipped with this distribution (except
WARNING: `lt~obsolete.m4'). After that, retry this bootstrap.
EOF
rm -rf `find . -path './{arch}' -prune -o \( -name autom4te.cache -o -name libtool \) -print`
# Delete stale files from previous libtool versions.
rm -f acinclude.m4 config/ltmain.sh libltdl/config.h
if test -z "$reconfdirs"; then
reconfdirs=". `ls -1d tests/*demo tests/*demo[0-9]`"
fi
# Extract the package name and version number from configure.ac:
set -- `sed '/AC_INIT/{s/[][,()]/ /g; p;};d' configure.ac`
# Building distributed files from configure is bad for automake, so we
# generate them here, and have Makefile rules to keep them up to date.
# We don't have all the substitution values to build ltmain.sh from this
# script yet, but we need config/ltmain.sh for the libtool commands in
# configure, and ltversion.m4 to generate configure in the first place:
rm -f ./config/ltmain.sh ./m4/ltversion.m4
test -f Makefile || { makefile=Makefile; cp Makefile.am $makefile; }
make ./config/ltmain.sh ./m4/ltversion.m4 ./libtoolize.in ./tests/defs.in \
top_srcdir=. PACKAGE="$2" VERSION="$3" M4SH="autom4te --language=m4sh"
make ./tests/testsuite AUTOTEST="autom4te --language=autotest" \
top_srcdir=. PACKAGE="$2" VERSION="$3" PACKAGE_BUGREPORT="bug-$2@gnu.org"
test -f clcommit.m4sh && make -f Makefile.maint commit \
top_srcdir=. PACKAGE="$2" VERSION="$3" M4SH="autom4te -l m4sh" \
SED=sed GREP=grep FGREP=fgrep EGREP=egrep LN_S="ln -s"
test -z "$makefile" || rm -f "$makefile"
# Make a dummy libtoolize script for autoreconf:
test -f clcommit.m4sh && cat > ./config/libtoolize <<'EOF'
#! /bin/sh
# This is a dummy file for bootstrapping CVS libtool.
echo "$0: Bootstrap detected, no files installed." | sed 's,^.*/,,g'
exit 0
EOF
chmod 755 ./config/libtoolize
# Running the installed `libtoolize' will trash the local (newer) libtool.m4
# among others. Call the dummy script we made earlier.
LIBTOOLIZE=`pwd`/config/libtoolize
export LIBTOOLIZE
for sub in $reconfdirs; do
autoreconf --force --verbose --install $sub
done
# Remove our dummy libtoolize
rm -f ./config/libtoolize
# These files can cause an infinite configure loop if left behind.
rm -f Makefile libltdl/Makefile libtool vcl.tmp
# This file is misgenerated earlier in bootstrap to satisfy automake 1.9.1
# and earlier, but has a new enough timestamp to not be updated. Force it
# to be regenerated at make-time with proper substitutions in place:
touch config/ltmain.in
# Commit script caveat:
cat <<'EOF'
WARNING: You might want to regenerate `commit' and `config/mailnotify'
WARNING: after you have run `configure' to discover the real whereabouts
WARNING: of `sed', `grep' etc. like this:
WARNING:
WARNING: rm -f config/mailnotify; make -f Makefile.maint commit
EOF
exit 0