]>
Commit | Line | Data |
---|---|---|
88ffc135 PE |
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 | ||
7631b4e5 | 27 | DOWNLOAD_PO=yes |
54e32211 PE |
28 | for option |
29 | do | |
88ffc135 PE |
30 | case $option in |
31 | --help) | |
a0c65636 | 32 | echo "$0: usage: $0 [--gnulib-srcdir=DIR][--cvs-auth=AUTH-METHOD][--cvs-user=USERNAME]" |
88ffc135 PE |
33 | exit;; |
34 | --gnulib-srcdir=*) | |
0ad27d19 | 35 | GNULIB_SRCDIR=`expr "$option" : '--gnulib-srcdir=\(.*\)'`;; |
a0c65636 | 36 | --cvs-auth=*) |
0ad27d19 | 37 | CVS_AUTH=`expr "$option" : '--cvs-auth=\(.*\)'`;; |
a0c65636 | 38 | --cvs-user=*) |
0ad27d19 | 39 | CVS_USER=`expr "$option" : '--cvs-user=\(.*\)'`;; |
7631b4e5 SP |
40 | --no-po) |
41 | DOWNLOAD_PO=no;; | |
88ffc135 PE |
42 | *) |
43 | echo >&2 "$0: $option: unknown option" | |
44 | exit 1;; | |
45 | esac | |
46 | done | |
47 | ||
659f70a3 SP |
48 | echo "$0: Bootstrapping CVS tar..." |
49 | ||
a0c65636 SP |
50 | build_cvs_prefix() { |
51 | CVS_PREFIX=:${1}: | |
52 | if [ "${2}" != - ]; then | |
53 | CVS_PREFIX=${CVS_PREFIX}${2}@ | |
54 | fi | |
55 | } | |
56 | ||
88ffc135 PE |
57 | # Get gnulib files. |
58 | ||
88ffc135 PE |
59 | case ${GNULIB_SRCDIR--} in |
60 | -) | |
61 | if [ ! -d gnulib ]; then | |
659f70a3 SP |
62 | echo "$0: getting gnulib files..." |
63 | ||
88ffc135 PE |
64 | trap exit 1 2 13 15 |
65 | trap 'rm -fr gnulib; exit 1' 0 | |
a0c65636 | 66 | |
659f70a3 SP |
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 | |
a0c65636 SP |
78 | if [ "${CVS_AUTH--}" = "pserver" ]; then |
79 | cvs -d ${CVS_PREFIX}subversions.gnu.org:/cvsroot/gnulib login || exit | |
80 | fi | |
659f70a3 SP |
81 | cvs -q -d ${CVS_PREFIX}subversions.gnu.org:/cvsroot/gnulib co gnulib || exit |
82 | ||
88ffc135 PE |
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 | |
01f19e97 | 98 | fnmatch-gnu |
88ffc135 PE |
99 | ftruncate |
100 | full-write | |
101 | getdate | |
102 | getline | |
103 | getopt | |
104 | gettext | |
105 | hash | |
106 | human | |
107 | lchown | |
108 | memset | |
109 | modechange | |
c22a8b44 | 110 | obstack |
88ffc135 PE |
111 | quote |
112 | quotearg | |
113 | rmdir | |
01f19e97 | 114 | safe-read |
88ffc135 PE |
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 | |
7631b4e5 SP |
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;; | |
88ffc135 PE |
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 | ||
7631b4e5 SP |
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 | |
88ffc135 PE |
179 | |
180 | # Reconfigure, getting other files. | |
181 | ||
182 | echo "$0: autoreconf --verbose --install --force ..." | |
7631b4e5 | 183 | autoreconf --verbose --install --force |
88ffc135 PE |
184 | |
185 | ||
186 | echo "$0: done. Now you can run './configure'." |