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 # Find the path separator.
23 # (Snippet copied from configure's initialization in Autoconf 2.65)
24 if test "${PATH_SEPARATOR+set}" != set; then
26 (PATH
='/bin;/bin'; FPATH
=$PATH; sh
-c :) >/dev
/null
2>&1 && {
27 (PATH
='/bin:/bin'; FPATH
=$PATH; sh
-c :) >/dev
/null
2>&1 ||
32 # Don't ignore failures.
35 # Set program basename.
36 me
=`echo "$0" | sed 's,^.*/,,'`
38 # Find perl. Code based on Autoconf, but without non-POSIX support.
39 if test -z "$PERL"; then
44 test -z "$dir" && dir
=.
45 if test -x "$dir/perl" && test ! -d "$dir/perl"; then
52 if test -z "$PERL"; then
53 echo "$me: cannot find perl" >&2
57 # Variables to substitute.
58 VERSION
=`sed -ne '/AC_INIT/s/^[^[]*\[[^[]*\[\([^]]*\)\].*$/\1/p' configure.ac`
63 # Override SHELL. This is required on DJGPP so that Perl's system()
64 # uses bash, not COMMAND.COM which doesn't quote arguments properly.
65 # It's not used otherwise.
66 if test -n "$DJDIR"; then
67 BOOTSTRAP_SHELL
=/dev
/env
/DJDIR
/bin
/bash.exe
69 BOOTSTRAP_SHELL
=/bin
/sh
72 # Read the rule for calculating APIVERSION and execute it.
73 apiver_cmd
=`sed -ne 's/\[\[/[/g;s/\]\]/]/g;/^APIVERSION=/p' configure.ac`
77 if test -z "$VERSION"; then
78 echo "$me: cannot find VERSION" >&2
82 if test -z "$APIVERSION"; then
83 echo "$me: cannot find VERSION" >&2
87 # Make a dummy versioned directory for aclocal.
88 rm -rf aclocal-
$APIVERSION
89 mkdir aclocal-
$APIVERSION
90 if test -d automake-
$APIVERSION; then
91 find automake-
$APIVERSION -exec chmod u
+wx
'{}' ';'
93 rm -rf automake-
$APIVERSION
94 # Can't use `ln -s lib automake-$APIVERSION', that would create a
95 # lib.exe stub under DJGPP 2.03.
96 mkdir automake-
$APIVERSION
97 cp -rf lib
/* automake-
$APIVERSION
102 in=`echo $1 | sed 's,^.*/,,'`
103 sed -e "s%@APIVERSION@%$APIVERSION%g" \
104 -e "s%@PACKAGE@%$PACKAGE%g" \
105 -e "s%@PERL@%$PERL%g" \
106 -e "s%@PERL_THREADS@%$PERL_THREADS%g" \
107 -e "s%@SHELL@%$BOOTSTRAP_SHELL%g" \
108 -e "s%@VERSION@%$VERSION%g" \
109 -e "s%@datadir@%$datadir%g" \
110 -e "s%@configure_input@%Generated from $in; do not edit by hand.%g" \
116 # Create temporary replacement for lib/Automake/Config.pm.
117 dosubst automake-
$APIVERSION/Automake
/Config.
in \
118 automake-
$APIVERSION/Automake
/Config.pm
120 # Create temporary replacement for aclocal.
121 dosubst aclocal.
in aclocal.tmp
123 # Overwrite amversion.m4.
124 dosubst m
4/amversion.
in m
4/amversion.
m4
126 # Create temporary replacement for automake.
127 dosubst automake.
in automake.tmp
129 # Create tests/parallel-tests.am.
131 $BOOTSTRAP_SHELL .
/gen-parallel-tests
> parallel-tests.am
135 $PERL .
/aclocal.tmp
-I m4
139 # Remove temporary files and directories.
140 rm -rf aclocal-
$APIVERSION automake-
$APIVERSION
141 rm -f aclocal.tmp automake.tmp
142 rm -f lib
/Automake
/Config.pm