mirror of
git://git.savannah.gnu.org/libtool.git
synced 2025-02-05 14:40:42 +08:00
required to write this changeset -- especially that ltmain.sh is the same on any machine for a given release, which I hadn't noticed for some bizarre reason: It turns out that generating distributed files from configure causes no end of hassle, as evidenced by the many patches I've generated over the last few days to try and get the dist and distcheck make rules to work. Instead of all that hair, we now simply generate our distributed files (now including ltmain.sh) with make rules -- and since automake creates make variables for all AC_SUBSTs, that is really easy. The code looks a lot more like automake and autoconf Makefile.ams now, and doesn't have all the rough edges the earlier hacky solution suffered from. We still generate libtool from config.status, but that is not a distributed file, and doesn't break the golden rule. Besides, there is way more going on there than a bunch of substitutions: * Makefile.am (edit): New common sed substitutions for files now generated by make instead of config.status. (CLEANFILES): Clean new tmp files. (EXTRA_DIST): Add ltmain.sh. (vcl-tmp): Reinstated. (m4/ltversion.m4, config/ltmain.sh): New rules. Generate from here instead of config.status. (libtoolize): Ditto. (libtool): Call config.status to regenerate if necessary. (dist-hook): Removed. * config/ltmain.in: Moved here from top_srcdir. * README-alpha: Update instructions to check AS_SHELL_SANITIZE is up to date. * bootstrap: Rewritten. Generate m4/ltversion.m4 and config/ltmain.sh because configure depends on them. * configure.ac (AC_CONFIG_SRCDIR): Use libtoolize.in now that ltmain.in has moved. (AC_CONFIG_FILES): Don't generate distributed files, config/ltmain.sh and libtoolize from config.status. We have make rules to do that now.
85 lines
3.1 KiB
Bash
Executable File
85 lines
3.1 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 `libtool.m4' as shipped with this distribution.
|
|
WARNING: After that, retry this bootstrap.
|
|
EOF
|
|
|
|
rm -rf `find . -path './{arch}' -prune -o \( -name autom4te.cache -o -name libtool \) -print`
|
|
|
|
# Delete stale acinclude.m4 from previous libtool versions.
|
|
rm -f acinclude.m4
|
|
|
|
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:
|
|
rm -f ./config/ltmain.sh ./m4/ltversion.m4
|
|
make -f Makefile.am ./config/ltmain.sh ./m4/ltversion.m4 \
|
|
top_srcdir=. PACKAGE="$2" VERSION="$3"
|
|
|
|
# Make a dummy libtoolize script for autoreconf:
|
|
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
|
|
|
|
exit 0
|