3 # Bootstrap this package from CVS.
5 # Copyright (C) 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
22 # Written by Paul Eggert.
26 # Ensure file names are sorted consistently across platforms;
27 # e.g., m4/ulonglong_gl.m4 should follow m4/ulonglong.m4.
28 # Also, ensure diagnostics are in English, e.g., "wget --help" below.
38 echo "$0: usage: $0 [--gnulib-srcdir=DIR] [--cvs-user=USERNAME] [--skip-po]"
41 GNULIB_SRCDIR
=`expr "$option" : '--gnulib-srcdir=\(.*\)'`;;
43 CVS_USER
=`expr "$option" : '--cvs-user=\(.*\)'`;;
47 echo >&2 "$0: $option: unknown option"
52 echo "$0: Bootstrapping CVS $package..."
56 if [ "${2}" != - ]; then
57 CVS_PREFIX
=${CVS_PREFIX}${2}@
63 case ${GNULIB_SRCDIR--} in
65 if [ ! -d gnulib
]; then
66 echo "$0: getting gnulib files..."
69 trap 'rm -fr gnulib; exit 1' 0
71 case ${CVS_AUTH-anoncvs} in
73 CVS_PREFIX
='anoncvs@';;
75 CVS_PREFIX
="$CVS_USER${CVS_USER+@}";;
77 echo "$0: $CVS_AUTH: Unknown CVS access method" >&2
82 '') export CVS_RSH
=ssh;;
85 cvs
-z3 -q -d ${CVS_PREFIX}subversions.gnu.org
:/cvsroot
/gnulib co gnulib ||
exit
92 <$GNULIB_SRCDIR/gnulib-tool ||
exit
118 previous_gnulib_modules
=
119 while [ "$gnulib_modules" != "$previous_gnulib_modules" ]; do
120 previous_gnulib_modules
=$gnulib_modules
122 (echo "$gnulib_modules"
123 for gnulib_module in $gnulib_modules; do
124 $GNULIB_SRCDIR/gnulib-tool --extract-dependencies $gnulib_module
130 (for gnulib_module in $gnulib_modules; do
131 $GNULIB_SRCDIR/gnulib-tool --extract-filelist $gnulib_module
135 gnulib_dirs
=`echo "$gnulib_files" | sed 's,/[^/]*$,,' | sort -u`
136 mkdir
-p $gnulib_dirs ||
exit
138 for gnulib_file
in $gnulib_files; do
142 m
4/onceonly_2_57.
m4) dest
=m
4/onceonly.
m4;;
143 # These will be overwritten by autopoint, which still uses
144 # old jm_.* macro names, so we have to keep both copies.
145 # m4/gettext.m4 isn't mentioned here, since it's patched below.
146 m
4/glibc21.
m4 | m
4/inttypes_h.
m4 | m
4/lib-ld.
m4 | \
147 m
4/lib-prefix.
m4 | m
4/po.
m4 | m
4/stdint_h.
m4 | m
4/uintmax_t.
m4 | \
149 dest
=`expr $gnulib_file : '\(.*\).m4'`_gl.
m4;;
153 echo "$0: Copying file $GNULIB_SRCDIR/$gnulib_file" &&
154 cp -p $GNULIB_SRCDIR/$gnulib_file $dest ||
exit
157 # This suppresses a bogus diagnostic
158 # "warning: macro `AM_LANGINFO_CODESET' not found in library".
159 echo "$0: patching m4/gettext.m4 so that AM_INTL_SUBDIR is empty ..."
161 /^AC_DEFUN(\[AM_INTL_SUBDIR],/,/^]/c\
162 AC_DEFUN([AM_INTL_SUBDIR], [])
163 ' m
4/gettext.
m4 >m
4/gettext_gl.
m4 ||
exit
170 case `wget --help` in
172 no_cache
='--no-cache';;
174 no_cache
='--cache=off';;
179 echo "$0: getting translations into po (please ignore the robots.txt ERROR 404)..."
181 rm -f dummy
`ls | sed -n '/\.gmo$/p; /\.po/p'` &&
182 wget
-nv -nd -r -l 1 -A .po
$no_cache \
183 http
://www.iro.umontreal.ca
/translation
/maint
/$package/ &&
184 ls *.po |
sed 's/\.po$//' >LINGUAS
189 echo "$0: getting translations into po (please ignore the robots.txt ERROR 404)..."
191 rm -f dummy
`ls | sed -n '/\.gmo$/p; /\.po$/p'` &&
192 wget
-nv -nd -r -l 1 -A .po
$no_cache \
193 http
://www.iro.umontreal.ca
/translation
/maint
/$package-runtime/ &&
195 # For translations that have not yet been upgraded to the new
196 # runtime-po domain, prime the pump by extracting the relevant
197 # strings from the obsolete translations.
198 # This code can be removed once the bison-runtime domain
199 # has been translated by each team.
200 for po
in ..
/po
/*.po
; do
201 test -f "$po" ||
continue
205 -e 'memory exhausted' \
210 /^msgid "syntax error; also memory exhausted"$/,/^$/d
213 if cmp -s $runpo- $runpo; then
218 test -s $runpo ||
rm -f $runpo
222 ls *.po |
sed 's/\.po$//' >LINGUAS
228 # Generate autoconf and automake snippets.
230 (echo '# This file is generated automatically by "bootstrap".' &&
231 echo 'AC_DEFUN([GNULIB_AUTOCONF_SNIPPET],[' &&
232 $GNULIB_SRCDIR/gnulib-tool
--extract-autoconf-snippet $gnulib_modules &&
234 ) >m
4/gnulib.
m4 ||
exit
236 (echo '# This file is generated automatically by "bootstrap".' &&
237 $GNULIB_SRCDIR/gnulib-tool
--extract-automake-snippet $gnulib_modules
238 ) >lib
/gnulib.mk ||
exit
241 # Reconfigure, getting other files.
243 echo "$0: autoreconf --verbose --install --force ..."
244 autoreconf
--verbose --install --force ||
exit
247 # We don't need intl, so remove it.
248 # Remove aclocal.m4 too, so that it gets rebuilt.
249 intl_files_to_remove
='
278 echo $0: rm -fr $intl_files_to_remove ...
279 rm -fr $intl_files_to_remove ||
exit
281 # Put bug-reporting address into po/Makevars.
282 echo "$0: sed '/^MSGID_BUGS_ADDRESS *=/s/=.*/= bug-bison@gnu.org/' po/Makevars.template >po/Makevars ..."
283 sed '/^MSGID_BUGS_ADDRESS *=/s/=.*/= bug-bison@gnu.org/' po
/Makevars.template
>po
/Makevars
285 # Likewise for runtime-po/Makevars, except also change a few other parameters.
287 s/^\(DOMAIN\) *=.*/\1 = bison-runtime/
288 s/^\(subdir\) *=.*/\1 = runtime-po/
289 s/^\(XGETTEXT_OPTIONS\) *=.*/\1 = --keyword=YY_/
290 ' <po
/Makevars
>runtime-po
/Makevars
292 # Copy identical files from po to runtime-po.
293 (cd po
&& cp -p Makefile.
in.
in *-quot *.header
*.
sed *.sin ..
/runtime-po
)
295 # if src/parse-gram.[ch] are out of date, rebuild them.
296 parse_gram_y
=`find src/parse-gram.y \
297 '(' -newer src/parse-gram.c -o -newer src/parse-gram.h ')' \
299 case $parse_gram_y in
301 echo "$0: warning: bootstrapping with old src/parse-gram.[ch] files."
303 echo "$0: touch -c src/parse-gram.[ch] ... "
304 touch -c src
/parse-gram.
[ch
] ||
exit
306 echo "$0: ./configure --disable-nls ..."
307 .
/configure
--disable-nls ||
exit
309 echo "$0: (cd lib && make) ..."
310 (cd lib
&& make) ||
exit
312 echo "$0: (cd src && make) ..."
313 (cd src
&& make) ||
exit
315 echo "$0: rm -f src/parse-gram.c src/parse-gram.h ..."
316 rm -f src
/parse-gram.c src
/parse-gram.h ||
exit
318 echo "$0: (cd src && make parse-gram.c parse-gram.h) ..."
319 (cd src
&& make parse-gram.c parse-gram.h
) ||
exit
321 echo "$0: make distclean ..."
322 make distclean ||
exit;;
325 echo "$0: done. Now you can run './configure'."