3 # This script helps bootstrap automake, when checked out from git.
5 # Copyright (C) 2002-2017 Free Software Foundation, Inc.
6 # Originally written by Pavel Roskin <proski@gnu.org> September 2002.
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2, or (at your option)
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21 # Since Automake uses itself in its build process, we can't simply run
22 # 'autoreconf -i' which would require Automake to already be
25 # Don't ignore failures.
28 # Set program basename.
29 me
=`echo "$0" | sed 's,^.*/,,'`
31 # Let user choose which version of autoconf, autom4te and perl to use.
32 : ${AUTOCONF=autoconf}
33 export AUTOCONF
# might be used by aclocal and/or automake
34 : ${AUTOM4TE=autom4te}
35 export AUTOM4TE
# ditto
38 # Variables to substitute.
39 VERSION
=`sed -ne '/AC_INIT/s/^[^[]*\[[^[]*\[\([^]]*\)\].*$/\1/p' configure.ac`
42 # This should be automatically updated by the 'update-copyright'
43 # rule of our Makefile.
46 # Override SHELL. This is required on DJGPP so that Perl's system()
47 # uses bash, not COMMAND.COM which doesn't quote arguments properly.
48 # It's not used otherwise.
49 if test -n "$DJDIR"; then
50 BOOTSTRAP_SHELL
=/dev
/env
/DJDIR
/bin
/bash.exe
52 BOOTSTRAP_SHELL
=/bin
/sh
55 # Read the rule for calculating APIVERSION and execute it.
56 apiver_cmd
=`sed -ne 's/\[\[/[/g;s/\]\]/]/g;/^APIVERSION=/p' configure.ac`
60 if test -z "$VERSION"; then
61 echo "$me: cannot find VERSION" >&2
65 if test -z "$APIVERSION"; then
66 echo "$me: cannot find APIVERSION" >&2
70 # Make a dummy versioned directory for aclocal.
71 rm -rf aclocal-
$APIVERSION
72 mkdir aclocal-
$APIVERSION
73 if test -d automake-
$APIVERSION; then
74 find automake-
$APIVERSION -exec chmod u
+wx
'{}' ';'
76 rm -rf automake-
$APIVERSION
77 # Can't use "ln -s lib automake-$APIVERSION", that would create a
78 # lib.exe stub under DJGPP 2.03.
79 mkdir automake-
$APIVERSION
80 cp -rf lib
/* automake-
$APIVERSION
85 in=`echo $1 | sed 's,^.*/,,'`
86 sed -e "s%@APIVERSION@%$APIVERSION%g" \
87 -e "s%@PACKAGE@%$PACKAGE%g" \
88 -e "s%@PERL@%$PERL%g" \
89 -e "s%@SHELL@%$BOOTSTRAP_SHELL%g" \
90 -e "s%@VERSION@%$VERSION%g" \
91 -e "s%@datadir@%$datadir%g" \
92 -e "s%@RELEASE_YEAR@%$RELEASE_YEAR%g" \
93 -e "s%@configure_input@%Generated from $in; do not edit by hand.%g" \
98 # Create temporary replacement for lib/Automake/Config.pm.
99 dosubst automake-
$APIVERSION/Automake
/Config.
in \
100 automake-
$APIVERSION/Automake
/Config.pm
102 # Overwrite amversion.m4.
103 dosubst m
4/amversion.
in m
4/amversion.
m4
105 # Create temporary replacement for aclocal and automake.
106 for p
in bin
/aclocal bin
/automake
; do
108 $PERL -w bin
/gen-perl-protos
$p.tmp
> $p.tmp2
112 # Create required makefile snippets.
113 $PERL .
/gen-testsuite-part
> t
/testsuite-part.tmp
114 chmod a-w t
/testsuite-part.tmp
115 mv -f t
/testsuite-part.tmp t
/testsuite-part.am
117 # Run the autotools. Bail out if any warning is triggered.
118 # Use '-I' here so that our own *.m4 files in m4/ gets included,
119 # not copied, in aclocal.m4.
120 $PERL .
/bin
/aclocal.tmp
-Wall -Werror -I m4 \
121 --automake-acdir=m4 --system-acdir=m
4/acdir
122 $AUTOCONF -Wall -Werror
123 $PERL .
/bin
/automake.tmp
-Wall -Werror
125 # Remove temporary files and directories.
126 rm -rf aclocal-
$APIVERSION automake-
$APIVERSION
127 rm -f bin
/aclocal.tmp bin
/automake.tmp