configure.in: Put {start,end}-sanitize-for-fsf around code that removes some
[platform/upstream/binutils.git] / .Sanitize
1 # .Sanitize for devo.
2
3 # Each directory to survive it's 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.
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
14 # done in this directory.
15
16 Do-first:
17
18 if ( echo $* | grep keep\-chill > /dev/null ) ; then
19         keep_these_too="chillrt test-chill"
20 fi
21
22 if ( echo $* | grep keep\-cygnus > /dev/null) ; then
23         keep_these_too="${keep_these_too} release release-info"
24 fi
25
26
27 # All files listed between the "Things-to-keep:" line and the
28 # "Do-last:" line will be kept.  All other files will be removed.
29 # Directories listed in this section will have their own Sanitize
30 # called.  Directories not listed will be removed in their entirety
31 # with rm -rf.
32
33 Things-to-keep:
34
35 .cvsignore
36 COPYING
37 COPYING.LIB
38 CYGNUS
39 ChangeLog
40 Makefile.in
41 README
42 autoconf
43 bfd
44 binutils
45 build-all.mk
46 byacc
47 config
48 config.guess
49 config.sub
50 configure
51 configure.bat
52 configure.in
53 cvs
54 deja-gnu
55 dejagnu
56 diff
57 dvips
58 emacs
59 etc
60 expect
61 fileutils
62 flex
63 gas
64 gcc
65 gdb
66 gdbm
67 gdbtest
68 glob
69 gprof
70 grep
71 groff
72 include
73 install.sh
74 ispell
75 ld
76 libg++
77 libgcc
78 libiberty
79 libio
80 m4
81 make
82 mmalloc
83 move-if-change
84 newlib
85 opcodes
86 patch
87 prms
88 rcs
89 readline
90 sed
91 send-pr
92 shellutils
93 sim
94 tcl
95 textutils
96 tk
97 test-build.mk
98 texinfo
99 tgas
100 uudecode
101 wdiff
102 xiberty
103
104 Things-to-lose:
105
106
107 # The lines between the "Do-last:" line and the end of the file
108 # are executed as a /bin/sh shell script after everything else is
109 # done.
110
111 Do-last:
112
113 if ( echo $* | egrep verbose > /dev/null ) ; then
114         verbose=true
115 else
116         verbose=
117 fi
118
119 if [ -n "${verbose}" ] ; then
120         echo Looking for signs of \"v9\"...
121 fi
122
123 # Don't try to clean directories here, as the 'mv' command will fail.
124 # Also, grep fails on NFS mounted directories.
125 if ( echo $* | grep keep\-v9 > /dev/null ) ; then
126         for i in * ; do
127                 if test ! -d $i && (grep sanitize-v9 $i > /dev/null) ; then
128                         if [ -n "${verbose}" ] ; then
129                                 echo Keeping v9 stuff in $i
130                         fi
131                 fi
132         done
133 else
134         for i in * ; do
135                 if test ! -d $i && (grep sanitize-v9 $i > /dev/null) ; then
136                         if [ -n "${verbose}" ] ; then
137                                 echo Cleaning the \"v9\" out of $i...
138                         fi
139                         cp $i new
140                         sed '/start\-sanitize\-v9/,/end-\sanitize\-v9/d' < $i > new
141                         if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
142                                 mv $i .Recover
143                         fi
144                         mv new $i
145                 fi
146         done
147 fi
148
149 if [ -n "${verbose}" ] ; then
150         echo Thawing away the \"chill\"...
151 fi
152
153 # Don't try to clean directories here, as the 'mv' command will fail.
154 # Also, grep fails on NFS mounted directories.
155 if ( echo $* | grep keep\-chill > /dev/null ) ; then
156         for i in * ; do
157                 if test ! -d $i && (grep sanitize-chill $i > /dev/null) ; then
158                         if [ -n "${verbose}" ] ; then
159                                 echo Keeping chill stuff in $i
160                         fi
161                 fi
162         done
163 else
164         for i in * ; do
165                 if test ! -d $i && (grep sanitize-chill $i > /dev/null) ; then
166                         if [ -n "${verbose}" ] ; then
167                                 echo Thawing the \"chill\" out of $i...
168                         fi
169                         cp $i new
170                         sed '/start\-sanitize\-chill/,/end-\sanitize\-chill/d' < $i > new
171                         if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
172                                 if [ -n "${verbose}" ] ; then
173                                         echo Caching $i in .Recover...
174                                 fi
175                                 mv $i .Recover
176                         fi
177                         mv new $i
178                 fi
179         done
180 fi
181
182 if ( echo $* | grep for\-fsf > /dev/null ) ; then
183         if [ -n "${verbose}" ]; then
184                 echo Cleaning up configure.in for FSF release...
185         fi
186         sed '/start\-sanitize\-for\-fsf/,/end\-sanitize\-for\-fsf/d' < configure.in > new
187         if [ -n "${safe}" -a ! -f .Recover/$i ]; then
188                 if [ -n "${verbose}" ]; then
189                         echo Caching configure.in in .Recover...
190                 fi
191                 mv configure.in .Recover
192         fi
193         mv new configure.in
194 else
195         if [ -n "${verbose}" ]; then
196                 echo Removing sanitize-for-fsf markers from configure.in...
197         fi
198         grep -v sanitize-for-fsf < configure.in > new
199         if [ -n "${safe}" ]; then
200                 if [ -n "${verbose}" ]; then
201                         echo Caching configure.in in .Recover...
202                 fi
203                 mv configure.in .Recover
204         fi
205         mv new configure.in
206 fi
207
208 for i in * ; do
209         if test ! -d $i && (grep sanitize $i > /dev/null) ; then
210                 echo '***' Some mentions of Sanitize are still left in $i! 1>&2
211         fi
212 done
213
214 # eof