OSDN Git Service

bbe76e0dba342e9da2d9c794f590bb1e2dd5308a
[pf3gnuchains/gcc-fork.git] / gcc / fixinc / fixincl.tpl
1 [= autogen template -*- Mode: C -*-
2 x =]
3 /*
4  *  DO NOT EDIT THIS FILE - it has been generated
5  *
6  * Install modified versions of certain ANSI-incompatible system header
7  * files which are fixed to work correctly with ANSI C and placed in a
8  * directory that GNU C will search.
9  *
10  * This file contains [=_eval fix _count =] fixup descriptions.
11  *
12  * See README-fixinc for more information.
13  *
14  *  inclhack copyright (c) [=_eval "date +%Y" _shell
15                                 =] The Free Software Foundation, Inc.
16  *
17 [=_eval inclhack "# *  " _gpl=]
18  *[=_EVAL "re_ct=0\nmax_mach=0" _shell=][=
19
20 _FOR fix =]
21  *
22  *  Description of [=hackname _Cap=] fix
23  */
24 #define [=hackname _up #_FIXIDX + #%-32s _printf=] [=_eval _index=]
25 tSCC z[=hackname _cap=]Name[] =
26      [=hackname _cap _krstr=];
27 /*
28  *  File name selection pattern
29  */[=
30
31   _IF files _exist=]
32 tSCC z[=hackname _cap=]List[] =
33   "[=_FOR files =]|[=files=][=/files=]|";[=
34
35   _ELSE =]
36 #define z[=hackname _cap=]List (char*)NULL[=
37   _ENDIF "files _exist" =]
38 /*
39  *  Machine/OS name selection pattern
40  */[=
41
42   _IF mach _exist=]
43 tSCC* apz[=hackname _cap=]Machs[] = {[=
44     _EVAL "this_mach=0" _shell =][=
45
46     _FOR mach =]
47         [=mach _krstr=],[=
48       _EVAL mach _len "this_mach=`expr $this_mach + %d + 5`"
49             _printf _shell =][=
50     /mach=]
51         (const char*)NULL };[=
52
53     _EVAL "if [ $this_mach -gt $max_mach ] ; then max_mach=$this_mach ; fi"
54           _shell =][=
55
56   _ELSE =]
57 #define apz[=hackname _cap=]Machs (const char**)NULL[=
58   _ENDIF "files _exist" =][=
59
60   _IF exesel _exist=]
61
62 /*
63  *  content selection pattern - do fix if pattern found
64  *  This is a special pattern that not all egrep commands
65  *  are capable of coping with.  We use the GNU library, tho :)
66  */[=
67     _FOR exesel =]
68 tSCC z[=hackname _cap=]Select[=_eval _index=][] =
69        [=exesel _krstr=];[=
70     /exesel =][=
71
72   _ELIF select _exist=]
73
74 /*
75  *  content selection pattern - do fix if pattern found
76  */[=
77     _FOR select =]
78 tSCC z[=hackname _cap=]Select[=_eval _index=][] =
79        [=select _krstr=];[=
80     /select =][=
81   _ENDIF =][=
82
83   _IF bypass _exist=]
84
85 /*
86  *  content bypass pattern - skip fix if pattern found
87  */[=
88     _FOR bypass =]
89 tSCC z[=hackname _cap=]Bypass[=_eval _index=][] =
90        [=bypass _krstr=];[=
91     /bypass =][=
92   _ENDIF =][=
93
94   _IF test _exist=]
95
96 /*
97  *  perform the 'test' shell command - do fix on success
98  */[=
99     _FOR test =]
100 tSCC z[=hackname _cap=]Test[=_eval _index=][] =
101        [=test _krstr=];[=
102     /test =][=
103   _ENDIF =][=
104
105   _IF c_test _exist=]
106
107 /*
108  *  perform the C function call test
109  */[=
110     _FOR c_test =]
111 tSCC z[=hackname _cap=]FTst[=_eval _index=][] = "[=c_test=]";[=
112     /c_test =][=
113   _ENDIF =][=
114
115
116 #  Build the array of test descriptions for this fix: =][=
117
118   _IF exesel  _exist
119       select  _exist |
120       bypass  _exist |
121       test    _exist |
122       c_test  _exist |
123 =]
124
125 #define    [=hackname _up =]_TEST_CT  [=
126     _IF exesel _exist =][=
127        _eval exesel       _count
128              bypass       _count +
129              test         _count + 
130              c_test       _count +
131         "ct=%d ; re_ct=`expr $ct + $re_ct` ; echo $ct"
132         _printf _shell =][=
133     _ELSE =][=
134        _eval select       _count
135              bypass       _count +
136              test         _count + 
137              c_test       _count +
138         "ct=%d ; re_ct=`expr $ct + $re_ct` ; echo $ct"
139         _printf _shell =][=
140     _ENDIF =]
141 tTestDesc a[=hackname _cap=]Tests[] = {[=
142
143     _FOR test =]
144   { TT_TEST,     z[=hackname _cap=]Test[=_eval _index=],   0 /* unused */ },[=
145     /test =][=
146
147     _FOR c_test =]
148   { TT_FUNCTION, z[=hackname _cap=]FTst[=_eval _index=],   0 /* unused */ },[=
149     /c_test =][=
150
151     _FOR bypass =]
152   { TT_NEGREP,   z[=hackname _cap=]Bypass[=_eval _index=], (regex_t*)NULL },[=
153     /bypass =][=
154
155     #  IF there is an exesel, then use that (those) selection
156           expressions, instead of the regular select expressions
157     =][=
158     _IF exesel _exist =][=
159       _FOR exesel =]
160   { TT_EGREP,    z[=hackname _cap=]Select[=_eval _index=], (regex_t*)NULL },[=
161       /exesel =][=
162
163     _ELSE =][=
164       _FOR select =]
165   { TT_EGREP,    z[=hackname _cap=]Select[=_eval _index=], (regex_t*)NULL },[=
166       /select =][=
167     _ENDIF =] };[=
168   _ELSE =]
169 #define [=hackname _up=]_TEST_CT  0
170 #define a[=hackname _cap=]Tests   (tTestDesc*)NULL[=
171   _ENDIF =]
172
173 /*
174  *  Fix Command Arguments for [=hackname _cap=]
175  */
176 const char* apz[=hackname _cap=]Patch[] = {[=
177     _IF   sed         _exist =] "sed"[=
178       _FOR sed=],
179     "-e", [=sed _krstr=][=
180       /sed=],[=
181
182     _ELIF shell       _exist =] "sh", "-c",
183     [=shell _krstr=],[=
184
185     _ELIF c_fix _exist =]"[=c_fix=]",[=
186
187     _ELIF replace _len =]
188 [=replace _krstr=],[=
189
190     _ENDIF=]
191     (char*)NULL };
192
193 /* * * * * * * * * * * * * * * * * * * * * * * * * *[=
194 /fix=]
195  *
196  *  List of all fixes
197  */
198 [=_EVAL '
199 echo "#define REGEX_COUNT          $re_ct"
200 echo "#define MACH_LIST_SIZE_LIMIT `expr $max_mach + 128`" ' _shell =][=
201
202 #  as of this writing, 49 bytes are needed by the case statement format.
203    We also must allow for the size of the target machine machine name.
204    This allows for a 79 byte machine name.  Better be enough.
205 =]
206 #define FIX_COUNT            [=_eval fix _count =]
207
208 tFixDesc fixDescList[ FIX_COUNT ] = {[=
209
210
211 _FOR fix ",\n" =]
212   {  z[=hackname _cap=]Name,    z[=hackname _cap=]List,
213      apz[=hackname _cap=]Machs, (regex_t*)NULL,
214      [=hackname  _up=]_TEST_CT, [=
215        _IF not_machine _exist =]FD_MACH_IFNOT[=
216        _ELSE                  =]FD_MACH_ONLY[=
217        _ENDIF =][=
218        _IF    shell    _exist =] | FD_SHELL_SCRIPT[=
219        _ELIF  c_fix    _exist =] | FD_SUBROUTINE[=
220        _ELIF  replace  _exist =] | FD_REPLACEMENT[=
221        _ENDIF =],
222      a[=hackname _cap=]Tests,   apz[=hackname _cap=]Patch }[=
223
224 /fix=]
225 };