]>
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.
37 echo "$0: usage: $0 [--gnulib-srcdir=DIR] [--cvs-user=USERNAME] [--skip-po]"
40 GNULIB_SRCDIR
=`expr "$option" : '--gnulib-srcdir=\(.*\)'`;;
42 CVS_USER
=`expr "$option" : '--cvs-user=\(.*\)'`;;
46 echo >&2 "$0: $option: unknown option"
51 echo "$0: Bootstrapping CVS $package..."
55 if [ "${2}" != - ]; then
56 CVS_PREFIX
=${CVS_PREFIX}${2}@
62 case ${GNULIB_SRCDIR--} in
64 if [ ! -d gnulib
]; then
65 echo "$0: getting gnulib files..."
68 trap 'rm -fr gnulib; exit 1' 0
70 case ${CVS_AUTH-anoncvs} in
72 CVS_PREFIX
='anoncvs@';;
74 CVS_PREFIX
="$CVS_USER${CVS_USER+@}";;
76 echo "$0: $CVS_AUTH: Unknown CVS access method" >&2
81 '') export CVS_RSH
=ssh;;
84 cvs
-z3 -q -d ${CVS_PREFIX}subversions.gnu.org
:/cvsroot
/gnulib co gnulib
|| exit
91 <$GNULIB_SRCDIR/gnulib
-tool || exit
117 previous_gnulib_modules
=
118 while [ "$gnulib_modules" != "$previous_gnulib_modules" ]; do
119 previous_gnulib_modules
=$gnulib_modules
121 (echo "$gnulib_modules"
122 for gnulib_module in $gnulib_modules; do
123 $GNULIB_SRCDIR/gnulib-tool --extract-dependencies $gnulib_module
129 (for gnulib_module in $gnulib_modules; do
130 $GNULIB_SRCDIR/gnulib-tool --extract-filelist $gnulib_module
134 gnulib_dirs
=`echo "$gnulib_files" | sed 's,/[^/]*$,,' | sort -u`
135 mkdir -p $gnulib_dirs || exit
137 for gnulib_file
in $gnulib_files; do
141 m
4/onceonly_2_57.
m4) dest
=m
4/onceonly.
m4;;
142 # These will be overwritten by autopoint, which still uses
143 # old jm_.* macro names, so we have to keep both copies.
144 # m4/gettext.m4 isn't mentioned here, since it's patched below.
145 m
4/glibc21.
m4 | m
4/inttypes_h.
m4 | m
4/lib
-ld.
m4 | \
146 m
4/lib
-prefix.
m4 | m
4/po.
m4 | m
4/stdint_h.
m4 | m
4/uintmax_t.
m4 | \
148 dest
=`expr $gnulib_file : '\(.*\).m4'`_gl.
m4;;
152 echo "$0: Copying file $GNULIB_SRCDIR/$gnulib_file" &&
153 cp -p $GNULIB_SRCDIR/$gnulib_file $dest || exit
156 echo "$0: patching m4/gettext.m4 so that AM_INTL_SUBDIR is empty ..."
158 /^AC_DEFUN(\[AM_INTL_SUBDIR],/,/^]/c\
159 AC_DEFUN([AM_INTL_SUBDIR], [])
160 ' m
4/gettext.
m4 >m
4/gettext_gl.
m4 || exit
167 echo "$0: getting translations into po (please ignore the robots.txt ERROR 404)..."
169 rm -f dummy
`ls | sed -n '/\.gmo$/p; /\.po/p'` &&
170 wget
-nv -nd -r -l 1 -A .po
-C off \
171 http
://www.iro.umontreal.ca
/translation
/maint
/$package/ &&
172 ls *.po
| sed 's/\.po$//' >LINGUAS
177 echo "$0: getting translations into po (please ignore the robots.txt ERROR 404)..."
179 rm -f dummy
`ls | sed -n '/\.gmo$/p; /\.po$/p'` &&
180 wget
-nv -nd -r -l 1 -A .po
-C off \
181 http
://www.iro.umontreal.ca
/translation
/maint
/$package-runtime/ &&
182 ls *.po
| sed 's/\.po$//' >LINGUAS
188 # Generate autoconf and automake snippets.
190 (echo '# This file is generated automatically by "bootstrap".' &&
191 echo 'AC_DEFUN([GNULIB_AUTOCONF_SNIPPET],[' &&
192 $GNULIB_SRCDIR/gnulib
-tool --extract-autoconf-snippet $gnulib_modules &&
194 ) >m
4/gnulib.
m4 || exit
196 (echo '# This file is generated automatically by "bootstrap".' &&
197 $GNULIB_SRCDIR/gnulib
-tool --extract-automake-snippet $gnulib_modules
198 ) >lib
/gnulib.mk
|| exit
201 # Reconfigure, getting other files.
203 echo "$0: autoreconf --verbose --install --force ..."
204 autoreconf
--verbose --install --force || exit
207 # We don't need intl, so remove it.
208 # Remove aclocal.m4 too, so that it gets rebuilt.
209 intl_files_to_remove
='
238 echo $0: rm -fr $intl_files_to_remove ...
239 rm -fr $intl_files_to_remove || exit
241 # Put bug-reporting address into po/Makevars.
242 echo "$0: sed '/^MSGID_BUGS_ADDRESS *=/s/=.*/= bug-bison@gnu.org/' po/Makevars.template >po/Makevars ..."
243 sed '/^MSGID_BUGS_ADDRESS *=/s/=.*/= bug-bison@gnu.org/' po
/Makevars.template
>po
/Makevars
245 # Likewise for runtime-po/Makevars, except also change a few other parameters.
247 s/^\(DOMAIN\) *=.*/\1 = bison-runtime/
248 s/^\(subdir\) *=.*/\1 = runtime-po/
249 s/^\(XGETTEXT_OPTIONS\) *=.*/\1 = --keyword=YY_/
250 ' <po
/Makevars
>runtime
-po/Makevars
252 # Copy identical files from po to runtime-po.
253 (cd po
&& cp -p Makefile.
in.
in *-quot *.header
*.
sed *.sin ..
/runtime
-po)
255 # if src/parse-gram.[ch] are out of date, rebuild them.
256 parse_gram_y
=`find src/parse-gram.y \
257 '(' -newer src/parse-gram.c -o -newer src/parse-gram.h ')' \
259 case $parse_gram_y in
261 echo "$0: warning: bootstrapping with old src/parse-gram.[ch] files."
263 echo "$0: touch -c src/parse-gram.[ch] ... "
264 touch -c src
/parse
-gram.
[ch
] || exit
266 echo "$0: ./configure --disable-nls ..."
267 .
/configure
--disable-nls || exit
269 echo "$0: (cd lib && make) ..."
270 (cd lib
&& make) || exit
272 echo "$0: (cd src && make) ..."
273 (cd src
&& make) || exit
275 echo "$0: rm -f src/parse-gram.c src/parse-gram.h ..."
276 rm -f src
/parse
-gram.c src
/parse
-gram.h
|| exit
278 echo "$0: (cd src && make parse-gram.c parse-gram.h) ..."
279 (cd src
&& make parse
-gram.c parse
-gram.h
) || exit
281 echo "$0: make distclean ..."
282 make distclean
|| exit;;
285 echo "$0: done. Now you can run './configure'."