]>
git.saurik.com Git - bison.git/blob - bootstrap
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 echo "$0: Bootstrapping CVS $package..."
50 if [ "${2}" != - ]; then
51 CVS_PREFIX
=${CVS_PREFIX}${2}@
57 case ${GNULIB_SRCDIR--} in
59 if [ ! -d gnulib
]; then
60 echo "$0: getting gnulib files..."
63 trap 'rm -fr gnulib; exit 1' 0
65 case ${CVS_AUTH-anoncvs} in
67 CVS_PREFIX
='anoncvs@';;
69 CVS_PREFIX
="$CVS_USER${CVS_USER+@}";;
71 echo "$0: $CVS_AUTH: Unknown CVS access method" >&2
76 '') export CVS_RSH
=ssh;;
79 cvs
-z3 -q -d ${CVS_PREFIX}subversions.gnu.org
:/cvsroot
/gnulib co gnulib
|| exit
86 <$GNULIB_SRCDIR/gnulib
-tool || exit
107 previous_gnulib_modules
=
108 while [ "$gnulib_modules" != "$previous_gnulib_modules" ]; do
109 previous_gnulib_modules
=$gnulib_modules
111 (echo "$gnulib_modules"
112 for gnulib_module in $gnulib_modules; do
113 $GNULIB_SRCDIR/gnulib-tool --extract-dependencies $gnulib_module
119 (for gnulib_module in $gnulib_modules; do
120 $GNULIB_SRCDIR/gnulib-tool --extract-filelist $gnulib_module
124 gnulib_dirs
=`echo "$gnulib_files" | sed 's,/[^/]*$,,' | sort -u`
125 mkdir -p $gnulib_dirs || exit
127 for gnulib_file
in $gnulib_files; do
131 m
4/onceonly_2_57.
m4) dest
=m
4/onceonly.
m4;;
135 echo "$0: Copying file $GNULIB_SRCDIR/$gnulib_file" &&
136 cp -p $GNULIB_SRCDIR/$gnulib_file $dest || exit
144 echo "$0: getting translations into po..."
146 rm -f dummy
`ls | sed -n '/\.gmo$/p; /\.po/p'` &&
147 wget
-nv -nd -r -l 1 -A .po
-C off \
148 http
://www2.iro.umontreal.ca
/~gnutra
/po
/maint
/$package/ &&
149 ls *.po
| sed 's/\.po$//' >LINGUAS
154 # Generate autoconf and automake snippets.
156 (echo '# This file is generated automatically by "bootstrap".' &&
157 echo 'AC_DEFUN([GNULIB_AUTOCONF_SNIPPET],[' &&
158 $GNULIB_SRCDIR/gnulib
-tool --extract-autoconf-snippet $gnulib_modules &&
160 ) >m
4/gnulib.
m4 || exit
162 (echo '# This file is generated automatically by "bootstrap".' &&
163 $GNULIB_SRCDIR/gnulib
-tool --extract-automake-snippet $gnulib_modules
164 ) >lib
/gnulib.mk
|| exit
167 # Reconfigure, getting other files.
169 echo "$0: autoreconf --verbose --install --force ..."
170 autoreconf
--verbose --install --force || exit
173 # We don't need intl, so remove it.
174 # Remove aclocal.m4 too, so that it gets rebuilt.
175 intl_files_to_remove
='
199 echo $0: rm -fr $intl_files_to_remove ...
200 rm -fr $intl_files_to_remove || exit
202 echo "$0: patching m4/gettext.m4 so that AM_INTL_SUBDIR is empty ..."
204 /^AC_DEFUN(\[AM_INTL_SUBDIR],/,/^]/c\
205 AC_DEFUN([AM_INTL_SUBDIR], [])
206 ' m
4/gettext.
m4 >m
4/gettext.m4t
&&
207 mv m
4/gettext.m4t m
4/gettext.
m4 || exit
209 echo 'AC_DEFUN([AM_INTL_SUBDIR],[])' >>m
4/gettext.
m4 || exit
211 # Patch what appears to be a bug in gettext 0.14.1;
212 # remove this once the bug is fixed.
213 grep @top_builddir@ po
/Makefile.
in.
in >/dev
/null
|| {
214 echo "$0: prepending 'top_builddir=@top_builddir@' to po/Makefile.in.in ... "
215 old_contents
=$(cat po/Makefile.in.in) || exit
216 cat >po
/Makefile.
in.
in <<EOF
217 top_builddir=@top_builddir@
222 # Put bug-reporting address into po/Makevars.
223 echo "$0: sed '/^MSGID_BUGS_ADDRESS *=/s/=.*/= bug-bison@gnu.org/' po/Makevars.template >po/Makevars ..."
224 sed '/^MSGID_BUGS_ADDRESS *=/s/=.*/= bug-bison@gnu.org/' po
/Makevars.template
>po
/Makevars
227 # if src/parse-gram.[ch] are out of date, rebuild them.
228 parse_gram_y
=$
(find src
/parse
-gram.y \
229 '(' -newer src
/parse
-gram.c
-o -newer src
/parse
-gram.h
')' \
231 case $parse_gram_y in
233 echo "$0: warning: bootstrapping with old src/parse-gram.[ch] files."
235 echo "$0: touch -c src/parse-gram.[ch] ... "
236 touch -c src
/parse
-gram.
[ch
] || exit
238 echo "$0: ./configure --disable-nls ..."
239 .
/configure
--disable-nls || exit
241 echo "$0: (cd lib && make) ..."
242 (cd lib
&& make) || exit
244 echo "$0: (cd src && make) ..."
245 (cd src
&& make) || exit
247 echo "$0: rm -f src/parse-gram.c src/parse-gram.h ..."
248 rm -f src
/parse
-gram.c src
/parse
-gram.h
|| exit
250 echo "$0: (cd src && make parse-gram.c parse-gram.h) ..."
251 (cd src
&& make parse
-gram.c parse
-gram.h
) || exit
253 echo "$0: make distclean ..."
254 make distclean
|| exit;;
257 echo "$0: done. Now you can run './configure'."