* Fixes for PR 18015, from customer.
[deliverable/binutils-gdb.git] / ld / .Sanitize
CommitLineData
e33bfde7 1# .Sanitize for devo/ld
86e4d6e4 2
747a47f2 3# Each directory to survive its way into a release will need a file
86e4d6e4
RP
4# like this one called "./.Sanitize". All keyword lines must exist,
5# and must exist in the order specified by this file. Each directory
6# in the tree will be processed, top down, in the following order.
7
8# Hash started lines like this one are comments and will be deleted
9# before anything else is done. Blank lines will also be squashed
10# out.
11
12# The lines between the "Do-first:" line and the "Things-to-keep:"
13# line are executed as a /bin/sh shell script before anything else is
747a47f2 14# done in this directory.
86e4d6e4
RP
15
16Do-first:
17
cbf40048
ILT
18# Remember the current lists of files in the subdirectories from which
19# we might remove files.
20if test -d emulparams; then
21 ld_emulparams_files=`cd emulparams; echo *`
22else
23 ld_emulparams_files=
24fi
25if test -d emultempl; then
26 ld_emultempl_files=`cd emultempl; echo *`
27else
28 ld_emultempl_files=
29fi
30if test -d scripttempl; then
31 ld_scripttempl_files=`cd scripttempl; echo *`
32else
33 ld_scripttempl_files=
34fi
e33bfde7 35
86e4d6e4 36# All files listed between the "Things-to-keep:" line and the
e33bfde7 37# "Do-last:" line will be kept. All other files will be removed.
86e4d6e4
RP
38# Directories listed in this section will have their own Sanitize
39# called. Directories not listed will be removed in their entirety
40# with rm -rf.
41
42Things-to-keep:
87756e15 43
5784123f 44ChangeLog
49c009b5 45Makefile.am
86e4d6e4 46Makefile.in
bc3b479c 47NEWS
c3d97ef6 48README
fbd74d07 49TODO
d66c832b 50acconfig.h
49c009b5 51acinclude.m4
e33bfde7 52aclocal.m4
ef346f1a 53config.in
d66c832b 54configure
65aa3724 55configure.bat
d66c832b 56configure.host
86e4d6e4 57configure.in
d66c832b 58configure.tgt
f8083739 59dep-in.sed
2b63dbfe
DM
60emulparams
61emultempl
e33bfde7 62gen-doc.texi
c3d97ef6 63genscripts.sh
2412a768 64h8-doc.texi
40ab8532 65ld.1
5f1fec76
SC
66ld.h
67ld.texinfo
07acd23b 68ldcref.c
ffa057ee 69ldctor.c
1cc27b5e 70ldctor.h
c3d97ef6
PB
71ldemul.c
72ldemul.h
5f1fec76
SC
73ldexp.c
74ldexp.h
75ldfile.c
5f1fec76 76ldfile.h
5f1fec76 77ldgram.y
4b91c519 78ldint.texinfo
5f1fec76
SC
79ldlang.c
80ldlang.h
81ldlex.h
82ldlex.l
5f1fec76
SC
83ldmain.c
84ldmain.h
85ldmisc.c
86ldmisc.h
5f1fec76
SC
87ldver.c
88ldver.h
5f1fec76
SC
89ldwrite.c
90ldwrite.h
0cc6a796 91lexsup.c
aacc02d7 92mac-ld.r
36ae618c 93mpw-config.in
c6cfcb7f 94mpw-elfmips.c
aaa877b7 95mpw-eppcmac.c
aad90580 96mpw-esh.c
e33bfde7 97mpw-idtmips.c
aacc02d7 98mpw-make.sed
b11a9b28 99mri.c
a586b5bc 100mri.h
e33bfde7 101po
2b63dbfe 102scripttempl
49c009b5 103stamp-h.in
d66c832b 104sysdep.h
e2f9f0f6 105testsuite
86e4d6e4 106
87756e15
RP
107Things-to-lose:
108
e33bfde7
ILT
109
110
111# The lines between the "Do-last:" line and the end of the file
112# are executed as a /bin/sh shell script after everything else is
113# done.
114
86e4d6e4
RP
115Do-last:
116
49c009b5 117v850_files="ChangeLog configure.tgt Makefile.am Makefile.in"
ab11a82c
NC
118if ( echo $* | grep keep\-v850e > /dev/null ) ; then
119 for i in $v850_files ; do
120 if test ! -d $i && (grep sanitize-v850e $i > /dev/null) ; then
121 if [ -n "${verbose}" ] ; then
122 echo Keeping v850e stuff in $i
123 fi
124 fi
125 done
126else
127 for i in $v850_files ; do
128 if test ! -d $i && (grep sanitize-v850e $i > /dev/null) ; then
129 if [ -n "${verbose}" ] ; then
130 echo Removing traces of \"v850e\" from $i...
131 fi
132 cp $i new
133 sed '/start\-sanitize\-v850e/,/end-\sanitize\-v850e/d' < $i > new
134 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
135 if [ -n "${verbose}" ] ; then
136 echo Caching $i in .Recover...
137 fi
138 mv $i .Recover
139 fi
140 mv new $i
141 fi
142 done
ab11a82c 143fi
276c2d7d 144
d020618a 145tx49_files="ChangeLog configure.tgt"
d020618a
GRK
146if ( echo $* | grep keep\-tx49 > /dev/null ) ; then
147 for i in $tx49_files ; do
148 if test ! -d $i && (grep sanitize-tx49 $i > /dev/null) ; then
149 if [ -n "${verbose}" ] ; then
150 echo Keeping tx49 stuff in $i
151 fi
152 fi
153 done
154else
155 for i in $tx49_files ; do
156 if test ! -d $i && (grep sanitize-tx49 $i > /dev/null) ; then
157 if [ -n "${verbose}" ] ; then
158 echo Removing traces of \"tx49\" from $i...
159 fi
160 cp $i new
161 sed '/start\-sanitize\-tx49/,/end-\sanitize\-tx49/d' < $i > new
162 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
163 if [ -n "${verbose}" ] ; then
164 echo Caching $i in .Recover...
165 fi
166 mv $i .Recover
167 fi
168 mv new $i
169 fi
170 done
171fi
172
38c82baf 173r5900_files="ChangeLog configure.tgt Makefile.in Makefile.am"
276c2d7d
GRK
174if ( echo $* | grep keep\-r5900 > /dev/null ) ; then
175 for i in $r5900_files ; do
176 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
177 if [ -n "${verbose}" ] ; then
178 echo Keeping r5900 stuff in $i
179 fi
180 fi
181 done
182else
183 for i in $r5900_files ; do
184 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
185 if [ -n "${verbose}" ] ; then
186 echo Removing traces of \"r5900\" from $i...
187 fi
188 cp $i new
189 sed '/start\-sanitize\-r5900/,/end-\sanitize\-r5900/d' < $i > new
190 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
191 if [ -n "${verbose}" ] ; then
04c17a75
JL
192 echo Caching $i in .Recover...
193 fi
194 mv $i .Recover
195 fi
196 mv new $i
197 fi
198 done
199fi
200
7cdb3e27 201vr4320_files="ChangeLog configure.tgt"
7cdb3e27
GRK
202if ( echo $* | grep keep\-vr4320 > /dev/null ) ; then
203 for i in $vr4320_files ; do
204 if test ! -d $i && (grep sanitize-vr4320 $i > /dev/null) ; then
205 if [ -n "${verbose}" ] ; then
206 echo Keeping vr4320 stuff in $i
207 fi
208 fi
209 done
210else
211 for i in $vr4320_files ; do
212 if test ! -d $i && (grep sanitize-vr4320 $i > /dev/null) ; then
213 if [ -n "${verbose}" ] ; then
214 echo Removing traces of \"vr4320\" from $i...
215 fi
216 cp $i new
217 sed '/start\-sanitize\-vr4320/,/end-\sanitize\-vr4320/d' < $i > new
218 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
219 if [ -n "${verbose}" ] ; then
220 echo Caching $i in .Recover...
221 fi
222 mv $i .Recover
223 fi
224 mv new $i
225 fi
226 done
227fi
228
49c009b5 229tic80_files="ChangeLog configure.tgt Makefile.am Makefile.in"
11effa69
FF
230if ( echo $* | grep keep\-tic80 > /dev/null ) ; then
231 for i in $tic80_files ; do
232 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
233 if [ -n "${verbose}" ] ; then
234 echo Keeping tic80 stuff in $i
235 fi
236 fi
237 done
238else
239 for i in $tic80_files ; do
240 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
241 if [ -n "${verbose}" ] ; then
242 echo Removing traces of \"tic80\" from $i...
243 fi
244 cp $i new
245 sed '/start\-sanitize\-tic80/,/end-\sanitize\-tic80/d' < $i > new
246 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
247 if [ -n "${verbose}" ] ; then
248 echo Caching $i in .Recover...
249 fi
250 mv $i .Recover
251 fi
252 mv new $i
253 fi
254 done
255fi
256
75aacf7a 257sky_files="ChangeLog configure.tgt"
f5870264
DE
258if ( echo $* | grep keep\-sky > /dev/null ) ; then
259 for i in $sky_files ; do
260 if test ! -d $i && (grep sanitize-sky $i > /dev/null) ; then
261 if [ -n "${verbose}" ] ; then
262 echo Keeping sky stuff in $i
263 fi
264 fi
265 done
266else
267 for i in $sky_files ; do
268 if test ! -d $i && (grep sanitize-sky $i > /dev/null) ; then
269 if [ -n "${verbose}" ] ; then
270 echo Removing traces of \"sky\" from $i...
271 fi
272 cp $i new
273 sed '/start\-sanitize\-sky/,/end-\sanitize\-sky/d' < $i > new
274 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
275 if [ -n "${verbose}" ] ; then
276 echo Caching $i in .Recover...
277 fi
278 mv $i .Recover
279 fi
280 mv new $i
281 fi
282 done
283fi
284
c86d82ee
RH
285beos_files="ChangeLog Makefile.am Makefile.in configure.tgt"
286if ( echo $* | grep keep\-beos > /dev/null ) ; then
287 for i in $beos_files ; do
288 if test ! -d $i && (grep sanitize-beos $i > /dev/null) ; then
289 if [ -n "${verbose}" ] ; then
290 echo Keeping beos stuff in $i
291 fi
292 fi
293 done
294else
295 for i in $beos_files ; do
296 if test ! -d $i && (grep sanitize-beos $i > /dev/null) ; then
297 if [ -n "${verbose}" ] ; then
298 echo Removing traces of \"beos\" from $i...
299 fi
300 cp $i new
301 sed '/start\-sanitize\-beos/,/end-\sanitize\-beos/d' < $i > new
4857ffb4
NC
302 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
303 if [ -n "${verbose}" ] ; then
304 echo Caching $i in .Recover...
305 fi
306 mv $i .Recover
307 fi
308 mv new $i
309 fi
310 done
311fi
312
43607f2c 313for i in * ; do
cbf40048
ILT
314 if test ! -d $i && (grep sanitize $i > /dev/null) ; then
315 echo '***' Some mentions of Sanitize are still left in ld/$i! 1>&2
316 fi
317done
318
319for lost in .. $ld_emulparams_files; do
bb7835f0 320 if test $lost != .. && test $lost != CVS; then
cbf40048
ILT
321 if test -f emulparams/$lost; then
322 :
323 else
324 lost2=`echo $lost | sed -e 's/.sh$//'`
325 for i in Makefile.am Makefile.in configure.host configure.tgt configure.in configure; do
bb7835f0 326 if fgrep $lost2 $i >/dev/null 2>&1; then
cbf40048
ILT
327 echo '***' File ld/emulparams/$lost was sanitized out but is still mentioned in ld/$i 1>&2
328 fi
329 done
330 fi
331 fi
332done
333
334for lost in .. $ld_emultempl_files; do
bb7835f0 335 if test $lost != .. && test $lost != CVS; then
cbf40048
ILT
336 if test -f emultempl/$lost; then
337 :
338 else
339 lost2=`echo $lost | sed -e 's/.em$//'`
340 for i in Makefile.am Makefile.in configure.host configure.tgt configure.in configure; do
bb7835f0
ILT
341 if fgrep $lost2 $i >/dev/null 2>&1; then
342 # There is a valid mention of beos in configure.tgt
343 if test $lost2 != "beos" || test $i != configure.tgt; then
344 echo '***' File ld/emultempl/$lost was sanitized out but is still mentioned in ld/$i 1>&2
345 fi
cbf40048
ILT
346 fi
347 done
348 if test -d emulparams; then
349 for i in emulparams/*; do
bb7835f0
ILT
350 if fgrep $lost2 $i >/dev/null 2>&1; then
351 echo '***' File ld/emultempl/$lost was sanitized out but is still mentioned in ld/$i 1>&2
cbf40048
ILT
352 fi
353 done
354 fi
355 fi
356 fi
357done
358
359for lost in .. $ld_scripttempl_files; do
bb7835f0 360 if test $lost != .. && test $lost != CVS; then
cbf40048
ILT
361 if test -f scripttempl/$lost; then
362 :
363 else
364 lost2=`echo $lost | sed -e 's/.sc$//'`
365 for i in Makefile.am Makefile.in configure.host configure.tgt configure.in configure; do
bb7835f0 366 if fgrep $lost2 $i >/dev/null 2>&1; then
cbf40048
ILT
367 echo '***' File ld/scripttempl/$lost was sanitized out but is still mentioned in ld/$i 1>&2
368 fi
369 done
370 if test -d emulparams; then
371 for i in emulparams/*; do
bb7835f0
ILT
372 if fgrep $lost2 $i >/dev/null 2>&1; then
373 echo '***' File ld/scripttempl/$lost was sanitized out but is still mentioned in ld/$i 1>&2
cbf40048
ILT
374 fi
375 done
376 fi
377 fi
378 fi
43607f2c
NC
379done
380
3d96e9b4
TT
381# This must come after all other sanitizations. Re-sanitize the .pot
382# file.
383if [ -n "${verbose}" ]; then
384 echo Re-computing files for gettext ...
385fi
386
387if [ -n "${safe}" -a ! -f po/.Recover/POTFILES.in ]; then
388 if [ -n "${verbose}" ]; then
389 echo Caching po/POTFILES.in in .Recover...
390 fi
391 mv po/POTFILES.in po/.Recover
392fi
393find . -name '*.[ch]' | sed -e 's,^\./,,' > po/POTFILES.in
394
395if [ -n "${safe}" -a ! -f po/.Recover/ld.pot ]; then
396 if [ -n "${verbose}" ]; then
397 echo Caching po/ld.pot in .Recover...
398 fi
399 mv po/ld.pot po/.Recover
400fi
d6f3da9b 401# If this fails, Sanitization must fail.
f0ba99a6 402xgettext -c -C -k_ -kN_ -f po/POTFILES.in -o po/ld.pot || exit 1
e33bfde7 403# eof
This page took 0.256875 seconds and 4 git commands to generate.