]>
git.saurik.com Git - bison.git/blob - bootstrap
3 # Bootstrap this package from CVS.
5 # Copyright (C) 2003, 2004, 2005, 2006 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 # Translation Project URL, for the registry of all projects.
27 TP_URL
='http://www.iro.umontreal.ca/translation/registry.cgi?domain='
29 # Ensure file names are sorted consistently across platforms.
30 # Also, ensure diagnostics are in English, e.g., "wget --help" below.
40 echo "$0: usage: $0 [--gnulib-srcdir=DIR] [--cvs-user=USERNAME] [--skip-po]"
43 GNULIB_SRCDIR
=`expr "$option" : '--gnulib-srcdir=\(.*\)'`;;
45 CVS_USER
=`expr "$option" : '--cvs-user=\(.*\)'`;;
49 echo >&2 "$0: $option: unknown option"
54 echo "$0: Bootstrapping CVS $package..."
64 case ${GNULIB_SRCDIR--} in
66 if [ ! -d gnulib
]; then
67 echo "$0: getting gnulib files..."
69 case ${CVS_AUTH-pserver} in
71 CVS_PREFIX
=':pserver:anonymous@';;
73 CVS_PREFIX
="$CVS_USER${CVS_USER+@}";;
75 echo "$0: $CVS_AUTH: Unknown CVS access method" >&2
80 '') export CVS_RSH
=ssh;;
83 trap cleanup_gnulib
1 2 13 15
85 cvs
-z3 -q -d ${CVS_PREFIX}cvs.savannah.gnu.org
:/cvsroot
/gnulib co gnulib
||
93 gnulib_tool
=$GNULIB_SRCDIR/gnulib
-tool
124 previous_gnulib_modules
=
125 while [ "$gnulib_modules" != "$previous_gnulib_modules" ]; do
126 previous_gnulib_modules
=$gnulib_modules
128 (echo "$gnulib_modules"
129 for gnulib_module in $gnulib_modules; do
130 $gnulib_tool --extract-dependencies $gnulib_module
137 for gnulib_module in $gnulib_modules; do
138 $gnulib_tool --extract-filelist $gnulib_module
142 gnulib_dirs
=`echo "$gnulib_files" | sed 's,/[^/]*$,,' | sort -u`
143 mkdir -p $gnulib_dirs || exit
145 for gnulib_file
in $gnulib_files; do
148 echo "$0: Copying file $GNULIB_SRCDIR/$gnulib_file" &&
149 cp -p $GNULIB_SRCDIR/$gnulib_file $dest || exit
152 # This suppresses a bogus diagnostic
153 # "warning: macro `AM_LANGINFO_CODESET' not found in library".
154 echo "$0: patching m4/gettext.m4 to remove need for intl/* ..."
156 /^AC_DEFUN(\[AM_INTL_SUBDIR],/,/^]/c\
157 AC_DEFUN([AM_INTL_SUBDIR], [])
158 /^AC_DEFUN(\[gt_INTL_SUBDIR_CORE],/,/^]/c\
159 AC_DEFUN([gt_INTL_SUBDIR_CORE], [])
160 ' m
4/gettext.
m4 >m
4/gettext_gl.
m4 || exit
169 echo "$0: getting translations into $subdir for $domain..."
170 (cd $subdir && rm -f dummy
`ls | sed -n '/\.gmo$/p; /\.po/p'`) &&
172 $WGET_COMMAND -O "$subdir/$domain.html" "$TP_URL$domain" &&
174 sed -n 's|.*"http://[^"]*/translation/teams/PO/\([^/"]*\)/'"$domain"'-\([^/"]*\)\.[^."]*\.po".*|\1.\2|p' <"$subdir/$domain.html" |
175 sort -k 1,1 -k 2,2n
-k2,2 -k3,3n
-k3,3 -k4,4n
-k4,4 -k5,5n
-k5.5
|
177 { if (lang && $1 != lang) print lang, ver }
178 { lang = $1; ver = substr($0, index($0, ".") + 1) }
179 END { if (lang) print lang, ver }
180 ' | awk -v domain
="$domain" -v subdir
="$subdir" '
184 # Work around bugs in Bison 2.3 translations uncovered by gettext 0.15.
185 # This workaround can be removed once the translations are fixed.
186 if (lang == "id" || lang == "tr") next
190 printf "$WGET_COMMAND -O %s/%s.po 'http
://www.iro.umontreal.ca
/translation
/teams
/PO
/%s
/%s
-%s.
%s.po
' &&\n", subdir, lang, lang, domain, ver, lang
194 ls "$subdir"/*.po
| sed 's|.*/||; s|\.po$||' >"$subdir/LINGUAS" &&
195 rm "$subdir/$domain.html"
200 case `wget --help` in
202 no_cache
='--no-cache';;
204 no_cache
='--cache=off';;
209 WGET_COMMAND
="wget -nv $no_cache"
212 get_translations po
$package || exit
216 get_translations runtime
-po $package-runtime || exit
221 # Generate autoconf and automake snippets.
223 (echo '# This file is generated automatically by "bootstrap".' &&
224 echo 'AC_DEFUN([GNULIB_AUTOCONF_SNIPPET],[' &&
225 $gnulib_tool --extract-autoconf-snippet $gnulib_modules |
226 sed 's/AM_GNU_GETTEXT(\[external]/&, [need-ngettext]/' &&
228 ) >m
4/gnulib.
m4 || exit
230 (echo '# This file is generated automatically by "bootstrap".' &&
231 $gnulib_tool --extract-automake-snippet $gnulib_modules |
232 sed 's/^[ ]*AM_CPPFLAGS[ ]*+=/# (commented out by bootstrap) &/'
233 ) >lib
/gnulib.mk
|| exit
236 # Reconfigure, getting other files.
238 echo "$0: autopoint --force ..."
239 autopoint
--force || exit
241 # We don't need intl, so remove it.
242 intl_files_to_remove
='
262 echo $0: rm -fr $intl_files_to_remove ...
263 rm -fr $intl_files_to_remove || exit
266 # Undo changes to gnulib files that autoreconf made.
267 for gnulib_file
in $gnulib_files; do
268 test ! -f $gnulib_file || cmp -s $gnulib_file $GNULIB_SRCDIR/$gnulib_file || {
269 rm -f $gnulib_file &&
270 echo "$0: Copying file $GNULIB_SRCDIR/$gnulib_file again" &&
271 cp -p $GNULIB_SRCDIR/$gnulib_file $gnulib_file || exit
275 # Make sure aclocal.m4 is not older than input files.
279 'aclocal --force -I m4' \
281 'autoheader --force' \
282 'automake --add-missing --copy --force-missing';
284 echo "$0: $command ..."
289 # Put bug-reporting address into po/Makevars.
290 echo "$0: Creating po/Makevars from po/Makevars.template ..."
292 /^MSGID_BUGS_ADDRESS *=/s/=.*/= bug-bison@gnu.org/
293 /^XGETTEXT_OPTIONS *=/{
296 --flag=_:1:pass-c-format \\\
297 --flag=N_:1:pass-c-format \\\
298 --flag=error:3:c-format --flag=error_at_line:5:c-format \\\
299 --flag=warn:1:c-format --flag=warn_at:2:c-format \\\
300 --flag=complain:1:c-format --flag=complain_at:2:c-format \\\
301 --flag=fatal:1:c-format --flag=fatal_at:2:c-format
303 ' po
/Makevars.template
>po
/Makevars
305 # Likewise for runtime-po/Makevars, except also change a few other parameters.
307 s/^\(DOMAIN\) *=.*/\1 = bison-runtime/
308 s/^\(subdir\) *=.*/\1 = runtime-po/
309 s/^\(XGETTEXT_OPTIONS\) *=.*/\1 = --keyword=YY_/
310 ' <po
/Makevars
>runtime
-po/Makevars
312 # Copy identical files from po to runtime-po.
313 (cd po
&& cp -p Makefile.
in.
in *-quot *.header
*.
sed *.sin ..
/runtime
-po)
315 # if src/parse-gram.[ch] are out of date, rebuild them.
316 parse_gram_y
=`find src/parse-gram.y \
317 '(' -newer src/parse-gram.c -o -newer src/parse-gram.h ')' \
319 case $parse_gram_y in
321 echo "$0: warning: bootstrapping with old src/parse-gram.[ch] files."
323 echo "$0: touch -c src/parse-gram.[ch] ... "
324 touch -c src
/parse
-gram.
[ch
] || exit
326 echo "$0: ./configure --disable-nls ..."
327 .
/configure
--disable-nls || exit
329 echo "$0: (cd lib && make) ..."
330 (cd lib
&& make) || exit
332 echo "$0: (cd src && make) ..."
333 (cd src
&& make) || exit
335 echo "$0: rm -f src/parse-gram.c src/parse-gram.h ..."
336 rm -f src
/parse
-gram.c src
/parse
-gram.h
|| exit
338 echo "$0: (cd src && make parse-gram.c parse-gram.h) ..."
339 (cd src
&& make parse
-gram.c parse
-gram.h
) || exit
341 echo "$0: make distclean ..."
342 make distclean
|| exit;;
345 echo "$0: done. Now you can run './configure'."