]>
git.saurik.com Git - bison.git/blob - bootstrap
e0de221a58852b159a8538e12675c37a3e898b59
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 # e.g., m4/ulonglong_gl.m4 should follow m4/ulonglong.m4.
31 # Also, ensure diagnostics are in English, e.g., "wget --help" below.
41 echo "$0: usage: $0 [--gnulib-srcdir=DIR] [--cvs-user=USERNAME] [--skip-po]"
44 GNULIB_SRCDIR
=`expr "$option" : '--gnulib-srcdir=\(.*\)'`;;
46 CVS_USER
=`expr "$option" : '--cvs-user=\(.*\)'`;;
50 echo >&2 "$0: $option: unknown option"
55 echo "$0: Bootstrapping CVS $package..."
65 case ${GNULIB_SRCDIR--} in
67 if [ ! -d gnulib
]; then
68 echo "$0: getting gnulib files..."
70 case ${CVS_AUTH-pserver} in
72 CVS_PREFIX
=':pserver:anonymous@';;
74 CVS_PREFIX
="$CVS_USER${CVS_USER+@}";;
76 echo "$0: $CVS_AUTH: Unknown CVS access method" >&2
81 '') export CVS_RSH
=ssh;;
84 trap cleanup_gnulib
1 2 13 15
86 cvs
-z3 -q -d ${CVS_PREFIX}cvs.savannah.gnu.org
:/cvsroot
/gnulib co gnulib
||
94 <$GNULIB_SRCDIR/gnulib
-tool || exit
95 gnulib_tool
="$GNULIB_SRCDIR/gnulib-tool --assume-autoconf=latest-stable"
126 previous_gnulib_modules
=
127 while [ "$gnulib_modules" != "$previous_gnulib_modules" ]; do
128 previous_gnulib_modules
=$gnulib_modules
130 (echo "$gnulib_modules"
131 for gnulib_module in $gnulib_modules; do
132 $gnulib_tool --extract-dependencies $gnulib_module
138 (for gnulib_module in $gnulib_modules; do
139 $gnulib_tool --extract-filelist $gnulib_module
143 gnulib_dirs
=`echo "$gnulib_files" | sed 's,/[^/]*$,,' | sort -u`
144 mkdir -p $gnulib_dirs || exit
146 for gnulib_file
in $gnulib_files; do
150 # These will be overwritten by autopoint, which still uses
151 # old jm_.* macro names, so we have to keep both copies.
152 # m4/gettext.m4 isn't mentioned here, since it's patched below.
153 m
4/glibc21.
m4 | m
4/inttypes_h.
m4 | m
4/lib
-ld.
m4 | \
154 m
4/lib
-prefix.
m4 | m
4/po.
m4 | m
4/stdint_h.
m4 | m
4/uintmax_t.
m4 | \
156 dest
=`expr $gnulib_file : '\(.*\).m4'`_gl.
m4;;
160 echo "$0: Copying file $GNULIB_SRCDIR/$gnulib_file" &&
161 cp -p $GNULIB_SRCDIR/$gnulib_file $dest || exit
164 # This suppresses a bogus diagnostic
165 # "warning: macro `AM_LANGINFO_CODESET' not found in library".
166 echo "$0: patching m4/gettext.m4 so that AM_INTL_SUBDIR is empty ..."
168 /^AC_DEFUN(\[AM_INTL_SUBDIR],/,/^]/c\
169 AC_DEFUN([AM_INTL_SUBDIR], [])
170 ' m
4/gettext.
m4 >m
4/gettext_gl.
m4 || exit
179 echo "$0: getting translations into $subdir for $domain..."
180 (cd $subdir && rm -f dummy
`ls | sed -n '/\.gmo$/p; /\.po/p'`) &&
182 $WGET_COMMAND -O "$subdir/$domain.html" "$TP_URL$domain" &&
184 sed -n 's|.*"http://[^"]*/translation/teams/PO/\([^/"]*\)/'"$domain"'-\([^/"]*\)\.[^."]*\.po".*|\1.\2|p' <"$subdir/$domain.html" |
185 sort -k 1,1 -k 2,2n
-k2,2 -k3,3n
-k3,3 -k4,4n
-k4,4 -k5,5n
-k5.5
|
187 { if (lang && $1 != lang) print lang, ver }
188 { lang = $1; ver = substr($0, index($0, ".") + 1) }
189 END { if (lang) print lang, ver }
190 ' | awk -v domain
="$domain" -v subdir
="$subdir" '
195 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
199 ls "$subdir"/*.po
| sed 's|.*/||; s|\.po$||' >"$subdir/LINGUAS" &&
200 rm "$subdir/$domain.html"
205 case `wget --help` in
207 no_cache
='--no-cache';;
209 no_cache
='--cache=off';;
214 WGET_COMMAND
="wget -nv $no_cache"
217 get_translations po
$package || exit
221 get_translations runtime
-po $package-runtime || exit
226 # Generate autoconf and automake snippets.
228 (echo '# This file is generated automatically by "bootstrap".' &&
229 echo 'AC_DEFUN([GNULIB_AUTOCONF_SNIPPET],[' &&
230 $gnulib_tool --extract-autoconf-snippet $gnulib_modules &&
232 ) >m
4/gnulib.
m4 || exit
234 (echo '# This file is generated automatically by "bootstrap".' &&
235 $gnulib_tool --extract-automake-snippet $gnulib_modules |
236 sed 's/^[ ]*AM_CPPFLAGS[ ]*+=/# (commented out by bootstrap) &/'
237 ) >lib
/gnulib.mk
|| exit
240 # Reconfigure, getting other files.
242 echo "$0: autoreconf --verbose --install --force ..."
243 autoreconf
--verbose --install --force || exit
246 # We don't need intl, so remove it.
247 # Remove aclocal.m4 too, so that it gets rebuilt.
248 intl_files_to_remove
='
275 echo $0: rm -fr $intl_files_to_remove ...
276 rm -fr $intl_files_to_remove || exit
278 # Undo changes to gnulib files that autoreconf made.
279 for gnulib_file
in $gnulib_files; do
280 test ! -f $gnulib_file || cmp -s $gnulib_file $GNULIB_SRCDIR/$gnulib_file || {
281 rm -f $gnulib_file &&
282 echo "$0: Copying file $GNULIB_SRCDIR/$gnulib_file again" &&
283 cp -p $GNULIB_SRCDIR/$gnulib_file $gnulib_file || exit
287 # Put bug-reporting address into po/Makevars.
288 echo "$0: sed '/^MSGID_BUGS_ADDRESS *=/s/=.*/= bug-bison@gnu.org/' po/Makevars.template >po/Makevars ..."
289 sed '/^MSGID_BUGS_ADDRESS *=/s/=.*/= bug-bison@gnu.org/' po
/Makevars.template
>po
/Makevars
291 # Likewise for runtime-po/Makevars, except also change a few other parameters.
293 s/^\(DOMAIN\) *=.*/\1 = bison-runtime/
294 s/^\(subdir\) *=.*/\1 = runtime-po/
295 s/^\(XGETTEXT_OPTIONS\) *=.*/\1 = --keyword=YY_/
296 ' <po
/Makevars
>runtime
-po/Makevars
298 # Append 'datarootdir = $(prefix)/share' to po/Makefile.in.in to work
299 # around an incompatibility between Autoconf 2.60 and gettext 0.14.6.
300 # This hack can be removed once we assume gettext 0.15 or later.
301 grep datarootdir po
/Makefile.
in.
in >/dev
/null
||
302 echo 'datarootdir = @datarootdir@' >>po
/Makefile.
in.
in
304 # Copy identical files from po to runtime-po.
305 (cd po
&& cp -p Makefile.
in.
in *-quot *.header
*.
sed *.sin ..
/runtime
-po)
307 # if src/parse-gram.[ch] are out of date, rebuild them.
308 parse_gram_y
=`find src/parse-gram.y \
309 '(' -newer src/parse-gram.c -o -newer src/parse-gram.h ')' \
311 case $parse_gram_y in
313 echo "$0: warning: bootstrapping with old src/parse-gram.[ch] files."
315 echo "$0: touch -c src/parse-gram.[ch] ... "
316 touch -c src
/parse
-gram.
[ch
] || exit
318 echo "$0: ./configure --disable-nls ..."
319 .
/configure
--disable-nls || exit
321 echo "$0: (cd lib && make) ..."
322 (cd lib
&& make) || exit
324 echo "$0: (cd src && make) ..."
325 (cd src
&& make) || exit
327 echo "$0: rm -f src/parse-gram.c src/parse-gram.h ..."
328 rm -f src
/parse
-gram.c src
/parse
-gram.h
|| exit
330 echo "$0: (cd src && make parse-gram.c parse-gram.h) ..."
331 (cd src
&& make parse
-gram.c parse
-gram.h
) || exit
333 echo "$0: make distclean ..."
334 make distclean
|| exit;;
337 echo "$0: done. Now you can run './configure'."