3 # This script helps bootstrap automake, when checked out from git.
5 # Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc.
6 # 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 3, 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 # Find the path separator
22 echo "#! /bin/sh" >boot$$.sh
23 echo "exit 0" >>boot$$.sh
25 if (PATH
="/nonexistent;."; boot$$.sh
) >/dev
/null
2>&1; then
32 # Don't ignore failures
35 # Find perl. Code based on Autoconf, but without non-POSIX support.
36 if test -z "$PERL"; then
41 test -z "$dir" && dir
=.
42 if test -x "$dir/perl" && test ! -d "$dir/perl"; then
49 if test -z "$PERL"; then
50 echo "Cannot find perl" >&2
54 # Variables to substitute
55 VERSION
=`sed -ne '/AC_INIT/s/^[^[]*\[[^[]*\[\([^]]*\)\].*$/\1/p' configure.ac`
59 # Override SHELL. This is required on DJGPP so that Perl's system()
60 # uses bash, not COMMAND.COM which doesn't quote arguments properly.
61 # It's not used otherwise.
62 if test -n "$DJGPP"; then
63 BOOTSTRAP_SHELL
=/dev
/env
/DJDIR
/bin
/bash.exe
65 BOOTSTRAP_SHELL
=/bin
/sh
68 # Read the rule for calculating APIVERSION and execute it
69 apiver_cmd
=`sed -ne 's/\[\[/[/g;s/\]\]/]/g;/^APIVERSION=/p' configure.ac`
73 if test -z "$VERSION"; then
74 echo "Cannot find VERSION" >&2
78 if test -z "$APIVERSION"; then
79 echo "Cannot find VERSION" >&2
83 # Make a dummy versioned directory for aclocal
84 rm -rf aclocal-
$APIVERSION
85 mkdir aclocal-
$APIVERSION
86 rm -rf automake-
$APIVERSION
87 # Can't use `ln -s lib automake-$APIVERSION',
88 # that would create a lib.exe stub under DJGPP 2.03.
89 mkdir automake-
$APIVERSION
90 cp -rf lib
/* automake-
$APIVERSION
95 in=`echo $1 | sed 's,^.*/,,'`
96 sed -e "s%@APIVERSION@%$APIVERSION%g" \
97 -e "s%@PACKAGE@%$PACKAGE%g" \
98 -e "s%@PERL@%$PERL%g" \
99 -e "s%@SHELL@%$BOOTSTRAP_SHELL%g" \
100 -e "s%@VERSION@%$VERSION%g" \
101 -e "s%@datadir@%$datadir%g" \
102 -e "s%@configure_input@%Generated from $in; do not edit by hand.%g" \
108 # Create temporary replacement for lib/Automake/Config.pm
109 dosubst automake-
$APIVERSION/Automake
/Config.
in \
110 automake-
$APIVERSION/Automake
/Config.pm
112 # Create temporary replacement for aclocal
113 dosubst aclocal.
in aclocal.tmp
115 # Overwrite amversion.m4
116 dosubst m
4/amversion.
in m
4/amversion.
m4
118 # Create temporary replacement for automake
119 dosubst automake.
in automake.tmp
122 $PERL .
/aclocal.tmp
-I m4
126 # Remove temporary files and directories
127 rm -rf aclocal-
$APIVERSION automake-
$APIVERSION
128 rm -f aclocal.tmp automake.tmp
129 rm -f lib
/Automake
/Config.pm