]>
Commit | Line | Data |
---|---|---|
06bbab1b BK |
1 | #!/bin/sh |
2 | # | |
be02fa1a | 3 | # DO NOT EDIT THIS FILE - it has been generated |
06bbab1b BK |
4 | # |
5 | # Install modified versions of certain ANSI-incompatible system header | |
6 | # files which are fixed to work correctly with ANSI C and placed in a | |
7 | # directory that GNU C will search. | |
8 | # | |
78a0d70c | 9 | # This script contains 113 fixup scripts. |
06bbab1b BK |
10 | # |
11 | # See README-fixinc for more information. | |
12 | # | |
3be1fb72 ZW |
13 | # fixincludes copyright (c) 1998, 1999, 2000 |
14 | # The Free Software Foundation, Inc. | |
be02fa1a | 15 | # |
06bbab1b BK |
16 | # fixincludes is free software. |
17 | # | |
18 | # You may redistribute it and/or modify it under the terms of the | |
19 | # GNU General Public License, as published by the Free Software | |
20 | # Foundation; either version 2, or (at your option) any later version. | |
21 | # | |
22 | # fixincludes is distributed in the hope that it will be useful, | |
23 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
24 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | |
25 | # See the GNU General Public License for more details. | |
26 | # | |
27 | # You should have received a copy of the GNU General Public License | |
28 | # along with fixincludes. See the file "COPYING". If not, | |
29 | # write to: The Free Software Foundation, Inc., | |
30 | # 59 Temple Place - Suite 330, | |
31 | # Boston, MA 02111-1307, USA. | |
32 | # | |
33 | # # # # # # # # # # # # # # # # # # # # # | |
34 | # | |
35 | # Directory in which to store the results. | |
36 | # Fail if no arg to specify a directory for the output. | |
37 | if [ "x$1" = "x" ] | |
87ad679b BK |
38 | then |
39 | echo fixincludes: no output directory specified | |
40 | exit 1 | |
06bbab1b BK |
41 | fi |
42 | ||
43 | LIB=${1} | |
44 | shift | |
45 | ||
46 | # Make sure it exists. | |
47 | if [ ! -d $LIB ]; then | |
48 | mkdir $LIB || { | |
49 | echo fixincludes: output dir '`'$LIB"' cannot be created" | |
50 | exit 1 | |
51 | } | |
52 | else | |
1912ba9d | 53 | ( cd $LIB && touch DONE && rm DONE ) || { |
06bbab1b BK |
54 | echo fixincludes: output dir '`'$LIB"' is an invalid directory" |
55 | exit 1 | |
56 | } | |
57 | fi | |
58 | ||
f878ebdb BK |
59 | FIXTESTS=$PWD/fixinc/fixtests |
60 | FIXFIXES=$PWD/fixinc/fixfixes | |
61 | ||
87ad679b BK |
62 | if test -z "$VERBOSE" |
63 | then | |
64 | VERBOSE=2 | |
65 | export VERBOSE | |
66 | else | |
67 | case "$VERBOSE" in | |
68 | [0-9] ) : ;; | |
69 | * ) VERBOSE=3 ;; | |
70 | esac | |
71 | fi | |
72 | ||
06bbab1b BK |
73 | # Define what target system we're fixing. |
74 | # | |
75 | if test -r ./Makefile; then | |
76 | target_canonical="`sed -n -e 's,^target[ ]*=[ ]*\(.*\)$,\1,p' < Makefile`" | |
77 | fi | |
78 | ||
79 | # If not from the Makefile, then try config.guess | |
80 | # | |
81 | if test -z "${target_canonical}" ; then | |
82 | if test -x ./config.guess ; then | |
83 | target_canonical="`config.guess`" ; fi | |
84 | test -z "${target_canonical}" && target_canonical=unknown | |
85 | fi | |
86 | export target_canonical | |
87 | ||
88 | # # # # # # # # # # # # # # # # # # # # # | |
89 | # | |
90 | # Define PWDCMD as a command to use to get the working dir | |
91 | # in the form that we want. | |
92 | PWDCMD=pwd | |
93 | ||
94 | case "`$PWDCMD`" in | |
95 | //*) | |
96 | # On an Apollo, discard everything before `/usr'. | |
97 | PWDCMD="eval pwd | sed -e 's,.*/usr/,/usr/,'" | |
98 | ;; | |
99 | esac | |
100 | ||
101 | # Original directory. | |
102 | ORIGDIR=`${PWDCMD}` | |
103 | ||
104 | # Make LIB absolute only if needed to avoid problems with the amd. | |
105 | case $LIB in | |
106 | /*) | |
107 | ;; | |
108 | *) | |
109 | cd $LIB; LIB=`${PWDCMD}` | |
110 | ;; | |
111 | esac | |
112 | ||
87ad679b BK |
113 | if test $VERBOSE -gt 0 |
114 | then echo Fixing headers into ${LIB} for ${target_canonical} target ; fi | |
48bd9529 | 115 | |
06bbab1b BK |
116 | # Determine whether this system has symbolic links. |
117 | if ln -s X $LIB/ShouldNotExist 2>/dev/null; then | |
118 | rm -f $LIB/ShouldNotExist | |
119 | LINKS=true | |
120 | elif ln -s X /tmp/ShouldNotExist 2>/dev/null; then | |
121 | rm -f /tmp/ShouldNotExist | |
122 | LINKS=true | |
123 | else | |
124 | LINKS=false | |
125 | fi | |
48bd9529 | 126 | |
06bbab1b BK |
127 | # # # # # # # # # # # # # # # # # # # # # |
128 | # | |
129 | # Search each input directory for broken header files. | |
130 | # This loop ends near the end of the file. | |
131 | # | |
132 | if test $# -eq 0 | |
133 | then | |
134 | INPUTLIST="/usr/include" | |
135 | else | |
136 | INPUTLIST="$@" | |
137 | fi | |
138 | ||
139 | for INPUT in ${INPUTLIST} ; do | |
140 | ||
141 | cd ${ORIGDIR} | |
142 | ||
5787d8da JW |
143 | # Make sure a directory exists before changing into it, |
144 | # otherwise Solaris2 will fail-exit the script. | |
145 | # | |
146 | if [ ! -d ${INPUT} ]; then | |
147 | continue | |
148 | fi | |
149 | cd ${INPUT} | |
150 | ||
48bd9529 | 151 | INPUT=`${PWDCMD}` |
06bbab1b BK |
152 | |
153 | # | |
154 | # # # # # # # # # # # # # # # # # # # # # | |
155 | # | |
87ad679b BK |
156 | if test $VERBOSE -gt 1 |
157 | then echo Finding directories and links to directories ; fi | |
06bbab1b BK |
158 | |
159 | # Find all directories and all symlinks that point to directories. | |
48bd9529 | 160 | # Put the list in $all_dirs. |
06bbab1b BK |
161 | # Each time we find a symlink, add it to newdirs |
162 | # so that we do another find within the dir the link points to. | |
48bd9529 | 163 | # Note that $all_dirs may have duplicates in it; |
06bbab1b BK |
164 | # later parts of this file are supposed to ignore them. |
165 | dirs="." | |
166 | levels=2 | |
48bd9529 BK |
167 | all_dirs="" |
168 | search_dirs="" | |
169 | ||
06bbab1b BK |
170 | while [ -n "$dirs" ] && [ $levels -gt 0 ] |
171 | do | |
48bd9529 BK |
172 | levels=`expr $levels - 1` |
173 | newdirs= | |
174 | for d in $dirs | |
175 | do | |
87ad679b BK |
176 | if test $VERBOSE -gt 1 |
177 | then echo " Searching $INPUT/$d" ; fi | |
48bd9529 | 178 | |
06bbab1b BK |
179 | # Find all directories under $d, relative to $d, excluding $d itself. |
180 | # (The /. is needed after $d in case $d is a symlink.) | |
48bd9529 | 181 | all_dirs="$all_dirs `find $d/. -type d -print | \ |
06bbab1b BK |
182 | sed -e '/\/\.$/d' -e 's@/./@/@g'`" |
183 | # Find all links to directories. | |
184 | # Using `-exec test -d' in find fails on some systems, | |
185 | # and trying to run test via sh fails on others, | |
186 | # so this is the simplest alternative left. | |
187 | # First find all the links, then test each one. | |
188 | theselinks= | |
189 | $LINKS && \ | |
190 | theselinks=`find $d/. -type l -print | sed -e 's@/./@/@g'` | |
191 | for d1 in $theselinks --dummy-- | |
192 | do | |
48bd9529 BK |
193 | # If the link points to a directory, |
194 | # add that dir to $newdirs | |
195 | if [ -d $d1 ] | |
196 | then | |
197 | all_dirs="$all_dirs $d1" | |
06bbab1b BK |
198 | if [ "`ls -ld $d1 | sed -n 's/.*-> //p'`" != "." ] |
199 | then | |
48bd9529 BK |
200 | newdirs="$newdirs $d1" |
201 | search_dirs="$search_dirs $d1" | |
06bbab1b | 202 | fi |
48bd9529 | 203 | fi |
06bbab1b | 204 | done |
48bd9529 BK |
205 | done |
206 | ||
207 | dirs="$newdirs" | |
06bbab1b | 208 | done |
48bd9529 | 209 | |
06bbab1b BK |
210 | # # # # # # # # # # # # # # # # # # # # # |
211 | # | |
212 | dirs= | |
87ad679b BK |
213 | if test $VERBOSE -gt 2 |
214 | then echo "All directories (including links to directories):" | |
215 | echo $all_dirs | |
216 | fi | |
48bd9529 BK |
217 | |
218 | for file in $all_dirs; do | |
06bbab1b BK |
219 | rm -rf $LIB/$file |
220 | if [ ! -d $LIB/$file ] | |
221 | then mkdir $LIB/$file | |
222 | fi | |
223 | done | |
224 | mkdir $LIB/root | |
48bd9529 | 225 | |
06bbab1b BK |
226 | # # # # # # # # # # # # # # # # # # # # # |
227 | # | |
228 | # treetops gets an alternating list | |
229 | # of old directories to copy | |
230 | # and the new directories to copy to. | |
48bd9529 BK |
231 | treetops=". ${LIB}" |
232 | ||
06bbab1b | 233 | if $LINKS; then |
87ad679b BK |
234 | if test $VERBOSE -gt 1 |
235 | then echo 'Making symbolic directory links' ; fi | |
48bd9529 BK |
236 | cwd=`${PWDCMD}` |
237 | ||
238 | for sym_link in $search_dirs; do | |
239 | cd ${INPUT} | |
240 | dest=`ls -ld ${sym_link} | sed -n 's/.*-> //p'` | |
241 | ||
242 | # In case $dest is relative, get to ${sym_link}'s dir first. | |
243 | # | |
244 | cd ./`echo ${sym_link} | sed 's;/[^/]*$;;'` | |
245 | ||
246 | # Check that the target directory exists. | |
247 | # Redirections changed to avoid bug in sh on Ultrix. | |
248 | # | |
249 | (cd $dest) > /dev/null 2>&1 | |
250 | if [ $? = 0 ]; then | |
251 | cd $dest | |
252 | ||
253 | # full_dest_dir gets the dir that the link actually leads to. | |
254 | # | |
255 | full_dest_dir=`${PWDCMD}` | |
256 | ||
257 | # Canonicalize ${INPUT} now to minimize the time an | |
258 | # automounter has to change the result of ${PWDCMD}. | |
259 | # | |
260 | cinput=`cd ${INPUT}; ${PWDCMD}` | |
261 | ||
262 | # If a link points to ., make a similar link to . | |
263 | # | |
264 | if [ ${full_dest_dir} = ${cinput} ]; then | |
87ad679b BK |
265 | if test $VERBOSE -gt 2 |
266 | then echo ${sym_link} '->' . ': Making self link' ; fi | |
48bd9529 BK |
267 | rm -fr ${LIB}/${sym_link} > /dev/null 2>&1 |
268 | ln -s . ${LIB}/${sym_link} > /dev/null 2>&1 | |
269 | ||
270 | # If link leads back into ${INPUT}, | |
271 | # make a similar link here. | |
272 | # | |
273 | elif expr ${full_dest_dir} : "${cinput}/.*" > /dev/null; then | |
274 | # Y gets the actual target dir name, relative to ${INPUT}. | |
275 | y=`echo ${full_dest_dir} | sed -n "s&${cinput}/&&p"` | |
276 | # DOTS is the relative path from ${LIB}/${sym_link} back to ${LIB}. | |
277 | dots=`echo "${sym_link}" | | |
278 | sed -e 's@^./@@' -e 's@/./@/@g' -e 's@[^/][^/]*@..@g' -e 's@..$@@'` | |
87ad679b BK |
279 | if test $VERBOSE -gt 2 |
280 | then echo ${sym_link} '->' $dots$y ': Making local link' ; fi | |
48bd9529 BK |
281 | rm -fr ${LIB}/${sym_link} > /dev/null 2>&1 |
282 | ln -s $dots$y ${LIB}/${sym_link} > /dev/null 2>&1 | |
283 | ||
06bbab1b | 284 | else |
48bd9529 BK |
285 | # If the link is to a dir $target outside ${INPUT}, |
286 | # repoint the link at ${INPUT}/root$target | |
287 | # and process $target into ${INPUT}/root$target | |
288 | # treat this directory as if it actually contained the files. | |
289 | # | |
87ad679b BK |
290 | if test $VERBOSE -gt 2 |
291 | then echo ${sym_link} '->' root${full_dest_dir} ': Making rooted link' | |
292 | fi | |
48bd9529 | 293 | if [ -d $LIB/root${full_dest_dir} ] |
06bbab1b BK |
294 | then true |
295 | else | |
48bd9529 BK |
296 | dirname=root${full_dest_dir}/ |
297 | dirmade=. | |
298 | cd $LIB | |
299 | while [ x$dirname != x ]; do | |
300 | component=`echo $dirname | sed -e 's|/.*$||'` | |
301 | mkdir $component >/dev/null 2>&1 | |
302 | cd $component | |
303 | dirmade=$dirmade/$component | |
304 | dirname=`echo $dirname | sed -e 's|[^/]*/||'` | |
06bbab1b | 305 | done |
48bd9529 BK |
306 | fi |
307 | ||
308 | # Duplicate directory structure created in ${LIB}/${sym_link} in new | |
309 | # root area. | |
310 | # | |
311 | for file2 in $all_dirs; do | |
312 | case $file2 in | |
313 | ${sym_link}/*) | |
314 | dupdir=${LIB}/root${full_dest_dir}/`echo $file2 | | |
315 | sed -n "s|^${sym_link}/||p"` | |
87ad679b BK |
316 | if test $VERBOSE -gt 2 |
317 | then echo "Duplicating ${sym_link}'s ${dupdir}" ; fi | |
48bd9529 BK |
318 | if [ -d ${dupdir} ] |
319 | then true | |
320 | else | |
321 | mkdir ${dupdir} | |
322 | fi | |
323 | ;; | |
324 | *) | |
325 | ;; | |
326 | esac | |
327 | done | |
328 | ||
329 | # Get the path from ${LIB} to ${sym_link}, accounting for symlinks. | |
330 | # | |
331 | parent=`echo "${sym_link}" | sed -e 's@/[^/]*$@@'` | |
332 | libabs=`cd ${LIB}; ${PWDCMD}` | |
333 | file2=`cd ${LIB}; cd $parent; ${PWDCMD} | sed -e "s@^${libabs}@@"` | |
334 | ||
335 | # DOTS is the relative path from ${LIB}/${sym_link} back to ${LIB}. | |
336 | # | |
337 | dots=`echo "$file2" | sed -e 's@/[^/]*@../@g'` | |
338 | rm -fr ${LIB}/${sym_link} > /dev/null 2>&1 | |
339 | ln -s ${dots}root${full_dest_dir} ${LIB}/${sym_link} > /dev/null 2>&1 | |
340 | treetops="$treetops ${sym_link} ${LIB}/root${full_dest_dir}" | |
06bbab1b | 341 | fi |
06bbab1b BK |
342 | fi |
343 | done | |
344 | fi | |
48bd9529 | 345 | |
06bbab1b BK |
346 | # # # # # # # # # # # # # # # # # # # # # |
347 | # | |
348 | required= | |
349 | set x $treetops | |
350 | shift | |
351 | while [ $# != 0 ]; do | |
352 | # $1 is an old directory to copy, and $2 is the new directory to copy to. | |
353 | # | |
354 | SRCDIR=`cd ${INPUT} ; cd $1 ; ${PWDCMD}` | |
355 | export SRCDIR | |
48bd9529 BK |
356 | |
357 | FIND_BASE=$1 | |
358 | export FIND_BASE | |
06bbab1b BK |
359 | shift |
360 | ||
361 | DESTDIR=`cd $1;${PWDCMD}` | |
362 | export DESTDIR | |
363 | shift | |
364 | ||
365 | # The same dir can appear more than once in treetops. | |
366 | # There's no need to scan it more than once. | |
367 | # | |
368 | if [ -f ${DESTDIR}/DONE ] | |
369 | then continue ; fi | |
370 | ||
371 | touch ${DESTDIR}/DONE | |
87ad679b BK |
372 | if test $VERBOSE -gt 1 |
373 | then echo Fixing directory ${SRCDIR} into ${DESTDIR} ; fi | |
06bbab1b | 374 | |
48bd9529 | 375 | # Check files which are symlinks as well as those which are files. |
06bbab1b | 376 | # |
48bd9529 BK |
377 | cd ${INPUT} |
378 | files=`if $LINKS; then | |
be02fa1a | 379 | find ${FIND_BASE}/. -name '*.h' \( -type f -o -type l \) -print |
06bbab1b | 380 | else |
be02fa1a | 381 | find ${FIND_BASE}/. -name '*.h' -type f -print |
48bd9529 | 382 | fi | \ |
706e665a | 383 | sed -e 's;/\./;/;g' -e 's;//*;/;g' ` |
48bd9529 | 384 | |
06bbab1b BK |
385 | echo Checking header files |
386 | for file in $files; do | |
387 | ||
20cc423f | 388 | # Skip unreadable files, symlinks to directories and glibc files |
c5984b7b | 389 | if test ! -r "${file}" || test -d "${file}/." ; then |
20cc423f JL |
390 | continue |
391 | fi | |
06bbab1b BK |
392 | |
393 | fixlist="" | |
48bd9529 | 394 | DESTFILE=${DESTDIR}/`echo ${file} | sed "s;${FIND_BASE}/;;" ` |
06bbab1b BK |
395 | |
396 | # | |
87ad679b | 397 | # Fix Aaa_Ki_Iface |
5abc1f74 BK |
398 | # |
399 | case "${file}" in ./sys/ki_iface.h ) | |
400 | if ( test -n "`egrep 'These definitions are for HP Internal developers' ${file}`" | |
401 | ) > /dev/null 2>&1 ; then | |
87ad679b | 402 | echo "AAA_ki_iface bypassing file ${file}" |
5abc1f74 BK |
403 | continue |
404 | ||
405 | fi # end of select 'if' | |
406 | ;; # case end for file name test | |
407 | esac | |
408 | ||
409 | ||
410 | # | |
87ad679b | 411 | # Fix Aaa_Ki |
5abc1f74 BK |
412 | # |
413 | case "${file}" in ./sys/ki.h ) | |
414 | if ( test -n "`egrep '11.00 HP-UX LP64' ${file}`" | |
415 | ) > /dev/null 2>&1 ; then | |
87ad679b | 416 | echo "AAA_ki bypassing file ${file}" |
5abc1f74 BK |
417 | continue |
418 | ||
419 | fi # end of select 'if' | |
420 | ;; # case end for file name test | |
421 | esac | |
422 | ||
423 | ||
424 | # | |
87ad679b | 425 | # Fix Aaa_Ki_Calls |
5abc1f74 BK |
426 | # |
427 | case "${file}" in ./sys/ki_calls.h ) | |
428 | if ( test -n "`egrep 'kthread_create_caller_t' ${file}`" | |
429 | ) > /dev/null 2>&1 ; then | |
87ad679b | 430 | echo "AAA_ki_calls bypassing file ${file}" |
5abc1f74 BK |
431 | continue |
432 | ||
433 | fi # end of select 'if' | |
434 | ;; # case end for file name test | |
435 | esac | |
436 | ||
437 | ||
438 | # | |
87ad679b | 439 | # Fix Aaa_Ki_Defs |
5abc1f74 BK |
440 | # |
441 | case "${file}" in ./sys/ki_defs.h ) | |
442 | if ( test -n "`egrep 'Kernel Instrumentation Definitions' ${file}`" | |
443 | ) > /dev/null 2>&1 ; then | |
87ad679b | 444 | echo "AAA_ki_defs bypassing file ${file}" |
5abc1f74 BK |
445 | continue |
446 | ||
447 | fi # end of select 'if' | |
448 | ;; # case end for file name test | |
449 | esac | |
450 | ||
451 | ||
452 | # | |
87ad679b | 453 | # Fix Aaa_Bad_Fixes |
5abc1f74 BK |
454 | # |
455 | case "${file}" in ./sundev/ipi_error.h ) | |
87ad679b | 456 | echo "AAA_bad_fixes bypassing file ${file}" |
5abc1f74 BK |
457 | continue |
458 | ||
459 | ;; # case end for file name test | |
460 | esac | |
461 | ||
462 | ||
463 | # | |
87ad679b | 464 | # Fix Aaa_Time |
5abc1f74 BK |
465 | # |
466 | case "${file}" in ./sys/time.h ) | |
467 | if ( test -n "`egrep '11.0 and later representation of ki time' ${file}`" | |
468 | ) > /dev/null 2>&1 ; then | |
87ad679b | 469 | echo "AAA_time bypassing file ${file}" |
5abc1f74 BK |
470 | continue |
471 | ||
472 | fi # end of select 'if' | |
473 | ;; # case end for file name test | |
474 | esac | |
475 | ||
476 | ||
477 | # | |
87ad679b | 478 | # Fix Aab_Dgux_Int_Varargs |
5abc1f74 BK |
479 | # |
480 | case "${file}" in ./_int_varargs.h ) | |
87ad679b | 481 | echo "AAB_dgux_int_varargs replacing file ${file}" >&2 |
5abc1f74 BK |
482 | cat > ${DESTFILE} << '_EOF_' |
483 | #ifndef __INT_VARARGS_H | |
484 | #define __INT_VARARGS_H | |
485 | ||
486 | /************************************************************************/ | |
487 | /* _INT_VARARGS.H - Define the common stuff for varargs/stdarg/stdio. */ | |
488 | /************************************************************************/ | |
489 | ||
490 | /* | |
491 | ** This file is a DG internal header. Never include this | |
492 | ** file directly. | |
493 | */ | |
494 | ||
495 | #ifndef ___int_features_h | |
496 | #include <sys/_int_features.h> | |
497 | #endif | |
498 | ||
499 | #if !(defined(_VA_LIST) || defined(_VA_LIST_)) | |
500 | #define _VA_LIST | |
501 | #define _VA_LIST_ | |
502 | ||
503 | #ifdef __LINT__ | |
504 | ||
505 | #ifdef __STDC__ | |
506 | typedef void * va_list; | |
507 | #else | |
508 | typedef char * va_list; | |
509 | #endif | |
510 | ||
511 | #else | |
512 | #if _M88K_ANY | |
513 | ||
514 | #if defined(__DCC__) | |
515 | ||
516 | typedef struct { | |
517 | int next_arg; | |
518 | int *mem_ptr; | |
519 | int *reg_ptr; | |
520 | } va_list; | |
521 | ||
522 | #else /* ! defined(__DCC__) */ | |
523 | ||
524 | typedef struct { | |
525 | int __va_arg; /* argument number */ | |
526 | int *__va_stk; /* start of args passed on stack */ | |
527 | int *__va_reg; /* start of args passed in regs */ | |
528 | } va_list; | |
529 | ||
530 | #endif /* ! defined(__DCC__) */ | |
531 | ||
532 | #elif _IX86_ANY | |
533 | ||
534 | #if defined(__GNUC__) || defined(__STDC__) | |
535 | typedef void * va_list; | |
536 | #else | |
537 | typedef char * va_list; | |
538 | #endif | |
539 | ||
540 | #endif /* _IX86_ANY */ | |
541 | ||
542 | #endif /* __LINT__ */ | |
543 | #endif /* !(defined(_VA_LIST) || defined(_VA_LIST_)) */ | |
544 | #endif /* #ifndef __INT_VARARGS_H */ | |
545 | ||
546 | _EOF_ | |
547 | continue | |
548 | ||
549 | ;; # case end for file name test | |
550 | esac | |
551 | ||
552 | ||
553 | # | |
87ad679b | 554 | # Fix Aab_Fd_Zero_Asm_Posix_Types_H |
8aeb3b0e BK |
555 | # |
556 | case "${file}" in ./asm/posix_types.h ) | |
c5984b7b | 557 | case "$target_canonical" in i[34567]86-*-linux-gnu* ) |
d7eb5a45 ZW |
558 | if ( test -z "`egrep '} while' ${file}`" |
559 | ) > /dev/null 2>&1 ; then | |
87ad679b | 560 | echo "AAB_fd_zero_asm_posix_types_h replacing file ${file}" >&2 |
8aeb3b0e | 561 | cat > ${DESTFILE} << '_EOF_' |
d7eb5a45 ZW |
562 | /* This file fixes a bug in the __FD_ZERO macro |
563 | for older versions of the Linux kernel. */ | |
8aeb3b0e BK |
564 | #ifndef _POSIX_TYPES_H_WRAPPER |
565 | #include <features.h> | |
566 | #include_next <asm/posix_types.h> | |
567 | ||
568 | #if defined(__FD_ZERO) && !defined(__GLIBC__) | |
569 | #undef __FD_ZERO | |
d7eb5a45 ZW |
570 | #define __FD_ZERO(fdsetp) \ |
571 | do { \ | |
572 | int __d0, __d1; \ | |
573 | __asm__ __volatile__("cld ; rep ; stosl" \ | |
574 | : "=&c" (__d0), "=&D" (__d1) \ | |
575 | : "a" (0), "0" (__FDSET_LONGS), \ | |
576 | "1" ((__kernel_fd_set *) (fdsetp)) :"memory"); \ | |
577 | } while (0) | |
8aeb3b0e BK |
578 | #endif |
579 | ||
580 | #define _POSIX_TYPES_H_WRAPPER | |
581 | #endif /* _POSIX_TYPES_H_WRAPPER */ | |
582 | ||
583 | _EOF_ | |
584 | continue | |
585 | ||
d7eb5a45 | 586 | fi # end of bypass 'if' |
c5984b7b BK |
587 | ;; # case end for machine type test |
588 | esac | |
8aeb3b0e BK |
589 | ;; # case end for file name test |
590 | esac | |
591 | ||
592 | ||
593 | # | |
87ad679b | 594 | # Fix Aab_Fd_Zero_Gnu_Types_H |
8aeb3b0e BK |
595 | # |
596 | case "${file}" in ./gnu/types.h ) | |
c5984b7b | 597 | case "$target_canonical" in i[34567]86-*-linux-gnu* ) |
87ad679b | 598 | echo "AAB_fd_zero_gnu_types_h replacing file ${file}" >&2 |
8aeb3b0e | 599 | cat > ${DESTFILE} << '_EOF_' |
d7eb5a45 | 600 | /* This file fixes a bug in the __FD_ZERO macro present in glibc 1.x. */ |
8aeb3b0e BK |
601 | #ifndef _TYPES_H_WRAPPER |
602 | #include <features.h> | |
603 | #include_next <gnu/types.h> | |
604 | ||
605 | #if defined(__FD_ZERO) && !defined(__GLIBC__) | |
606 | #undef __FD_ZERO | |
d7eb5a45 ZW |
607 | # define __FD_ZERO(fdsetp) \ |
608 | do { \ | |
609 | int __d0, __d1; \ | |
610 | __asm__ __volatile__("cld ; rep ; stosl" \ | |
611 | : "=&c" (__d0), "=&D" (__d1) \ | |
612 | : "a" (0), "0" (__FDSET_LONGS), \ | |
613 | "1" ((__fd_set *) (fdsetp)) :"memory"); \ | |
614 | } while (0) | |
8aeb3b0e BK |
615 | #endif |
616 | ||
617 | #define _TYPES_H_WRAPPER | |
618 | #endif /* _TYPES_H_WRAPPER */ | |
619 | ||
620 | _EOF_ | |
621 | continue | |
622 | ||
c5984b7b BK |
623 | ;; # case end for machine type test |
624 | esac | |
8aeb3b0e BK |
625 | ;; # case end for file name test |
626 | esac | |
627 | ||
628 | ||
629 | # | |
87ad679b | 630 | # Fix Aab_Fd_Zero_Selectbits_H |
8aeb3b0e BK |
631 | # |
632 | case "${file}" in ./selectbits.h ) | |
c5984b7b | 633 | case "$target_canonical" in i[34567]86-*-linux-gnu* ) |
87ad679b | 634 | echo "AAB_fd_zero_selectbits_h replacing file ${file}" >&2 |
8aeb3b0e | 635 | cat > ${DESTFILE} << '_EOF_' |
d7eb5a45 | 636 | /* This file fixes a bug in the __FD_ZERO macro present in glibc 2.0.x. */ |
8aeb3b0e BK |
637 | #ifndef _SELECTBITS_H_WRAPPER |
638 | #include <features.h> | |
639 | #include_next <selectbits.h> | |
640 | ||
d7eb5a45 ZW |
641 | #if defined(__FD_ZERO) && defined(__GLIBC__) \ |
642 | && defined(__GLIBC_MINOR__) && __GLIBC__ == 2 \ | |
643 | && __GLIBC_MINOR__ == 0 | |
8aeb3b0e | 644 | #undef __FD_ZERO |
d7eb5a45 ZW |
645 | #define __FD_ZERO(fdsetp) \ |
646 | do { \ | |
647 | int __d0, __d1; \ | |
648 | __asm__ __volatile__ ("cld; rep; stosl" \ | |
649 | : "=&c" (__d0), "=&D" (__d1) \ | |
650 | : "a" (0), "0" (sizeof (__fd_set) \ | |
651 | / sizeof (__fd_mask)), \ | |
652 | "1" ((__fd_mask *) (fdsetp)) \ | |
653 | : "memory"); \ | |
654 | } while (0) | |
8aeb3b0e BK |
655 | #endif |
656 | ||
657 | #define _SELECTBITS_H_WRAPPER | |
658 | #endif /* _SELECTBITS_H_WRAPPER */ | |
659 | ||
660 | _EOF_ | |
661 | continue | |
662 | ||
c5984b7b BK |
663 | ;; # case end for machine type test |
664 | esac | |
8aeb3b0e BK |
665 | ;; # case end for file name test |
666 | esac | |
667 | ||
668 | ||
b51207a4 ZW |
669 | # |
670 | # Fix Aab_Sun_Memcpy | |
671 | # | |
672 | case "${file}" in ./memory.h ) | |
673 | if ( test -n "`egrep '/\\* @\\(#\\)(head/memory.h 50.1 |memory\\.h 1\\.[2-4] 8./../.. SMI; from S5R2 1\\.2 )\\*/' ${file}`" | |
674 | ) > /dev/null 2>&1 ; then | |
675 | echo "AAB_sun_memcpy replacing file ${file}" >&2 | |
676 | cat > ${DESTFILE} << '_EOF_' | |
677 | /* This file was generated by fixincludes */ | |
678 | #ifndef __memory_h__ | |
679 | #define __memory_h__ | |
680 | ||
681 | #ifdef __STDC__ | |
682 | extern void *memccpy(); | |
683 | extern void *memchr(); | |
684 | extern void *memcpy(); | |
685 | extern void *memset(); | |
686 | #else | |
687 | extern char *memccpy(); | |
688 | extern char *memchr(); | |
689 | extern char *memcpy(); | |
690 | extern char *memset(); | |
691 | #endif /* __STDC__ */ | |
692 | ||
693 | extern int memcmp(); | |
694 | ||
695 | #endif /* __memory_h__ */ | |
696 | ||
697 | _EOF_ | |
698 | continue | |
699 | ||
700 | fi # end of select 'if' | |
701 | ;; # case end for file name test | |
702 | esac | |
703 | ||
704 | ||
8aeb3b0e | 705 | # |
87ad679b | 706 | # Fix Aab_Svr4_Replace_Byteorder |
86765ca0 RL |
707 | # |
708 | case "${file}" in ./sys/byteorder.h ) | |
709 | case "$target_canonical" in *-*-sysv4* | \ | |
710 | i[34567]86-*-sysv5* | \ | |
711 | i[34567]86-*-udk* | \ | |
712 | i[34567]86-*-solaris2.[0-4] | \ | |
713 | powerpcle-*-solaris2.[0-4] | \ | |
714 | sparc-*-solaris2.[0-4] ) | |
87ad679b | 715 | echo "AAB_svr4_replace_byteorder replacing file ${file}" >&2 |
86765ca0 RL |
716 | cat > ${DESTFILE} << '_EOF_' |
717 | #ifndef _SYS_BYTEORDER_H | |
718 | #define _SYS_BYTEORDER_H | |
719 | ||
720 | /* Functions to convert `short' and `long' quantities from host byte order | |
721 | to (internet) network byte order (i.e. big-endian). | |
722 | ||
723 | Written by Ron Guilmette (rfg@ncd.com). | |
724 | ||
725 | This isn't actually used by GCC. It is installed by fixinc.svr4. | |
726 | ||
727 | For big-endian machines these functions are essentially no-ops. | |
728 | ||
729 | For little-endian machines, we define the functions using specialized | |
730 | asm sequences in cases where doing so yields better code (e.g. i386). */ | |
731 | ||
732 | #if !defined (__GNUC__) && !defined (__GNUG__) | |
733 | #error You lose! This file is only useful with GNU compilers. | |
734 | #endif | |
735 | ||
736 | #ifndef __BYTE_ORDER__ | |
737 | /* Byte order defines. These are as defined on UnixWare 1.1, but with | |
738 | double underscores added at the front and back. */ | |
739 | #define __LITTLE_ENDIAN__ 1234 | |
740 | #define __BIG_ENDIAN__ 4321 | |
741 | #define __PDP_ENDIAN__ 3412 | |
742 | #endif | |
743 | ||
744 | #ifdef __STDC__ | |
745 | static __inline__ unsigned long htonl (unsigned long); | |
746 | static __inline__ unsigned short htons (unsigned int); | |
747 | static __inline__ unsigned long ntohl (unsigned long); | |
748 | static __inline__ unsigned short ntohs (unsigned int); | |
749 | #endif /* defined (__STDC__) */ | |
750 | ||
751 | #if defined (__i386__) | |
752 | ||
753 | #ifndef __BYTE_ORDER__ | |
754 | #define __BYTE_ORDER__ __LITTLE_ENDIAN__ | |
755 | #endif | |
756 | ||
757 | /* Convert a host long to a network long. */ | |
758 | ||
759 | /* We must use a new-style function definition, so that this will also | |
760 | be valid for C++. */ | |
761 | static __inline__ unsigned long | |
762 | htonl (unsigned long __arg) | |
763 | { | |
764 | register unsigned long __result; | |
765 | ||
766 | __asm__ ("xchg%B0 %b0,%h0 | |
767 | ror%L0 $16,%0 | |
768 | xchg%B0 %b0,%h0" : "=q" (__result) : "0" (__arg)); | |
769 | return __result; | |
770 | } | |
771 | ||
772 | /* Convert a host short to a network short. */ | |
773 | ||
774 | static __inline__ unsigned short | |
775 | htons (unsigned int __arg) | |
776 | { | |
777 | register unsigned short __result; | |
778 | ||
779 | __asm__ ("xchg%B0 %b0,%h0" : "=q" (__result) : "0" (__arg)); | |
780 | return __result; | |
781 | } | |
782 | ||
d7eb5a45 ZW |
783 | #elif ((defined (__i860__) && !defined (__i860_big_endian__)) \ |
784 | || defined (__ns32k__) || defined (__vax__) \ | |
785 | || defined (__spur__) || defined (__arm__)) | |
86765ca0 RL |
786 | |
787 | #ifndef __BYTE_ORDER__ | |
788 | #define __BYTE_ORDER__ __LITTLE_ENDIAN__ | |
789 | #endif | |
790 | ||
791 | /* For other little-endian machines, using C code is just as efficient as | |
792 | using assembly code. */ | |
793 | ||
794 | /* Convert a host long to a network long. */ | |
795 | ||
796 | static __inline__ unsigned long | |
797 | htonl (unsigned long __arg) | |
798 | { | |
799 | register unsigned long __result; | |
800 | ||
801 | __result = (__arg >> 24) & 0x000000ff; | |
802 | __result |= (__arg >> 8) & 0x0000ff00; | |
803 | __result |= (__arg << 8) & 0x00ff0000; | |
804 | __result |= (__arg << 24) & 0xff000000; | |
805 | return __result; | |
806 | } | |
807 | ||
808 | /* Convert a host short to a network short. */ | |
809 | ||
810 | static __inline__ unsigned short | |
811 | htons (unsigned int __arg) | |
812 | { | |
813 | register unsigned short __result; | |
814 | ||
815 | __result = (__arg << 8) & 0xff00; | |
816 | __result |= (__arg >> 8) & 0x00ff; | |
817 | return __result; | |
818 | } | |
819 | ||
820 | #else /* must be a big-endian machine */ | |
821 | ||
822 | #ifndef __BYTE_ORDER__ | |
823 | #define __BYTE_ORDER__ __BIG_ENDIAN__ | |
824 | #endif | |
825 | ||
826 | /* Convert a host long to a network long. */ | |
827 | ||
828 | static __inline__ unsigned long | |
829 | htonl (unsigned long __arg) | |
830 | { | |
831 | return __arg; | |
832 | } | |
833 | ||
834 | /* Convert a host short to a network short. */ | |
835 | ||
836 | static __inline__ unsigned short | |
837 | htons (unsigned int __arg) | |
838 | { | |
839 | return __arg; | |
840 | } | |
841 | ||
842 | #endif /* big-endian */ | |
843 | ||
844 | /* Convert a network long to a host long. */ | |
845 | ||
846 | static __inline__ unsigned long | |
847 | ntohl (unsigned long __arg) | |
848 | { | |
849 | return htonl (__arg); | |
850 | } | |
851 | ||
852 | /* Convert a network short to a host short. */ | |
853 | ||
854 | static __inline__ unsigned short | |
855 | ntohs (unsigned int __arg) | |
856 | { | |
857 | return htons (__arg); | |
858 | } | |
859 | #endif | |
860 | ||
861 | _EOF_ | |
862 | continue | |
863 | ||
864 | ;; # case end for machine type test | |
865 | esac | |
866 | ;; # case end for file name test | |
867 | esac | |
868 | ||
869 | ||
b51207a4 ZW |
870 | # |
871 | # Fix Aab_Ultrix_Ansi_Compat | |
872 | # | |
873 | case "${file}" in ./ansi_compat.h ) | |
874 | if ( test -n "`egrep 'ULTRIX' ${file}`" | |
875 | ) > /dev/null 2>&1 ; then | |
876 | echo "AAB_ultrix_ansi_compat replacing file ${file}" >&2 | |
877 | cat > ${DESTFILE} << '_EOF_' | |
878 | /* This file intentionally left blank. */ | |
879 | ||
880 | _EOF_ | |
881 | continue | |
882 | ||
883 | fi # end of select 'if' | |
884 | ;; # case end for file name test | |
885 | esac | |
886 | ||
887 | ||
86765ca0 | 888 | # |
87ad679b | 889 | # Fix Aix_Syswait |
06bbab1b | 890 | # |
48bd9529 BK |
891 | case "${file}" in ./sys/wait.h ) |
892 | if ( test -n "`egrep 'bos325,' ${file}`" | |
06bbab1b BK |
893 | ) > /dev/null 2>&1 ; then |
894 | fixlist="${fixlist} | |
895 | aix_syswait" | |
48bd9529 BK |
896 | if [ ! -r ${DESTFILE} ] |
897 | then infile=${file} | |
898 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
899 | |
900 | sed -e '/^extern pid_t wait3();$/i\ | |
901 | struct rusage; | |
902 | ' \ | |
0cb97c8d | 903 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
904 | rm -f ${DESTFILE} |
905 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 906 | fi # end of select 'if' |
06bbab1b BK |
907 | ;; # case end for file name test |
908 | esac | |
909 | ||
910 | ||
911 | # | |
87ad679b | 912 | # Fix Aix_Volatile |
06bbab1b | 913 | # |
48bd9529 BK |
914 | case "${file}" in ./sys/signal.h ) |
915 | if ( test -n "`egrep 'typedef volatile int sig_atomic_t' ${file}`" | |
06bbab1b BK |
916 | ) > /dev/null 2>&1 ; then |
917 | fixlist="${fixlist} | |
918 | aix_volatile" | |
48bd9529 BK |
919 | if [ ! -r ${DESTFILE} ] |
920 | then infile=${file} | |
921 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
922 | |
923 | sed -e 's/typedef volatile int sig_atomic_t/typedef int sig_atomic_t/' \ | |
0cb97c8d | 924 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
925 | rm -f ${DESTFILE} |
926 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 927 | fi # end of select 'if' |
06bbab1b BK |
928 | ;; # case end for file name test |
929 | esac | |
930 | ||
931 | ||
932 | # | |
87ad679b | 933 | # Fix Alpha_Getopt |
06bbab1b | 934 | # |
48bd9529 | 935 | case "${file}" in ./stdio.h | \ |
06bbab1b | 936 | ./stdlib.h ) |
48bd9529 | 937 | if ( test -n "`egrep 'getopt\\(int, char \\*\\[' ${file}`" |
06bbab1b BK |
938 | ) > /dev/null 2>&1 ; then |
939 | fixlist="${fixlist} | |
940 | alpha_getopt" | |
48bd9529 BK |
941 | if [ ! -r ${DESTFILE} ] |
942 | then infile=${file} | |
943 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
944 | |
945 | sed -e 's/getopt(int, char \*\[\],[ ]*char \*)/getopt(int, char *const[], const char *)/' \ | |
0cb97c8d | 946 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
947 | rm -f ${DESTFILE} |
948 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 949 | fi # end of select 'if' |
06bbab1b BK |
950 | ;; # case end for file name test |
951 | esac | |
952 | ||
953 | ||
954 | # | |
87ad679b | 955 | # Fix Alpha_Parens |
06bbab1b | 956 | # |
48bd9529 BK |
957 | case "${file}" in ./sym.h ) |
958 | if ( test -n "`egrep '#ifndef\\(__mips64\\)' ${file}`" | |
06bbab1b BK |
959 | ) > /dev/null 2>&1 ; then |
960 | fixlist="${fixlist} | |
961 | alpha_parens" | |
48bd9529 BK |
962 | if [ ! -r ${DESTFILE} ] |
963 | then infile=${file} | |
964 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
965 | |
966 | sed -e 's/#ifndef(__mips64)/#ifndef __mips64/' \ | |
0cb97c8d | 967 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
968 | rm -f ${DESTFILE} |
969 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 970 | fi # end of select 'if' |
06bbab1b BK |
971 | ;; # case end for file name test |
972 | esac | |
973 | ||
974 | ||
975 | # | |
87ad679b | 976 | # Fix Alpha_Sbrk |
06bbab1b | 977 | # |
48bd9529 BK |
978 | case "${file}" in ./unistd.h ) |
979 | if ( test -n "`egrep 'char[ ]*\\*[ ]*sbrk[ ]*\\(' ${file}`" | |
06bbab1b BK |
980 | ) > /dev/null 2>&1 ; then |
981 | fixlist="${fixlist} | |
982 | alpha_sbrk" | |
48bd9529 BK |
983 | if [ ! -r ${DESTFILE} ] |
984 | then infile=${file} | |
985 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
986 | |
987 | sed -e 's/char\([ ]*\*[ ]*sbrk[ ]*(\)/void\1/' \ | |
0cb97c8d | 988 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
989 | rm -f ${DESTFILE} |
990 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 991 | fi # end of select 'if' |
06bbab1b BK |
992 | ;; # case end for file name test |
993 | esac | |
994 | ||
995 | ||
996 | # | |
87ad679b | 997 | # Fix Arm_Norcroft_Hint |
06bbab1b | 998 | # |
48bd9529 | 999 | case "${file}" in ./X11/Intrinsic.h ) |
ef16b5e5 JL |
1000 | if ( test -n "`egrep '___type p_type' ${file}`" |
1001 | ) > /dev/null 2>&1 ; then | |
06bbab1b BK |
1002 | fixlist="${fixlist} |
1003 | arm_norcroft_hint" | |
48bd9529 BK |
1004 | if [ ! -r ${DESTFILE} ] |
1005 | then infile=${file} | |
1006 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
1007 | |
1008 | sed -e 's/___type p_type/p_type/' \ | |
0cb97c8d | 1009 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
1010 | rm -f ${DESTFILE} |
1011 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 1012 | fi # end of select 'if' |
06bbab1b BK |
1013 | ;; # case end for file name test |
1014 | esac | |
1015 | ||
1016 | ||
1017 | # | |
87ad679b | 1018 | # Fix Arm_Wchar |
06bbab1b | 1019 | # |
48bd9529 BK |
1020 | case "${file}" in ./stdlib.h ) |
1021 | if ( test -n "`egrep '#[ ]*define[ ]*__wchar_t' ${file}`" | |
06bbab1b BK |
1022 | ) > /dev/null 2>&1 ; then |
1023 | fixlist="${fixlist} | |
1024 | arm_wchar" | |
48bd9529 BK |
1025 | if [ ! -r ${DESTFILE} ] |
1026 | then infile=${file} | |
1027 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
1028 | |
1029 | sed -e 's/\(#[ ]*ifndef[ ]*\)__wchar_t/\1_GCC_WCHAR_T/' \ | |
1030 | -e 's/\(#[ ]*define[ ]*\)__wchar_t/\1_GCC_WCHAR_T/' \ | |
0cb97c8d | 1031 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
1032 | rm -f ${DESTFILE} |
1033 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 1034 | fi # end of select 'if' |
06bbab1b BK |
1035 | ;; # case end for file name test |
1036 | esac | |
1037 | ||
1038 | ||
1039 | # | |
87ad679b | 1040 | # Fix Aux_Asm |
06bbab1b | 1041 | # |
48bd9529 BK |
1042 | case "${file}" in ./sys/param.h ) |
1043 | if ( test -n "`egrep '#ifndef NOINLINE' ${file}`" | |
06bbab1b BK |
1044 | ) > /dev/null 2>&1 ; then |
1045 | fixlist="${fixlist} | |
1046 | aux_asm" | |
48bd9529 BK |
1047 | if [ ! -r ${DESTFILE} ] |
1048 | then infile=${file} | |
1049 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
1050 | |
1051 | sed -e 's|#ifndef NOINLINE|#if !defined(NOINLINE) \&\& !defined(__GNUC__)|' \ | |
0cb97c8d | 1052 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
1053 | rm -f ${DESTFILE} |
1054 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 1055 | fi # end of select 'if' |
06bbab1b BK |
1056 | ;; # case end for file name test |
1057 | esac | |
1058 | ||
1059 | ||
1060 | # | |
87ad679b | 1061 | # Fix Avoid_Bool |
06bbab1b | 1062 | # |
48bd9529 | 1063 | case "${file}" in ./curses.h | \ |
b080ce78 | 1064 | ./curses_colr/curses.h | \ |
06bbab1b BK |
1065 | ./term.h | \ |
1066 | ./tinfo.h ) | |
5c0d5b94 ZW |
1067 | if ( test -n "`egrep 'char[ ]+bool|bool[ ]+char' ${file}`" |
1068 | ) > /dev/null 2>&1 ; then | |
1069 | if ( test -z "`egrep 'we must use the C\\+\\+ compiler'\\''s type' ${file}`" | |
1070 | ) > /dev/null 2>&1 ; then | |
06bbab1b BK |
1071 | fixlist="${fixlist} |
1072 | avoid_bool" | |
48bd9529 BK |
1073 | if [ ! -r ${DESTFILE} ] |
1074 | then infile=${file} | |
1075 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
1076 | |
1077 | sed -e '/^#[ ]*define[ ][ ]*bool[ ][ ]*char[ ]*$/i\ | |
1078 | #ifndef __cplusplus | |
1079 | ' \ | |
1080 | -e '/^#[ ]*define[ ][ ]*bool[ ][ ]*char[ ]*$/a\ | |
1081 | #endif | |
1082 | ' \ | |
1083 | -e '/^typedef[ ][ ]*char[ ][ ]*bool[ ]*;/i\ | |
1084 | #ifndef __cplusplus | |
1085 | ' \ | |
1086 | -e '/^typedef[ ][ ]*char[ ][ ]*bool[ ]*;/a\ | |
1087 | #endif | |
26e2e81d RL |
1088 | ' \ |
1089 | -e '/^[ ]*typedef[ ][ ]*unsigned char[ ][ ]*bool[ ]*;/i\ | |
1090 | #ifndef __cplusplus | |
1091 | ' \ | |
1092 | -e '/^[ ]*typedef[ ][ ]*unsigned char[ ][ ]*bool[ ]*;/a\ | |
1093 | #endif | |
fbc35bc1 JL |
1094 | ' \ |
1095 | -e '/^typedef[ ][ ]*int[ ][ ]*bool[ ]*;/i\ | |
1096 | #ifndef __cplusplus | |
1097 | ' \ | |
1098 | -e '/^typedef[ ][ ]*int[ ][ ]*bool[ ]*;/a\ | |
1099 | #endif | |
1100 | ' \ | |
1101 | -e '/^[ ]*typedef[ ][ ]*unsigned int[ ][ ]*bool[ ]*;/i\ | |
1102 | #ifndef __cplusplus | |
1103 | ' \ | |
1104 | -e '/^[ ]*typedef[ ][ ]*unsigned int[ ][ ]*bool[ ]*;/a\ | |
1105 | #endif | |
06bbab1b | 1106 | ' \ |
0cb97c8d | 1107 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
1108 | rm -f ${DESTFILE} |
1109 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5c0d5b94 ZW |
1110 | fi # end of bypass 'if' |
1111 | fi # end of select 'if' | |
06bbab1b BK |
1112 | ;; # case end for file name test |
1113 | esac | |
1114 | ||
1115 | ||
1116 | # | |
87ad679b | 1117 | # Fix Bad_Struct_Term |
06bbab1b | 1118 | # |
48bd9529 BK |
1119 | case "${file}" in ./curses.h ) |
1120 | if ( test -n "`egrep '^[ ]*typedef[ ]+struct[ ]+term[ ]*;' ${file}`" | |
06bbab1b BK |
1121 | ) > /dev/null 2>&1 ; then |
1122 | fixlist="${fixlist} | |
1123 | bad_struct_term" | |
48bd9529 BK |
1124 | if [ ! -r ${DESTFILE} ] |
1125 | then infile=${file} | |
1126 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
1127 | |
1128 | sed -e 's/^[ ]*typedef[ ][ ]*\(struct[ ][ ]*term[ ]*;[ ]*\)$/\1/' \ | |
0cb97c8d | 1129 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
1130 | rm -f ${DESTFILE} |
1131 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 1132 | fi # end of select 'if' |
06bbab1b BK |
1133 | ;; # case end for file name test |
1134 | esac | |
1135 | ||
1136 | ||
1137 | # | |
87ad679b | 1138 | # Fix Badquote |
06bbab1b | 1139 | # |
48bd9529 | 1140 | case "${file}" in ./sundev/vuid_event.h ) |
06bbab1b BK |
1141 | fixlist="${fixlist} |
1142 | badquote" | |
48bd9529 BK |
1143 | if [ ! -r ${DESTFILE} ] |
1144 | then infile=${file} | |
1145 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
1146 | |
1147 | sed -e 's/doesn'\''t/does not/' \ | |
0cb97c8d | 1148 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
1149 | rm -f ${DESTFILE} |
1150 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
06bbab1b BK |
1151 | ;; # case end for file name test |
1152 | esac | |
1153 | ||
1154 | ||
1155 | # | |
87ad679b | 1156 | # Fix Bad_Lval |
06bbab1b | 1157 | # |
48bd9529 | 1158 | case "${file}" in ./libgen.h | \ |
06bbab1b BK |
1159 | ./dirent.h | \ |
1160 | ./ftw.h | \ | |
1161 | ./grp.h | \ | |
1162 | ./ndbm.h | \ | |
1163 | ./pthread.h | \ | |
1164 | ./pwd.h | \ | |
1165 | ./signal.h | \ | |
1166 | ./standards.h | \ | |
1167 | ./stdlib.h | \ | |
1168 | ./string.h | \ | |
1169 | ./stropts.h | \ | |
1170 | ./time.h | \ | |
1171 | ./unistd.h ) | |
8aeb3b0e BK |
1172 | if ( test -n "`egrep '^[ ]*#[ ]*pragma[ ][ ]*extern_prefix' ${file}`" |
1173 | ) > /dev/null 2>&1 ; then | |
06bbab1b BK |
1174 | fixlist="${fixlist} |
1175 | bad_lval" | |
48bd9529 BK |
1176 | if [ ! -r ${DESTFILE} ] |
1177 | then infile=${file} | |
1178 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
1179 | |
1180 | sed -e 's/^[ ]*#[ ]*define[ ]*\([^(]*\)\(([^)]*)\)[ ]*\(_.\)\1\2[ ]*$/#define \1 \3\1/' \ | |
0cb97c8d | 1181 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
1182 | rm -f ${DESTFILE} |
1183 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
8aeb3b0e | 1184 | fi # end of select 'if' |
06bbab1b BK |
1185 | ;; # case end for file name test |
1186 | esac | |
1187 | ||
1188 | ||
1189 | # | |
87ad679b | 1190 | # Fix Broken_Assert_Stdio |
06bbab1b | 1191 | # |
48bd9529 | 1192 | case "${file}" in ./assert.h ) |
5abc1f74 BK |
1193 | if ( test -n "`egrep 'stderr' ${file}`" |
1194 | ) > /dev/null 2>&1 ; then | |
d7eb5a45 | 1195 | if ( test -z "`egrep 'include.*stdio.h' ${file}`" |
06bbab1b BK |
1196 | ) > /dev/null 2>&1 ; then |
1197 | fixlist="${fixlist} | |
1198 | broken_assert_stdio" | |
48bd9529 BK |
1199 | if [ ! -r ${DESTFILE} ] |
1200 | then infile=${file} | |
1201 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
1202 | |
1203 | sed -e '1i\ | |
1204 | #include <stdio.h> | |
1205 | ' \ | |
0cb97c8d | 1206 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
1207 | rm -f ${DESTFILE} |
1208 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 BK |
1209 | fi # end of bypass 'if' |
1210 | fi # end of select 'if' | |
06bbab1b BK |
1211 | ;; # case end for file name test |
1212 | esac | |
1213 | ||
1214 | ||
1215 | # | |
87ad679b | 1216 | # Fix Broken_Assert_Stdlib |
06bbab1b | 1217 | # |
48bd9529 | 1218 | case "${file}" in ./assert.h ) |
5abc1f74 BK |
1219 | if ( test -n "`egrep 'exit *\\(|abort *\\(' ${file}`" |
1220 | ) > /dev/null 2>&1 ; then | |
d7eb5a45 | 1221 | if ( test -z "`egrep 'include.*stdlib.h' ${file}`" |
06bbab1b BK |
1222 | ) > /dev/null 2>&1 ; then |
1223 | fixlist="${fixlist} | |
1224 | broken_assert_stdlib" | |
48bd9529 BK |
1225 | if [ ! -r ${DESTFILE} ] |
1226 | then infile=${file} | |
1227 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
1228 | |
1229 | sed -e '1i\ | |
1230 | #ifdef __cplusplus\ | |
1231 | #include <stdlib.h>\ | |
1232 | #endif | |
1233 | ' \ | |
0cb97c8d | 1234 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
1235 | rm -f ${DESTFILE} |
1236 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 BK |
1237 | fi # end of bypass 'if' |
1238 | fi # end of select 'if' | |
06bbab1b BK |
1239 | ;; # case end for file name test |
1240 | esac | |
1241 | ||
1242 | ||
06bbab1b | 1243 | # |
87ad679b | 1244 | # Fix Dec_Intern_Asm |
06bbab1b | 1245 | # |
48bd9529 | 1246 | case "${file}" in ./c_asm.h ) |
06bbab1b | 1247 | fixlist="${fixlist} |
48bd9529 BK |
1248 | dec_intern_asm" |
1249 | if [ ! -r ${DESTFILE} ] | |
1250 | then infile=${file} | |
1251 | else infile=${DESTFILE} ; fi | |
06bbab1b | 1252 | |
adc8046e | 1253 | sed -e '/^[ ]*float[ ]*fasm/i\ |
48bd9529 BK |
1254 | #ifdef __DECC |
1255 | ' \ | |
adc8046e | 1256 | -e '/^[ ]*#[ ]*pragma[ ]*intrinsic([ ]*dasm/a\ |
48bd9529 BK |
1257 | #endif |
1258 | ' \ | |
0cb97c8d | 1259 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
1260 | rm -f ${DESTFILE} |
1261 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
1262 | ;; # case end for file name test | |
1263 | esac | |
06bbab1b BK |
1264 | |
1265 | ||
06bbab1b | 1266 | # |
87ad679b | 1267 | # Fix Ecd_Cursor |
06bbab1b | 1268 | # |
48bd9529 | 1269 | case "${file}" in ./sunwindow/win_lock.h | \ |
06bbab1b BK |
1270 | ./sunwindow/win_cursor.h ) |
1271 | fixlist="${fixlist} | |
1272 | ecd_cursor" | |
48bd9529 BK |
1273 | if [ ! -r ${DESTFILE} ] |
1274 | then infile=${file} | |
1275 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
1276 | |
1277 | sed -e 's/ecd.cursor/ecd_cursor/' \ | |
0cb97c8d | 1278 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
1279 | rm -f ${DESTFILE} |
1280 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
06bbab1b BK |
1281 | ;; # case end for file name test |
1282 | esac | |
1283 | ||
1284 | ||
1285 | # | |
87ad679b | 1286 | # Fix Sco5_Stat_Wrappers |
26e2e81d RL |
1287 | # |
1288 | case "${file}" in ./sys/stat.h ) | |
1289 | case "$target_canonical" in i*86-*-sco3.2v5* ) | |
1290 | fixlist="${fixlist} | |
1291 | sco5_stat_wrappers" | |
1292 | if [ ! -r ${DESTFILE} ] | |
1293 | then infile=${file} | |
1294 | else infile=${DESTFILE} ; fi | |
1295 | ||
1296 | sed -e '/^static int[ ]*[a-z]*stat(/i\ | |
1297 | #ifdef __cplusplus\ | |
1298 | extern "C"\ | |
1299 | {\ | |
1300 | #endif\ | |
1301 | ' \ | |
1302 | -e '/^}$/a\ | |
1303 | #ifdef __cplusplus\ | |
1304 | }\ | |
1305 | #endif /* __cplusplus */\ | |
1306 | ' \ | |
1307 | < $infile > ${DESTDIR}/fixinc.tmp | |
1308 | rm -f ${DESTFILE} | |
1309 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
1310 | ;; # case end for machine type test | |
1311 | esac | |
1312 | ;; # case end for file name test | |
1313 | esac | |
1314 | ||
1315 | ||
06bbab1b | 1316 | # |
87ad679b | 1317 | # Fix Hp_Inline |
06bbab1b | 1318 | # |
48bd9529 BK |
1319 | case "${file}" in ./sys/spinlock.h ) |
1320 | if ( test -n "`egrep 'include.*\"\\.\\./machine/' ${file}`" | |
06bbab1b BK |
1321 | ) > /dev/null 2>&1 ; then |
1322 | fixlist="${fixlist} | |
1323 | hp_inline" | |
48bd9529 BK |
1324 | if [ ! -r ${DESTFILE} ] |
1325 | then infile=${file} | |
1326 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
1327 | |
1328 | sed -e 's,"../machine/inline.h",<machine/inline.h>,' \ | |
1329 | -e 's,"../machine/psl.h",<machine/psl.h>,' \ | |
0cb97c8d | 1330 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
1331 | rm -f ${DESTFILE} |
1332 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 1333 | fi # end of select 'if' |
06bbab1b BK |
1334 | ;; # case end for file name test |
1335 | esac | |
1336 | ||
1337 | ||
1338 | # | |
87ad679b | 1339 | # Fix Hp_Sysfile |
06bbab1b | 1340 | # |
48bd9529 BK |
1341 | case "${file}" in ./sys/file.h ) |
1342 | if ( test -n "`egrep 'HPUX_SOURCE' ${file}`" | |
06bbab1b BK |
1343 | ) > /dev/null 2>&1 ; then |
1344 | fixlist="${fixlist} | |
1345 | hp_sysfile" | |
48bd9529 BK |
1346 | if [ ! -r ${DESTFILE} ] |
1347 | then infile=${file} | |
1348 | else infile=${DESTFILE} ; fi | |
06bbab1b | 1349 | |
78a0d70c | 1350 | sed -e 's/(\.\.\.)/(struct file *, ...)/' \ |
0cb97c8d | 1351 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
1352 | rm -f ${DESTFILE} |
1353 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 1354 | fi # end of select 'if' |
06bbab1b BK |
1355 | ;; # case end for file name test |
1356 | esac | |
1357 | ||
1358 | ||
1359 | # | |
87ad679b | 1360 | # Fix Cxx_Unready |
06bbab1b | 1361 | # |
48bd9529 BK |
1362 | case "${file}" in ./sys/mman.h | \ |
1363 | ./rpc/types.h ) | |
3be1fb72 ZW |
1364 | if ( test -n "`egrep '[^#]+malloc.*;' ${file}`" |
1365 | ) > /dev/null 2>&1 ; then | |
d7eb5a45 | 1366 | if ( test -z "`egrep '\"C\"|__BEGIN_DECLS' ${file}`" |
06bbab1b BK |
1367 | ) > /dev/null 2>&1 ; then |
1368 | fixlist="${fixlist} | |
48bd9529 BK |
1369 | cxx_unready" |
1370 | if [ ! -r ${DESTFILE} ] | |
1371 | then infile=${file} | |
1372 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
1373 | |
1374 | sed -e '1i\ | |
1375 | #ifdef __cplusplus\ | |
1376 | extern "C" {\ | |
1377 | #endif\ | |
1378 | ||
1379 | ' \ | |
1380 | -e '$a\ | |
1381 | #ifdef __cplusplus\ | |
1382 | }\ | |
1383 | #endif | |
1384 | ' \ | |
0cb97c8d | 1385 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
1386 | rm -f ${DESTFILE} |
1387 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 1388 | fi # end of bypass 'if' |
3be1fb72 | 1389 | fi # end of select 'if' |
06bbab1b BK |
1390 | ;; # case end for file name test |
1391 | esac | |
1392 | ||
1393 | ||
1394 | # | |
87ad679b | 1395 | # Fix Hpux_Maxint |
06bbab1b | 1396 | # |
48bd9529 | 1397 | case "${file}" in ./sys/param.h ) |
06bbab1b BK |
1398 | fixlist="${fixlist} |
1399 | hpux_maxint" | |
48bd9529 BK |
1400 | if [ ! -r ${DESTFILE} ] |
1401 | then infile=${file} | |
1402 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
1403 | |
1404 | sed -e '/^#[ ]*define[ ]*MAXINT[ ]/i\ | |
1405 | #ifndef MAXINT | |
1406 | ' \ | |
1407 | -e '/^#[ ]*define[ ]*MAXINT[ ]/a\ | |
1408 | #endif | |
1409 | ' \ | |
0cb97c8d | 1410 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
1411 | rm -f ${DESTFILE} |
1412 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
06bbab1b BK |
1413 | ;; # case end for file name test |
1414 | esac | |
1415 | ||
1416 | ||
1417 | # | |
87ad679b | 1418 | # Fix Hpux_Systime |
06bbab1b | 1419 | # |
48bd9529 BK |
1420 | case "${file}" in ./sys/time.h ) |
1421 | if ( test -n "`egrep '^extern struct sigevent;' ${file}`" | |
06bbab1b BK |
1422 | ) > /dev/null 2>&1 ; then |
1423 | fixlist="${fixlist} | |
1424 | hpux_systime" | |
48bd9529 BK |
1425 | if [ ! -r ${DESTFILE} ] |
1426 | then infile=${file} | |
1427 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
1428 | |
1429 | sed -e 's/^extern struct sigevent;/struct sigevent;/' \ | |
0cb97c8d | 1430 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
1431 | rm -f ${DESTFILE} |
1432 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 1433 | fi # end of select 'if' |
06bbab1b BK |
1434 | ;; # case end for file name test |
1435 | esac | |
1436 | ||
1437 | ||
1438 | # | |
87ad679b | 1439 | # Fix Hpux8_Bogus_Inlines |
d7eb5a45 ZW |
1440 | # |
1441 | case "${file}" in ./math.h ) | |
1442 | if ( test -n "`egrep 'inline' ${file}`" | |
1443 | ) > /dev/null 2>&1 ; then | |
1444 | fixlist="${fixlist} | |
1445 | hpux8_bogus_inlines" | |
1446 | if [ ! -r ${DESTFILE} ] | |
1447 | then infile=${file} | |
1448 | else infile=${DESTFILE} ; fi | |
1449 | ||
1450 | sed -e 's@inline int abs(int [a-z][a-z]*) {.*}@extern "C" int abs(int);@' \ | |
1451 | -e 's@inline double abs(double [a-z][a-z]*) {.*}@@' \ | |
1452 | -e 's@inline int sqr(int [a-z][a-z]*) {.*}@@' \ | |
1453 | -e 's@inline double sqr(double [a-z][a-z]*) {.*}@@' \ | |
1454 | < $infile > ${DESTDIR}/fixinc.tmp | |
1455 | rm -f ${DESTFILE} | |
1456 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
1457 | fi # end of select 'if' | |
1458 | ;; # case end for file name test | |
1459 | esac | |
1460 | ||
1461 | ||
1462 | # | |
87ad679b | 1463 | # Fix Hpux11_Uint32_C |
abf7cec7 GRK |
1464 | # |
1465 | case "${file}" in ./inttypes.h ) | |
1466 | if ( test -n "`egrep '^#define UINT32_C\\(__c\\)[ ]*__CONCAT__\\(__CONCAT_U__\\(__c\\),l\\)' ${file}`" | |
1467 | ) > /dev/null 2>&1 ; then | |
1468 | fixlist="${fixlist} | |
1469 | hpux11_uint32_c" | |
1470 | if [ ! -r ${DESTFILE} ] | |
1471 | then infile=${file} | |
1472 | else infile=${DESTFILE} ; fi | |
1473 | ||
1474 | sed -e 's/^#define UINT32_C(__c)\([ ]*\)__CONCAT__(__CONCAT_U__(__c),l)/#define UINT32_C(__c)\1__CONCAT__(__c,ul)/' \ | |
1475 | < $infile > ${DESTDIR}/fixinc.tmp | |
1476 | rm -f ${DESTFILE} | |
1477 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
1478 | fi # end of select 'if' | |
1479 | ;; # case end for file name test | |
1480 | esac | |
1481 | ||
1482 | ||
1483 | # | |
b51207a4 | 1484 | # Fix Isc_Omits_With_Stdc |
06bbab1b | 1485 | # |
48bd9529 | 1486 | case "${file}" in ./stdio.h | \ |
06bbab1b BK |
1487 | ./math.h | \ |
1488 | ./ctype.h | \ | |
1489 | ./sys/limits.h | \ | |
1490 | ./sys/fcntl.h | \ | |
1491 | ./sys/dirent.h ) | |
b51207a4 | 1492 | if ( test -n "`egrep 'defined(__STDC__) && !defined(_POSIX_SOURCE)' ${file}`" |
06bbab1b BK |
1493 | ) > /dev/null 2>&1 ; then |
1494 | fixlist="${fixlist} | |
b51207a4 | 1495 | isc_omits_with_stdc" |
48bd9529 BK |
1496 | if [ ! -r ${DESTFILE} ] |
1497 | then infile=${file} | |
1498 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
1499 | |
1500 | sed -e 's/!defined(__STDC__) && !defined(_POSIX_SOURCE)/!defined(_POSIX_SOURCE)/' \ | |
0cb97c8d | 1501 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
1502 | rm -f ${DESTFILE} |
1503 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
b51207a4 | 1504 | fi # end of select 'if' |
06bbab1b BK |
1505 | ;; # case end for file name test |
1506 | esac | |
1507 | ||
1508 | ||
5c0d5b94 ZW |
1509 | # |
1510 | # Fix Io_Use_Quotes | |
1511 | # | |
1512 | if ( test -n "`egrep 'define[ ]+[A-Z0-9_]+[ ]+[A-Z0-9_]+IO[A-Z]*[ ]*\\( *[^,'\\'']' ${file}`" | |
1513 | ) > /dev/null 2>&1 ; then | |
1514 | fixlist="${fixlist} | |
1515 | io_use_quotes" | |
1516 | if [ ! -r ${DESTFILE} ] | |
1517 | then infile=${file} | |
1518 | else infile=${DESTFILE} ; fi | |
1519 | ${FIXFIXES} ${file} IO_use < $infile > ${DESTDIR}/fixinc.tmp | |
1520 | rm -f ${DESTFILE} | |
1521 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
1522 | fi # end of select 'if' | |
1523 | ||
1524 | ||
06bbab1b | 1525 | # |
87ad679b | 1526 | # Fix Io_Def_Quotes |
06bbab1b | 1527 | # |
5c0d5b94 | 1528 | if ( test -n "`egrep 'define[ ]+[A-Z0-9_]+IO[A-Z]*\\(([a-zA-Z]).*'\\''\\1'\\''' ${file}`" |
06bbab1b BK |
1529 | ) > /dev/null 2>&1 ; then |
1530 | fixlist="${fixlist} | |
1531 | io_def_quotes" | |
48bd9529 BK |
1532 | if [ ! -r ${DESTFILE} ] |
1533 | then infile=${file} | |
1534 | else infile=${DESTFILE} ; fi | |
5c0d5b94 | 1535 | ${FIXFIXES} ${file} IO_defn < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
1536 | rm -f ${DESTFILE} |
1537 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 1538 | fi # end of select 'if' |
06bbab1b BK |
1539 | |
1540 | ||
1541 | # | |
5c0d5b94 | 1542 | # Fix Ctrl_Use_Quotes |
06bbab1b | 1543 | # |
5c0d5b94 | 1544 | if ( test -n "`egrep 'define[ ]+[A-Z0-9_]+[ ]+[A-Z0-9_]+CTRL[ ]*\\( *[^,'\\'']' ${file}`" |
06bbab1b BK |
1545 | ) > /dev/null 2>&1 ; then |
1546 | fixlist="${fixlist} | |
5c0d5b94 | 1547 | ctrl_use_quotes" |
48bd9529 BK |
1548 | if [ ! -r ${DESTFILE} ] |
1549 | then infile=${file} | |
1550 | else infile=${DESTFILE} ; fi | |
5c0d5b94 ZW |
1551 | ${FIXFIXES} ${file} CTRL_use < $infile > ${DESTDIR}/fixinc.tmp |
1552 | rm -f ${DESTFILE} | |
1553 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
1554 | fi # end of select 'if' | |
06bbab1b | 1555 | |
5c0d5b94 ZW |
1556 | |
1557 | # | |
1558 | # Fix Ctrl_Def_Quotes | |
1559 | # | |
1560 | if ( test -n "`egrep 'define[ ]+[A-Z0-9_]+CTRL\\(([a-zA-Z]).*'\\''\\1'\\''' ${file}`" | |
1561 | ) > /dev/null 2>&1 ; then | |
1562 | fixlist="${fixlist} | |
1563 | ctrl_def_quotes" | |
1564 | if [ ! -r ${DESTFILE} ] | |
1565 | then infile=${file} | |
1566 | else infile=${DESTFILE} ; fi | |
1567 | ${FIXFIXES} ${file} CTRL_defn < $infile > ${DESTDIR}/fixinc.tmp | |
48bd9529 BK |
1568 | rm -f ${DESTFILE} |
1569 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 1570 | fi # end of select 'if' |
06bbab1b BK |
1571 | |
1572 | ||
1573 | # | |
87ad679b | 1574 | # Fix Ip_Missing_Semi |
06bbab1b | 1575 | # |
48bd9529 | 1576 | case "${file}" in ./netinet/ip.h ) |
d7eb5a45 ZW |
1577 | if ( test -n "`egrep '}$' ${file}`" |
1578 | ) > /dev/null 2>&1 ; then | |
06bbab1b BK |
1579 | fixlist="${fixlist} |
1580 | ip_missing_semi" | |
48bd9529 BK |
1581 | if [ ! -r ${DESTFILE} ] |
1582 | then infile=${file} | |
1583 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
1584 | |
1585 | sed -e '/^struct/,/^};/s/}$/};/' \ | |
0cb97c8d | 1586 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
1587 | rm -f ${DESTFILE} |
1588 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
d7eb5a45 | 1589 | fi # end of select 'if' |
06bbab1b BK |
1590 | ;; # case end for file name test |
1591 | esac | |
1592 | ||
1593 | ||
1594 | # | |
87ad679b | 1595 | # Fix Irix_Multiline_Cmnt |
06bbab1b | 1596 | # |
48bd9529 | 1597 | case "${file}" in ./sys/types.h ) |
06bbab1b BK |
1598 | fixlist="${fixlist} |
1599 | irix_multiline_cmnt" | |
48bd9529 BK |
1600 | if [ ! -r ${DESTFILE} ] |
1601 | then infile=${file} | |
1602 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
1603 | |
1604 | sed -e 's@type of the result@type of the result */@' \ | |
1605 | -e 's@of the sizeof@/* of the sizeof@' \ | |
0cb97c8d | 1606 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
1607 | rm -f ${DESTFILE} |
1608 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
06bbab1b BK |
1609 | ;; # case end for file name test |
1610 | esac | |
1611 | ||
1612 | ||
1613 | # | |
87ad679b | 1614 | # Fix Irix_Sockaddr |
06bbab1b | 1615 | # |
48bd9529 BK |
1616 | case "${file}" in ./rpc/auth.h ) |
1617 | if ( test -n "`egrep 'authdes_create.*struct sockaddr' ${file}`" | |
06bbab1b | 1618 | ) > /dev/null 2>&1 ; then |
3be1fb72 ZW |
1619 | if ( test -z "`egrep '<sys/socket.h>' ${file}`" |
1620 | ) > /dev/null 2>&1 ; then | |
06bbab1b BK |
1621 | fixlist="${fixlist} |
1622 | irix_sockaddr" | |
48bd9529 BK |
1623 | if [ ! -r ${DESTFILE} ] |
1624 | then infile=${file} | |
1625 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
1626 | |
1627 | sed -e '/authdes_create.*struct sockaddr/i\ | |
1628 | struct sockaddr; | |
1629 | ' \ | |
0cb97c8d | 1630 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
1631 | rm -f ${DESTFILE} |
1632 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
3be1fb72 | 1633 | fi # end of bypass 'if' |
5abc1f74 | 1634 | fi # end of select 'if' |
06bbab1b BK |
1635 | ;; # case end for file name test |
1636 | esac | |
1637 | ||
1638 | ||
1639 | # | |
87ad679b | 1640 | # Fix Irix_Struct__File |
06bbab1b | 1641 | # |
48bd9529 | 1642 | case "${file}" in ./rpc/xdr.h ) |
06bbab1b BK |
1643 | fixlist="${fixlist} |
1644 | irix_struct__file" | |
48bd9529 BK |
1645 | if [ ! -r ${DESTFILE} ] |
1646 | then infile=${file} | |
1647 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
1648 | |
1649 | sed -e '/xdrstdio_create.*struct __file_s/i\ | |
1650 | struct __file_s; | |
1651 | ' \ | |
0cb97c8d | 1652 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
1653 | rm -f ${DESTFILE} |
1654 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
06bbab1b BK |
1655 | ;; # case end for file name test |
1656 | esac | |
1657 | ||
1658 | ||
1659 | # | |
87ad679b | 1660 | # Fix Irix_Asm_Apostrophe |
94cc6036 BK |
1661 | # |
1662 | case "${file}" in ./sys/asm.h ) | |
1663 | if ( test -n "`egrep '^[ ]*#.*[Ww]e'\\''re' ${file}`" | |
1664 | ) > /dev/null 2>&1 ; then | |
1665 | fixlist="${fixlist} | |
1666 | irix_asm_apostrophe" | |
1667 | if [ ! -r ${DESTFILE} ] | |
1668 | then infile=${file} | |
1669 | else infile=${DESTFILE} ; fi | |
1670 | ||
1671 | sed -e '/^[ ]*#/s/\([Ww]e\)'\''re/\1 are/' \ | |
1672 | < $infile > ${DESTDIR}/fixinc.tmp | |
1673 | rm -f ${DESTFILE} | |
1674 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 1675 | fi # end of select 'if' |
94cc6036 BK |
1676 | ;; # case end for file name test |
1677 | esac | |
1678 | ||
1679 | ||
1680 | # | |
87ad679b | 1681 | # Fix Isc_Fmod |
06bbab1b | 1682 | # |
48bd9529 BK |
1683 | case "${file}" in ./math.h ) |
1684 | if ( test -n "`egrep 'fmod\\(double\\)' ${file}`" | |
06bbab1b BK |
1685 | ) > /dev/null 2>&1 ; then |
1686 | fixlist="${fixlist} | |
1687 | isc_fmod" | |
48bd9529 BK |
1688 | if [ ! -r ${DESTFILE} ] |
1689 | then infile=${file} | |
1690 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
1691 | |
1692 | sed -e 's/fmod(double)/fmod(double, double)/' \ | |
0cb97c8d | 1693 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
1694 | rm -f ${DESTFILE} |
1695 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 1696 | fi # end of select 'if' |
06bbab1b BK |
1697 | ;; # case end for file name test |
1698 | esac | |
1699 | ||
1700 | ||
1701 | # | |
87ad679b | 1702 | # Fix Motorola_Nested |
06bbab1b | 1703 | # |
48bd9529 | 1704 | case "${file}" in ./limits.h | \ |
06bbab1b | 1705 | ./sys/limits.h ) |
48bd9529 | 1706 | case "$target_canonical" in m68k-motorola-sysv* ) |
06bbab1b BK |
1707 | fixlist="${fixlist} |
1708 | motorola_nested" | |
48bd9529 BK |
1709 | if [ ! -r ${DESTFILE} ] |
1710 | then infile=${file} | |
1711 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
1712 | |
1713 | sed -e 's@^\(#undef[ ][ ]*PIPE_BUF[ ]*/\* max # bytes atomic in write to a\)$@\1 */@' \ | |
1714 | -e 's@\(/\*#define HUGE_VAL 3.40282346638528860e+38 \)\(/\*error value returned by Math lib\*/\)$@\1*/ \2@' \ | |
0cb97c8d | 1715 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
1716 | rm -f ${DESTFILE} |
1717 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
1718 | ;; # case end for machine type test | |
1719 | esac | |
06bbab1b BK |
1720 | ;; # case end for file name test |
1721 | esac | |
1722 | ||
1723 | ||
1724 | # | |
87ad679b | 1725 | # Fix Isc_Sys_Limits |
06bbab1b | 1726 | # |
48bd9529 BK |
1727 | case "${file}" in ./sys/limits.h ) |
1728 | if ( test -n "`egrep 'CHILD_MAX' ${file}`" | |
06bbab1b BK |
1729 | ) > /dev/null 2>&1 ; then |
1730 | fixlist="${fixlist} | |
1731 | isc_sys_limits" | |
48bd9529 BK |
1732 | if [ ! -r ${DESTFILE} ] |
1733 | then infile=${file} | |
1734 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
1735 | |
1736 | sed -e '/CHILD_MAX/s,/\* Max, Max,' \ | |
1737 | -e '/OPEN_MAX/s,/\* Max, Max,' \ | |
0cb97c8d | 1738 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
1739 | rm -f ${DESTFILE} |
1740 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 1741 | fi # end of select 'if' |
06bbab1b BK |
1742 | ;; # case end for file name test |
1743 | esac | |
1744 | ||
1745 | ||
1746 | # | |
87ad679b | 1747 | # Fix Kandr_Concat |
06bbab1b | 1748 | # |
48bd9529 | 1749 | case "${file}" in ./sparc/asm_linkage.h | \ |
06bbab1b BK |
1750 | ./sun3/asm_linkage.h | \ |
1751 | ./sun3x/asm_linkage.h | \ | |
1752 | ./sun4/asm_linkage.h | \ | |
1753 | ./sun4c/asm_linkage.h | \ | |
1754 | ./sun4m/asm_linkage.h | \ | |
1755 | ./sun4c/debug/asm_linkage.h | \ | |
1756 | ./sun4m/debug/asm_linkage.h | \ | |
1757 | ./arm/as_support.h | \ | |
1758 | ./arm/mc_type.h | \ | |
1759 | ./arm/xcb.h | \ | |
1760 | ./dev/chardefmac.h | \ | |
1761 | ./dev/ps_irq.h | \ | |
1762 | ./dev/screen.h | \ | |
1763 | ./dev/scsi.h | \ | |
1764 | ./sys/tty.h | \ | |
1765 | ./Xm.acorn/XmP.h | \ | |
1766 | ./bsd43/bsd43_.h ) | |
48bd9529 | 1767 | if ( test -n "`egrep '/\\*\\*/' ${file}`" |
06bbab1b BK |
1768 | ) > /dev/null 2>&1 ; then |
1769 | fixlist="${fixlist} | |
1770 | kandr_concat" | |
48bd9529 BK |
1771 | if [ ! -r ${DESTFILE} ] |
1772 | then infile=${file} | |
1773 | else infile=${DESTFILE} ; fi | |
06bbab1b | 1774 | |
48bd9529 | 1775 | sed -e 's|/\*\*/|##|g' \ |
0cb97c8d | 1776 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
1777 | rm -f ${DESTFILE} |
1778 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 1779 | fi # end of select 'if' |
06bbab1b BK |
1780 | ;; # case end for file name test |
1781 | esac | |
1782 | ||
1783 | ||
1784 | # | |
87ad679b | 1785 | # Fix Limits_Ifndefs |
06bbab1b | 1786 | # |
149911d4 JL |
1787 | case "${file}" in ./limits.h | \ |
1788 | ./sys/limits.h ) | |
d7eb5a45 | 1789 | if ( test -z "`egrep 'ifndef[ ]+FLT_MIN' ${file}`" |
06bbab1b BK |
1790 | ) > /dev/null 2>&1 ; then |
1791 | fixlist="${fixlist} | |
1792 | limits_ifndefs" | |
48bd9529 BK |
1793 | if [ ! -r ${DESTFILE} ] |
1794 | then infile=${file} | |
1795 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
1796 | |
1797 | sed -e '/[ ]FLT_MIN[ ]/i\ | |
1798 | #ifndef FLT_MIN | |
1799 | ' \ | |
1800 | -e '/[ ]FLT_MIN[ ]/a\ | |
1801 | #endif | |
1802 | ' \ | |
1803 | -e '/[ ]FLT_MAX[ ]/i\ | |
1804 | #ifndef FLT_MAX | |
1805 | ' \ | |
1806 | -e '/[ ]FLT_MAX[ ]/a\ | |
1807 | #endif | |
1808 | ' \ | |
1809 | -e '/[ ]FLT_DIG[ ]/i\ | |
1810 | #ifndef FLT_DIG | |
1811 | ' \ | |
1812 | -e '/[ ]FLT_DIG[ ]/a\ | |
1813 | #endif | |
1814 | ' \ | |
1815 | -e '/[ ]DBL_MIN[ ]/i\ | |
1816 | #ifndef DBL_MIN | |
1817 | ' \ | |
1818 | -e '/[ ]DBL_MIN[ ]/a\ | |
1819 | #endif | |
1820 | ' \ | |
1821 | -e '/[ ]DBL_MAX[ ]/i\ | |
1822 | #ifndef DBL_MAX | |
1823 | ' \ | |
1824 | -e '/[ ]DBL_MAX[ ]/a\ | |
1825 | #endif | |
1826 | ' \ | |
1827 | -e '/[ ]DBL_DIG[ ]/i\ | |
1828 | #ifndef DBL_DIG | |
1829 | ' \ | |
1830 | -e '/[ ]DBL_DIG[ ]/a\ | |
1831 | #endif | |
1832 | ' \ | |
1833 | -e '/^\(\/\*#define HUGE_VAL 3\.[0-9e+]* *\)\/\*/s//\1/' \ | |
0cb97c8d | 1834 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
1835 | rm -f ${DESTFILE} |
1836 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 1837 | fi # end of bypass 'if' |
06bbab1b BK |
1838 | ;; # case end for file name test |
1839 | esac | |
1840 | ||
1841 | ||
1842 | # | |
87ad679b | 1843 | # Fix Lynx_Void_Int |
06bbab1b | 1844 | # |
48bd9529 BK |
1845 | case "${file}" in ./curses.h ) |
1846 | if ( test -n "`egrep '#[ ]*define[ ]+void[ ]+int' ${file}`" | |
06bbab1b BK |
1847 | ) > /dev/null 2>&1 ; then |
1848 | fixlist="${fixlist} | |
1849 | lynx_void_int" | |
48bd9529 BK |
1850 | if [ ! -r ${DESTFILE} ] |
1851 | then infile=${file} | |
1852 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
1853 | |
1854 | sed -e '/#[ ]*define[ ][ ]*void[ ]int/d' \ | |
0cb97c8d | 1855 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
1856 | rm -f ${DESTFILE} |
1857 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 1858 | fi # end of select 'if' |
06bbab1b BK |
1859 | ;; # case end for file name test |
1860 | esac | |
1861 | ||
1862 | ||
1863 | # | |
87ad679b | 1864 | # Fix Lynxos_Fcntl_Proto |
06bbab1b | 1865 | # |
48bd9529 BK |
1866 | case "${file}" in ./fcntl.h ) |
1867 | if ( test -n "`egrep 'fcntl.*\\(int, int, int\\)' ${file}`" | |
1868 | ) > /dev/null 2>&1 ; then | |
06bbab1b BK |
1869 | fixlist="${fixlist} |
1870 | lynxos_fcntl_proto" | |
48bd9529 BK |
1871 | if [ ! -r ${DESTFILE} ] |
1872 | then infile=${file} | |
1873 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
1874 | |
1875 | sed -e 's/\(fcntl.*(int, int, \)int)/\1...)/' \ | |
0cb97c8d | 1876 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
1877 | rm -f ${DESTFILE} |
1878 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 1879 | fi # end of select 'if' |
06bbab1b BK |
1880 | ;; # case end for file name test |
1881 | esac | |
1882 | ||
1883 | ||
1884 | # | |
87ad679b | 1885 | # Fix M88k_Bad_Hypot_Opt |
06bbab1b | 1886 | # |
48bd9529 | 1887 | case "${file}" in ./math.h ) |
06bbab1b BK |
1888 | case "$target_canonical" in m88k-motorola-sysv3* ) |
1889 | fixlist="${fixlist} | |
1890 | m88k_bad_hypot_opt" | |
48bd9529 BK |
1891 | if [ ! -r ${DESTFILE} ] |
1892 | then infile=${file} | |
1893 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
1894 | |
1895 | sed -e 's/extern double floor(), ceil(), fmod(), fabs();/extern double floor(), ceil(), fmod(), fabs _PARAMS((double));/' \ | |
1896 | -e '/^extern double hypot();$/a\ | |
1897 | \/* Workaround a stupid Motorola optimization if one\ | |
1898 | of x or y is 0.0 and the other is negative! *\/\ | |
1899 | #ifdef __STDC__\ | |
1900 | static __inline__ double fake_hypot (double x, double y)\ | |
1901 | #else\ | |
1902 | static __inline__ double fake_hypot (x, y)\ | |
1903 | double x, y;\ | |
1904 | #endif\ | |
1905 | {\ | |
1906 | return fabs (hypot (x, y));\ | |
1907 | }\ | |
1908 | #define hypot fake_hypot | |
1909 | ' \ | |
0cb97c8d | 1910 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
1911 | rm -f ${DESTFILE} |
1912 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
06bbab1b BK |
1913 | ;; # case end for machine type test |
1914 | esac | |
1915 | ;; # case end for file name test | |
1916 | esac | |
1917 | ||
1918 | ||
1919 | # | |
87ad679b | 1920 | # Fix M88k_Bad_S_If |
06bbab1b | 1921 | # |
48bd9529 | 1922 | case "${file}" in ./sys/stat.h ) |
06bbab1b | 1923 | case "$target_canonical" in m88k-*-sysv3* ) |
48bd9529 | 1924 | if ( test -n "`egrep '#define[ ]+S_IS[A-Z]*(m)[ ]' ${file}`" |
06bbab1b BK |
1925 | ) > /dev/null 2>&1 ; then |
1926 | fixlist="${fixlist} | |
1927 | m88k_bad_s_if" | |
48bd9529 BK |
1928 | if [ ! -r ${DESTFILE} ] |
1929 | then infile=${file} | |
1930 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
1931 | |
1932 | sed -e 's/^\(#define[ ]*S_IS[A-Z]*(m)\)[ ]*(m[ ]*&[ ]*\(S_IF[A-Z][A-Z][A-Z][A-Z]*\)[ ]*)/\1 (((m)\&S_IFMT)==\2)/' \ | |
1933 | -e 's/^\(#define[ ]*S_IS[A-Z]*(m)\)[ ]*(m[ ]*&[ ]*\(0[0-9]*\)[ ]*)/\1 (((m)\&S_IFMT)==\2)/' \ | |
0cb97c8d | 1934 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
1935 | rm -f ${DESTFILE} |
1936 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 1937 | fi # end of select 'if' |
06bbab1b BK |
1938 | ;; # case end for machine type test |
1939 | esac | |
1940 | ;; # case end for file name test | |
1941 | esac | |
1942 | ||
1943 | ||
1944 | # | |
87ad679b | 1945 | # Fix M88k_Multi_Incl |
06bbab1b | 1946 | # |
48bd9529 | 1947 | case "${file}" in ./time.h ) |
06bbab1b | 1948 | case "$target_canonical" in m88k-tektronix-sysv3* ) |
d7eb5a45 | 1949 | if ( test -z "`egrep '#ifndef' ${file}`" |
06bbab1b BK |
1950 | ) > /dev/null 2>&1 ; then |
1951 | fixlist="${fixlist} | |
1952 | m88k_multi_incl" | |
48bd9529 BK |
1953 | if [ ! -r ${DESTFILE} ] |
1954 | then infile=${file} | |
1955 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
1956 | ( echo Fixing $file, to protect against multiple inclusion. >&2 |
1957 | cpp_wrapper=`echo $file | sed -e 's,\.,_,g' -e 's,/,_,g'` | |
48bd9529 BK |
1958 | echo "#ifndef __GCC_GOT_${cpp_wrapper}_" |
1959 | echo "#define __GCC_GOT_${cpp_wrapper}_" | |
1960 | cat | |
0cb97c8d | 1961 | echo "#endif /* ! __GCC_GOT_${cpp_wrapper}_ */" ) < $infile > ${DESTDIR}/fixinc.tmp |
06bbab1b BK |
1962 | |
1963 | # Shell scripts have the potential of removing the output | |
1964 | # We interpret that to mean the file is not to be altered | |
1965 | # | |
48bd9529 | 1966 | if test ! -f ${DESTDIR}/fixinc.tmp |
06bbab1b | 1967 | then continue ; fi |
48bd9529 BK |
1968 | rm -f ${DESTFILE} |
1969 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 1970 | fi # end of bypass 'if' |
06bbab1b BK |
1971 | ;; # case end for machine type test |
1972 | esac | |
1973 | ;; # case end for file name test | |
1974 | esac | |
1975 | ||
1976 | ||
3be1fb72 ZW |
1977 | # |
1978 | # Fix Machine_Ansi_H_Va_List | |
1979 | # | |
1980 | case "${file}" in ./machine/ansi.h ) | |
1981 | if ( test -n "`egrep '_BSD_VA_LIST_' ${file}`" | |
1982 | ) > /dev/null 2>&1 ; then | |
1983 | if ( test -z "`egrep '__builtin_va_list' ${file}`" | |
1984 | ) > /dev/null 2>&1 ; then | |
1985 | fixlist="${fixlist} | |
1986 | machine_ansi_h_va_list" | |
1987 | if [ ! -r ${DESTFILE} ] | |
1988 | then infile=${file} | |
1989 | else infile=${DESTFILE} ; fi | |
1990 | ||
1991 | sed -e 's/\(_BSD_VA_LIST_[ ][ ]*\).*$/\1__builtin_va_list/' \ | |
1992 | < $infile > ${DESTDIR}/fixinc.tmp | |
1993 | rm -f ${DESTFILE} | |
1994 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
1995 | fi # end of bypass 'if' | |
1996 | fi # end of select 'if' | |
1997 | ;; # case end for file name test | |
1998 | esac | |
1999 | ||
2000 | ||
06bbab1b | 2001 | # |
87ad679b | 2002 | # Fix Machine_Name |
06bbab1b | 2003 | # |
52c207e2 ZW |
2004 | if ${FIXTESTS} ${file} machine_name |
2005 | then | |
06bbab1b BK |
2006 | fixlist="${fixlist} |
2007 | machine_name" | |
48bd9529 BK |
2008 | if [ ! -r ${DESTFILE} ] |
2009 | then infile=${file} | |
2010 | else infile=${DESTFILE} ; fi | |
52c207e2 | 2011 | ${FIXFIXES} ${file} machine_name < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
2012 | rm -f ${DESTFILE} |
2013 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
52c207e2 | 2014 | fi # end of c_test 'if' |
06bbab1b BK |
2015 | |
2016 | ||
2017 | # | |
87ad679b | 2018 | # Fix Math_Exception |
06bbab1b | 2019 | # |
48bd9529 BK |
2020 | case "${file}" in ./math.h ) |
2021 | if ( test -n "`egrep 'struct exception' ${file}`" | |
06bbab1b | 2022 | ) > /dev/null 2>&1 ; then |
5c0d5b94 | 2023 | if ( test -z "`egrep 'We have a problem when using C\\+\\+' ${file}`" |
d7eb5a45 | 2024 | ) > /dev/null 2>&1 ; then |
06bbab1b BK |
2025 | fixlist="${fixlist} |
2026 | math_exception" | |
48bd9529 BK |
2027 | if [ ! -r ${DESTFILE} ] |
2028 | then infile=${file} | |
2029 | else infile=${DESTFILE} ; fi | |
06bbab1b | 2030 | |
78a0d70c | 2031 | sed -e '1i\ |
06bbab1b BK |
2032 | #ifdef __cplusplus\ |
2033 | #define exception __math_exception\ | |
2034 | #endif | |
2035 | ' \ | |
78a0d70c | 2036 | -e '$a\ |
06bbab1b BK |
2037 | #ifdef __cplusplus\ |
2038 | #undef exception\ | |
2039 | #endif | |
06bbab1b | 2040 | ' \ |
0cb97c8d | 2041 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
2042 | rm -f ${DESTFILE} |
2043 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
d7eb5a45 | 2044 | fi # end of bypass 'if' |
5abc1f74 | 2045 | fi # end of select 'if' |
06bbab1b BK |
2046 | ;; # case end for file name test |
2047 | esac | |
2048 | ||
2049 | ||
2050 | # | |
87ad679b | 2051 | # Fix Math_Huge_Val_From_Dbl_Max |
06bbab1b | 2052 | # |
48bd9529 | 2053 | case "${file}" in ./math.h ) |
d7eb5a45 ZW |
2054 | if ( test -n "`egrep 'define[ ]*HUGE_VAL[ ]*DBL_MAX' ${file}`" |
2055 | ) > /dev/null 2>&1 ; then | |
2056 | if ( test -z "`egrep 'define[ ]*DBL_MAX' ${file}`" | |
2057 | ) > /dev/null 2>&1 ; then | |
06bbab1b | 2058 | fixlist="${fixlist} |
d7eb5a45 | 2059 | math_huge_val_from_dbl_max" |
48bd9529 BK |
2060 | if [ ! -r ${DESTFILE} ] |
2061 | then infile=${file} | |
2062 | else infile=${DESTFILE} ; fi | |
2063 | ( dbl_max_def=`egrep 'define[ ]+DBL_MAX[ ]+.*' float.h 2>/dev/null` | |
06bbab1b | 2064 | |
d7eb5a45 ZW |
2065 | if ( test -n "${dbl_max_def}" ) > /dev/null 2>&1 |
2066 | then sed -e '/define[ ]*HUGE_VAL[ ]*DBL_MAX/s/DBL_MAX/'"$dbl_max_def/" | |
2067 | else cat | |
2068 | fi ) < $infile > ${DESTDIR}/fixinc.tmp | |
06bbab1b BK |
2069 | |
2070 | # Shell scripts have the potential of removing the output | |
2071 | # We interpret that to mean the file is not to be altered | |
2072 | # | |
48bd9529 | 2073 | if test ! -f ${DESTDIR}/fixinc.tmp |
06bbab1b | 2074 | then continue ; fi |
48bd9529 BK |
2075 | rm -f ${DESTFILE} |
2076 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
d7eb5a45 ZW |
2077 | fi # end of bypass 'if' |
2078 | fi # end of select 'if' | |
2079 | ;; # case end for file name test | |
2080 | esac | |
2081 | ||
2082 | ||
2083 | # | |
87ad679b | 2084 | # Fix Math_Huge_Val_Ifndef |
d7eb5a45 ZW |
2085 | # |
2086 | case "${file}" in ./math/math.h ) | |
2087 | if ( test -n "`egrep 'define[ ]*HUGE_VAL' ${file}`" | |
2088 | ) > /dev/null 2>&1 ; then | |
2089 | fixlist="${fixlist} | |
2090 | math_huge_val_ifndef" | |
2091 | if [ ! -r ${DESTFILE} ] | |
2092 | then infile=${file} | |
2093 | else infile=${DESTFILE} ; fi | |
2094 | ||
2095 | sed -e '/define[ ]HUGE_VAL[ ]/i\ | |
2096 | #ifndef HUGE_VAL | |
2097 | ' \ | |
2098 | -e '/define[ ]HUGE_VAL[ ]/a\ | |
2099 | #endif | |
2100 | ' \ | |
2101 | < $infile > ${DESTDIR}/fixinc.tmp | |
2102 | rm -f ${DESTFILE} | |
2103 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
2104 | fi # end of select 'if' | |
06bbab1b BK |
2105 | ;; # case end for file name test |
2106 | esac | |
2107 | ||
2108 | ||
2109 | # | |
87ad679b | 2110 | # Fix Nested_Comment |
06bbab1b | 2111 | # |
48bd9529 | 2112 | case "${file}" in ./rpc/rpc.h ) |
06bbab1b BK |
2113 | fixlist="${fixlist} |
2114 | nested_comment" | |
48bd9529 BK |
2115 | if [ ! -r ${DESTFILE} ] |
2116 | then infile=${file} | |
2117 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
2118 | |
2119 | sed -e 's@^\(/\*.*rpc/auth_des.h>.*\)/\*@\1*/ /*@' \ | |
0cb97c8d | 2120 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
2121 | rm -f ${DESTFILE} |
2122 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
06bbab1b BK |
2123 | ;; # case end for file name test |
2124 | esac | |
2125 | ||
2126 | ||
2127 | # | |
87ad679b | 2128 | # Fix News_Os_Recursion |
06bbab1b | 2129 | # |
48bd9529 BK |
2130 | case "${file}" in ./stdlib.h ) |
2131 | if ( test -n "`egrep '#include <stdlib.h>' ${file}`" | |
06bbab1b BK |
2132 | ) > /dev/null 2>&1 ; then |
2133 | fixlist="${fixlist} | |
2134 | news_os_recursion" | |
48bd9529 BK |
2135 | if [ ! -r ${DESTFILE} ] |
2136 | then infile=${file} | |
2137 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
2138 | |
2139 | sed -e '/^#include <stdlib.h>/i\ | |
2140 | #ifdef BOGUS_RECURSION | |
2141 | ' \ | |
2142 | -e '/^#include <stdlib.h>/a\ | |
2143 | #endif | |
2144 | ' \ | |
0cb97c8d | 2145 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
2146 | rm -f ${DESTFILE} |
2147 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 2148 | fi # end of select 'if' |
06bbab1b BK |
2149 | ;; # case end for file name test |
2150 | esac | |
2151 | ||
2152 | ||
2153 | # | |
87ad679b | 2154 | # Fix Next_Math_Prefix |
06bbab1b | 2155 | # |
48bd9529 BK |
2156 | case "${file}" in ./ansi/math.h ) |
2157 | if ( test -n "`egrep '^extern.*double.*__const__.*' ${file}`" | |
06bbab1b BK |
2158 | ) > /dev/null 2>&1 ; then |
2159 | fixlist="${fixlist} | |
2160 | next_math_prefix" | |
48bd9529 BK |
2161 | if [ ! -r ${DESTFILE} ] |
2162 | then infile=${file} | |
2163 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
2164 | |
2165 | sed -e '/^extern.*double.*__const__.*sqrt(/s/__const__//' \ | |
2166 | -e '/^extern.*double.*__const__.*fabs(/s/__const__//' \ | |
2167 | -e '/^extern.*double.*__const__.*cos(/s/__const__//' \ | |
2168 | -e '/^extern.*double.*__const__.*hypot(/s/__const__//' \ | |
2169 | -e '/^extern.*double.*__const__.*sin(/s/__const__//' \ | |
0cb97c8d | 2170 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
2171 | rm -f ${DESTFILE} |
2172 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 2173 | fi # end of select 'if' |
06bbab1b BK |
2174 | ;; # case end for file name test |
2175 | esac | |
2176 | ||
2177 | ||
2178 | # | |
87ad679b | 2179 | # Fix Next_Template |
06bbab1b | 2180 | # |
48bd9529 BK |
2181 | case "${file}" in ./bsd/libc.h ) |
2182 | if ( test -n "`egrep 'template' ${file}`" | |
06bbab1b BK |
2183 | ) > /dev/null 2>&1 ; then |
2184 | fixlist="${fixlist} | |
2185 | next_template" | |
48bd9529 BK |
2186 | if [ ! -r ${DESTFILE} ] |
2187 | then infile=${file} | |
2188 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
2189 | |
2190 | sed -e '/\(.*template\)/s/template//' \ | |
2191 | -e '/extern.*volatile.*void.*abort/s/volatile//' \ | |
0cb97c8d | 2192 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
2193 | rm -f ${DESTFILE} |
2194 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 2195 | fi # end of select 'if' |
06bbab1b BK |
2196 | ;; # case end for file name test |
2197 | esac | |
2198 | ||
2199 | ||
2200 | # | |
87ad679b | 2201 | # Fix Next_Volitile |
06bbab1b | 2202 | # |
48bd9529 BK |
2203 | case "${file}" in ./ansi/stdlib.h ) |
2204 | if ( test -n "`egrep 'volatile' ${file}`" | |
06bbab1b BK |
2205 | ) > /dev/null 2>&1 ; then |
2206 | fixlist="${fixlist} | |
2207 | next_volitile" | |
48bd9529 BK |
2208 | if [ ! -r ${DESTFILE} ] |
2209 | then infile=${file} | |
2210 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
2211 | |
2212 | sed -e '/extern.*volatile.*void.*exit/s/volatile//' \ | |
2213 | -e '/extern.*volatile.*void.*abort/s/volatile//' \ | |
0cb97c8d | 2214 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
2215 | rm -f ${DESTFILE} |
2216 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 2217 | fi # end of select 'if' |
06bbab1b BK |
2218 | ;; # case end for file name test |
2219 | esac | |
2220 | ||
2221 | ||
2222 | # | |
87ad679b | 2223 | # Fix Next_Wait_Union |
06bbab1b | 2224 | # |
48bd9529 BK |
2225 | case "${file}" in ./sys/wait.h ) |
2226 | if ( test -n "`egrep 'wait\\(union wait' ${file}`" | |
06bbab1b BK |
2227 | ) > /dev/null 2>&1 ; then |
2228 | fixlist="${fixlist} | |
2229 | next_wait_union" | |
48bd9529 BK |
2230 | if [ ! -r ${DESTFILE} ] |
2231 | then infile=${file} | |
2232 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
2233 | |
2234 | sed -e 's@wait(union wait@wait(void@' \ | |
0cb97c8d | 2235 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
2236 | rm -f ${DESTFILE} |
2237 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 2238 | fi # end of select 'if' |
06bbab1b BK |
2239 | ;; # case end for file name test |
2240 | esac | |
2241 | ||
2242 | ||
2243 | # | |
87ad679b | 2244 | # Fix Nodeent_Syntax |
06bbab1b | 2245 | # |
48bd9529 | 2246 | case "${file}" in ./netdnet/dnetdb.h ) |
06bbab1b BK |
2247 | fixlist="${fixlist} |
2248 | nodeent_syntax" | |
48bd9529 BK |
2249 | if [ ! -r ${DESTFILE} ] |
2250 | then infile=${file} | |
2251 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
2252 | |
2253 | sed -e 's/char.*na_addr *$/char *na_addr;/' \ | |
0cb97c8d | 2254 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
2255 | rm -f ${DESTFILE} |
2256 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
06bbab1b BK |
2257 | ;; # case end for file name test |
2258 | esac | |
2259 | ||
2260 | ||
2261 | # | |
87ad679b | 2262 | # Fix Osf_Namespace_A |
06bbab1b | 2263 | # |
48bd9529 | 2264 | case "${file}" in ./reg_types.h | \ |
06bbab1b | 2265 | ./sys/lc_core.h ) |
48bd9529 BK |
2266 | if ( test '(' -r reg_types.h ')' -a \ |
2267 | '(' -r sys/lc_core.h ')' -a \ | |
2268 | '(' -n "`grep '} regex_t;' reg_types.h`" ')' -a \ | |
2269 | '(' -z "`grep __regex_t regex.h`" ')' | |
06bbab1b BK |
2270 | ) > /dev/null 2>&1 ; then |
2271 | fixlist="${fixlist} | |
2272 | osf_namespace_a" | |
48bd9529 BK |
2273 | if [ ! -r ${DESTFILE} ] |
2274 | then infile=${file} | |
2275 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
2276 | |
2277 | sed -e 's/regex_t/__regex_t/g' \ | |
2278 | -e 's/regoff_t/__regoff_t/g' \ | |
2279 | -e 's/regmatch_t/__regmatch_t/g' \ | |
0cb97c8d | 2280 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
2281 | rm -f ${DESTFILE} |
2282 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 2283 | fi # end of test expression 'if' |
06bbab1b BK |
2284 | ;; # case end for file name test |
2285 | esac | |
2286 | ||
2287 | ||
2288 | # | |
87ad679b | 2289 | # Fix Osf_Namespace_B |
06bbab1b | 2290 | # |
48bd9529 BK |
2291 | case "${file}" in ./regex.h ) |
2292 | if ( test '(' -r reg_types.h ')' -a \ | |
2293 | '(' -r sys/lc_core.h ')' -a \ | |
2294 | '(' -n "`grep '} regex_t;' reg_types.h`" ')' -a \ | |
2295 | '(' -z "`grep __regex_t regex.h`" ')' | |
06bbab1b BK |
2296 | ) > /dev/null 2>&1 ; then |
2297 | fixlist="${fixlist} | |
2298 | osf_namespace_b" | |
48bd9529 BK |
2299 | if [ ! -r ${DESTFILE} ] |
2300 | then infile=${file} | |
2301 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
2302 | |
2303 | sed -e '/#include <reg_types.h>/a\ | |
2304 | typedef __regex_t regex_t;\ | |
2305 | typedef __regoff_t regoff_t;\ | |
2306 | typedef __regmatch_t regmatch_t; | |
2307 | ' \ | |
0cb97c8d | 2308 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
2309 | rm -f ${DESTFILE} |
2310 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 2311 | fi # end of test expression 'if' |
06bbab1b BK |
2312 | ;; # case end for file name test |
2313 | esac | |
2314 | ||
2315 | ||
2316 | # | |
87ad679b | 2317 | # Fix Pthread_Page_Size |
06bbab1b | 2318 | # |
48bd9529 BK |
2319 | case "${file}" in ./pthread.h ) |
2320 | if ( test -n "`egrep '^int __page_size' ${file}`" | |
06bbab1b BK |
2321 | ) > /dev/null 2>&1 ; then |
2322 | fixlist="${fixlist} | |
2323 | pthread_page_size" | |
48bd9529 BK |
2324 | if [ ! -r ${DESTFILE} ] |
2325 | then infile=${file} | |
2326 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
2327 | |
2328 | sed -e 's/^int __page_size/extern int __page_size/' \ | |
0cb97c8d | 2329 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
2330 | rm -f ${DESTFILE} |
2331 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 2332 | fi # end of select 'if' |
06bbab1b BK |
2333 | ;; # case end for file name test |
2334 | esac | |
2335 | ||
2336 | ||
2337 | # | |
87ad679b | 2338 | # Fix Read_Ret_Type |
d71ef9d4 BK |
2339 | # |
2340 | case "${file}" in ./stdio.h ) | |
2341 | if ( test -n "`egrep 'extern int .*, fread\\(\\), fwrite\\(\\)' ${file}`" | |
2342 | ) > /dev/null 2>&1 ; then | |
2343 | fixlist="${fixlist} | |
2344 | read_ret_type" | |
2345 | if [ ! -r ${DESTFILE} ] | |
2346 | then infile=${file} | |
2347 | else infile=${DESTFILE} ; fi | |
2348 | ||
2349 | sed -e 's/^\(extern int fclose(), fflush()\), \(fread(), fwrite()\)\(.*\)$/extern unsigned int \2;\ | |
2350 | \1\3/' \ | |
2351 | < $infile > ${DESTDIR}/fixinc.tmp | |
2352 | rm -f ${DESTFILE} | |
2353 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 2354 | fi # end of select 'if' |
d71ef9d4 BK |
2355 | ;; # case end for file name test |
2356 | esac | |
2357 | ||
2358 | ||
2359 | # | |
87ad679b | 2360 | # Fix Rs6000_Double |
06bbab1b | 2361 | # |
48bd9529 BK |
2362 | case "${file}" in ./math.h ) |
2363 | if ( test -n "`egrep '[^a-zA-Z_]class\\(' ${file}`" | |
06bbab1b BK |
2364 | ) > /dev/null 2>&1 ; then |
2365 | fixlist="${fixlist} | |
2366 | rs6000_double" | |
48bd9529 BK |
2367 | if [ ! -r ${DESTFILE} ] |
2368 | then infile=${file} | |
2369 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
2370 | |
2371 | sed -e '/class[(]/i\ | |
2372 | #ifndef __cplusplus | |
2373 | ' \ | |
2374 | -e '/class[(]/a\ | |
2375 | #endif | |
2376 | ' \ | |
0cb97c8d | 2377 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
2378 | rm -f ${DESTFILE} |
2379 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 2380 | fi # end of select 'if' |
06bbab1b BK |
2381 | ;; # case end for file name test |
2382 | esac | |
2383 | ||
2384 | ||
2385 | # | |
87ad679b | 2386 | # Fix Rs6000_Fchmod |
06bbab1b | 2387 | # |
48bd9529 BK |
2388 | case "${file}" in ./sys/stat.h ) |
2389 | if ( test -n "`egrep 'fchmod\\(char' ${file}`" | |
06bbab1b BK |
2390 | ) > /dev/null 2>&1 ; then |
2391 | fixlist="${fixlist} | |
2392 | rs6000_fchmod" | |
48bd9529 BK |
2393 | if [ ! -r ${DESTFILE} ] |
2394 | then infile=${file} | |
2395 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
2396 | |
2397 | sed -e 's/fchmod(char \*/fchmod(int/' \ | |
0cb97c8d | 2398 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
2399 | rm -f ${DESTFILE} |
2400 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 2401 | fi # end of select 'if' |
06bbab1b BK |
2402 | ;; # case end for file name test |
2403 | esac | |
2404 | ||
2405 | ||
2406 | # | |
87ad679b | 2407 | # Fix Rs6000_Param |
06bbab1b | 2408 | # |
48bd9529 | 2409 | case "${file}" in ./stdio.h | \ |
06bbab1b | 2410 | ./unistd.h ) |
d7eb5a45 ZW |
2411 | if ( test -n "`egrep 'const char new' ${file}`" |
2412 | ) > /dev/null 2>&1 ; then | |
06bbab1b BK |
2413 | fixlist="${fixlist} |
2414 | rs6000_param" | |
48bd9529 BK |
2415 | if [ ! -r ${DESTFILE} ] |
2416 | then infile=${file} | |
2417 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
2418 | |
2419 | sed -e 's@rename(const char \*old, const char \*new)@rename(const char *_old, const char *_new)@' \ | |
0cb97c8d | 2420 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
2421 | rm -f ${DESTFILE} |
2422 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
d7eb5a45 | 2423 | fi # end of select 'if' |
06bbab1b BK |
2424 | ;; # case end for file name test |
2425 | esac | |
2426 | ||
2427 | ||
2428 | # | |
87ad679b | 2429 | # Fix Sony_Include |
06bbab1b | 2430 | # |
48bd9529 BK |
2431 | case "${file}" in ./machine/machparam.h ) |
2432 | if ( test -n "`egrep '\"\\.\\./machine/endian.h\"' ${file}`" | |
06bbab1b BK |
2433 | ) > /dev/null 2>&1 ; then |
2434 | fixlist="${fixlist} | |
2435 | sony_include" | |
48bd9529 BK |
2436 | if [ ! -r ${DESTFILE} ] |
2437 | then infile=${file} | |
2438 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
2439 | |
2440 | sed -e 's@"../machine/endian.h"@<machine/endian.h>@' \ | |
0cb97c8d | 2441 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
2442 | rm -f ${DESTFILE} |
2443 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 2444 | fi # end of select 'if' |
06bbab1b BK |
2445 | ;; # case end for file name test |
2446 | esac | |
2447 | ||
2448 | ||
2449 | # | |
87ad679b | 2450 | # Fix Statsswtch |
06bbab1b | 2451 | # |
48bd9529 BK |
2452 | case "${file}" in ./rpcsvc/rstat.h ) |
2453 | if ( test -n "`egrep 'boottime$' ${file}`" | |
06bbab1b BK |
2454 | ) > /dev/null 2>&1 ; then |
2455 | fixlist="${fixlist} | |
2456 | statsswtch" | |
48bd9529 BK |
2457 | if [ ! -r ${DESTFILE} ] |
2458 | then infile=${file} | |
2459 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
2460 | |
2461 | sed -e 's/boottime$/boottime;/' \ | |
0cb97c8d | 2462 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
2463 | rm -f ${DESTFILE} |
2464 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 2465 | fi # end of select 'if' |
06bbab1b BK |
2466 | ;; # case end for file name test |
2467 | esac | |
2468 | ||
2469 | ||
2470 | # | |
3be1fb72 | 2471 | # Fix Stdio_Stdarg_H |
06bbab1b | 2472 | # |
48bd9529 | 2473 | case "${file}" in ./stdio.h ) |
3be1fb72 | 2474 | if ( test -z "`egrep 'include.*(stdarg.h|machine/ansi.h)' ${file}`" |
d7eb5a45 | 2475 | ) > /dev/null 2>&1 ; then |
06bbab1b | 2476 | fixlist="${fixlist} |
3be1fb72 | 2477 | stdio_stdarg_h" |
48bd9529 BK |
2478 | if [ ! -r ${DESTFILE} ] |
2479 | then infile=${file} | |
2480 | else infile=${DESTFILE} ; fi | |
06bbab1b | 2481 | |
3be1fb72 ZW |
2482 | sed -e '1i\ |
2483 | #define __need___va_list\ | |
2484 | #include <stdarg.h> | |
2485 | ' \ | |
2486 | < $infile > ${DESTDIR}/fixinc.tmp | |
2487 | rm -f ${DESTFILE} | |
2488 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
2489 | fi # end of bypass 'if' | |
2490 | ;; # case end for file name test | |
2491 | esac | |
2492 | ||
06bbab1b | 2493 | |
06bbab1b | 2494 | # |
3be1fb72 ZW |
2495 | # Fix Stdio_Va_List |
2496 | # | |
2497 | case "${file}" in ./stdio.h ) | |
2498 | if ( test -z "`egrep '__gnuc_va_list|_BSD_VA_LIST_' ${file}`" | |
2499 | ) > /dev/null 2>&1 ; then | |
2500 | fixlist="${fixlist} | |
2501 | stdio_va_list" | |
2502 | if [ ! -r ${DESTFILE} ] | |
2503 | then infile=${file} | |
2504 | else infile=${DESTFILE} ; fi | |
2505 | ||
2506 | sed -e 's@ va_list @ __gnuc_va_list @ | |
2507 | s@ va_list)@ __gnuc_va_list)@ | |
2508 | s@ _VA_LIST_));@ __gnuc_va_list));@ | |
2509 | s@ va_list@ __not_va_list__@ | |
2510 | s@\*va_list@*__not_va_list__@ | |
2511 | s@ __va_list)@ __gnuc_va_list)@ | |
b6412bae | 2512 | s@typedef[ ]\(.*\)[ ]va_list[ ]*;@typedef \1 __not_va_list__;@ |
3be1fb72 ZW |
2513 | s@GNUC_VA_LIST@GNUC_Va_LIST@ |
2514 | s@_NEED___VA_LIST@_NEED___Va_LIST@ | |
2515 | s@VA_LIST@DUMMY_VA_LIST@ | |
2516 | s@_Va_LIST@_VA_LIST@' \ | |
2517 | < $infile > ${DESTDIR}/fixinc.tmp | |
48bd9529 BK |
2518 | rm -f ${DESTFILE} |
2519 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
d7eb5a45 | 2520 | fi # end of bypass 'if' |
06bbab1b BK |
2521 | ;; # case end for file name test |
2522 | esac | |
2523 | ||
2524 | ||
2525 | # | |
87ad679b | 2526 | # Fix Sun_Bogus_Ifdef |
06bbab1b | 2527 | # |
48bd9529 | 2528 | case "${file}" in ./hsfs/hsfs_spec.h | \ |
06bbab1b | 2529 | ./hsfs/iso_spec.h ) |
48bd9529 | 2530 | if ( test -n "`egrep '#ifdef __i386__ || __vax__' ${file}`" |
06bbab1b BK |
2531 | ) > /dev/null 2>&1 ; then |
2532 | fixlist="${fixlist} | |
2533 | sun_bogus_ifdef" | |
48bd9529 BK |
2534 | if [ ! -r ${DESTFILE} ] |
2535 | then infile=${file} | |
2536 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
2537 | |
2538 | sed -e 's/\#ifdef __i386__ || __vax__/\#if __i386__ || __vax__/g' \ | |
0cb97c8d | 2539 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
2540 | rm -f ${DESTFILE} |
2541 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 2542 | fi # end of select 'if' |
06bbab1b BK |
2543 | ;; # case end for file name test |
2544 | esac | |
2545 | ||
2546 | ||
2547 | # | |
87ad679b | 2548 | # Fix Sun_Bogus_Ifdef_Sun4c |
06bbab1b | 2549 | # |
48bd9529 BK |
2550 | case "${file}" in ./hsfs/hsnode.h ) |
2551 | if ( test -n "`egrep '#ifdef __i386__ || __sun4c__' ${file}`" | |
06bbab1b BK |
2552 | ) > /dev/null 2>&1 ; then |
2553 | fixlist="${fixlist} | |
2554 | sun_bogus_ifdef_sun4c" | |
48bd9529 BK |
2555 | if [ ! -r ${DESTFILE} ] |
2556 | then infile=${file} | |
2557 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
2558 | |
2559 | sed -e 's/\#ifdef __i386__ || __sun4c__/\#if __i386__ || __sun4c__/g' \ | |
0cb97c8d | 2560 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
2561 | rm -f ${DESTFILE} |
2562 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 2563 | fi # end of select 'if' |
06bbab1b BK |
2564 | ;; # case end for file name test |
2565 | esac | |
2566 | ||
2567 | ||
2568 | # | |
87ad679b | 2569 | # Fix Sun_Catmacro |
06bbab1b | 2570 | # |
48bd9529 | 2571 | case "${file}" in ./pixrect/memvar.h ) |
b75b4e92 | 2572 | if ( test -n "`egrep '^#define[ ]+CAT\\(a,b\\)' ${file}`" |
06bbab1b BK |
2573 | ) > /dev/null 2>&1 ; then |
2574 | fixlist="${fixlist} | |
2575 | sun_catmacro" | |
48bd9529 BK |
2576 | if [ ! -r ${DESTFILE} ] |
2577 | then infile=${file} | |
2578 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
2579 | |
2580 | sed -e '/^#define[ ]CAT(a,b)/ i\ | |
2581 | #ifdef __STDC__ \ | |
2582 | #define CAT(a,b) a##b\ | |
2583 | #else | |
2584 | ' \ | |
2585 | -e '/^#define[ ]CAT(a,b)/ a\ | |
2586 | #endif | |
2587 | ' \ | |
0cb97c8d | 2588 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
2589 | rm -f ${DESTFILE} |
2590 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 2591 | fi # end of select 'if' |
06bbab1b BK |
2592 | ;; # case end for file name test |
2593 | esac | |
2594 | ||
2595 | ||
2596 | # | |
87ad679b | 2597 | # Fix Sun_Malloc |
06bbab1b | 2598 | # |
48bd9529 | 2599 | case "${file}" in ./malloc.h ) |
06bbab1b BK |
2600 | fixlist="${fixlist} |
2601 | sun_malloc" | |
48bd9529 BK |
2602 | if [ ! -r ${DESTFILE} ] |
2603 | then infile=${file} | |
2604 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
2605 | |
2606 | sed -e 's/typedef[ ]char \* malloc_t/typedef void \* malloc_t/g' \ | |
2607 | -e 's/int[ ][ ]*free/void free/g' \ | |
2608 | -e 's/char\([ ]*\*[ ]*malloc\)/void\1/g' \ | |
2609 | -e 's/char\([ ]*\*[ ]*realloc\)/void\1/g' \ | |
0cb97c8d | 2610 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
2611 | rm -f ${DESTFILE} |
2612 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
06bbab1b BK |
2613 | ;; # case end for file name test |
2614 | esac | |
2615 | ||
2616 | ||
06bbab1b | 2617 | # |
87ad679b | 2618 | # Fix Sun_Rusers_Semi |
06bbab1b | 2619 | # |
48bd9529 BK |
2620 | case "${file}" in ./rpcsvc/rusers.h ) |
2621 | if ( test -n "`egrep '_cnt$' ${file}`" | |
06bbab1b BK |
2622 | ) > /dev/null 2>&1 ; then |
2623 | fixlist="${fixlist} | |
2624 | sun_rusers_semi" | |
48bd9529 BK |
2625 | if [ ! -r ${DESTFILE} ] |
2626 | then infile=${file} | |
2627 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
2628 | |
2629 | sed -e '/^struct/,/^};/s/_cnt$/_cnt;/' \ | |
0cb97c8d | 2630 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
2631 | rm -f ${DESTFILE} |
2632 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 2633 | fi # end of select 'if' |
06bbab1b BK |
2634 | ;; # case end for file name test |
2635 | esac | |
2636 | ||
2637 | ||
2638 | # | |
87ad679b | 2639 | # Fix Sun_Signal |
06bbab1b | 2640 | # |
48bd9529 | 2641 | case "${file}" in ./sys/signal.h | \ |
06bbab1b | 2642 | ./signal.h ) |
48bd9529 | 2643 | if ( test -n "`egrep '^void \\(\\*signal\\(\\)\\)\\(\\);' ${file}`" |
06bbab1b BK |
2644 | ) > /dev/null 2>&1 ; then |
2645 | fixlist="${fixlist} | |
2646 | sun_signal" | |
48bd9529 BK |
2647 | if [ ! -r ${DESTFILE} ] |
2648 | then infile=${file} | |
2649 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
2650 | |
2651 | sed -e '/^void (\*signal())();$/i\ | |
2652 | #ifdef __cplusplus\ | |
2653 | void (*signal(...))(...);\ | |
2654 | #else | |
2655 | ' \ | |
2656 | -e '/^void (\*signal())();$/a\ | |
2657 | #endif | |
2658 | ' \ | |
0cb97c8d | 2659 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
2660 | rm -f ${DESTFILE} |
2661 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 2662 | fi # end of select 'if' |
06bbab1b BK |
2663 | ;; # case end for file name test |
2664 | esac | |
2665 | ||
2666 | ||
2667 | # | |
87ad679b | 2668 | # Fix Sun_Auth_Proto |
06bbab1b | 2669 | # |
48bd9529 | 2670 | case "${file}" in ./rpc/auth.h | \ |
06bbab1b BK |
2671 | ./rpc/clnt.h | \ |
2672 | ./rpc/svc.h | \ | |
2673 | ./rpc/xdr.h ) | |
b4e01caa | 2674 | if ( test -n "`egrep '\\(\\*[a-z][a-z_]*\\)\\(\\)' ${file}`" |
06bbab1b BK |
2675 | ) > /dev/null 2>&1 ; then |
2676 | fixlist="${fixlist} | |
2677 | sun_auth_proto" | |
48bd9529 BK |
2678 | if [ ! -r ${DESTFILE} ] |
2679 | then infile=${file} | |
2680 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
2681 | |
2682 | sed -e 's/^\(.*(\*[a-z][a-z_]*)(\)\();.*\)/\ | |
2683 | #ifdef __cplusplus\ | |
2684 | \1...\2\ | |
2685 | #else\ | |
2686 | \1\2\ | |
2687 | #endif/' \ | |
0cb97c8d | 2688 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
2689 | rm -f ${DESTFILE} |
2690 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 2691 | fi # end of select 'if' |
06bbab1b BK |
2692 | ;; # case end for file name test |
2693 | esac | |
2694 | ||
2695 | ||
2696 | # | |
87ad679b | 2697 | # Fix Sunos_Matherr_Decl |
06bbab1b | 2698 | # |
48bd9529 | 2699 | case "${file}" in ./math.h ) |
d7eb5a45 ZW |
2700 | if ( test -z "`egrep 'matherr.*struct exception' ${file}`" |
2701 | ) > /dev/null 2>&1 ; then | |
06bbab1b BK |
2702 | fixlist="${fixlist} |
2703 | sunos_matherr_decl" | |
48bd9529 BK |
2704 | if [ ! -r ${DESTFILE} ] |
2705 | then infile=${file} | |
2706 | else infile=${DESTFILE} ; fi | |
06bbab1b | 2707 | |
48bd9529 BK |
2708 | sed -e '/^struct exception/,$b' \ |
2709 | -e '/matherr/i\ | |
06bbab1b BK |
2710 | struct exception; |
2711 | ' \ | |
0cb97c8d | 2712 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
2713 | rm -f ${DESTFILE} |
2714 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
d7eb5a45 | 2715 | fi # end of bypass 'if' |
06bbab1b BK |
2716 | ;; # case end for file name test |
2717 | esac | |
2718 | ||
2719 | ||
2720 | # | |
87ad679b | 2721 | # Fix Sunos_Strlen |
06bbab1b | 2722 | # |
48bd9529 | 2723 | case "${file}" in ./strings.h ) |
d7eb5a45 ZW |
2724 | if ( test -n "`egrep 'int[ ]*strlen' ${file}`" |
2725 | ) > /dev/null 2>&1 ; then | |
06bbab1b BK |
2726 | fixlist="${fixlist} |
2727 | sunos_strlen" | |
48bd9529 BK |
2728 | if [ ! -r ${DESTFILE} ] |
2729 | then infile=${file} | |
2730 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
2731 | |
2732 | sed -e 's/int[ ]*strlen();/__SIZE_TYPE__ strlen();/' \ | |
0cb97c8d | 2733 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
2734 | rm -f ${DESTFILE} |
2735 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
d7eb5a45 | 2736 | fi # end of select 'if' |
06bbab1b BK |
2737 | ;; # case end for file name test |
2738 | esac | |
2739 | ||
2740 | ||
2741 | # | |
87ad679b | 2742 | # Fix Systypes |
06bbab1b | 2743 | # |
48bd9529 | 2744 | case "${file}" in ./sys/types.h | \ |
06bbab1b BK |
2745 | ./stdlib.h | \ |
2746 | ./sys/stdtypes.h | \ | |
2747 | ./stddef.h | \ | |
2748 | ./memory.h | \ | |
2749 | ./unistd.h ) | |
48bd9529 | 2750 | if ( test -n "`egrep 'typedef[ ]+[a-z_][ a-z_]*[ ](size|ptrdiff|wchar)_t' ${file}`" |
06bbab1b BK |
2751 | ) > /dev/null 2>&1 ; then |
2752 | fixlist="${fixlist} | |
2753 | systypes" | |
48bd9529 BK |
2754 | if [ ! -r ${DESTFILE} ] |
2755 | then infile=${file} | |
2756 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
2757 | |
2758 | sed -e '/^[ ]*\*[ ]*typedef unsigned int size_t;/N' \ | |
2759 | -e 's/^\([ ]*\*[ ]*typedef unsigned int size_t;\n[ ]*\*\/\)/\1\ | |
2760 | #ifndef __SIZE_TYPE__\ | |
2761 | #define __SIZE_TYPE__ long unsigned int\ | |
2762 | #endif\ | |
2763 | typedef __SIZE_TYPE__ size_t;\ | |
2764 | /' \ | |
2765 | -e '/typedef[ ][ ]*[a-z_][ a-z_]*[ ]size_t/i\ | |
2766 | #ifndef __SIZE_TYPE__\ | |
2767 | #define __SIZE_TYPE__ long unsigned int\ | |
2768 | #endif | |
2769 | ' \ | |
2770 | -e 's/typedef[ ][ ]*[a-z_][ a-z_]*[ ]size_t/typedef __SIZE_TYPE__ size_t/' \ | |
2771 | -e '/typedef[ ][ ]*[a-z_][ a-z_]*[ ]ptrdiff_t/i\ | |
2772 | #ifndef __PTRDIFF_TYPE__\ | |
2773 | #define __PTRDIFF_TYPE__ long int\ | |
2774 | #endif | |
2775 | ' \ | |
2776 | -e 's/typedef[ ][ ]*[a-z_][ a-z_]*[ ]ptrdiff_t/typedef __PTRDIFF_TYPE__ ptrdiff_t/' \ | |
2777 | -e '/typedef[ ][ ]*[a-z_][ a-z_]*[ ]wchar_t/i\ | |
2778 | #ifndef __WCHAR_TYPE__\ | |
2779 | #define __WCHAR_TYPE__ int\ | |
2780 | #endif\ | |
2781 | #ifndef __cplusplus | |
2782 | ' \ | |
2783 | -e '/typedef[ ][ ]*[a-z_][ a-z_]*[ ]wchar_t/a\ | |
2784 | #endif | |
2785 | ' \ | |
2786 | -e 's/typedef[ ][ ]*[a-z_][ a-z_]*[ ]wchar_t/typedef __WCHAR_TYPE__ wchar_t/' \ | |
0cb97c8d | 2787 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
2788 | rm -f ${DESTFILE} |
2789 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 2790 | fi # end of select 'if' |
06bbab1b BK |
2791 | ;; # case end for file name test |
2792 | esac | |
2793 | ||
2794 | ||
2795 | # | |
3be1fb72 | 2796 | # Fix Systypes_Stdlib_Size_T |
06bbab1b | 2797 | # |
3be1fb72 ZW |
2798 | case "${file}" in ./sys/types.h | \ |
2799 | ./stdlib.h ) | |
5abc1f74 BK |
2800 | if ( test -n "`egrep 'typedef[ ][ ]*[A-Za-z_][ A-Za-z_]*[ ]size_t' ${file}`" |
2801 | ) > /dev/null 2>&1 ; then | |
3be1fb72 | 2802 | if ( test -z "`egrep '_(GCC|BSD)_SIZE_T' ${file}`" |
06bbab1b BK |
2803 | ) > /dev/null 2>&1 ; then |
2804 | fixlist="${fixlist} | |
3be1fb72 | 2805 | systypes_stdlib_size_t" |
48bd9529 BK |
2806 | if [ ! -r ${DESTFILE} ] |
2807 | then infile=${file} | |
2808 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
2809 | |
2810 | sed -e '/typedef[ ][ ]*[A-Za-z_][ A-Za-z_]*[ ]size_t/i\ | |
2811 | #ifndef _GCC_SIZE_T\ | |
2812 | #define _GCC_SIZE_T | |
2813 | ' \ | |
2814 | -e '/typedef[ ][ ]*[A-Za-z_][ A-Za-z_]*[ ]size_t/a\ | |
2815 | #endif | |
2816 | ' \ | |
0cb97c8d | 2817 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
2818 | rm -f ${DESTFILE} |
2819 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 BK |
2820 | fi # end of bypass 'if' |
2821 | fi # end of select 'if' | |
06bbab1b BK |
2822 | ;; # case end for file name test |
2823 | esac | |
2824 | ||
2825 | ||
2826 | # | |
87ad679b | 2827 | # Fix Sysv68_String |
06bbab1b | 2828 | # |
48bd9529 | 2829 | case "${file}" in ./string.h ) |
06bbab1b BK |
2830 | fixlist="${fixlist} |
2831 | sysv68_string" | |
48bd9529 BK |
2832 | if [ ! -r ${DESTFILE} ] |
2833 | then infile=${file} | |
2834 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
2835 | |
2836 | sed -e 's/extern[ ]*int[ ]*strlen();/extern unsigned int strlen();/' \ | |
2837 | -e 's/extern[ ]*int[ ]*ffs[ ]*(long);/extern int ffs(int);/' \ | |
2838 | -e 's/strdup(char \*s1);/strdup(const char *s1);/' \ | |
2839 | -e '/^extern char$/N' \ | |
2840 | -e 's/^extern char\(\n \*memccpy(),\)$/extern void\1/' \ | |
2841 | -e '/^ strncmp(),$/N' \ | |
2842 | -e 's/^\( strncmp()\),\n\( strlen(),\)$/\1;\ | |
2843 | extern unsigned int\ | |
2844 | \2/' \ | |
2845 | -e '/^extern int$/N' \ | |
2846 | -e 's/^extern int\(\n strlen(),\)/extern size_t\1/' \ | |
0cb97c8d | 2847 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
2848 | rm -f ${DESTFILE} |
2849 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
06bbab1b BK |
2850 | ;; # case end for file name test |
2851 | esac | |
2852 | ||
2853 | ||
2854 | # | |
87ad679b | 2855 | # Fix Sysz_Stdlib_For_Sun |
06bbab1b | 2856 | # |
48bd9529 | 2857 | case "${file}" in ./stdlib.h ) |
06bbab1b BK |
2858 | fixlist="${fixlist} |
2859 | sysz_stdlib_for_sun" | |
48bd9529 BK |
2860 | if [ ! -r ${DESTFILE} ] |
2861 | then infile=${file} | |
2862 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
2863 | |
2864 | sed -e 's/int abort/void abort/g' \ | |
2865 | -e 's/int free/void free/g' \ | |
2866 | -e 's/char[ ]*\*[ ]*calloc/void \* calloc/g' \ | |
2867 | -e 's/char[ ]*\*[ ]*malloc/void \* malloc/g' \ | |
2868 | -e 's/char[ ]*\*[ ]*realloc/void \* realloc/g' \ | |
c354f40d | 2869 | -e 's/char[ ]*\*[ ]*bsearch/void \* bsearch/g' \ |
06bbab1b | 2870 | -e 's/int[ ][ ]*exit/void exit/g' \ |
0cb97c8d | 2871 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
2872 | rm -f ${DESTFILE} |
2873 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
06bbab1b BK |
2874 | ;; # case end for file name test |
2875 | esac | |
2876 | ||
2877 | ||
2878 | # | |
87ad679b | 2879 | # Fix Sysz_Stdtypes_For_Sun |
06bbab1b | 2880 | # |
48bd9529 | 2881 | case "${file}" in ./sys/stdtypes.h ) |
06bbab1b BK |
2882 | fixlist="${fixlist} |
2883 | sysz_stdtypes_for_sun" | |
48bd9529 BK |
2884 | if [ ! -r ${DESTFILE} ] |
2885 | then infile=${file} | |
2886 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
2887 | |
2888 | sed -e '/[ ]size_t.*;/i\ | |
2889 | #ifndef _GCC_SIZE_T\ | |
2890 | #define _GCC_SIZE_T | |
2891 | ' \ | |
2892 | -e '/[ ]size_t.*;/a\ | |
2893 | #endif | |
2894 | ' \ | |
2895 | -e '/[ ]ptrdiff_t.*;/i\ | |
2896 | #ifndef _GCC_PTRDIFF_T\ | |
2897 | #define _GCC_PTRDIFF_T | |
2898 | ' \ | |
2899 | -e '/[ ]ptrdiff_t.*;/a\ | |
2900 | #endif | |
2901 | ' \ | |
2902 | -e '/[ ]wchar_t.*;/i\ | |
2903 | #ifndef _GCC_WCHAR_T\ | |
2904 | #define _GCC_WCHAR_T | |
2905 | ' \ | |
2906 | -e '/[ ]wchar_t.*;/a\ | |
2907 | #endif | |
2908 | ' \ | |
0cb97c8d | 2909 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
2910 | rm -f ${DESTFILE} |
2911 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
06bbab1b BK |
2912 | ;; # case end for file name test |
2913 | esac | |
2914 | ||
2915 | ||
2916 | # | |
87ad679b | 2917 | # Fix Tinfo_Cplusplus |
06bbab1b | 2918 | # |
48bd9529 | 2919 | case "${file}" in ./tinfo.h ) |
d7eb5a45 ZW |
2920 | if ( test -n "`egrep '[ ]_cplusplus' ${file}`" |
2921 | ) > /dev/null 2>&1 ; then | |
06bbab1b BK |
2922 | fixlist="${fixlist} |
2923 | tinfo_cplusplus" | |
48bd9529 BK |
2924 | if [ ! -r ${DESTFILE} ] |
2925 | then infile=${file} | |
2926 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
2927 | |
2928 | sed -e 's/[ ]_cplusplus/ __cplusplus/' \ | |
0cb97c8d | 2929 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
2930 | rm -f ${DESTFILE} |
2931 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
d7eb5a45 | 2932 | fi # end of select 'if' |
06bbab1b BK |
2933 | ;; # case end for file name test |
2934 | esac | |
2935 | ||
2936 | ||
06bbab1b | 2937 | # |
87ad679b | 2938 | # Fix Ultrix_Fix_Fixproto |
1f414ac4 | 2939 | # |
48bd9529 BK |
2940 | case "${file}" in ./sys/utsname.h ) |
2941 | if ( test -n "`egrep 'ULTRIX' ${file}`" | |
1f414ac4 BK |
2942 | ) > /dev/null 2>&1 ; then |
2943 | fixlist="${fixlist} | |
2944 | ultrix_fix_fixproto" | |
48bd9529 BK |
2945 | if [ ! -r ${DESTFILE} ] |
2946 | then infile=${file} | |
2947 | else infile=${DESTFILE} ; fi | |
1f414ac4 BK |
2948 | |
2949 | sed -e '/^[ ]*extern[ ]*int[ ]*uname();$/i\ | |
2950 | struct utsname; | |
2951 | ' \ | |
0cb97c8d | 2952 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
2953 | rm -f ${DESTFILE} |
2954 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 2955 | fi # end of select 'if' |
1f414ac4 BK |
2956 | ;; # case end for file name test |
2957 | esac | |
2958 | ||
2959 | ||
2960 | # | |
87ad679b | 2961 | # Fix Ultrix_Atof_Param |
06bbab1b | 2962 | # |
48bd9529 | 2963 | case "${file}" in ./math.h ) |
d7eb5a45 ZW |
2964 | if ( test -n "`egrep 'atof\\([ ]*char' ${file}`" |
2965 | ) > /dev/null 2>&1 ; then | |
06bbab1b BK |
2966 | fixlist="${fixlist} |
2967 | ultrix_atof_param" | |
48bd9529 BK |
2968 | if [ ! -r ${DESTFILE} ] |
2969 | then infile=${file} | |
2970 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
2971 | |
2972 | sed -e 's@atof(\([ ]*char[ ]*\*[^)]*\))@atof(const \1)@' \ | |
0cb97c8d | 2973 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
2974 | rm -f ${DESTFILE} |
2975 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
d7eb5a45 | 2976 | fi # end of select 'if' |
06bbab1b BK |
2977 | ;; # case end for file name test |
2978 | esac | |
2979 | ||
2980 | ||
2981 | # | |
87ad679b | 2982 | # Fix Ultrix_Const |
06bbab1b | 2983 | # |
48bd9529 | 2984 | case "${file}" in ./stdio.h ) |
06bbab1b BK |
2985 | fixlist="${fixlist} |
2986 | ultrix_const" | |
48bd9529 BK |
2987 | if [ ! -r ${DESTFILE} ] |
2988 | then infile=${file} | |
2989 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
2990 | |
2991 | sed -e 's@perror( char \*__s );@perror( const char *__s );@' \ | |
2992 | -e 's@fputs( char \*__s,@fputs( const char *__s,@' \ | |
2993 | -e 's@fopen( char \*__filename, char \*__type );@fopen( const char *__filename, const char *__type );@' \ | |
2994 | -e 's@fwrite( void \*__ptr,@fwrite( const void *__ptr,@' \ | |
2995 | -e 's@fscanf( FILE \*__stream, char \*__format,@fscanf( FILE *__stream, const char *__format,@' \ | |
2996 | -e 's@scanf( char \*__format,@scanf( const char *__format,@' \ | |
2997 | -e 's@sscanf( char \*__s, char \*__format,@sscanf( const char *__s, const char *__format,@' \ | |
2998 | -e 's@popen(char \*, char \*);@popen(const char *, const char *);@' \ | |
2999 | -e 's@tempnam(char\*,char\*);@tempnam(const char*,const char*);@' \ | |
0cb97c8d | 3000 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
3001 | rm -f ${DESTFILE} |
3002 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
06bbab1b BK |
3003 | ;; # case end for file name test |
3004 | esac | |
3005 | ||
3006 | ||
3007 | # | |
87ad679b | 3008 | # Fix Ultrix_Ifdef |
06bbab1b | 3009 | # |
48bd9529 | 3010 | case "${file}" in ./sys/file.h ) |
3be1fb72 | 3011 | if ( test -n "`egrep '#ifdef KERNEL[ ]*[^ ]' ${file}`" |
06bbab1b BK |
3012 | ) > /dev/null 2>&1 ; then |
3013 | fixlist="${fixlist} | |
3014 | ultrix_ifdef" | |
48bd9529 BK |
3015 | if [ ! -r ${DESTFILE} ] |
3016 | then infile=${file} | |
3017 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
3018 | |
3019 | sed -e 's/#ifdef KERNEL/#if defined(KERNEL)/' \ | |
0cb97c8d | 3020 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
3021 | rm -f ${DESTFILE} |
3022 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 3023 | fi # end of select 'if' |
06bbab1b BK |
3024 | ;; # case end for file name test |
3025 | esac | |
3026 | ||
3027 | ||
3028 | # | |
87ad679b | 3029 | # Fix Ultrix_Nested_Cmnt |
06bbab1b | 3030 | # |
48bd9529 | 3031 | case "${file}" in ./rpc/svc.h ) |
06bbab1b BK |
3032 | fixlist="${fixlist} |
3033 | ultrix_nested_cmnt" | |
48bd9529 BK |
3034 | if [ ! -r ${DESTFILE} ] |
3035 | then infile=${file} | |
3036 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
3037 | |
3038 | sed -e 's@^\( \* int protocol; \)/\*@\1*/ /*@' \ | |
0cb97c8d | 3039 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
3040 | rm -f ${DESTFILE} |
3041 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
06bbab1b BK |
3042 | ;; # case end for file name test |
3043 | esac | |
3044 | ||
3045 | ||
3046 | # | |
87ad679b | 3047 | # Fix Ultrix_Static |
06bbab1b | 3048 | # |
48bd9529 BK |
3049 | case "${file}" in ./machine/cpu.h ) |
3050 | if ( test -n "`egrep '#include \"r[34]_cpu' ${file}`" | |
06bbab1b BK |
3051 | ) > /dev/null 2>&1 ; then |
3052 | fixlist="${fixlist} | |
3053 | ultrix_static" | |
48bd9529 BK |
3054 | if [ ! -r ${DESTFILE} ] |
3055 | then infile=${file} | |
3056 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
3057 | |
3058 | sed -e 's/^static struct tlb_pid_state/struct tlb_pid_state/' \ | |
3059 | -e 's/^#include "r3_cpu\.h"$/#include <machine\/r3_cpu\.h>/' \ | |
3060 | -e 's/^#include "r4_cpu\.h"$/#include <machine\/r4_cpu\.h>/' \ | |
0cb97c8d | 3061 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
3062 | rm -f ${DESTFILE} |
3063 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 3064 | fi # end of select 'if' |
06bbab1b BK |
3065 | ;; # case end for file name test |
3066 | esac | |
3067 | ||
3068 | ||
3069 | # | |
87ad679b | 3070 | # Fix Undefine_Null |
06bbab1b | 3071 | # |
42a2c30e | 3072 | if ( test -n "`egrep '^#[ ]*define[ ]*[ ]NULL[ \r]' ${file}`" |
5abc1f74 | 3073 | ) > /dev/null 2>&1 ; then |
42a2c30e | 3074 | if ( test -z "`egrep '#[ ]*(ifn|un)def[ ]*[ ]NULL($|[ \r])' ${file}`" |
06bbab1b BK |
3075 | ) > /dev/null 2>&1 ; then |
3076 | fixlist="${fixlist} | |
3077 | undefine_null" | |
48bd9529 BK |
3078 | if [ ! -r ${DESTFILE} ] |
3079 | then infile=${file} | |
3080 | else infile=${DESTFILE} ; fi | |
06bbab1b | 3081 | |
42a2c30e | 3082 | sed -e '/^#[ ]*define[ ][ ]*NULL[ \r]/i\ |
06bbab1b BK |
3083 | #undef NULL |
3084 | ' \ | |
0cb97c8d | 3085 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
3086 | rm -f ${DESTFILE} |
3087 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 BK |
3088 | fi # end of bypass 'if' |
3089 | fi # end of select 'if' | |
06bbab1b BK |
3090 | |
3091 | ||
3092 | # | |
87ad679b | 3093 | # Fix Unixware7_Byteorder_Fix |
86765ca0 RL |
3094 | # |
3095 | case "${file}" in ./arpa/inet.h ) | |
3096 | case "$target_canonical" in *-*-sysv4* | \ | |
3097 | i[34567]86-*-sysv5* | \ | |
3098 | i[34567]86-*-udk* | \ | |
3099 | i[34567]86-*-solaris2.[0-4] | \ | |
3100 | powerpcle-*-solaris2.[0-4] | \ | |
3101 | sparc-*-solaris2.[0-4] ) | |
3102 | if ( test -n "`egrep 'in_port_t' ${file}`" | |
3103 | ) > /dev/null 2>&1 ; then | |
3104 | fixlist="${fixlist} | |
3105 | unixware7_byteorder_fix" | |
3106 | if [ ! -r ${DESTFILE} ] | |
3107 | then infile=${file} | |
3108 | else infile=${DESTFILE} ; fi | |
3109 | ||
3110 | sed -e '/^extern.*htons.*(in_port_t)/d' \ | |
3111 | -e '/^extern.*ntohs.*(in_port_t)/d' \ | |
3112 | < $infile > ${DESTDIR}/fixinc.tmp | |
3113 | rm -f ${DESTFILE} | |
3114 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
3115 | fi # end of select 'if' | |
3116 | ;; # case end for machine type test | |
3117 | esac | |
3118 | ;; # case end for file name test | |
3119 | esac | |
3120 | ||
3121 | ||
3122 | # | |
87ad679b | 3123 | # Fix Va_I960_Macro |
06bbab1b | 3124 | # |
48bd9529 BK |
3125 | case "${file}" in ./arch/i960/archI960.h ) |
3126 | if ( test -n "`egrep '__(vsiz|vali|vpad|alignof__)' ${file}`" | |
06bbab1b BK |
3127 | ) > /dev/null 2>&1 ; then |
3128 | fixlist="${fixlist} | |
3129 | va_i960_macro" | |
48bd9529 BK |
3130 | if [ ! -r ${DESTFILE} ] |
3131 | then infile=${file} | |
3132 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
3133 | |
3134 | sed -e 's/__vsiz/__vxvsiz/' \ | |
3135 | -e 's/__vali/__vxvali/' \ | |
3136 | -e 's/__vpad/__vxvpad/' \ | |
3137 | -e 's/__alignof__/__vxalignof__/' \ | |
0cb97c8d | 3138 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
3139 | rm -f ${DESTFILE} |
3140 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 3141 | fi # end of select 'if' |
06bbab1b BK |
3142 | ;; # case end for file name test |
3143 | esac | |
3144 | ||
3145 | ||
3146 | # | |
87ad679b | 3147 | # Fix Void_Null |
06bbab1b | 3148 | # |
48bd9529 | 3149 | case "${file}" in ./curses.h | \ |
06bbab1b BK |
3150 | ./dbm.h | \ |
3151 | ./locale.h | \ | |
3152 | ./stdio.h | \ | |
3153 | ./stdlib.h | \ | |
3154 | ./string.h | \ | |
3155 | ./time.h | \ | |
3156 | ./unistd.h | \ | |
3157 | ./sys/dir.h | \ | |
3158 | ./sys/param.h | \ | |
3159 | ./sys/types.h ) | |
48bd9529 | 3160 | if ( test -n "`egrep '#[ ]*define[ ][ ]*NULL[ ].*void' ${file}`" |
06bbab1b BK |
3161 | ) > /dev/null 2>&1 ; then |
3162 | fixlist="${fixlist} | |
3163 | void_null" | |
48bd9529 BK |
3164 | if [ ! -r ${DESTFILE} ] |
3165 | then infile=${file} | |
3166 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
3167 | |
3168 | sed -e 's/^#[ ]*define[ ]*NULL[ ]*((void[ ]*\*)0)/#define NULL 0/' \ | |
0cb97c8d | 3169 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
3170 | rm -f ${DESTFILE} |
3171 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 3172 | fi # end of select 'if' |
06bbab1b BK |
3173 | ;; # case end for file name test |
3174 | esac | |
3175 | ||
3176 | ||
3177 | # | |
87ad679b | 3178 | # Fix Vxworks_Gcc_Problem |
06bbab1b | 3179 | # |
48bd9529 BK |
3180 | case "${file}" in ./types/vxTypesBase.h ) |
3181 | if ( test -n "`egrep '__GNUC_TYPEOF_FEATURE_BROKEN_USE_DEFAULT_UNTIL_FIXED__' ${file}`" | |
06bbab1b BK |
3182 | ) > /dev/null 2>&1 ; then |
3183 | fixlist="${fixlist} | |
3184 | vxworks_gcc_problem" | |
48bd9529 BK |
3185 | if [ ! -r ${DESTFILE} ] |
3186 | then infile=${file} | |
3187 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
3188 | |
3189 | sed -e 's/#ifdef __GNUC_TYPEOF_FEATURE_BROKEN_USE_DEFAULT_UNTIL_FIXED__/#if 1/' \ | |
3190 | -e '/[ ]size_t/i\ | |
3191 | #ifndef _GCC_SIZE_T\ | |
3192 | #define _GCC_SIZE_T | |
3193 | ' \ | |
3194 | -e '/[ ]size_t/a\ | |
3195 | #endif | |
3196 | ' \ | |
3197 | -e '/[ ]ptrdiff_t/i\ | |
3198 | #ifndef _GCC_PTRDIFF_T\ | |
3199 | #define _GCC_PTRDIFF_T | |
3200 | ' \ | |
3201 | -e '/[ ]ptrdiff_t/a\ | |
3202 | #endif | |
3203 | ' \ | |
3204 | -e '/[ ]wchar_t/i\ | |
3205 | #ifndef _GCC_WCHAR_T\ | |
3206 | #define _GCC_WCHAR_T | |
3207 | ' \ | |
3208 | -e '/[ ]wchar_t/a\ | |
3209 | #endif | |
3210 | ' \ | |
0cb97c8d | 3211 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
3212 | rm -f ${DESTFILE} |
3213 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 3214 | fi # end of select 'if' |
06bbab1b BK |
3215 | ;; # case end for file name test |
3216 | esac | |
3217 | ||
3218 | ||
3219 | # | |
87ad679b | 3220 | # Fix Vxworks_Needs_Vxtypes |
06bbab1b | 3221 | # |
48bd9529 BK |
3222 | case "${file}" in ./time.h ) |
3223 | if ( test -n "`egrep 'uint_t[ ][ ]*_clocks_per_sec' ${file}`" | |
06bbab1b BK |
3224 | ) > /dev/null 2>&1 ; then |
3225 | fixlist="${fixlist} | |
3226 | vxworks_needs_vxtypes" | |
48bd9529 BK |
3227 | if [ ! -r ${DESTFILE} ] |
3228 | then infile=${file} | |
3229 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
3230 | |
3231 | sed -e 's/uint_t/unsigned int/' \ | |
0cb97c8d | 3232 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
3233 | rm -f ${DESTFILE} |
3234 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 3235 | fi # end of select 'if' |
06bbab1b BK |
3236 | ;; # case end for file name test |
3237 | esac | |
3238 | ||
3239 | ||
3240 | # | |
87ad679b | 3241 | # Fix Vxworks_Needs_Vxworks |
06bbab1b | 3242 | # |
48bd9529 | 3243 | case "${file}" in ./sys/stat.h ) |
5abc1f74 BK |
3244 | if ( test -n "`egrep '#[ ]define[ ][ ]*__INCstath' ${file}`" |
3245 | ) > /dev/null 2>&1 ; then | |
3246 | if ( test '(' -r types/vxTypesOld.h ')' -a \ | |
48bd9529 BK |
3247 | '(' -n "`egrep '#include' $file`" ')' -a \ |
3248 | '(' -n "`egrep ULONG $file`" ')' | |
06bbab1b BK |
3249 | ) > /dev/null 2>&1 ; then |
3250 | fixlist="${fixlist} | |
3251 | vxworks_needs_vxworks" | |
48bd9529 BK |
3252 | if [ ! -r ${DESTFILE} ] |
3253 | then infile=${file} | |
3254 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
3255 | |
3256 | sed -e '/#[ ]define[ ][ ]*__INCstath/a\ | |
3257 | #include <types/vxTypesOld.h> | |
3258 | ' \ | |
0cb97c8d | 3259 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
3260 | rm -f ${DESTFILE} |
3261 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 BK |
3262 | fi # end of test expression 'if' |
3263 | fi # end of select 'if' | |
06bbab1b BK |
3264 | ;; # case end for file name test |
3265 | esac | |
3266 | ||
3267 | ||
3268 | # | |
87ad679b | 3269 | # Fix Vxworks_Time |
06bbab1b | 3270 | # |
48bd9529 | 3271 | case "${file}" in ./time.h ) |
5abc1f74 BK |
3272 | if ( test -n "`egrep 'VOIDFUNCPTR' ${file}`" |
3273 | ) > /dev/null 2>&1 ; then | |
3274 | if ( test '(' -r vxWorks.h ')' | |
06bbab1b BK |
3275 | ) > /dev/null 2>&1 ; then |
3276 | fixlist="${fixlist} | |
3277 | vxworks_time" | |
48bd9529 BK |
3278 | if [ ! -r ${DESTFILE} ] |
3279 | then infile=${file} | |
3280 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
3281 | |
3282 | sed -e '/VOIDFUNCPTR/i\ | |
3283 | #ifndef __gcc_VOIDFUNCPTR_defined\ | |
3284 | #ifdef __cplusplus\ | |
3285 | typedef void (*__gcc_VOIDFUNCPTR) (...);\ | |
3286 | #else\ | |
3287 | typedef void (*__gcc_VOIDFUNCPTR) ();\ | |
3288 | #endif\ | |
3289 | #define __gcc_VOIDFUNCPTR_defined\ | |
3290 | #endif | |
3291 | ' \ | |
3292 | -e 's/VOIDFUNCPTR/__gcc_VOIDFUNCPTR/g' \ | |
0cb97c8d | 3293 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
3294 | rm -f ${DESTFILE} |
3295 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 BK |
3296 | fi # end of test expression 'if' |
3297 | fi # end of select 'if' | |
06bbab1b BK |
3298 | ;; # case end for file name test |
3299 | esac | |
3300 | ||
3301 | ||
3302 | # | |
87ad679b | 3303 | # Fix X11_Class |
06bbab1b | 3304 | # |
48bd9529 | 3305 | case "${file}" in ./X11/ShellP.h ) |
d7eb5a45 | 3306 | if ( test -z "`egrep '__cplusplus' ${file}`" |
06bbab1b BK |
3307 | ) > /dev/null 2>&1 ; then |
3308 | fixlist="${fixlist} | |
3309 | x11_class" | |
48bd9529 BK |
3310 | if [ ! -r ${DESTFILE} ] |
3311 | then infile=${file} | |
3312 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
3313 | |
3314 | sed -e '/char \*class;/i\ | |
3315 | #ifdef __cplusplus\ | |
3316 | char *c_class;\ | |
3317 | #else | |
3318 | ' \ | |
3319 | -e '/char \*class;/a\ | |
3320 | #endif | |
3321 | ' \ | |
0cb97c8d | 3322 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
3323 | rm -f ${DESTFILE} |
3324 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 3325 | fi # end of bypass 'if' |
06bbab1b BK |
3326 | ;; # case end for file name test |
3327 | esac | |
3328 | ||
3329 | ||
3330 | # | |
87ad679b | 3331 | # Fix X11_Class_Usage |
06bbab1b | 3332 | # |
48bd9529 | 3333 | case "${file}" in ./Xm/BaseClassI.h ) |
d7eb5a45 | 3334 | if ( test -z "`egrep '__cplusplus' ${file}`" |
06bbab1b BK |
3335 | ) > /dev/null 2>&1 ; then |
3336 | fixlist="${fixlist} | |
3337 | x11_class_usage" | |
48bd9529 BK |
3338 | if [ ! -r ${DESTFILE} ] |
3339 | then infile=${file} | |
3340 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
3341 | |
3342 | sed -e 's/ class[)]/ c_class)/g' \ | |
0cb97c8d | 3343 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
3344 | rm -f ${DESTFILE} |
3345 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 3346 | fi # end of bypass 'if' |
06bbab1b BK |
3347 | ;; # case end for file name test |
3348 | esac | |
3349 | ||
3350 | ||
3351 | # | |
87ad679b | 3352 | # Fix X11_New |
06bbab1b | 3353 | # |
48bd9529 | 3354 | case "${file}" in ./Xm/Traversal.h ) |
d7eb5a45 | 3355 | if ( test -z "`egrep '__cplusplus' ${file}`" |
06bbab1b BK |
3356 | ) > /dev/null 2>&1 ; then |
3357 | fixlist="${fixlist} | |
3358 | x11_new" | |
48bd9529 BK |
3359 | if [ ! -r ${DESTFILE} ] |
3360 | then infile=${file} | |
3361 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
3362 | |
3363 | sed -e '/Widget old, new;/i\ | |
3364 | #ifdef __cplusplus\ | |
3365 | Widget old, c_new;\ | |
3366 | #else | |
3367 | ' \ | |
3368 | -e '/Widget old, new;/a\ | |
3369 | #endif | |
3370 | ' \ | |
3371 | -e 's/Widget new,/Widget c_new,/g' \ | |
0cb97c8d | 3372 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
3373 | rm -f ${DESTFILE} |
3374 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
5abc1f74 | 3375 | fi # end of bypass 'if' |
06bbab1b BK |
3376 | ;; # case end for file name test |
3377 | esac | |
3378 | ||
3379 | ||
3380 | # | |
87ad679b | 3381 | # Fix X11_Sprintf |
06bbab1b | 3382 | # |
b51207a4 ZW |
3383 | case "${file}" in ./X11/Xmu.h | \ |
3384 | ./X11/Xmu/Xmu.h ) | |
3385 | if ( test -n "`egrep 'sprintf\\(\\)' ${file}`" | |
3386 | ) > /dev/null 2>&1 ; then | |
06bbab1b BK |
3387 | fixlist="${fixlist} |
3388 | x11_sprintf" | |
48bd9529 BK |
3389 | if [ ! -r ${DESTFILE} ] |
3390 | then infile=${file} | |
3391 | else infile=${DESTFILE} ; fi | |
06bbab1b BK |
3392 | |
3393 | sed -e 's,^extern char \* sprintf();$,#ifndef __STDC__\ | |
3394 | extern char * sprintf();\ | |
3395 | #endif /* !defined __STDC__ */,' \ | |
0cb97c8d | 3396 | < $infile > ${DESTDIR}/fixinc.tmp |
48bd9529 BK |
3397 | rm -f ${DESTFILE} |
3398 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
b51207a4 | 3399 | fi # end of select 'if' |
06bbab1b BK |
3400 | ;; # case end for file name test |
3401 | esac | |
06bbab1b BK |
3402 | # IF the output has been removed OR it is unchanged, |
3403 | # THEN ensure the output is gone | |
3404 | # ELSE look for local directory include syntax | |
3405 | # | |
48bd9529 BK |
3406 | if ( test ! -f ${DESTFILE} || \ |
3407 | cmp ${file} ${DESTFILE} ) > /dev/null 2>&1 | |
06bbab1b | 3408 | then |
48bd9529 | 3409 | rm -f ${DESTFILE} |
06bbab1b | 3410 | else |
48bd9529 | 3411 | echo "Fixed ${file}:${fixlist}" |
06bbab1b BK |
3412 | |
3413 | # Find any include directives that use "file". | |
3414 | # | |
48bd9529 | 3415 | dir=`echo ${file} | sed -e s';/[^/]*$;;'` |
1907bb7c | 3416 | ddir=${DESTDIR}/$dir |
48bd9529 | 3417 | |
06bbab1b | 3418 | for include in ` |
48bd9529 BK |
3419 | egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${DESTFILE} | |
3420 | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'` | |
06bbab1b | 3421 | do |
48bd9529 | 3422 | required="$required ${SRCDIR} $dir/$include ${ddir}/$include" |
06bbab1b BK |
3423 | done |
3424 | fi | |
3425 | done # for file in $files | |
3426 | ||
3427 | done | |
3428 | ||
3429 | ## Make sure that any include files referenced using double quotes | |
3430 | ## exist in the fixed directory. This comes last since otherwise | |
3431 | ## we might end up deleting some of these files "because they don't | |
3432 | ## need any change." | |
3433 | set x `echo $required` | |
3434 | shift | |
3435 | while [ $# != 0 ]; do | |
3436 | newreq= | |
3437 | while [ $# != 0 ]; do | |
3438 | # $1 is the directory to copy from, | |
3439 | # $2 is the unfixed file, | |
3440 | # $3 is the fixed file name. | |
3441 | # | |
3442 | cd ${INPUT} | |
3443 | cd $1 | |
1f414ac4 BK |
3444 | if [ -f $2 ] ; then |
3445 | if [ -r $2 ] && [ ! -r $3 ]; then | |
3446 | cp $2 $3 >/dev/null 2>&1 || echo "Can't copy $2" >&2 | |
3447 | chmod +w $3 2>/dev/null | |
3448 | chmod a+r $3 2>/dev/null | |
87ad679b BK |
3449 | if test $VERBOSE -gt 2 |
3450 | then echo Copied $2 ; fi | |
1f414ac4 | 3451 | for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' $3 | |
06bbab1b | 3452 | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'` |
1f414ac4 BK |
3453 | do |
3454 | dir=`echo $2 | sed -e s'|/[^/]*$||'` | |
3455 | dir2=`echo $3 | sed -e s'|/[^/]*$||'` | |
3456 | newreq="$newreq $1 $dir/$include $dir2/$include" | |
3457 | done | |
3458 | fi | |
06bbab1b BK |
3459 | fi |
3460 | shift; shift; shift | |
3461 | done | |
3462 | set x $newreq | |
3463 | shift | |
3464 | done | |
3465 | ||
87ad679b BK |
3466 | if test $VERBOSE -gt 2 |
3467 | then echo 'Cleaning up DONE files.' ; fi | |
06bbab1b BK |
3468 | cd $LIB |
3469 | find . -name DONE -exec rm -f '{}' ';' | |
3470 | ||
87ad679b BK |
3471 | if test $VERBOSE -gt 1 |
3472 | then echo 'Cleaning up unneeded directories:' ; fi | |
06bbab1b | 3473 | cd $LIB |
babb4c65 | 3474 | all_dirs=`find . -type d \! -name '.' -print | sort -r` |
48bd9529 | 3475 | for file in $all_dirs; do |
1c804566 | 3476 | rmdir $LIB/$file > /dev/null 2>&1 |
06bbab1b BK |
3477 | done |
3478 | ||
87ad679b BK |
3479 | if test $VERBOSE -gt 0 |
3480 | then echo fixincludes is done ; fi | |
3481 | ||
06bbab1b BK |
3482 | # # # # # # # # # # # # # # # # # # # # # |
3483 | # | |
3484 | # End of for INPUT directories | |
3485 | # | |
3486 | done | |
3487 | # | |
3488 | # # # # # # # # # # # # # # # # # # # # # | |
3489 | ||
7aed7b70 BK |
3490 | if [ x${INSTALL_ASSERT_H} != x ] && [ -f ${srcdir}/assert.h ] |
3491 | then | |
3492 | cd $ORIGDIR | |
3493 | rm -f include/assert.h | |
3494 | cp ${srcdir}/assert.h include/assert.h || exit 1 | |
3495 | chmod a+r include/assert.h | |
3496 | fi |