3 # This script helps bootstrap automake, when checked out from git.
5 # Copyright (C) 2002, 2003, 2004, 2007, 2008, 2010 Free Software
7 # Originally written by Pavel Roskin <proski@gnu.org> September 2002.
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2, or (at your option)
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program. If not, see <http://www.gnu.org/licenses/>.
22 # Don't ignore failures.
25 # Set program basename.
26 me=`echo "$0" | sed 's,^.*/,,'`
28 # Let user choose which version of autoconf, autom4te and perl to use.
29 : ${AUTOCONF=autoconf}
30 export AUTOCONF # might be used by aclocal and/or automake
31 : ${AUTOM4TE=autom4te}
32 export AUTOM4TE # ditto
35 # Variables to substitute.
36 VERSION=`sed -ne '/AC_INIT/s/^[^[]*\[[^[]*\[\([^]]*\)\].*$/\1/p' configure.ac`
41 # Override SHELL. This is required on DJGPP so that Perl's system()
42 # uses bash, not COMMAND.COM which doesn't quote arguments properly.
43 # It's not used otherwise.
44 if test -n "$DJDIR"; then
45 BOOTSTRAP_SHELL=/dev/env/DJDIR/bin/bash.exe
47 BOOTSTRAP_SHELL=/bin/sh
50 # Read the rule for calculating APIVERSION and execute it.
51 apiver_cmd=`sed -ne 's/\[\[/[/g;s/\]\]/]/g;/^APIVERSION=/p' configure.ac`
55 if test -z "$VERSION"; then
56 echo "$me: cannot find VERSION" >&2
60 if test -z "$APIVERSION"; then
61 echo "$me: cannot find APIVERSION" >&2
65 # Make a dummy versioned directory for aclocal.
66 rm -rf aclocal-$APIVERSION
67 mkdir aclocal-$APIVERSION
68 if test -d automake-$APIVERSION; then
69 find automake-$APIVERSION -exec chmod u+wx '{}' ';'
71 rm -rf automake-$APIVERSION
72 # Can't use `ln -s lib automake-$APIVERSION', that would create a
73 # lib.exe stub under DJGPP 2.03.
74 mkdir automake-$APIVERSION
75 cp -rf lib/* automake-$APIVERSION
80 in=`echo $1 | sed 's,^.*/,,'`
81 sed -e "s%@APIVERSION@%$APIVERSION%g" \
82 -e "s%@PACKAGE@%$PACKAGE%g" \
83 -e "s%@PERL@%$PERL%g" \
84 -e "s%@PERL_THREADS@%$PERL_THREADS%g" \
85 -e "s%@SHELL@%$BOOTSTRAP_SHELL%g" \
86 -e "s%@VERSION@%$VERSION%g" \
87 -e "s%@datadir@%$datadir%g" \
88 -e "s%@configure_input@%Generated from $in; do not edit by hand.%g" \
93 # Create temporary replacement for lib/Automake/Config.pm.
94 dosubst automake-$APIVERSION/Automake/Config.in \
95 automake-$APIVERSION/Automake/Config.pm
97 # Create temporary replacement for aclocal.
98 dosubst aclocal.in aclocal.tmp
100 # Overwrite amversion.m4.
101 dosubst m4/amversion.in m4/amversion.m4
103 # Create temporary replacement for automake.
104 dosubst automake.in automake.tmp
106 # Create tests/parallel-tests.am.
108 $BOOTSTRAP_SHELL ./gen-parallel-tests > parallel-tests.am
112 $PERL ./aclocal.tmp -I m4
116 # Remove temporary files and directories.
117 rm -rf aclocal-$APIVERSION automake-$APIVERSION
118 rm -f aclocal.tmp automake.tmp