]>
git.saurik.com Git - bison.git/blob - bootstrap
34dce9d445c35634e3d4468499a8548c2521c15a
3 # Bootstrap this package from CVS.
5 # Copyright (C) 2003, 2004 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., 59 Temple Place - Suite 330, Boston, MA
22 # Written by Paul Eggert.
32 echo "$0: usage: $0 [--gnulib-srcdir=DIR] [--cvs-user=USERNAME] [--skip-po]"
35 GNULIB_SRCDIR
=`expr "$option" : '--gnulib-srcdir=\(.*\)'`;;
37 CVS_USER
=`expr "$option" : '--cvs-user=\(.*\)'`;;
41 echo >&2 "$0: $option: unknown option"
46 # Check that gettext version matches what's in configure.ac.
47 # FIXME: We shouldn't have to modify configure.ac every time
48 # a new gettext version comes out.
49 gettext_have
=$(LC_ALL=C gettext --version | sed 's/.* //; 1q')
51 sed -n '/^AM_GNU_GETTEXT_VERSION/{ s/.*\[//; s/].*//; p; q; }' configure.ac
53 test "$gettext_have" = "$gettext_need" || {
54 echo >&2 "$0: Your gettext version is $gettext_have."
55 echo >&2 "$0: Please install and use gettext-$gettext_need instead."
59 echo "$0: Bootstrapping CVS $package..."
63 if [ "${2}" != - ]; then
64 CVS_PREFIX
=${CVS_PREFIX}${2}@
70 case ${GNULIB_SRCDIR--} in
72 if [ ! -d gnulib
]; then
73 echo "$0: getting gnulib files..."
76 trap 'rm -fr gnulib; exit 1' 0
78 case ${CVS_AUTH-anoncvs} in
80 CVS_PREFIX
='anoncvs@';;
82 CVS_PREFIX
="$CVS_USER${CVS_USER+@}";;
84 echo "$0: $CVS_AUTH: Unknown CVS access method" >&2
89 '') export CVS_RSH
=ssh;;
92 cvs
-z3 -q -d ${CVS_PREFIX}subversions.gnu.org
:/cvsroot
/gnulib co gnulib
|| exit
99 <$GNULIB_SRCDIR/gnulib
-tool || exit
120 previous_gnulib_modules
=
121 while [ "$gnulib_modules" != "$previous_gnulib_modules" ]; do
122 previous_gnulib_modules
=$gnulib_modules
124 (echo "$gnulib_modules"
125 for gnulib_module in $gnulib_modules; do
126 $GNULIB_SRCDIR/gnulib-tool --extract-dependencies $gnulib_module
132 (for gnulib_module in $gnulib_modules; do
133 $GNULIB_SRCDIR/gnulib-tool --extract-filelist $gnulib_module
137 gnulib_dirs
=`echo "$gnulib_files" | sed 's,/[^/]*$,,' | sort -u`
138 mkdir -p $gnulib_dirs || exit
140 for gnulib_file
in $gnulib_files; do
144 m
4/onceonly_2_57.
m4) dest
=m
4/onceonly.
m4;;
148 echo "$0: Copying file $GNULIB_SRCDIR/$gnulib_file" &&
149 cp -p $GNULIB_SRCDIR/$gnulib_file $dest || exit
157 echo "$0: getting translations into po (please ignore the robots.txt ERROR 404)..."
159 rm -f dummy
`ls | sed -n '/\.gmo$/p; /\.po/p'` &&
160 wget
-nv -nd -r -l 1 -A .po
-C off \
161 http
://www2.iro.umontreal.ca
/~gnutra
/po
/maint
/$package/ &&
162 ls *.po
| sed 's/\.po$//' >LINGUAS
167 # Generate autoconf and automake snippets.
169 (echo '# This file is generated automatically by "bootstrap".' &&
170 echo 'AC_DEFUN([GNULIB_AUTOCONF_SNIPPET],[' &&
171 $GNULIB_SRCDIR/gnulib
-tool --extract-autoconf-snippet $gnulib_modules &&
173 ) >m
4/gnulib.
m4 || exit
175 (echo '# This file is generated automatically by "bootstrap".' &&
176 $GNULIB_SRCDIR/gnulib
-tool --extract-automake-snippet $gnulib_modules
177 ) >lib
/gnulib.mk
|| exit
180 # Reconfigure, getting other files.
182 echo "$0: autoreconf --verbose --install --force ..."
183 autoreconf
--verbose --install --force || exit
186 # We don't need intl, so remove it.
187 # Remove aclocal.m4 too, so that it gets rebuilt.
188 intl_files_to_remove
='
212 echo $0: rm -fr $intl_files_to_remove ...
213 rm -fr $intl_files_to_remove || exit
215 echo "$0: patching m4/gettext.m4 so that AM_INTL_SUBDIR is empty ..."
217 /^AC_DEFUN(\[AM_INTL_SUBDIR],/,/^]/c\
218 AC_DEFUN([AM_INTL_SUBDIR], [])
219 ' m
4/gettext.
m4 >m
4/gettext.m4t
&&
220 mv m
4/gettext.m4t m
4/gettext.
m4 || exit
222 # Patch what appears to be a bug in gettext 0.14.1;
223 # remove this once the bug is fixed.
224 grep @top_builddir@ po
/Makefile.
in.
in >/dev
/null
|| {
225 echo "$0: prepending 'top_builddir=@top_builddir@' to po/Makefile.in.in ... "
226 old_contents
=$(cat po/Makefile.in.in) || exit
227 cat >po
/Makefile.
in.
in <<EOF
228 top_builddir=@top_builddir@
233 # Put bug-reporting address into po/Makevars.
234 echo "$0: sed '/^MSGID_BUGS_ADDRESS *=/s/=.*/= bug-bison@gnu.org/' po/Makevars.template >po/Makevars ..."
235 sed '/^MSGID_BUGS_ADDRESS *=/s/=.*/= bug-bison@gnu.org/' po
/Makevars.template
>po
/Makevars
238 # if src/parse-gram.[ch] are out of date, rebuild them.
239 parse_gram_y
=$
(find src
/parse
-gram.y \
240 '(' -newer src
/parse
-gram.c
-o -newer src
/parse
-gram.h
')' \
242 case $parse_gram_y in
244 echo "$0: warning: bootstrapping with old src/parse-gram.[ch] files."
246 echo "$0: touch -c src/parse-gram.[ch] ... "
247 touch -c src
/parse
-gram.
[ch
] || exit
249 echo "$0: ./configure --disable-nls ..."
250 .
/configure
--disable-nls || exit
252 echo "$0: (cd lib && make) ..."
253 (cd lib
&& make) || exit
255 echo "$0: (cd src && make) ..."
256 (cd src
&& make) || exit
258 echo "$0: rm -f src/parse-gram.c src/parse-gram.h ..."
259 rm -f src
/parse
-gram.c src
/parse
-gram.h
|| exit
261 echo "$0: (cd src && make parse-gram.c parse-gram.h) ..."
262 (cd src
&& make parse
-gram.c parse
-gram.h
) || exit
264 echo "$0: make distclean ..."
265 make distclean
|| exit;;
268 echo "$0: done. Now you can run './configure'."