1 # .Sanitize for devo/ld
3 # Each directory to survive its way into a release will need a file
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.
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
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
14 # done in this directory.
18 # Remember the current lists of files in the subdirectories from which
19 # we might remove files.
20 if test -d emulparams; then
21 ld_emulparams_files=`cd emulparams; echo *`
25 if test -d emultempl; then
26 ld_emultempl_files=`cd emultempl; echo *`
30 if test -d scripttempl; then
31 ld_scripttempl_files=`cd scripttempl; echo *`
36 # All files listed between the "Things-to-keep:" line and the
37 # "Do-last:" line will be kept. All other files will be removed.
38 # Directories listed in this section will have their own Sanitize
39 # called. Directories not listed will be removed in their entirety
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
117 v850_files="ChangeLog configure.tgt Makefile.am Makefile.in"
118 if ( 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
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...
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...
145 tx49_files="ChangeLog configure.tgt"
146 if ( 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
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...
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...
173 r5900_files="ChangeLog configure.tgt Makefile.in Makefile.am"
174 if ( 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
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...
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
192 echo Caching $i in .Recover...
201 vr4320_files="ChangeLog configure.tgt"
202 if ( 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
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...
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...
229 tic80_files="ChangeLog configure.tgt Makefile.am Makefile.in"
230 if ( 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
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...
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...
257 sky_files="ChangeLog configure.tgt"
258 if ( 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
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...
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...
285 beos_files="ChangeLog Makefile.am Makefile.in configure.tgt"
286 if ( 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
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...
301 sed '/start\-sanitize\-beos/,/end-\sanitize\-beos/d' < $i > new
302 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
303 if [ -n "${verbose}" ] ; then
304 echo Caching $i in .Recover...
313 armelf_files="ChangeLog configure.tgt Makefile.am Makefile.in"
314 if ( echo $* | grep keep\-armelf > /dev/null ) ; then
315 for i in $armelf_files ; do
316 if test ! -d $i && (grep sanitize-armelf $i > /dev/null) ; then
317 if [ -n "${verbose}" ] ; then
318 echo Keeping armelf stuff in $i
323 for i in $armelf_files ; do
324 if test ! -d $i && (grep sanitize-armelf $i > /dev/null) ; then
325 if [ -n "${verbose}" ] ; then
326 echo Removing traces of \"armelf\" from $i...
329 sed '/start\-sanitize\-armelf/,/end-\sanitize\-armelf/d' < $i > new
330 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
331 if [ -n "${verbose}" ] ; then
332 echo Caching $i in .Recover...
342 if test ! -d $i && (grep sanitize $i > /dev/null) ; then
343 echo '***' Some mentions of Sanitize are still left in ld/$i! 1>&2
347 for lost in .. $ld_emulparams_files; do
348 if test $lost != .. && test $lost != CVS; then
349 if test -f emulparams/$lost; then
352 lost2=`echo $lost | sed -e 's/.sh$//'`
353 for i in Makefile.am Makefile.in configure.host configure.tgt configure.in configure; do
354 if fgrep $lost2 $i >/dev/null 2>&1; then
355 echo '***' File ld/emulparams/$lost was sanitized out but is still mentioned in ld/$i 1>&2
362 for lost in .. $ld_emultempl_files; do
363 if test $lost != .. && test $lost != CVS; then
364 if test -f emultempl/$lost; then
367 lost2=`echo $lost | sed -e 's/.em$//'`
368 for i in Makefile.am Makefile.in configure.host configure.tgt configure.in configure; do
369 if fgrep $lost2 $i >/dev/null 2>&1; then
370 # There is a valid mention of beos in configure.tgt
371 if test $lost2 != "beos" || test $i != configure.tgt; then
372 echo '***' File ld/emultempl/$lost was sanitized out but is still mentioned in ld/$i 1>&2
376 if test -d emulparams; then
377 for i in emulparams/*; do
378 if fgrep $lost2 $i >/dev/null 2>&1; then
379 echo '***' File ld/emultempl/$lost was sanitized out but is still mentioned in ld/$i 1>&2
387 for lost in .. $ld_scripttempl_files; do
388 if test $lost != .. && test $lost != CVS; then
389 if test -f scripttempl/$lost; then
392 lost2=`echo $lost | sed -e 's/.sc$//'`
393 for i in Makefile.am Makefile.in configure.host configure.tgt configure.in configure; do
394 if fgrep $lost2 $i >/dev/null 2>&1; then
395 echo '***' File ld/scripttempl/$lost was sanitized out but is still mentioned in ld/$i 1>&2
398 if test -d emulparams; then
399 for i in emulparams/*; do
400 if fgrep $lost2 $i >/dev/null 2>&1; then
401 echo '***' File ld/scripttempl/$lost was sanitized out but is still mentioned in ld/$i 1>&2
409 # This must come after all other sanitizations. Re-sanitize the .pot
411 if [ -n "${verbose}" ]; then
412 echo Re-computing files for gettext ...
415 if [ -n "${safe}" -a ! -f po/.Recover/POTFILES.in ]; then
416 if [ -n "${verbose}" ]; then
417 echo Caching po/POTFILES.in in .Recover...
419 mv po/POTFILES.in po/.Recover
421 find . -name '*.[ch]' | sed -e 's,^\./,,' > po/POTFILES.in
423 if [ -n "${safe}" -a ! -f po/.Recover/ld.pot ]; then
424 if [ -n "${verbose}" ]; then
425 echo Caching po/ld.pot in .Recover...
427 mv po/ld.pot po/.Recover
429 # If this fails, Sanitization must fail.
430 xgettext -c -C -k_ -kN_ -f po/POTFILES.in -o po/ld.pot || exit 1