]>
git.saurik.com Git - bison.git/blob - bootstrap
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..."
62 case ${GNULIB_SRCDIR--} in
64 if [ ! -d gnulib
]; then
65 echo "$0: getting gnulib files..."
67 case ${CVS_AUTH-pserver} in
69 CVS_PREFIX
=':pserver:anonymous@';;
71 CVS_PREFIX
="$CVS_USER${CVS_USER+@}";;
73 echo "$0: $CVS_AUTH: Unknown CVS access method" >&2
78 '') export CVS_RSH
=ssh;;
81 trap cleanup_gnulib
1 2 13 15
83 cvs
-z3 -q -d ${CVS_PREFIX}cvs.savannah.gnu.org
:/cvsroot
/gnulib co gnulib
||
91 <$GNULIB_SRCDIR/gnulib
-tool || exit
121 previous_gnulib_modules
=
122 while [ "$gnulib_modules" != "$previous_gnulib_modules" ]; do
123 previous_gnulib_modules
=$gnulib_modules
125 (echo "$gnulib_modules"
126 for gnulib_module in $gnulib_modules; do
127 $GNULIB_SRCDIR/gnulib-tool --extract-dependencies $gnulib_module
133 (for gnulib_module in $gnulib_modules; do
134 $GNULIB_SRCDIR/gnulib-tool --extract-filelist $gnulib_module
138 gnulib_dirs
=`echo "$gnulib_files" | sed 's,/[^/]*$,,' | sort -u`
139 mkdir -p $gnulib_dirs || exit
141 for gnulib_file
in $gnulib_files; do
145 m
4/onceonly_2_57.
m4) dest
=m
4/onceonly.
m4;;
146 # These will be overwritten by autopoint, which still uses
147 # old jm_.* macro names, so we have to keep both copies.
148 # m4/gettext.m4 isn't mentioned here, since it's patched below.
149 m
4/glibc21.
m4 | m
4/inttypes_h.
m4 | m
4/lib
-ld.
m4 | \
150 m
4/lib
-prefix.
m4 | m
4/po.
m4 | m
4/stdint_h.
m4 | m
4/uintmax_t.
m4 | \
152 dest
=`expr $gnulib_file : '\(.*\).m4'`_gl.
m4;;
156 echo "$0: Copying file $GNULIB_SRCDIR/$gnulib_file" &&
157 cp -p $GNULIB_SRCDIR/$gnulib_file $dest || exit
160 # This suppresses a bogus diagnostic
161 # "warning: macro `AM_LANGINFO_CODESET' not found in library".
162 echo "$0: patching m4/gettext.m4 so that AM_INTL_SUBDIR is empty ..."
164 /^AC_DEFUN(\[AM_INTL_SUBDIR],/,/^]/c\
165 AC_DEFUN([AM_INTL_SUBDIR], [])
166 ' m
4/gettext.
m4 >m
4/gettext_gl.
m4 || exit
173 case `wget --help` in
175 no_cache
='--no-cache';;
177 no_cache
='--cache=off';;
182 echo "$0: getting translations into po (please ignore the robots.txt ERROR 404)..."
184 rm -f dummy
`ls | sed -n '/\.gmo$/p; /\.po/p'` &&
185 wget
-nv -nd -r -l 1 -A .po
$no_cache \
186 http
://www.iro.umontreal.ca
/translation
/maint
/$package/ &&
187 ls *.po
| sed 's/\.po$//' >LINGUAS
192 echo "$0: getting translations into po (please ignore the robots.txt ERROR 404)..."
194 rm -f dummy
`ls | sed -n '/\.gmo$/p; /\.po$/p'` &&
195 wget
-nv -nd -r -l 1 -A .po
$no_cache \
196 http
://www.iro.umontreal.ca
/translation
/maint
/$package-runtime/ &&
198 # For translations that have not yet been upgraded to the new
199 # runtime-po domain, prime the pump by extracting the relevant
200 # strings from the obsolete translations.
201 # This code can be removed once the bison-runtime domain
202 # has been translated by each team.
203 for po
in ..
/po
/*.po
; do
204 test -f "$po" || continue
208 -e 'memory exhausted' \
213 /^msgid "syntax error; also memory exhausted"$/,/^$/d
216 if cmp -s $runpo- $runpo; then
221 test -s $runpo || rm -f $runpo
225 ls *.po
| sed 's/\.po$//' >LINGUAS
231 # Generate autoconf and automake snippets.
233 (echo '# This file is generated automatically by "bootstrap".' &&
234 echo 'AC_DEFUN([GNULIB_AUTOCONF_SNIPPET],[' &&
235 $GNULIB_SRCDIR/gnulib
-tool --extract-autoconf-snippet $gnulib_modules &&
237 ) >m
4/gnulib.
m4 || exit
239 (echo '# This file is generated automatically by "bootstrap".' &&
240 $GNULIB_SRCDIR/gnulib
-tool --extract-automake-snippet $gnulib_modules
241 ) >lib
/gnulib.mk
|| exit
244 # Reconfigure, getting other files.
246 echo "$0: autoreconf --verbose --install --force ..."
247 autoreconf
--verbose --install --force || exit
250 # We don't need intl, so remove it.
251 # Remove aclocal.m4 too, so that it gets rebuilt.
252 intl_files_to_remove
='
281 echo $0: rm -fr $intl_files_to_remove ...
282 rm -fr $intl_files_to_remove || exit
284 # Put bug-reporting address into po/Makevars.
285 echo "$0: sed '/^MSGID_BUGS_ADDRESS *=/s/=.*/= bug-bison@gnu.org/' po/Makevars.template >po/Makevars ..."
286 sed '/^MSGID_BUGS_ADDRESS *=/s/=.*/= bug-bison@gnu.org/' po
/Makevars.template
>po
/Makevars
288 # Likewise for runtime-po/Makevars, except also change a few other parameters.
290 s/^\(DOMAIN\) *=.*/\1 = bison-runtime/
291 s/^\(subdir\) *=.*/\1 = runtime-po/
292 s/^\(XGETTEXT_OPTIONS\) *=.*/\1 = --keyword=YY_/
293 ' <po
/Makevars
>runtime
-po/Makevars
295 # Copy identical files from po to runtime-po.
296 (cd po
&& cp -p Makefile.
in.
in *-quot *.header
*.
sed *.sin ..
/runtime
-po)
298 # if src/parse-gram.[ch] are out of date, rebuild them.
299 parse_gram_y
=`find src/parse-gram.y \
300 '(' -newer src/parse-gram.c -o -newer src/parse-gram.h ')' \
302 case $parse_gram_y in
304 echo "$0: warning: bootstrapping with old src/parse-gram.[ch] files."
306 echo "$0: touch -c src/parse-gram.[ch] ... "
307 touch -c src
/parse
-gram.
[ch
] || exit
309 echo "$0: ./configure --disable-nls ..."
310 .
/configure
--disable-nls || exit
312 echo "$0: (cd lib && make) ..."
313 (cd lib
&& make) || exit
315 echo "$0: (cd src && make) ..."
316 (cd src
&& make) || exit
318 echo "$0: rm -f src/parse-gram.c src/parse-gram.h ..."
319 rm -f src
/parse
-gram.c src
/parse
-gram.h
|| exit
321 echo "$0: (cd src && make parse-gram.c parse-gram.h) ..."
322 (cd src
&& make parse
-gram.c parse
-gram.h
) || exit
324 echo "$0: make distclean ..."
325 make distclean
|| exit;;
328 echo "$0: done. Now you can run './configure'."