Fix comment typos.
[automake/ericb.git] / bootstrap
blobaa50f5d14128a5dfacfbf8cd4e1543013e4e9ec3
1 #! /bin/sh
3 # This script helps bootstrap automake, when checked out from git.
5 # Copyright (C) 2002, 2003, 2004, 2007, 2008 Free Software Foundation,
6 # Inc.
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)
12 # any later version.
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
25 chmod +x boot$$.sh
26 if (PATH="/nonexistent;."; boot$$.sh) >/dev/null 2>&1; then
27 PATH_SEPARATOR=';'
28 else
29 PATH_SEPARATOR=:
31 rm -f boot$$.sh
33 # Don't ignore failures
34 set -e
36 # Find perl. Code based on Autoconf, but without non-POSIX support.
37 if test -z "$PERL"; then
38 save_IFS=$IFS
39 IFS=$PATH_SEPARATOR
40 for dir in $PATH; do
41 IFS=$save_IFS
42 test -z "$dir" && dir=.
43 if test -x "$dir/perl" && test ! -d "$dir/perl"; then
44 PERL="$dir/perl"
45 break
47 done
50 if test -z "$PERL"; then
51 echo "Cannot find perl" >&2
52 exit 1
55 # Variables to substitute
56 VERSION=`sed -ne '/AC_INIT/s/^[^[]*\[[^[]*\[\([^]]*\)\].*$/\1/p' configure.ac`
57 PACKAGE=automake
58 datadir=.
60 # Override SHELL. This is required on DJGPP so that Perl's system()
61 # uses bash, not COMMAND.COM which doesn't quote arguments properly.
62 # It's not used otherwise.
63 if test -n "$DJGPP"; then
64 BOOTSTRAP_SHELL=/dev/env/DJDIR/bin/bash.exe
65 else
66 BOOTSTRAP_SHELL=/bin/sh
69 # Read the rule for calculating APIVERSION and execute it
70 apiver_cmd=`sed -ne 's/\[\[/[/g;s/\]\]/]/g;/^APIVERSION=/p' configure.ac`
71 eval $apiver_cmd
73 # Sanity checks
74 if test -z "$VERSION"; then
75 echo "Cannot find VERSION" >&2
76 exit 1
79 if test -z "$APIVERSION"; then
80 echo "Cannot find VERSION" >&2
81 exit 1
84 # Make a dummy versioned directory for aclocal
85 rm -rf aclocal-$APIVERSION
86 mkdir aclocal-$APIVERSION
87 if test -d automake-$APIVERSION; then
88 find automake-$APIVERSION -exec chmod u+wx '{}' ';'
90 rm -rf automake-$APIVERSION
91 # Can't use `ln -s lib automake-$APIVERSION',
92 # that would create a lib.exe stub under DJGPP 2.03.
93 mkdir automake-$APIVERSION
94 cp -rf lib/* automake-$APIVERSION
96 dosubst ()
98 rm -f $2
99 in=`echo $1 | sed 's,^.*/,,'`
100 sed -e "s%@APIVERSION@%$APIVERSION%g" \
101 -e "s%@PACKAGE@%$PACKAGE%g" \
102 -e "s%@PERL@%$PERL%g" \
103 -e "s%@SHELL@%$BOOTSTRAP_SHELL%g" \
104 -e "s%@VERSION@%$VERSION%g" \
105 -e "s%@datadir@%$datadir%g" \
106 -e "s%@configure_input@%Generated from $in; do not edit by hand.%g" \
107 $1 > $2
108 chmod a-w $2
112 # Create temporary replacement for lib/Automake/Config.pm
113 dosubst automake-$APIVERSION/Automake/Config.in \
114 automake-$APIVERSION/Automake/Config.pm
116 # Create temporary replacement for aclocal
117 dosubst aclocal.in aclocal.tmp
119 # Overwrite amversion.m4
120 dosubst m4/amversion.in m4/amversion.m4
122 # Create temporary replacement for automake
123 dosubst automake.in automake.tmp
125 # Run the autotools.
126 $PERL ./aclocal.tmp -I m4
127 autoconf
128 $PERL ./automake.tmp
130 # Remove temporary files and directories
131 rm -rf aclocal-$APIVERSION automake-$APIVERSION
132 rm -f aclocal.tmp automake.tmp
133 rm -f lib/Automake/Config.pm