OSDN Git Service

Merge from no_bogosity
[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     _ELSE =][=
132        _eval select       _count
133              bypass       _count +
134              test         _count + 
135              c_test       _count + =][=
136     _ENDIF =]
137 #define    [=hackname _up =]_RE_CT    [=
138     _IF exesel _exist =][=
139        _eval exesel _count bypass _count
140              "#2$ct=`expr %d + %d` ; re_ct=`expr $ct + $re_ct` ; echo $ct"
141              _printf _shell =][=
142     _ELSE =][=
143        _eval select _count bypass _count
144              "#2$ct=`expr %d + %d` ; re_ct=`expr $ct + $re_ct` ; echo $ct"
145              _printf _shell =][=
146     _ENDIF =]
147 tTestDesc a[=hackname _cap=]Tests[] = {[=
148
149     _FOR test =]
150   { TT_TEST,     z[=hackname _cap=]Test[=_eval _index=],   0 /* unused */ },[=
151     /test =][=
152
153     _FOR c_test =]
154   { TT_FUNCTION, z[=hackname _cap=]FTst[=_eval _index=],   0 /* unused */ },[=
155     /c_test =][=
156
157     _FOR bypass =]
158   { TT_NEGREP,   z[=hackname _cap=]Bypass[=_eval _index=], (regex_t*)NULL },[=
159     /bypass =][=
160
161     #  IF there is an exesel, then use that (those) selection
162           expressions, instead of the regular select expressions
163     =][=
164     _IF exesel _exist =][=
165       _FOR exesel =]
166   { TT_EGREP,    z[=hackname _cap=]Select[=_eval _index=], (regex_t*)NULL },[=
167       /exesel =][=
168
169     _ELSE =][=
170       _FOR select =]
171   { TT_EGREP,    z[=hackname _cap=]Select[=_eval _index=], (regex_t*)NULL },[=
172       /select =][=
173     _ENDIF =] };[=
174   _ELSE =]
175 #define [=hackname _up=]_TEST_CT  0
176 #define [=hackname _up=]_RE_CT    0
177 #define a[=hackname _cap=]Tests   (tTestDesc*)NULL[=
178   _ENDIF =]
179
180 /*
181  *  Fix Command Arguments for [=hackname _cap=]
182  */
183 const char* apz[=hackname _cap=]Patch[] = {[=
184     _IF   sed         _exist =] "sed"[=
185       _FOR sed=],
186     "-e", [=sed _krstr=][=
187       /sed=],[=
188
189     _ELIF shell       _exist =] "sh", "-c",
190     [=shell _krstr=],[=
191
192     _ELIF c_fix _exist =]"[=c_fix=]",[=
193
194     _ELIF replace _len =]
195 [=replace _krstr=],[=
196
197     _ENDIF=]
198     (char*)NULL };
199
200 /* * * * * * * * * * * * * * * * * * * * * * * * * *[=
201 /fix=]
202  *
203  *  List of all fixes
204  */
205 [=_EVAL '
206 echo "#define REGEX_COUNT          $re_ct"
207 echo "#define MACH_LIST_SIZE_LIMIT `expr $max_mach + 128`" ' _shell =][=
208
209 #  as of this writing, 49 bytes are needed by the case statement format.
210    We also must allow for the size of the target machine machine name.
211    This allows for a 79 byte machine name.  Better be enough.
212 =]
213 #define FIX_COUNT            [=_eval fix _count =]
214
215 tFixDesc fixDescList[ FIX_COUNT ] = {[=
216
217
218 _FOR fix ",\n" =]
219   {  z[=hackname _cap=]Name,    z[=hackname _cap=]List,
220      apz[=hackname _cap=]Machs, (regex_t*)NULL,
221      [=hackname  _up=]_TEST_CT, [=
222        _IF not_machine _exist =]FD_MACH_IFNOT[=
223        _ELSE                  =]FD_MACH_ONLY[=
224        _ENDIF =][=
225        _IF    shell    _exist =] | FD_SHELL_SCRIPT[=
226        _ELIF  c_fix    _exist =] | FD_SUBROUTINE[=
227        _ELIF  replace  _exist =] | FD_REPLACEMENT[=
228        _ENDIF =],
229      a[=hackname _cap=]Tests,   apz[=hackname _cap=]Patch }[=
230
231 /fix=]
232 };