]>
git.saurik.com Git - bison.git/blob - bootstrap
3 # Bootstrap this package from CVS.
5 # Copyright (C) 2003, 2004 Free Software Foundation, Inc.
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2, or (at your option)
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
22 # Written by Paul Eggert.
32 echo "$0: usage: $0 [--gnulib-srcdir=DIR] [--cvs-user=USERNAME] [--skip-po]"
35 GNULIB_SRCDIR
=`expr "$option" : '--gnulib-srcdir=\(.*\)'`;;
37 CVS_USER
=`expr "$option" : '--cvs-user=\(.*\)'`;;
41 echo >&2 "$0: $option: unknown option"
46 # Check that gettext version matches what's in configure.ac.
47 # FIXME: We shouldn't have to modify configure.ac every time
48 # a new gettext version comes out.
50 gettext_version_output
=`LC_ALL=C gettext --version` &&
51 case $gettext_version_output in
56 echo >&2 "$0: Please install GNU gettext first."
61 last_word_in_first_line
="[^$newline]* \\([^$newline]*\\)"
62 gettext_have
=`expr "$gettext_version_output" : "$last_word_in_first_line"`
64 sed -n '/^AM_GNU_GETTEXT_VERSION/{ s/.*\[//; s/].*//; p; q; }' configure.ac
66 [ "$gettext_have" = "$gettext_need" ] || {
67 echo >&2 "$0: Your gettext version is $gettext_have."
68 echo >&2 "$0: Please install and use gettext-$gettext_need instead."
72 echo "$0: Bootstrapping CVS $package..."
76 if [ "${2}" != - ]; then
77 CVS_PREFIX
=${CVS_PREFIX}${2}@
83 case ${GNULIB_SRCDIR--} in
85 if [ ! -d gnulib
]; then
86 echo "$0: getting gnulib files..."
89 trap 'rm -fr gnulib; exit 1' 0
91 case ${CVS_AUTH-anoncvs} in
93 CVS_PREFIX
='anoncvs@';;
95 CVS_PREFIX
="$CVS_USER${CVS_USER+@}";;
97 echo "$0: $CVS_AUTH: Unknown CVS access method" >&2
102 '') export CVS_RSH
=ssh;;
105 cvs
-z3 -q -d ${CVS_PREFIX}subversions.gnu.org
:/cvsroot
/gnulib co gnulib
|| exit
112 <$GNULIB_SRCDIR/gnulib
-tool || exit
133 previous_gnulib_modules
=
134 while [ "$gnulib_modules" != "$previous_gnulib_modules" ]; do
135 previous_gnulib_modules
=$gnulib_modules
137 (echo "$gnulib_modules"
138 for gnulib_module in $gnulib_modules; do
139 $GNULIB_SRCDIR/gnulib-tool --extract-dependencies $gnulib_module
145 (for gnulib_module in $gnulib_modules; do
146 $GNULIB_SRCDIR/gnulib-tool --extract-filelist $gnulib_module
150 gnulib_dirs
=`echo "$gnulib_files" | sed 's,/[^/]*$,,' | sort -u`
151 mkdir -p $gnulib_dirs || exit
153 for gnulib_file
in $gnulib_files; do
157 m
4/onceonly_2_57.
m4) dest
=m
4/onceonly.
m4;;
161 echo "$0: Copying file $GNULIB_SRCDIR/$gnulib_file" &&
162 cp -p $GNULIB_SRCDIR/$gnulib_file $dest || exit
170 echo "$0: getting translations into po (please ignore the robots.txt ERROR 404)..."
172 rm -f dummy
`ls | sed -n '/\.gmo$/p; /\.po/p'` &&
173 wget
-nv -nd -r -l 1 -A .po
-C off \
174 http
://www2.iro.umontreal.ca
/~gnutra
/po
/maint
/$package/ &&
175 ls *.po
| sed 's/\.po$//' >LINGUAS
180 # Generate autoconf and automake snippets.
182 (echo '# This file is generated automatically by "bootstrap".' &&
183 echo 'AC_DEFUN([GNULIB_AUTOCONF_SNIPPET],[' &&
184 $GNULIB_SRCDIR/gnulib
-tool --extract-autoconf-snippet $gnulib_modules &&
186 ) >m
4/gnulib.
m4 || exit
188 (echo '# This file is generated automatically by "bootstrap".' &&
189 $GNULIB_SRCDIR/gnulib
-tool --extract-automake-snippet $gnulib_modules
190 ) >lib
/gnulib.mk
|| exit
193 # Reconfigure, getting other files.
195 echo "$0: autoreconf --verbose --install --force ..."
196 autoreconf
--verbose --install --force || exit
199 # We don't need intl, so remove it.
200 # Remove aclocal.m4 too, so that it gets rebuilt.
201 intl_files_to_remove
='
225 echo $0: rm -fr $intl_files_to_remove ...
226 rm -fr $intl_files_to_remove || exit
228 echo "$0: patching m4/gettext.m4 so that AM_INTL_SUBDIR is empty ..."
230 /^AC_DEFUN(\[AM_INTL_SUBDIR],/,/^]/c\
231 AC_DEFUN([AM_INTL_SUBDIR], [])
232 ' m
4/gettext.
m4 >m
4/gettext.m4t
&&
233 mv m
4/gettext.m4t m
4/gettext.
m4 || exit
235 # Patch what appears to be a bug in gettext 0.14.1;
236 # remove this once the bug is fixed.
237 grep @top_builddir@ po
/Makefile.
in.
in >/dev
/null
|| {
238 echo "$0: prepending 'top_builddir=@top_builddir@' to po/Makefile.in.in ... "
239 old_contents
=`cat po/Makefile.in.in` || exit
240 cat >po
/Makefile.
in.
in <<EOF
241 top_builddir=@top_builddir@
246 # Put bug-reporting address into po/Makevars.
247 echo "$0: sed '/^MSGID_BUGS_ADDRESS *=/s/=.*/= bug-bison@gnu.org/' po/Makevars.template >po/Makevars ..."
248 sed '/^MSGID_BUGS_ADDRESS *=/s/=.*/= bug-bison@gnu.org/' po
/Makevars.template
>po
/Makevars
251 # if src/parse-gram.[ch] are out of date, rebuild them.
252 parse_gram_y
=`find src/parse-gram.y \
253 '(' -newer src/parse-gram.c -o -newer src/parse-gram.h ')' \
255 case $parse_gram_y in
257 echo "$0: warning: bootstrapping with old src/parse-gram.[ch] files."
259 echo "$0: touch -c src/parse-gram.[ch] ... "
260 touch -c src
/parse
-gram.
[ch
] || exit
262 echo "$0: ./configure --disable-nls ..."
263 .
/configure
--disable-nls || exit
265 echo "$0: (cd lib && make) ..."
266 (cd lib
&& make) || exit
268 echo "$0: (cd src && make) ..."
269 (cd src
&& make) || exit
271 echo "$0: rm -f src/parse-gram.c src/parse-gram.h ..."
272 rm -f src
/parse
-gram.c src
/parse
-gram.h
|| exit
274 echo "$0: (cd src && make parse-gram.c parse-gram.h) ..."
275 (cd src
&& make parse
-gram.c parse
-gram.h
) || exit
277 echo "$0: make distclean ..."
278 make distclean
|| exit;;
281 echo "$0: done. Now you can run './configure'."