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