3 # This script helps bootstrap automake, when checked out from git.
5 # Copyright (C) 2002, 2003, 2004, 2007, 2008 Free Software Foundation,
7 # 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 3, 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 # Find the path separator
23 echo "#! /bin/sh" >boot$$.sh
24 echo "exit 0" >>boot$$.sh
26 if (PATH
="/nonexistent;."; boot$$.sh
) >/dev
/null
2>&1; then
33 # Don't ignore failures
36 # Find perl. Code based on Autoconf, but without non-POSIX support.
37 if test -z "$PERL"; then
42 test -z "$dir" && dir
=.
43 if test -x "$dir/perl" && test ! -d "$dir/perl"; then
50 if test -z "$PERL"; then
51 echo "Cannot find perl" >&2
55 # Variables to substitute
56 VERSION
=`sed -ne '/AC_INIT/s/^[^[]*\[[^[]*\[\([^]]*\)\].*$/\1/p' configure.ac`
61 # Override SHELL. This is required on DJGPP so that Perl's system()
62 # uses bash, not COMMAND.COM which doesn't quote arguments properly.
63 # It's not used otherwise.
64 if test -n "$DJGPP"; then
65 BOOTSTRAP_SHELL
=/dev
/env
/DJDIR
/bin
/bash.exe
67 BOOTSTRAP_SHELL
=/bin
/sh
70 # Read the rule for calculating APIVERSION and execute it
71 apiver_cmd
=`sed -ne 's/\[\[/[/g;s/\]\]/]/g;/^APIVERSION=/p' configure.ac`
75 if test -z "$VERSION"; then
76 echo "Cannot find VERSION" >&2
80 if test -z "$APIVERSION"; then
81 echo "Cannot find VERSION" >&2
85 # Make a dummy versioned directory for aclocal
86 rm -rf aclocal-
$APIVERSION
87 mkdir aclocal-
$APIVERSION
88 if test -d automake-
$APIVERSION; then
89 find automake-
$APIVERSION -exec chmod u
+wx
'{}' ';'
91 rm -rf automake-
$APIVERSION
92 # Can't use `ln -s lib automake-$APIVERSION',
93 # that would create a lib.exe stub under DJGPP 2.03.
94 mkdir automake-
$APIVERSION
95 cp -rf lib
/* automake-
$APIVERSION
100 in=`echo $1 | sed 's,^.*/,,'`
101 sed -e "s%@APIVERSION@%$APIVERSION%g" \
102 -e "s%@PACKAGE@%$PACKAGE%g" \
103 -e "s%@PERL@%$PERL%g" \
104 -e "s%@PERL_THREADS@%$PERL_THREADS%g" \
105 -e "s%@SHELL@%$BOOTSTRAP_SHELL%g" \
106 -e "s%@VERSION@%$VERSION%g" \
107 -e "s%@datadir@%$datadir%g" \
108 -e "s%@configure_input@%Generated from $in; do not edit by hand.%g" \
114 # Create temporary replacement for lib/Automake/Config.pm
115 dosubst automake-
$APIVERSION/Automake
/Config.
in \
116 automake-
$APIVERSION/Automake
/Config.pm
118 # Create temporary replacement for aclocal
119 dosubst aclocal.
in aclocal.tmp
121 # Overwrite amversion.m4
122 dosubst m
4/amversion.
in m
4/amversion.
m4
124 # Create temporary replacement for automake
125 dosubst automake.
in automake.tmp
127 # Create tests/parallel-tests.am.
129 $BOOTSTRAP_SHELL .
/gen-parallel-tests
> parallel-tests.am
133 $PERL .
/aclocal.tmp
-I m4
137 # Remove temporary files and directories
138 rm -rf aclocal-
$APIVERSION automake-
$APIVERSION
139 rm -f aclocal.tmp automake.tmp
140 rm -f lib
/Automake
/Config.pm