]> Dogcows Code - chaz/tar/blob - bootstrap
New option --no-po
[chaz/tar] / bootstrap
1 #! /bin/sh
2
3 # Bootstrap 'tar' from CVS.
4
5 # Copyright (C) 2003 Free Software Foundation, Inc.
6
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)
10 # any later version.
11
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.
16
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
20 # 02111-1307, USA.
21
22 # Written by Paul Eggert.
23
24
25 # Parse options.
26
27 DOWNLOAD_PO=yes
28 for option
29 do
30 case $option in
31 --help)
32 echo "$0: usage: $0 [--gnulib-srcdir=DIR][--cvs-auth=AUTH-METHOD][--cvs-user=USERNAME]"
33 exit;;
34 --gnulib-srcdir=*)
35 GNULIB_SRCDIR=`expr "$1" : '--gnulib-srcdir=\(.*\)'`;;
36 --cvs-auth=*)
37 CVS_AUTH=`expr "$1" : '--cvs-auth=\(.*\)'`;;
38 --cvs-user=*)
39 CVS_USER=`expr "$1" : '--cvs-user=\(.*\)'`;;
40 --no-po)
41 DOWNLOAD_PO=no;;
42 *)
43 echo >&2 "$0: $option: unknown option"
44 exit 1;;
45 esac
46 done
47
48 echo "$0: Bootstrapping CVS tar..."
49
50 build_cvs_prefix() {
51 CVS_PREFIX=:${1}:
52 if [ "${2}" != - ]; then
53 CVS_PREFIX=${CVS_PREFIX}${2}@
54 fi
55 }
56
57 # Get gnulib files.
58
59 case ${GNULIB_SRCDIR--} in
60 -)
61 if [ ! -d gnulib ]; then
62 echo "$0: getting gnulib files..."
63
64 trap exit 1 2 13 15
65 trap 'rm -fr gnulib; exit 1' 0
66
67 case "${CVS_AUTH--}" in
68 -) : ${CVS_RSH:?}
69 CVS_PREFIX="";;
70 pserver) build_cvs_prefix $CVS_AUTH ${CVS_USER:-anoncvs};;
71 gserver|server)
72 build_cvs_prefix $CVS_AUTH ${CVS_USER--};;
73 ext) : ${CVS_RSH:?}
74 build_cvs_prefix $CVS_AUTH ${CVS_USER--};;
75 *) echo "$0: Unknown CVS access method" >&2
76 exit 1;;
77 esac
78 if [ "${CVS_AUTH--}" = "pserver" ]; then
79 cvs -d ${CVS_PREFIX}subversions.gnu.org:/cvsroot/gnulib login || exit
80 fi
81 cvs -q -d ${CVS_PREFIX}subversions.gnu.org:/cvsroot/gnulib co gnulib || exit
82
83 trap 0
84 fi
85 GNULIB_SRCDIR=gnulib
86 esac
87
88 <$GNULIB_SRCDIR/gnulib-tool || exit
89
90 gnulib_modules='
91 alloca
92 argmatch
93 backupfile
94 dirname
95 error
96 exclude
97 fileblocks
98 fnmatch-gnu
99 ftruncate
100 full-write
101 getdate
102 getline
103 getopt
104 gettext
105 hash
106 human
107 lchown
108 memset
109 modechange
110 obstack
111 quote
112 quotearg
113 rmdir
114 safe-read
115 save-cwd
116 savedir
117 stdbool
118 strtol
119 strtoul
120 unlocked-io
121 utime
122 xalloc
123 xgetcwd
124 xstrtoumax
125 '
126
127 previous_gnulib_modules=
128 while [ "$gnulib_modules" != "$previous_gnulib_modules" ]; do
129 previous_gnulib_modules=$gnulib_modules
130 gnulib_modules=`
131 (echo "$gnulib_modules"
132 for gnulib_module in $gnulib_modules; do
133 $GNULIB_SRCDIR/gnulib-tool --extract-dependencies $gnulib_module
134 done) | sort -u
135 `
136 done
137
138 gnulib_files=`
139 (for gnulib_module in $gnulib_modules; do
140 $GNULIB_SRCDIR/gnulib-tool --extract-filelist $gnulib_module
141 done) | sort -u
142 `
143
144 gnulib_dirs=`echo "$gnulib_files" | sed 's,/[^/]*$,,' | sort -u`
145 mkdir -p $gnulib_dirs || exit
146
147 for gnulib_file in $gnulib_files; do
148 dest=$gnulib_file
149
150 case $gnulib_file in
151 m4/codeset.m4) continue;;
152 m4/glibc21.m4) continue;;
153 m4/intdiv0.m4) continue;;
154 m4/inttypes_h.m4) continue;;
155 m4/inttypes.m4) continue;;
156 m4/inttypes-pri.m4) continue;;
157 m4/isc-posix.m4) continue;;
158 m4/lcmessage.m4) continue;;
159 m4/onceonly_2_57.m4) dest=m4/onceonly.m4;;
160 esac
161
162 rm -f $dest &&
163 echo "$0: Copying file $GNULIB_SRCDIR/$gnulib_file" &&
164 cp -p $GNULIB_SRCDIR/$gnulib_file $dest || exit
165 done
166
167
168 # Get translations.
169
170 if test "$DOWNLOAD_PO" = "yes"; then
171 echo "$0: getting translations into po..."
172 (cd po &&
173 rm -f dummy `ls | sed -n '/\.gmo$/p; /\.po/p'` &&
174 wget -nv -nd -r -l 1 -A .po -C off \
175 http://www.iro.umontreal.ca/contrib/po/maint/tar/ &&
176 ls *.po | sed 's/\.po$//' >LINGUAS
177 ) || exit
178 fi
179
180 # Reconfigure, getting other files.
181
182 echo "$0: autoreconf --verbose --install --force ..."
183 autoreconf --verbose --install --force
184
185
186 echo "$0: done. Now you can run './configure'."
This page took 0.047092 seconds and 5 git commands to generate.