]>
Commit | Line | Data |
---|---|---|
1 | #!/bin/sh | |
2 | # | |
3 | # DO NOT EDIT THIS FILE - it has been generated | |
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 | # | |
9 | # This script contains 113 fixup scripts. | |
10 | # | |
11 | # See README-fixinc for more information. | |
12 | # | |
13 | # fixincludes copyright (c) 1998, 1999, 2000 | |
14 | # The Free Software Foundation, Inc. | |
15 | # | |
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" ] | |
38 | then | |
39 | echo fixincludes: no output directory specified | |
40 | exit 1 | |
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 | |
53 | ( cd $LIB && touch DONE && rm DONE ) || { | |
54 | echo fixincludes: output dir '`'$LIB"' is an invalid directory" | |
55 | exit 1 | |
56 | } | |
57 | fi | |
58 | ||
59 | FIXTESTS=$PWD/fixinc/fixtests | |
60 | FIXFIXES=$PWD/fixinc/fixfixes | |
61 | ||
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 | ||
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 | ||
113 | if test $VERBOSE -gt 0 | |
114 | then echo Fixing headers into ${LIB} for ${target_canonical} target ; fi | |
115 | ||
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 | |
126 | ||
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 | ||
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 | ||
151 | INPUT=`${PWDCMD}` | |
152 | ||
153 | # | |
154 | # # # # # # # # # # # # # # # # # # # # # | |
155 | # | |
156 | if test $VERBOSE -gt 1 | |
157 | then echo Finding directories and links to directories ; fi | |
158 | ||
159 | # Find all directories and all symlinks that point to directories. | |
160 | # Put the list in $all_dirs. | |
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. | |
163 | # Note that $all_dirs may have duplicates in it; | |
164 | # later parts of this file are supposed to ignore them. | |
165 | dirs="." | |
166 | levels=2 | |
167 | all_dirs="" | |
168 | search_dirs="" | |
169 | ||
170 | while [ -n "$dirs" ] && [ $levels -gt 0 ] | |
171 | do | |
172 | levels=`expr $levels - 1` | |
173 | newdirs= | |
174 | for d in $dirs | |
175 | do | |
176 | if test $VERBOSE -gt 1 | |
177 | then echo " Searching $INPUT/$d" ; fi | |
178 | ||
179 | # Find all directories under $d, relative to $d, excluding $d itself. | |
180 | # (The /. is needed after $d in case $d is a symlink.) | |
181 | all_dirs="$all_dirs `find $d/. -type d -print | \ | |
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 | |
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" | |
198 | if [ "`ls -ld $d1 | sed -n 's/.*-> //p'`" != "." ] | |
199 | then | |
200 | newdirs="$newdirs $d1" | |
201 | search_dirs="$search_dirs $d1" | |
202 | fi | |
203 | fi | |
204 | done | |
205 | done | |
206 | ||
207 | dirs="$newdirs" | |
208 | done | |
209 | ||
210 | # # # # # # # # # # # # # # # # # # # # # | |
211 | # | |
212 | dirs= | |
213 | if test $VERBOSE -gt 2 | |
214 | then echo "All directories (including links to directories):" | |
215 | echo $all_dirs | |
216 | fi | |
217 | ||
218 | for file in $all_dirs; do | |
219 | rm -rf $LIB/$file | |
220 | if [ ! -d $LIB/$file ] | |
221 | then mkdir $LIB/$file | |
222 | fi | |
223 | done | |
224 | mkdir $LIB/root | |
225 | ||
226 | # # # # # # # # # # # # # # # # # # # # # | |
227 | # | |
228 | # treetops gets an alternating list | |
229 | # of old directories to copy | |
230 | # and the new directories to copy to. | |
231 | treetops=". ${LIB}" | |
232 | ||
233 | if $LINKS; then | |
234 | if test $VERBOSE -gt 1 | |
235 | then echo 'Making symbolic directory links' ; fi | |
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 | |
265 | if test $VERBOSE -gt 2 | |
266 | then echo ${sym_link} '->' . ': Making self link' ; fi | |
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@..$@@'` | |
279 | if test $VERBOSE -gt 2 | |
280 | then echo ${sym_link} '->' $dots$y ': Making local link' ; fi | |
281 | rm -fr ${LIB}/${sym_link} > /dev/null 2>&1 | |
282 | ln -s $dots$y ${LIB}/${sym_link} > /dev/null 2>&1 | |
283 | ||
284 | else | |
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 | # | |
290 | if test $VERBOSE -gt 2 | |
291 | then echo ${sym_link} '->' root${full_dest_dir} ': Making rooted link' | |
292 | fi | |
293 | if [ -d $LIB/root${full_dest_dir} ] | |
294 | then true | |
295 | else | |
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|[^/]*/||'` | |
305 | done | |
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"` | |
316 | if test $VERBOSE -gt 2 | |
317 | then echo "Duplicating ${sym_link}'s ${dupdir}" ; fi | |
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}" | |
341 | fi | |
342 | fi | |
343 | done | |
344 | fi | |
345 | ||
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 | |
356 | ||
357 | FIND_BASE=$1 | |
358 | export FIND_BASE | |
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 | |
372 | if test $VERBOSE -gt 1 | |
373 | then echo Fixing directory ${SRCDIR} into ${DESTDIR} ; fi | |
374 | ||
375 | # Check files which are symlinks as well as those which are files. | |
376 | # | |
377 | cd ${INPUT} | |
378 | files=`if $LINKS; then | |
379 | find ${FIND_BASE}/. -name '*.h' \( -type f -o -type l \) -print | |
380 | else | |
381 | find ${FIND_BASE}/. -name '*.h' -type f -print | |
382 | fi | \ | |
383 | sed -e 's;/\./;/;g' -e 's;//*;/;g' ` | |
384 | ||
385 | echo Checking header files | |
386 | for file in $files; do | |
387 | ||
388 | # Skip unreadable files, symlinks to directories and glibc files | |
389 | if test ! -r "${file}" || test -d "${file}/." ; then | |
390 | continue | |
391 | fi | |
392 | ||
393 | fixlist="" | |
394 | DESTFILE=${DESTDIR}/`echo ${file} | sed "s;${FIND_BASE}/;;" ` | |
395 | ||
396 | # | |
397 | # Fix Aaa_Ki_Iface | |
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 | |
402 | echo "AAA_ki_iface bypassing file ${file}" | |
403 | continue | |
404 | ||
405 | fi # end of select 'if' | |
406 | ;; # case end for file name test | |
407 | esac | |
408 | ||
409 | ||
410 | # | |
411 | # Fix Aaa_Ki | |
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 | |
416 | echo "AAA_ki bypassing file ${file}" | |
417 | continue | |
418 | ||
419 | fi # end of select 'if' | |
420 | ;; # case end for file name test | |
421 | esac | |
422 | ||
423 | ||
424 | # | |
425 | # Fix Aaa_Ki_Calls | |
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 | |
430 | echo "AAA_ki_calls bypassing file ${file}" | |
431 | continue | |
432 | ||
433 | fi # end of select 'if' | |
434 | ;; # case end for file name test | |
435 | esac | |
436 | ||
437 | ||
438 | # | |
439 | # Fix Aaa_Ki_Defs | |
440 | # | |
441 | case "${file}" in ./sys/ki_defs.h ) | |
442 | if ( test -n "`egrep 'Kernel Instrumentation Definitions' ${file}`" | |
443 | ) > /dev/null 2>&1 ; then | |
444 | echo "AAA_ki_defs bypassing file ${file}" | |
445 | continue | |
446 | ||
447 | fi # end of select 'if' | |
448 | ;; # case end for file name test | |
449 | esac | |
450 | ||
451 | ||
452 | # | |
453 | # Fix Aaa_Bad_Fixes | |
454 | # | |
455 | case "${file}" in ./sundev/ipi_error.h ) | |
456 | echo "AAA_bad_fixes bypassing file ${file}" | |
457 | continue | |
458 | ||
459 | ;; # case end for file name test | |
460 | esac | |
461 | ||
462 | ||
463 | # | |
464 | # Fix Aaa_Time | |
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 | |
469 | echo "AAA_time bypassing file ${file}" | |
470 | continue | |
471 | ||
472 | fi # end of select 'if' | |
473 | ;; # case end for file name test | |
474 | esac | |
475 | ||
476 | ||
477 | # | |
478 | # Fix Aab_Dgux_Int_Varargs | |
479 | # | |
480 | case "${file}" in ./_int_varargs.h ) | |
481 | echo "AAB_dgux_int_varargs replacing file ${file}" >&2 | |
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 | # | |
554 | # Fix Aab_Fd_Zero_Asm_Posix_Types_H | |
555 | # | |
556 | case "${file}" in ./asm/posix_types.h ) | |
557 | case "$target_canonical" in i[34567]86-*-linux-gnu* ) | |
558 | if ( test -z "`egrep '} while' ${file}`" | |
559 | ) > /dev/null 2>&1 ; then | |
560 | echo "AAB_fd_zero_asm_posix_types_h replacing file ${file}" >&2 | |
561 | cat > ${DESTFILE} << '_EOF_' | |
562 | /* This file fixes a bug in the __FD_ZERO macro | |
563 | for older versions of the Linux kernel. */ | |
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 | |
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) | |
578 | #endif | |
579 | ||
580 | #define _POSIX_TYPES_H_WRAPPER | |
581 | #endif /* _POSIX_TYPES_H_WRAPPER */ | |
582 | ||
583 | _EOF_ | |
584 | continue | |
585 | ||
586 | fi # end of bypass 'if' | |
587 | ;; # case end for machine type test | |
588 | esac | |
589 | ;; # case end for file name test | |
590 | esac | |
591 | ||
592 | ||
593 | # | |
594 | # Fix Aab_Fd_Zero_Gnu_Types_H | |
595 | # | |
596 | case "${file}" in ./gnu/types.h ) | |
597 | case "$target_canonical" in i[34567]86-*-linux-gnu* ) | |
598 | echo "AAB_fd_zero_gnu_types_h replacing file ${file}" >&2 | |
599 | cat > ${DESTFILE} << '_EOF_' | |
600 | /* This file fixes a bug in the __FD_ZERO macro present in glibc 1.x. */ | |
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 | |
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) | |
615 | #endif | |
616 | ||
617 | #define _TYPES_H_WRAPPER | |
618 | #endif /* _TYPES_H_WRAPPER */ | |
619 | ||
620 | _EOF_ | |
621 | continue | |
622 | ||
623 | ;; # case end for machine type test | |
624 | esac | |
625 | ;; # case end for file name test | |
626 | esac | |
627 | ||
628 | ||
629 | # | |
630 | # Fix Aab_Fd_Zero_Selectbits_H | |
631 | # | |
632 | case "${file}" in ./selectbits.h ) | |
633 | case "$target_canonical" in i[34567]86-*-linux-gnu* ) | |
634 | echo "AAB_fd_zero_selectbits_h replacing file ${file}" >&2 | |
635 | cat > ${DESTFILE} << '_EOF_' | |
636 | /* This file fixes a bug in the __FD_ZERO macro present in glibc 2.0.x. */ | |
637 | #ifndef _SELECTBITS_H_WRAPPER | |
638 | #include <features.h> | |
639 | #include_next <selectbits.h> | |
640 | ||
641 | #if defined(__FD_ZERO) && defined(__GLIBC__) \ | |
642 | && defined(__GLIBC_MINOR__) && __GLIBC__ == 2 \ | |
643 | && __GLIBC_MINOR__ == 0 | |
644 | #undef __FD_ZERO | |
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) | |
655 | #endif | |
656 | ||
657 | #define _SELECTBITS_H_WRAPPER | |
658 | #endif /* _SELECTBITS_H_WRAPPER */ | |
659 | ||
660 | _EOF_ | |
661 | continue | |
662 | ||
663 | ;; # case end for machine type test | |
664 | esac | |
665 | ;; # case end for file name test | |
666 | esac | |
667 | ||
668 | ||
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 | ||
705 | # | |
706 | # Fix Aab_Svr4_Replace_Byteorder | |
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] ) | |
715 | echo "AAB_svr4_replace_byteorder replacing file ${file}" >&2 | |
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 | ||
783 | #elif ((defined (__i860__) && !defined (__i860_big_endian__)) \ | |
784 | || defined (__ns32k__) || defined (__vax__) \ | |
785 | || defined (__spur__) || defined (__arm__)) | |
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 | ||
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 | ||
888 | # | |
889 | # Fix Aix_Syswait | |
890 | # | |
891 | case "${file}" in ./sys/wait.h ) | |
892 | if ( test -n "`egrep 'bos325,' ${file}`" | |
893 | ) > /dev/null 2>&1 ; then | |
894 | fixlist="${fixlist} | |
895 | aix_syswait" | |
896 | if [ ! -r ${DESTFILE} ] | |
897 | then infile=${file} | |
898 | else infile=${DESTFILE} ; fi | |
899 | ||
900 | sed -e '/^extern pid_t wait3();$/i\ | |
901 | struct rusage; | |
902 | ' \ | |
903 | < $infile > ${DESTDIR}/fixinc.tmp | |
904 | rm -f ${DESTFILE} | |
905 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
906 | fi # end of select 'if' | |
907 | ;; # case end for file name test | |
908 | esac | |
909 | ||
910 | ||
911 | # | |
912 | # Fix Aix_Volatile | |
913 | # | |
914 | case "${file}" in ./sys/signal.h ) | |
915 | if ( test -n "`egrep 'typedef volatile int sig_atomic_t' ${file}`" | |
916 | ) > /dev/null 2>&1 ; then | |
917 | fixlist="${fixlist} | |
918 | aix_volatile" | |
919 | if [ ! -r ${DESTFILE} ] | |
920 | then infile=${file} | |
921 | else infile=${DESTFILE} ; fi | |
922 | ||
923 | sed -e 's/typedef volatile int sig_atomic_t/typedef int sig_atomic_t/' \ | |
924 | < $infile > ${DESTDIR}/fixinc.tmp | |
925 | rm -f ${DESTFILE} | |
926 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
927 | fi # end of select 'if' | |
928 | ;; # case end for file name test | |
929 | esac | |
930 | ||
931 | ||
932 | # | |
933 | # Fix Alpha_Getopt | |
934 | # | |
935 | case "${file}" in ./stdio.h | \ | |
936 | ./stdlib.h ) | |
937 | if ( test -n "`egrep 'getopt\\(int, char \\*\\[' ${file}`" | |
938 | ) > /dev/null 2>&1 ; then | |
939 | fixlist="${fixlist} | |
940 | alpha_getopt" | |
941 | if [ ! -r ${DESTFILE} ] | |
942 | then infile=${file} | |
943 | else infile=${DESTFILE} ; fi | |
944 | ||
945 | sed -e 's/getopt(int, char \*\[\],[ ]*char \*)/getopt(int, char *const[], const char *)/' \ | |
946 | < $infile > ${DESTDIR}/fixinc.tmp | |
947 | rm -f ${DESTFILE} | |
948 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
949 | fi # end of select 'if' | |
950 | ;; # case end for file name test | |
951 | esac | |
952 | ||
953 | ||
954 | # | |
955 | # Fix Alpha_Parens | |
956 | # | |
957 | case "${file}" in ./sym.h ) | |
958 | if ( test -n "`egrep '#ifndef\\(__mips64\\)' ${file}`" | |
959 | ) > /dev/null 2>&1 ; then | |
960 | fixlist="${fixlist} | |
961 | alpha_parens" | |
962 | if [ ! -r ${DESTFILE} ] | |
963 | then infile=${file} | |
964 | else infile=${DESTFILE} ; fi | |
965 | ||
966 | sed -e 's/#ifndef(__mips64)/#ifndef __mips64/' \ | |
967 | < $infile > ${DESTDIR}/fixinc.tmp | |
968 | rm -f ${DESTFILE} | |
969 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
970 | fi # end of select 'if' | |
971 | ;; # case end for file name test | |
972 | esac | |
973 | ||
974 | ||
975 | # | |
976 | # Fix Alpha_Sbrk | |
977 | # | |
978 | case "${file}" in ./unistd.h ) | |
979 | if ( test -n "`egrep 'char[ ]*\\*[ ]*sbrk[ ]*\\(' ${file}`" | |
980 | ) > /dev/null 2>&1 ; then | |
981 | fixlist="${fixlist} | |
982 | alpha_sbrk" | |
983 | if [ ! -r ${DESTFILE} ] | |
984 | then infile=${file} | |
985 | else infile=${DESTFILE} ; fi | |
986 | ||
987 | sed -e 's/char\([ ]*\*[ ]*sbrk[ ]*(\)/void\1/' \ | |
988 | < $infile > ${DESTDIR}/fixinc.tmp | |
989 | rm -f ${DESTFILE} | |
990 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
991 | fi # end of select 'if' | |
992 | ;; # case end for file name test | |
993 | esac | |
994 | ||
995 | ||
996 | # | |
997 | # Fix Arm_Norcroft_Hint | |
998 | # | |
999 | case "${file}" in ./X11/Intrinsic.h ) | |
1000 | if ( test -n "`egrep '___type p_type' ${file}`" | |
1001 | ) > /dev/null 2>&1 ; then | |
1002 | fixlist="${fixlist} | |
1003 | arm_norcroft_hint" | |
1004 | if [ ! -r ${DESTFILE} ] | |
1005 | then infile=${file} | |
1006 | else infile=${DESTFILE} ; fi | |
1007 | ||
1008 | sed -e 's/___type p_type/p_type/' \ | |
1009 | < $infile > ${DESTDIR}/fixinc.tmp | |
1010 | rm -f ${DESTFILE} | |
1011 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
1012 | fi # end of select 'if' | |
1013 | ;; # case end for file name test | |
1014 | esac | |
1015 | ||
1016 | ||
1017 | # | |
1018 | # Fix Arm_Wchar | |
1019 | # | |
1020 | case "${file}" in ./stdlib.h ) | |
1021 | if ( test -n "`egrep '#[ ]*define[ ]*__wchar_t' ${file}`" | |
1022 | ) > /dev/null 2>&1 ; then | |
1023 | fixlist="${fixlist} | |
1024 | arm_wchar" | |
1025 | if [ ! -r ${DESTFILE} ] | |
1026 | then infile=${file} | |
1027 | else infile=${DESTFILE} ; fi | |
1028 | ||
1029 | sed -e 's/\(#[ ]*ifndef[ ]*\)__wchar_t/\1_GCC_WCHAR_T/' \ | |
1030 | -e 's/\(#[ ]*define[ ]*\)__wchar_t/\1_GCC_WCHAR_T/' \ | |
1031 | < $infile > ${DESTDIR}/fixinc.tmp | |
1032 | rm -f ${DESTFILE} | |
1033 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
1034 | fi # end of select 'if' | |
1035 | ;; # case end for file name test | |
1036 | esac | |
1037 | ||
1038 | ||
1039 | # | |
1040 | # Fix Aux_Asm | |
1041 | # | |
1042 | case "${file}" in ./sys/param.h ) | |
1043 | if ( test -n "`egrep '#ifndef NOINLINE' ${file}`" | |
1044 | ) > /dev/null 2>&1 ; then | |
1045 | fixlist="${fixlist} | |
1046 | aux_asm" | |
1047 | if [ ! -r ${DESTFILE} ] | |
1048 | then infile=${file} | |
1049 | else infile=${DESTFILE} ; fi | |
1050 | ||
1051 | sed -e 's|#ifndef NOINLINE|#if !defined(NOINLINE) \&\& !defined(__GNUC__)|' \ | |
1052 | < $infile > ${DESTDIR}/fixinc.tmp | |
1053 | rm -f ${DESTFILE} | |
1054 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
1055 | fi # end of select 'if' | |
1056 | ;; # case end for file name test | |
1057 | esac | |
1058 | ||
1059 | ||
1060 | # | |
1061 | # Fix Avoid_Bool | |
1062 | # | |
1063 | case "${file}" in ./curses.h | \ | |
1064 | ./curses_colr/curses.h | \ | |
1065 | ./term.h | \ | |
1066 | ./tinfo.h ) | |
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 | |
1071 | fixlist="${fixlist} | |
1072 | avoid_bool" | |
1073 | if [ ! -r ${DESTFILE} ] | |
1074 | then infile=${file} | |
1075 | else infile=${DESTFILE} ; fi | |
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 | |
1088 | ' \ | |
1089 | -e '/^[ ]*typedef[ ][ ]*unsigned char[ ][ ]*bool[ ]*;/i\ | |
1090 | #ifndef __cplusplus | |
1091 | ' \ | |
1092 | -e '/^[ ]*typedef[ ][ ]*unsigned char[ ][ ]*bool[ ]*;/a\ | |
1093 | #endif | |
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 | |
1106 | ' \ | |
1107 | < $infile > ${DESTDIR}/fixinc.tmp | |
1108 | rm -f ${DESTFILE} | |
1109 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
1110 | fi # end of bypass 'if' | |
1111 | fi # end of select 'if' | |
1112 | ;; # case end for file name test | |
1113 | esac | |
1114 | ||
1115 | ||
1116 | # | |
1117 | # Fix Bad_Struct_Term | |
1118 | # | |
1119 | case "${file}" in ./curses.h ) | |
1120 | if ( test -n "`egrep '^[ ]*typedef[ ]+struct[ ]+term[ ]*;' ${file}`" | |
1121 | ) > /dev/null 2>&1 ; then | |
1122 | fixlist="${fixlist} | |
1123 | bad_struct_term" | |
1124 | if [ ! -r ${DESTFILE} ] | |
1125 | then infile=${file} | |
1126 | else infile=${DESTFILE} ; fi | |
1127 | ||
1128 | sed -e 's/^[ ]*typedef[ ][ ]*\(struct[ ][ ]*term[ ]*;[ ]*\)$/\1/' \ | |
1129 | < $infile > ${DESTDIR}/fixinc.tmp | |
1130 | rm -f ${DESTFILE} | |
1131 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
1132 | fi # end of select 'if' | |
1133 | ;; # case end for file name test | |
1134 | esac | |
1135 | ||
1136 | ||
1137 | # | |
1138 | # Fix Badquote | |
1139 | # | |
1140 | case "${file}" in ./sundev/vuid_event.h ) | |
1141 | fixlist="${fixlist} | |
1142 | badquote" | |
1143 | if [ ! -r ${DESTFILE} ] | |
1144 | then infile=${file} | |
1145 | else infile=${DESTFILE} ; fi | |
1146 | ||
1147 | sed -e 's/doesn'\''t/does not/' \ | |
1148 | < $infile > ${DESTDIR}/fixinc.tmp | |
1149 | rm -f ${DESTFILE} | |
1150 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
1151 | ;; # case end for file name test | |
1152 | esac | |
1153 | ||
1154 | ||
1155 | # | |
1156 | # Fix Bad_Lval | |
1157 | # | |
1158 | case "${file}" in ./libgen.h | \ | |
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 ) | |
1172 | if ( test -n "`egrep '^[ ]*#[ ]*pragma[ ][ ]*extern_prefix' ${file}`" | |
1173 | ) > /dev/null 2>&1 ; then | |
1174 | fixlist="${fixlist} | |
1175 | bad_lval" | |
1176 | if [ ! -r ${DESTFILE} ] | |
1177 | then infile=${file} | |
1178 | else infile=${DESTFILE} ; fi | |
1179 | ||
1180 | sed -e 's/^[ ]*#[ ]*define[ ]*\([^(]*\)\(([^)]*)\)[ ]*\(_.\)\1\2[ ]*$/#define \1 \3\1/' \ | |
1181 | < $infile > ${DESTDIR}/fixinc.tmp | |
1182 | rm -f ${DESTFILE} | |
1183 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
1184 | fi # end of select 'if' | |
1185 | ;; # case end for file name test | |
1186 | esac | |
1187 | ||
1188 | ||
1189 | # | |
1190 | # Fix Broken_Assert_Stdio | |
1191 | # | |
1192 | case "${file}" in ./assert.h ) | |
1193 | if ( test -n "`egrep 'stderr' ${file}`" | |
1194 | ) > /dev/null 2>&1 ; then | |
1195 | if ( test -z "`egrep 'include.*stdio.h' ${file}`" | |
1196 | ) > /dev/null 2>&1 ; then | |
1197 | fixlist="${fixlist} | |
1198 | broken_assert_stdio" | |
1199 | if [ ! -r ${DESTFILE} ] | |
1200 | then infile=${file} | |
1201 | else infile=${DESTFILE} ; fi | |
1202 | ||
1203 | sed -e '1i\ | |
1204 | #include <stdio.h> | |
1205 | ' \ | |
1206 | < $infile > ${DESTDIR}/fixinc.tmp | |
1207 | rm -f ${DESTFILE} | |
1208 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
1209 | fi # end of bypass 'if' | |
1210 | fi # end of select 'if' | |
1211 | ;; # case end for file name test | |
1212 | esac | |
1213 | ||
1214 | ||
1215 | # | |
1216 | # Fix Broken_Assert_Stdlib | |
1217 | # | |
1218 | case "${file}" in ./assert.h ) | |
1219 | if ( test -n "`egrep 'exit *\\(|abort *\\(' ${file}`" | |
1220 | ) > /dev/null 2>&1 ; then | |
1221 | if ( test -z "`egrep 'include.*stdlib.h' ${file}`" | |
1222 | ) > /dev/null 2>&1 ; then | |
1223 | fixlist="${fixlist} | |
1224 | broken_assert_stdlib" | |
1225 | if [ ! -r ${DESTFILE} ] | |
1226 | then infile=${file} | |
1227 | else infile=${DESTFILE} ; fi | |
1228 | ||
1229 | sed -e '1i\ | |
1230 | #ifdef __cplusplus\ | |
1231 | #include <stdlib.h>\ | |
1232 | #endif | |
1233 | ' \ | |
1234 | < $infile > ${DESTDIR}/fixinc.tmp | |
1235 | rm -f ${DESTFILE} | |
1236 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
1237 | fi # end of bypass 'if' | |
1238 | fi # end of select 'if' | |
1239 | ;; # case end for file name test | |
1240 | esac | |
1241 | ||
1242 | ||
1243 | # | |
1244 | # Fix Dec_Intern_Asm | |
1245 | # | |
1246 | case "${file}" in ./c_asm.h ) | |
1247 | fixlist="${fixlist} | |
1248 | dec_intern_asm" | |
1249 | if [ ! -r ${DESTFILE} ] | |
1250 | then infile=${file} | |
1251 | else infile=${DESTFILE} ; fi | |
1252 | ||
1253 | sed -e '/^[ ]*float[ ]*fasm/i\ | |
1254 | #ifdef __DECC | |
1255 | ' \ | |
1256 | -e '/^[ ]*#[ ]*pragma[ ]*intrinsic([ ]*dasm/a\ | |
1257 | #endif | |
1258 | ' \ | |
1259 | < $infile > ${DESTDIR}/fixinc.tmp | |
1260 | rm -f ${DESTFILE} | |
1261 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
1262 | ;; # case end for file name test | |
1263 | esac | |
1264 | ||
1265 | ||
1266 | # | |
1267 | # Fix Ecd_Cursor | |
1268 | # | |
1269 | case "${file}" in ./sunwindow/win_lock.h | \ | |
1270 | ./sunwindow/win_cursor.h ) | |
1271 | fixlist="${fixlist} | |
1272 | ecd_cursor" | |
1273 | if [ ! -r ${DESTFILE} ] | |
1274 | then infile=${file} | |
1275 | else infile=${DESTFILE} ; fi | |
1276 | ||
1277 | sed -e 's/ecd.cursor/ecd_cursor/' \ | |
1278 | < $infile > ${DESTDIR}/fixinc.tmp | |
1279 | rm -f ${DESTFILE} | |
1280 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
1281 | ;; # case end for file name test | |
1282 | esac | |
1283 | ||
1284 | ||
1285 | # | |
1286 | # Fix Sco5_Stat_Wrappers | |
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 | ||
1316 | # | |
1317 | # Fix Hp_Inline | |
1318 | # | |
1319 | case "${file}" in ./sys/spinlock.h ) | |
1320 | if ( test -n "`egrep 'include.*\"\\.\\./machine/' ${file}`" | |
1321 | ) > /dev/null 2>&1 ; then | |
1322 | fixlist="${fixlist} | |
1323 | hp_inline" | |
1324 | if [ ! -r ${DESTFILE} ] | |
1325 | then infile=${file} | |
1326 | else infile=${DESTFILE} ; fi | |
1327 | ||
1328 | sed -e 's,"../machine/inline.h",<machine/inline.h>,' \ | |
1329 | -e 's,"../machine/psl.h",<machine/psl.h>,' \ | |
1330 | < $infile > ${DESTDIR}/fixinc.tmp | |
1331 | rm -f ${DESTFILE} | |
1332 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
1333 | fi # end of select 'if' | |
1334 | ;; # case end for file name test | |
1335 | esac | |
1336 | ||
1337 | ||
1338 | # | |
1339 | # Fix Hp_Sysfile | |
1340 | # | |
1341 | case "${file}" in ./sys/file.h ) | |
1342 | if ( test -n "`egrep 'HPUX_SOURCE' ${file}`" | |
1343 | ) > /dev/null 2>&1 ; then | |
1344 | fixlist="${fixlist} | |
1345 | hp_sysfile" | |
1346 | if [ ! -r ${DESTFILE} ] | |
1347 | then infile=${file} | |
1348 | else infile=${DESTFILE} ; fi | |
1349 | ||
1350 | sed -e 's/(\.\.\.)/(struct file *, ...)/' \ | |
1351 | < $infile > ${DESTDIR}/fixinc.tmp | |
1352 | rm -f ${DESTFILE} | |
1353 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
1354 | fi # end of select 'if' | |
1355 | ;; # case end for file name test | |
1356 | esac | |
1357 | ||
1358 | ||
1359 | # | |
1360 | # Fix Cxx_Unready | |
1361 | # | |
1362 | case "${file}" in ./sys/mman.h | \ | |
1363 | ./rpc/types.h ) | |
1364 | if ( test -n "`egrep '[^#]+malloc.*;' ${file}`" | |
1365 | ) > /dev/null 2>&1 ; then | |
1366 | if ( test -z "`egrep '\"C\"|__BEGIN_DECLS' ${file}`" | |
1367 | ) > /dev/null 2>&1 ; then | |
1368 | fixlist="${fixlist} | |
1369 | cxx_unready" | |
1370 | if [ ! -r ${DESTFILE} ] | |
1371 | then infile=${file} | |
1372 | else infile=${DESTFILE} ; fi | |
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 | ' \ | |
1385 | < $infile > ${DESTDIR}/fixinc.tmp | |
1386 | rm -f ${DESTFILE} | |
1387 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
1388 | fi # end of bypass 'if' | |
1389 | fi # end of select 'if' | |
1390 | ;; # case end for file name test | |
1391 | esac | |
1392 | ||
1393 | ||
1394 | # | |
1395 | # Fix Hpux_Maxint | |
1396 | # | |
1397 | case "${file}" in ./sys/param.h ) | |
1398 | fixlist="${fixlist} | |
1399 | hpux_maxint" | |
1400 | if [ ! -r ${DESTFILE} ] | |
1401 | then infile=${file} | |
1402 | else infile=${DESTFILE} ; fi | |
1403 | ||
1404 | sed -e '/^#[ ]*define[ ]*MAXINT[ ]/i\ | |
1405 | #ifndef MAXINT | |
1406 | ' \ | |
1407 | -e '/^#[ ]*define[ ]*MAXINT[ ]/a\ | |
1408 | #endif | |
1409 | ' \ | |
1410 | < $infile > ${DESTDIR}/fixinc.tmp | |
1411 | rm -f ${DESTFILE} | |
1412 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
1413 | ;; # case end for file name test | |
1414 | esac | |
1415 | ||
1416 | ||
1417 | # | |
1418 | # Fix Hpux_Systime | |
1419 | # | |
1420 | case "${file}" in ./sys/time.h ) | |
1421 | if ( test -n "`egrep '^extern struct sigevent;' ${file}`" | |
1422 | ) > /dev/null 2>&1 ; then | |
1423 | fixlist="${fixlist} | |
1424 | hpux_systime" | |
1425 | if [ ! -r ${DESTFILE} ] | |
1426 | then infile=${file} | |
1427 | else infile=${DESTFILE} ; fi | |
1428 | ||
1429 | sed -e 's/^extern struct sigevent;/struct sigevent;/' \ | |
1430 | < $infile > ${DESTDIR}/fixinc.tmp | |
1431 | rm -f ${DESTFILE} | |
1432 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
1433 | fi # end of select 'if' | |
1434 | ;; # case end for file name test | |
1435 | esac | |
1436 | ||
1437 | ||
1438 | # | |
1439 | # Fix Hpux8_Bogus_Inlines | |
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 | # | |
1463 | # Fix Hpux11_Uint32_C | |
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 | # | |
1484 | # Fix Isc_Omits_With_Stdc | |
1485 | # | |
1486 | case "${file}" in ./stdio.h | \ | |
1487 | ./math.h | \ | |
1488 | ./ctype.h | \ | |
1489 | ./sys/limits.h | \ | |
1490 | ./sys/fcntl.h | \ | |
1491 | ./sys/dirent.h ) | |
1492 | if ( test -n "`egrep 'defined(__STDC__) && !defined(_POSIX_SOURCE)' ${file}`" | |
1493 | ) > /dev/null 2>&1 ; then | |
1494 | fixlist="${fixlist} | |
1495 | isc_omits_with_stdc" | |
1496 | if [ ! -r ${DESTFILE} ] | |
1497 | then infile=${file} | |
1498 | else infile=${DESTFILE} ; fi | |
1499 | ||
1500 | sed -e 's/!defined(__STDC__) && !defined(_POSIX_SOURCE)/!defined(_POSIX_SOURCE)/' \ | |
1501 | < $infile > ${DESTDIR}/fixinc.tmp | |
1502 | rm -f ${DESTFILE} | |
1503 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
1504 | fi # end of select 'if' | |
1505 | ;; # case end for file name test | |
1506 | esac | |
1507 | ||
1508 | ||
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 | ||
1525 | # | |
1526 | # Fix Io_Def_Quotes | |
1527 | # | |
1528 | if ( test -n "`egrep 'define[ ]+[A-Z0-9_]+IO[A-Z]*\\(([a-zA-Z]).*'\\''\\1'\\''' ${file}`" | |
1529 | ) > /dev/null 2>&1 ; then | |
1530 | fixlist="${fixlist} | |
1531 | io_def_quotes" | |
1532 | if [ ! -r ${DESTFILE} ] | |
1533 | then infile=${file} | |
1534 | else infile=${DESTFILE} ; fi | |
1535 | ${FIXFIXES} ${file} IO_defn < $infile > ${DESTDIR}/fixinc.tmp | |
1536 | rm -f ${DESTFILE} | |
1537 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
1538 | fi # end of select 'if' | |
1539 | ||
1540 | ||
1541 | # | |
1542 | # Fix Ctrl_Use_Quotes | |
1543 | # | |
1544 | if ( test -n "`egrep 'define[ ]+[A-Z0-9_]+[ ]+[A-Z0-9_]+CTRL[ ]*\\( *[^,'\\'']' ${file}`" | |
1545 | ) > /dev/null 2>&1 ; then | |
1546 | fixlist="${fixlist} | |
1547 | ctrl_use_quotes" | |
1548 | if [ ! -r ${DESTFILE} ] | |
1549 | then infile=${file} | |
1550 | else infile=${DESTFILE} ; fi | |
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' | |
1555 | ||
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 | |
1568 | rm -f ${DESTFILE} | |
1569 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
1570 | fi # end of select 'if' | |
1571 | ||
1572 | ||
1573 | # | |
1574 | # Fix Ip_Missing_Semi | |
1575 | # | |
1576 | case "${file}" in ./netinet/ip.h ) | |
1577 | if ( test -n "`egrep '}$' ${file}`" | |
1578 | ) > /dev/null 2>&1 ; then | |
1579 | fixlist="${fixlist} | |
1580 | ip_missing_semi" | |
1581 | if [ ! -r ${DESTFILE} ] | |
1582 | then infile=${file} | |
1583 | else infile=${DESTFILE} ; fi | |
1584 | ||
1585 | sed -e '/^struct/,/^};/s/}$/};/' \ | |
1586 | < $infile > ${DESTDIR}/fixinc.tmp | |
1587 | rm -f ${DESTFILE} | |
1588 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
1589 | fi # end of select 'if' | |
1590 | ;; # case end for file name test | |
1591 | esac | |
1592 | ||
1593 | ||
1594 | # | |
1595 | # Fix Irix_Multiline_Cmnt | |
1596 | # | |
1597 | case "${file}" in ./sys/types.h ) | |
1598 | fixlist="${fixlist} | |
1599 | irix_multiline_cmnt" | |
1600 | if [ ! -r ${DESTFILE} ] | |
1601 | then infile=${file} | |
1602 | else infile=${DESTFILE} ; fi | |
1603 | ||
1604 | sed -e 's@type of the result@type of the result */@' \ | |
1605 | -e 's@of the sizeof@/* of the sizeof@' \ | |
1606 | < $infile > ${DESTDIR}/fixinc.tmp | |
1607 | rm -f ${DESTFILE} | |
1608 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
1609 | ;; # case end for file name test | |
1610 | esac | |
1611 | ||
1612 | ||
1613 | # | |
1614 | # Fix Irix_Sockaddr | |
1615 | # | |
1616 | case "${file}" in ./rpc/auth.h ) | |
1617 | if ( test -n "`egrep 'authdes_create.*struct sockaddr' ${file}`" | |
1618 | ) > /dev/null 2>&1 ; then | |
1619 | if ( test -z "`egrep '<sys/socket.h>' ${file}`" | |
1620 | ) > /dev/null 2>&1 ; then | |
1621 | fixlist="${fixlist} | |
1622 | irix_sockaddr" | |
1623 | if [ ! -r ${DESTFILE} ] | |
1624 | then infile=${file} | |
1625 | else infile=${DESTFILE} ; fi | |
1626 | ||
1627 | sed -e '/authdes_create.*struct sockaddr/i\ | |
1628 | struct sockaddr; | |
1629 | ' \ | |
1630 | < $infile > ${DESTDIR}/fixinc.tmp | |
1631 | rm -f ${DESTFILE} | |
1632 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
1633 | fi # end of bypass 'if' | |
1634 | fi # end of select 'if' | |
1635 | ;; # case end for file name test | |
1636 | esac | |
1637 | ||
1638 | ||
1639 | # | |
1640 | # Fix Irix_Struct__File | |
1641 | # | |
1642 | case "${file}" in ./rpc/xdr.h ) | |
1643 | fixlist="${fixlist} | |
1644 | irix_struct__file" | |
1645 | if [ ! -r ${DESTFILE} ] | |
1646 | then infile=${file} | |
1647 | else infile=${DESTFILE} ; fi | |
1648 | ||
1649 | sed -e '/xdrstdio_create.*struct __file_s/i\ | |
1650 | struct __file_s; | |
1651 | ' \ | |
1652 | < $infile > ${DESTDIR}/fixinc.tmp | |
1653 | rm -f ${DESTFILE} | |
1654 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
1655 | ;; # case end for file name test | |
1656 | esac | |
1657 | ||
1658 | ||
1659 | # | |
1660 | # Fix Irix_Asm_Apostrophe | |
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} | |
1675 | fi # end of select 'if' | |
1676 | ;; # case end for file name test | |
1677 | esac | |
1678 | ||
1679 | ||
1680 | # | |
1681 | # Fix Isc_Fmod | |
1682 | # | |
1683 | case "${file}" in ./math.h ) | |
1684 | if ( test -n "`egrep 'fmod\\(double\\)' ${file}`" | |
1685 | ) > /dev/null 2>&1 ; then | |
1686 | fixlist="${fixlist} | |
1687 | isc_fmod" | |
1688 | if [ ! -r ${DESTFILE} ] | |
1689 | then infile=${file} | |
1690 | else infile=${DESTFILE} ; fi | |
1691 | ||
1692 | sed -e 's/fmod(double)/fmod(double, double)/' \ | |
1693 | < $infile > ${DESTDIR}/fixinc.tmp | |
1694 | rm -f ${DESTFILE} | |
1695 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
1696 | fi # end of select 'if' | |
1697 | ;; # case end for file name test | |
1698 | esac | |
1699 | ||
1700 | ||
1701 | # | |
1702 | # Fix Motorola_Nested | |
1703 | # | |
1704 | case "${file}" in ./limits.h | \ | |
1705 | ./sys/limits.h ) | |
1706 | case "$target_canonical" in m68k-motorola-sysv* ) | |
1707 | fixlist="${fixlist} | |
1708 | motorola_nested" | |
1709 | if [ ! -r ${DESTFILE} ] | |
1710 | then infile=${file} | |
1711 | else infile=${DESTFILE} ; fi | |
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@' \ | |
1715 | < $infile > ${DESTDIR}/fixinc.tmp | |
1716 | rm -f ${DESTFILE} | |
1717 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
1718 | ;; # case end for machine type test | |
1719 | esac | |
1720 | ;; # case end for file name test | |
1721 | esac | |
1722 | ||
1723 | ||
1724 | # | |
1725 | # Fix Isc_Sys_Limits | |
1726 | # | |
1727 | case "${file}" in ./sys/limits.h ) | |
1728 | if ( test -n "`egrep 'CHILD_MAX' ${file}`" | |
1729 | ) > /dev/null 2>&1 ; then | |
1730 | fixlist="${fixlist} | |
1731 | isc_sys_limits" | |
1732 | if [ ! -r ${DESTFILE} ] | |
1733 | then infile=${file} | |
1734 | else infile=${DESTFILE} ; fi | |
1735 | ||
1736 | sed -e '/CHILD_MAX/s,/\* Max, Max,' \ | |
1737 | -e '/OPEN_MAX/s,/\* Max, Max,' \ | |
1738 | < $infile > ${DESTDIR}/fixinc.tmp | |
1739 | rm -f ${DESTFILE} | |
1740 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
1741 | fi # end of select 'if' | |
1742 | ;; # case end for file name test | |
1743 | esac | |
1744 | ||
1745 | ||
1746 | # | |
1747 | # Fix Kandr_Concat | |
1748 | # | |
1749 | case "${file}" in ./sparc/asm_linkage.h | \ | |
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 ) | |
1767 | if ( test -n "`egrep '/\\*\\*/' ${file}`" | |
1768 | ) > /dev/null 2>&1 ; then | |
1769 | fixlist="${fixlist} | |
1770 | kandr_concat" | |
1771 | if [ ! -r ${DESTFILE} ] | |
1772 | then infile=${file} | |
1773 | else infile=${DESTFILE} ; fi | |
1774 | ||
1775 | sed -e 's|/\*\*/|##|g' \ | |
1776 | < $infile > ${DESTDIR}/fixinc.tmp | |
1777 | rm -f ${DESTFILE} | |
1778 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
1779 | fi # end of select 'if' | |
1780 | ;; # case end for file name test | |
1781 | esac | |
1782 | ||
1783 | ||
1784 | # | |
1785 | # Fix Limits_Ifndefs | |
1786 | # | |
1787 | case "${file}" in ./limits.h | \ | |
1788 | ./sys/limits.h ) | |
1789 | if ( test -z "`egrep 'ifndef[ ]+FLT_MIN' ${file}`" | |
1790 | ) > /dev/null 2>&1 ; then | |
1791 | fixlist="${fixlist} | |
1792 | limits_ifndefs" | |
1793 | if [ ! -r ${DESTFILE} ] | |
1794 | then infile=${file} | |
1795 | else infile=${DESTFILE} ; fi | |
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/' \ | |
1834 | < $infile > ${DESTDIR}/fixinc.tmp | |
1835 | rm -f ${DESTFILE} | |
1836 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
1837 | fi # end of bypass 'if' | |
1838 | ;; # case end for file name test | |
1839 | esac | |
1840 | ||
1841 | ||
1842 | # | |
1843 | # Fix Lynx_Void_Int | |
1844 | # | |
1845 | case "${file}" in ./curses.h ) | |
1846 | if ( test -n "`egrep '#[ ]*define[ ]+void[ ]+int' ${file}`" | |
1847 | ) > /dev/null 2>&1 ; then | |
1848 | fixlist="${fixlist} | |
1849 | lynx_void_int" | |
1850 | if [ ! -r ${DESTFILE} ] | |
1851 | then infile=${file} | |
1852 | else infile=${DESTFILE} ; fi | |
1853 | ||
1854 | sed -e '/#[ ]*define[ ][ ]*void[ ]int/d' \ | |
1855 | < $infile > ${DESTDIR}/fixinc.tmp | |
1856 | rm -f ${DESTFILE} | |
1857 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
1858 | fi # end of select 'if' | |
1859 | ;; # case end for file name test | |
1860 | esac | |
1861 | ||
1862 | ||
1863 | # | |
1864 | # Fix Lynxos_Fcntl_Proto | |
1865 | # | |
1866 | case "${file}" in ./fcntl.h ) | |
1867 | if ( test -n "`egrep 'fcntl.*\\(int, int, int\\)' ${file}`" | |
1868 | ) > /dev/null 2>&1 ; then | |
1869 | fixlist="${fixlist} | |
1870 | lynxos_fcntl_proto" | |
1871 | if [ ! -r ${DESTFILE} ] | |
1872 | then infile=${file} | |
1873 | else infile=${DESTFILE} ; fi | |
1874 | ||
1875 | sed -e 's/\(fcntl.*(int, int, \)int)/\1...)/' \ | |
1876 | < $infile > ${DESTDIR}/fixinc.tmp | |
1877 | rm -f ${DESTFILE} | |
1878 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
1879 | fi # end of select 'if' | |
1880 | ;; # case end for file name test | |
1881 | esac | |
1882 | ||
1883 | ||
1884 | # | |
1885 | # Fix M88k_Bad_Hypot_Opt | |
1886 | # | |
1887 | case "${file}" in ./math.h ) | |
1888 | case "$target_canonical" in m88k-motorola-sysv3* ) | |
1889 | fixlist="${fixlist} | |
1890 | m88k_bad_hypot_opt" | |
1891 | if [ ! -r ${DESTFILE} ] | |
1892 | then infile=${file} | |
1893 | else infile=${DESTFILE} ; fi | |
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 | ' \ | |
1910 | < $infile > ${DESTDIR}/fixinc.tmp | |
1911 | rm -f ${DESTFILE} | |
1912 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
1913 | ;; # case end for machine type test | |
1914 | esac | |
1915 | ;; # case end for file name test | |
1916 | esac | |
1917 | ||
1918 | ||
1919 | # | |
1920 | # Fix M88k_Bad_S_If | |
1921 | # | |
1922 | case "${file}" in ./sys/stat.h ) | |
1923 | case "$target_canonical" in m88k-*-sysv3* ) | |
1924 | if ( test -n "`egrep '#define[ ]+S_IS[A-Z]*(m)[ ]' ${file}`" | |
1925 | ) > /dev/null 2>&1 ; then | |
1926 | fixlist="${fixlist} | |
1927 | m88k_bad_s_if" | |
1928 | if [ ! -r ${DESTFILE} ] | |
1929 | then infile=${file} | |
1930 | else infile=${DESTFILE} ; fi | |
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)/' \ | |
1934 | < $infile > ${DESTDIR}/fixinc.tmp | |
1935 | rm -f ${DESTFILE} | |
1936 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
1937 | fi # end of select 'if' | |
1938 | ;; # case end for machine type test | |
1939 | esac | |
1940 | ;; # case end for file name test | |
1941 | esac | |
1942 | ||
1943 | ||
1944 | # | |
1945 | # Fix M88k_Multi_Incl | |
1946 | # | |
1947 | case "${file}" in ./time.h ) | |
1948 | case "$target_canonical" in m88k-tektronix-sysv3* ) | |
1949 | if ( test -z "`egrep '#ifndef' ${file}`" | |
1950 | ) > /dev/null 2>&1 ; then | |
1951 | fixlist="${fixlist} | |
1952 | m88k_multi_incl" | |
1953 | if [ ! -r ${DESTFILE} ] | |
1954 | then infile=${file} | |
1955 | else infile=${DESTFILE} ; fi | |
1956 | ( echo Fixing $file, to protect against multiple inclusion. >&2 | |
1957 | cpp_wrapper=`echo $file | sed -e 's,\.,_,g' -e 's,/,_,g'` | |
1958 | echo "#ifndef __GCC_GOT_${cpp_wrapper}_" | |
1959 | echo "#define __GCC_GOT_${cpp_wrapper}_" | |
1960 | cat | |
1961 | echo "#endif /* ! __GCC_GOT_${cpp_wrapper}_ */" ) < $infile > ${DESTDIR}/fixinc.tmp | |
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 | # | |
1966 | if test ! -f ${DESTDIR}/fixinc.tmp | |
1967 | then continue ; fi | |
1968 | rm -f ${DESTFILE} | |
1969 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
1970 | fi # end of bypass 'if' | |
1971 | ;; # case end for machine type test | |
1972 | esac | |
1973 | ;; # case end for file name test | |
1974 | esac | |
1975 | ||
1976 | ||
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 | ||
2001 | # | |
2002 | # Fix Machine_Name | |
2003 | # | |
2004 | if ${FIXTESTS} ${file} machine_name | |
2005 | then | |
2006 | fixlist="${fixlist} | |
2007 | machine_name" | |
2008 | if [ ! -r ${DESTFILE} ] | |
2009 | then infile=${file} | |
2010 | else infile=${DESTFILE} ; fi | |
2011 | ${FIXFIXES} ${file} machine_name < $infile > ${DESTDIR}/fixinc.tmp | |
2012 | rm -f ${DESTFILE} | |
2013 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
2014 | fi # end of c_test 'if' | |
2015 | ||
2016 | ||
2017 | # | |
2018 | # Fix Math_Exception | |
2019 | # | |
2020 | case "${file}" in ./math.h ) | |
2021 | if ( test -n "`egrep 'struct exception' ${file}`" | |
2022 | ) > /dev/null 2>&1 ; then | |
2023 | if ( test -z "`egrep 'We have a problem when using C\\+\\+' ${file}`" | |
2024 | ) > /dev/null 2>&1 ; then | |
2025 | fixlist="${fixlist} | |
2026 | math_exception" | |
2027 | if [ ! -r ${DESTFILE} ] | |
2028 | then infile=${file} | |
2029 | else infile=${DESTFILE} ; fi | |
2030 | ||
2031 | sed -e '1i\ | |
2032 | #ifdef __cplusplus\ | |
2033 | #define exception __math_exception\ | |
2034 | #endif | |
2035 | ' \ | |
2036 | -e '$a\ | |
2037 | #ifdef __cplusplus\ | |
2038 | #undef exception\ | |
2039 | #endif | |
2040 | ' \ | |
2041 | < $infile > ${DESTDIR}/fixinc.tmp | |
2042 | rm -f ${DESTFILE} | |
2043 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
2044 | fi # end of bypass 'if' | |
2045 | fi # end of select 'if' | |
2046 | ;; # case end for file name test | |
2047 | esac | |
2048 | ||
2049 | ||
2050 | # | |
2051 | # Fix Math_Huge_Val_From_Dbl_Max | |
2052 | # | |
2053 | case "${file}" in ./math.h ) | |
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 | |
2058 | fixlist="${fixlist} | |
2059 | math_huge_val_from_dbl_max" | |
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` | |
2064 | ||
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 | |
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 | # | |
2073 | if test ! -f ${DESTDIR}/fixinc.tmp | |
2074 | then continue ; fi | |
2075 | rm -f ${DESTFILE} | |
2076 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
2077 | fi # end of bypass 'if' | |
2078 | fi # end of select 'if' | |
2079 | ;; # case end for file name test | |
2080 | esac | |
2081 | ||
2082 | ||
2083 | # | |
2084 | # Fix Math_Huge_Val_Ifndef | |
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' | |
2105 | ;; # case end for file name test | |
2106 | esac | |
2107 | ||
2108 | ||
2109 | # | |
2110 | # Fix Nested_Comment | |
2111 | # | |
2112 | case "${file}" in ./rpc/rpc.h ) | |
2113 | fixlist="${fixlist} | |
2114 | nested_comment" | |
2115 | if [ ! -r ${DESTFILE} ] | |
2116 | then infile=${file} | |
2117 | else infile=${DESTFILE} ; fi | |
2118 | ||
2119 | sed -e 's@^\(/\*.*rpc/auth_des.h>.*\)/\*@\1*/ /*@' \ | |
2120 | < $infile > ${DESTDIR}/fixinc.tmp | |
2121 | rm -f ${DESTFILE} | |
2122 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
2123 | ;; # case end for file name test | |
2124 | esac | |
2125 | ||
2126 | ||
2127 | # | |
2128 | # Fix News_Os_Recursion | |
2129 | # | |
2130 | case "${file}" in ./stdlib.h ) | |
2131 | if ( test -n "`egrep '#include <stdlib.h>' ${file}`" | |
2132 | ) > /dev/null 2>&1 ; then | |
2133 | fixlist="${fixlist} | |
2134 | news_os_recursion" | |
2135 | if [ ! -r ${DESTFILE} ] | |
2136 | then infile=${file} | |
2137 | else infile=${DESTFILE} ; fi | |
2138 | ||
2139 | sed -e '/^#include <stdlib.h>/i\ | |
2140 | #ifdef BOGUS_RECURSION | |
2141 | ' \ | |
2142 | -e '/^#include <stdlib.h>/a\ | |
2143 | #endif | |
2144 | ' \ | |
2145 | < $infile > ${DESTDIR}/fixinc.tmp | |
2146 | rm -f ${DESTFILE} | |
2147 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
2148 | fi # end of select 'if' | |
2149 | ;; # case end for file name test | |
2150 | esac | |
2151 | ||
2152 | ||
2153 | # | |
2154 | # Fix Next_Math_Prefix | |
2155 | # | |
2156 | case "${file}" in ./ansi/math.h ) | |
2157 | if ( test -n "`egrep '^extern.*double.*__const__.*' ${file}`" | |
2158 | ) > /dev/null 2>&1 ; then | |
2159 | fixlist="${fixlist} | |
2160 | next_math_prefix" | |
2161 | if [ ! -r ${DESTFILE} ] | |
2162 | then infile=${file} | |
2163 | else infile=${DESTFILE} ; fi | |
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__//' \ | |
2170 | < $infile > ${DESTDIR}/fixinc.tmp | |
2171 | rm -f ${DESTFILE} | |
2172 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
2173 | fi # end of select 'if' | |
2174 | ;; # case end for file name test | |
2175 | esac | |
2176 | ||
2177 | ||
2178 | # | |
2179 | # Fix Next_Template | |
2180 | # | |
2181 | case "${file}" in ./bsd/libc.h ) | |
2182 | if ( test -n "`egrep 'template' ${file}`" | |
2183 | ) > /dev/null 2>&1 ; then | |
2184 | fixlist="${fixlist} | |
2185 | next_template" | |
2186 | if [ ! -r ${DESTFILE} ] | |
2187 | then infile=${file} | |
2188 | else infile=${DESTFILE} ; fi | |
2189 | ||
2190 | sed -e '/\(.*template\)/s/template//' \ | |
2191 | -e '/extern.*volatile.*void.*abort/s/volatile//' \ | |
2192 | < $infile > ${DESTDIR}/fixinc.tmp | |
2193 | rm -f ${DESTFILE} | |
2194 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
2195 | fi # end of select 'if' | |
2196 | ;; # case end for file name test | |
2197 | esac | |
2198 | ||
2199 | ||
2200 | # | |
2201 | # Fix Next_Volitile | |
2202 | # | |
2203 | case "${file}" in ./ansi/stdlib.h ) | |
2204 | if ( test -n "`egrep 'volatile' ${file}`" | |
2205 | ) > /dev/null 2>&1 ; then | |
2206 | fixlist="${fixlist} | |
2207 | next_volitile" | |
2208 | if [ ! -r ${DESTFILE} ] | |
2209 | then infile=${file} | |
2210 | else infile=${DESTFILE} ; fi | |
2211 | ||
2212 | sed -e '/extern.*volatile.*void.*exit/s/volatile//' \ | |
2213 | -e '/extern.*volatile.*void.*abort/s/volatile//' \ | |
2214 | < $infile > ${DESTDIR}/fixinc.tmp | |
2215 | rm -f ${DESTFILE} | |
2216 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
2217 | fi # end of select 'if' | |
2218 | ;; # case end for file name test | |
2219 | esac | |
2220 | ||
2221 | ||
2222 | # | |
2223 | # Fix Next_Wait_Union | |
2224 | # | |
2225 | case "${file}" in ./sys/wait.h ) | |
2226 | if ( test -n "`egrep 'wait\\(union wait' ${file}`" | |
2227 | ) > /dev/null 2>&1 ; then | |
2228 | fixlist="${fixlist} | |
2229 | next_wait_union" | |
2230 | if [ ! -r ${DESTFILE} ] | |
2231 | then infile=${file} | |
2232 | else infile=${DESTFILE} ; fi | |
2233 | ||
2234 | sed -e 's@wait(union wait@wait(void@' \ | |
2235 | < $infile > ${DESTDIR}/fixinc.tmp | |
2236 | rm -f ${DESTFILE} | |
2237 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
2238 | fi # end of select 'if' | |
2239 | ;; # case end for file name test | |
2240 | esac | |
2241 | ||
2242 | ||
2243 | # | |
2244 | # Fix Nodeent_Syntax | |
2245 | # | |
2246 | case "${file}" in ./netdnet/dnetdb.h ) | |
2247 | fixlist="${fixlist} | |
2248 | nodeent_syntax" | |
2249 | if [ ! -r ${DESTFILE} ] | |
2250 | then infile=${file} | |
2251 | else infile=${DESTFILE} ; fi | |
2252 | ||
2253 | sed -e 's/char.*na_addr *$/char *na_addr;/' \ | |
2254 | < $infile > ${DESTDIR}/fixinc.tmp | |
2255 | rm -f ${DESTFILE} | |
2256 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
2257 | ;; # case end for file name test | |
2258 | esac | |
2259 | ||
2260 | ||
2261 | # | |
2262 | # Fix Osf_Namespace_A | |
2263 | # | |
2264 | case "${file}" in ./reg_types.h | \ | |
2265 | ./sys/lc_core.h ) | |
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`" ')' | |
2270 | ) > /dev/null 2>&1 ; then | |
2271 | fixlist="${fixlist} | |
2272 | osf_namespace_a" | |
2273 | if [ ! -r ${DESTFILE} ] | |
2274 | then infile=${file} | |
2275 | else infile=${DESTFILE} ; fi | |
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' \ | |
2280 | < $infile > ${DESTDIR}/fixinc.tmp | |
2281 | rm -f ${DESTFILE} | |
2282 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
2283 | fi # end of test expression 'if' | |
2284 | ;; # case end for file name test | |
2285 | esac | |
2286 | ||
2287 | ||
2288 | # | |
2289 | # Fix Osf_Namespace_B | |
2290 | # | |
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`" ')' | |
2296 | ) > /dev/null 2>&1 ; then | |
2297 | fixlist="${fixlist} | |
2298 | osf_namespace_b" | |
2299 | if [ ! -r ${DESTFILE} ] | |
2300 | then infile=${file} | |
2301 | else infile=${DESTFILE} ; fi | |
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 | ' \ | |
2308 | < $infile > ${DESTDIR}/fixinc.tmp | |
2309 | rm -f ${DESTFILE} | |
2310 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
2311 | fi # end of test expression 'if' | |
2312 | ;; # case end for file name test | |
2313 | esac | |
2314 | ||
2315 | ||
2316 | # | |
2317 | # Fix Pthread_Page_Size | |
2318 | # | |
2319 | case "${file}" in ./pthread.h ) | |
2320 | if ( test -n "`egrep '^int __page_size' ${file}`" | |
2321 | ) > /dev/null 2>&1 ; then | |
2322 | fixlist="${fixlist} | |
2323 | pthread_page_size" | |
2324 | if [ ! -r ${DESTFILE} ] | |
2325 | then infile=${file} | |
2326 | else infile=${DESTFILE} ; fi | |
2327 | ||
2328 | sed -e 's/^int __page_size/extern int __page_size/' \ | |
2329 | < $infile > ${DESTDIR}/fixinc.tmp | |
2330 | rm -f ${DESTFILE} | |
2331 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
2332 | fi # end of select 'if' | |
2333 | ;; # case end for file name test | |
2334 | esac | |
2335 | ||
2336 | ||
2337 | # | |
2338 | # Fix Read_Ret_Type | |
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} | |
2354 | fi # end of select 'if' | |
2355 | ;; # case end for file name test | |
2356 | esac | |
2357 | ||
2358 | ||
2359 | # | |
2360 | # Fix Rs6000_Double | |
2361 | # | |
2362 | case "${file}" in ./math.h ) | |
2363 | if ( test -n "`egrep '[^a-zA-Z_]class\\(' ${file}`" | |
2364 | ) > /dev/null 2>&1 ; then | |
2365 | fixlist="${fixlist} | |
2366 | rs6000_double" | |
2367 | if [ ! -r ${DESTFILE} ] | |
2368 | then infile=${file} | |
2369 | else infile=${DESTFILE} ; fi | |
2370 | ||
2371 | sed -e '/class[(]/i\ | |
2372 | #ifndef __cplusplus | |
2373 | ' \ | |
2374 | -e '/class[(]/a\ | |
2375 | #endif | |
2376 | ' \ | |
2377 | < $infile > ${DESTDIR}/fixinc.tmp | |
2378 | rm -f ${DESTFILE} | |
2379 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
2380 | fi # end of select 'if' | |
2381 | ;; # case end for file name test | |
2382 | esac | |
2383 | ||
2384 | ||
2385 | # | |
2386 | # Fix Rs6000_Fchmod | |
2387 | # | |
2388 | case "${file}" in ./sys/stat.h ) | |
2389 | if ( test -n "`egrep 'fchmod\\(char' ${file}`" | |
2390 | ) > /dev/null 2>&1 ; then | |
2391 | fixlist="${fixlist} | |
2392 | rs6000_fchmod" | |
2393 | if [ ! -r ${DESTFILE} ] | |
2394 | then infile=${file} | |
2395 | else infile=${DESTFILE} ; fi | |
2396 | ||
2397 | sed -e 's/fchmod(char \*/fchmod(int/' \ | |
2398 | < $infile > ${DESTDIR}/fixinc.tmp | |
2399 | rm -f ${DESTFILE} | |
2400 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
2401 | fi # end of select 'if' | |
2402 | ;; # case end for file name test | |
2403 | esac | |
2404 | ||
2405 | ||
2406 | # | |
2407 | # Fix Rs6000_Param | |
2408 | # | |
2409 | case "${file}" in ./stdio.h | \ | |
2410 | ./unistd.h ) | |
2411 | if ( test -n "`egrep 'const char new' ${file}`" | |
2412 | ) > /dev/null 2>&1 ; then | |
2413 | fixlist="${fixlist} | |
2414 | rs6000_param" | |
2415 | if [ ! -r ${DESTFILE} ] | |
2416 | then infile=${file} | |
2417 | else infile=${DESTFILE} ; fi | |
2418 | ||
2419 | sed -e 's@rename(const char \*old, const char \*new)@rename(const char *_old, const char *_new)@' \ | |
2420 | < $infile > ${DESTDIR}/fixinc.tmp | |
2421 | rm -f ${DESTFILE} | |
2422 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
2423 | fi # end of select 'if' | |
2424 | ;; # case end for file name test | |
2425 | esac | |
2426 | ||
2427 | ||
2428 | # | |
2429 | # Fix Sony_Include | |
2430 | # | |
2431 | case "${file}" in ./machine/machparam.h ) | |
2432 | if ( test -n "`egrep '\"\\.\\./machine/endian.h\"' ${file}`" | |
2433 | ) > /dev/null 2>&1 ; then | |
2434 | fixlist="${fixlist} | |
2435 | sony_include" | |
2436 | if [ ! -r ${DESTFILE} ] | |
2437 | then infile=${file} | |
2438 | else infile=${DESTFILE} ; fi | |
2439 | ||
2440 | sed -e 's@"../machine/endian.h"@<machine/endian.h>@' \ | |
2441 | < $infile > ${DESTDIR}/fixinc.tmp | |
2442 | rm -f ${DESTFILE} | |
2443 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
2444 | fi # end of select 'if' | |
2445 | ;; # case end for file name test | |
2446 | esac | |
2447 | ||
2448 | ||
2449 | # | |
2450 | # Fix Statsswtch | |
2451 | # | |
2452 | case "${file}" in ./rpcsvc/rstat.h ) | |
2453 | if ( test -n "`egrep 'boottime$' ${file}`" | |
2454 | ) > /dev/null 2>&1 ; then | |
2455 | fixlist="${fixlist} | |
2456 | statsswtch" | |
2457 | if [ ! -r ${DESTFILE} ] | |
2458 | then infile=${file} | |
2459 | else infile=${DESTFILE} ; fi | |
2460 | ||
2461 | sed -e 's/boottime$/boottime;/' \ | |
2462 | < $infile > ${DESTDIR}/fixinc.tmp | |
2463 | rm -f ${DESTFILE} | |
2464 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
2465 | fi # end of select 'if' | |
2466 | ;; # case end for file name test | |
2467 | esac | |
2468 | ||
2469 | ||
2470 | # | |
2471 | # Fix Stdio_Stdarg_H | |
2472 | # | |
2473 | case "${file}" in ./stdio.h ) | |
2474 | if ( test -z "`egrep 'include.*(stdarg.h|machine/ansi.h)' ${file}`" | |
2475 | ) > /dev/null 2>&1 ; then | |
2476 | fixlist="${fixlist} | |
2477 | stdio_stdarg_h" | |
2478 | if [ ! -r ${DESTFILE} ] | |
2479 | then infile=${file} | |
2480 | else infile=${DESTFILE} ; fi | |
2481 | ||
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 | ||
2493 | ||
2494 | # | |
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)@ | |
2512 | s@typedef[ ]\(.*\)[ ]va_list[ ]*;@typedef \1 __not_va_list__;@ | |
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 | |
2518 | rm -f ${DESTFILE} | |
2519 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
2520 | fi # end of bypass 'if' | |
2521 | ;; # case end for file name test | |
2522 | esac | |
2523 | ||
2524 | ||
2525 | # | |
2526 | # Fix Sun_Bogus_Ifdef | |
2527 | # | |
2528 | case "${file}" in ./hsfs/hsfs_spec.h | \ | |
2529 | ./hsfs/iso_spec.h ) | |
2530 | if ( test -n "`egrep '#ifdef __i386__ || __vax__' ${file}`" | |
2531 | ) > /dev/null 2>&1 ; then | |
2532 | fixlist="${fixlist} | |
2533 | sun_bogus_ifdef" | |
2534 | if [ ! -r ${DESTFILE} ] | |
2535 | then infile=${file} | |
2536 | else infile=${DESTFILE} ; fi | |
2537 | ||
2538 | sed -e 's/\#ifdef __i386__ || __vax__/\#if __i386__ || __vax__/g' \ | |
2539 | < $infile > ${DESTDIR}/fixinc.tmp | |
2540 | rm -f ${DESTFILE} | |
2541 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
2542 | fi # end of select 'if' | |
2543 | ;; # case end for file name test | |
2544 | esac | |
2545 | ||
2546 | ||
2547 | # | |
2548 | # Fix Sun_Bogus_Ifdef_Sun4c | |
2549 | # | |
2550 | case "${file}" in ./hsfs/hsnode.h ) | |
2551 | if ( test -n "`egrep '#ifdef __i386__ || __sun4c__' ${file}`" | |
2552 | ) > /dev/null 2>&1 ; then | |
2553 | fixlist="${fixlist} | |
2554 | sun_bogus_ifdef_sun4c" | |
2555 | if [ ! -r ${DESTFILE} ] | |
2556 | then infile=${file} | |
2557 | else infile=${DESTFILE} ; fi | |
2558 | ||
2559 | sed -e 's/\#ifdef __i386__ || __sun4c__/\#if __i386__ || __sun4c__/g' \ | |
2560 | < $infile > ${DESTDIR}/fixinc.tmp | |
2561 | rm -f ${DESTFILE} | |
2562 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
2563 | fi # end of select 'if' | |
2564 | ;; # case end for file name test | |
2565 | esac | |
2566 | ||
2567 | ||
2568 | # | |
2569 | # Fix Sun_Catmacro | |
2570 | # | |
2571 | case "${file}" in ./pixrect/memvar.h ) | |
2572 | if ( test -n "`egrep '^#define[ ]+CAT\\(a,b\\)' ${file}`" | |
2573 | ) > /dev/null 2>&1 ; then | |
2574 | fixlist="${fixlist} | |
2575 | sun_catmacro" | |
2576 | if [ ! -r ${DESTFILE} ] | |
2577 | then infile=${file} | |
2578 | else infile=${DESTFILE} ; fi | |
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 | ' \ | |
2588 | < $infile > ${DESTDIR}/fixinc.tmp | |
2589 | rm -f ${DESTFILE} | |
2590 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
2591 | fi # end of select 'if' | |
2592 | ;; # case end for file name test | |
2593 | esac | |
2594 | ||
2595 | ||
2596 | # | |
2597 | # Fix Sun_Malloc | |
2598 | # | |
2599 | case "${file}" in ./malloc.h ) | |
2600 | fixlist="${fixlist} | |
2601 | sun_malloc" | |
2602 | if [ ! -r ${DESTFILE} ] | |
2603 | then infile=${file} | |
2604 | else infile=${DESTFILE} ; fi | |
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' \ | |
2610 | < $infile > ${DESTDIR}/fixinc.tmp | |
2611 | rm -f ${DESTFILE} | |
2612 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
2613 | ;; # case end for file name test | |
2614 | esac | |
2615 | ||
2616 | ||
2617 | # | |
2618 | # Fix Sun_Rusers_Semi | |
2619 | # | |
2620 | case "${file}" in ./rpcsvc/rusers.h ) | |
2621 | if ( test -n "`egrep '_cnt$' ${file}`" | |
2622 | ) > /dev/null 2>&1 ; then | |
2623 | fixlist="${fixlist} | |
2624 | sun_rusers_semi" | |
2625 | if [ ! -r ${DESTFILE} ] | |
2626 | then infile=${file} | |
2627 | else infile=${DESTFILE} ; fi | |
2628 | ||
2629 | sed -e '/^struct/,/^};/s/_cnt$/_cnt;/' \ | |
2630 | < $infile > ${DESTDIR}/fixinc.tmp | |
2631 | rm -f ${DESTFILE} | |
2632 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
2633 | fi # end of select 'if' | |
2634 | ;; # case end for file name test | |
2635 | esac | |
2636 | ||
2637 | ||
2638 | # | |
2639 | # Fix Sun_Signal | |
2640 | # | |
2641 | case "${file}" in ./sys/signal.h | \ | |
2642 | ./signal.h ) | |
2643 | if ( test -n "`egrep '^void \\(\\*signal\\(\\)\\)\\(\\);' ${file}`" | |
2644 | ) > /dev/null 2>&1 ; then | |
2645 | fixlist="${fixlist} | |
2646 | sun_signal" | |
2647 | if [ ! -r ${DESTFILE} ] | |
2648 | then infile=${file} | |
2649 | else infile=${DESTFILE} ; fi | |
2650 | ||
2651 | sed -e '/^void (\*signal())();$/i\ | |
2652 | #ifdef __cplusplus\ | |
2653 | void (*signal(...))(...);\ | |
2654 | #else | |
2655 | ' \ | |
2656 | -e '/^void (\*signal())();$/a\ | |
2657 | #endif | |
2658 | ' \ | |
2659 | < $infile > ${DESTDIR}/fixinc.tmp | |
2660 | rm -f ${DESTFILE} | |
2661 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
2662 | fi # end of select 'if' | |
2663 | ;; # case end for file name test | |
2664 | esac | |
2665 | ||
2666 | ||
2667 | # | |
2668 | # Fix Sun_Auth_Proto | |
2669 | # | |
2670 | case "${file}" in ./rpc/auth.h | \ | |
2671 | ./rpc/clnt.h | \ | |
2672 | ./rpc/svc.h | \ | |
2673 | ./rpc/xdr.h ) | |
2674 | if ( test -n "`egrep '\\(\\*[a-z][a-z_]*\\)\\(\\)' ${file}`" | |
2675 | ) > /dev/null 2>&1 ; then | |
2676 | fixlist="${fixlist} | |
2677 | sun_auth_proto" | |
2678 | if [ ! -r ${DESTFILE} ] | |
2679 | then infile=${file} | |
2680 | else infile=${DESTFILE} ; fi | |
2681 | ||
2682 | sed -e 's/^\(.*(\*[a-z][a-z_]*)(\)\();.*\)/\ | |
2683 | #ifdef __cplusplus\ | |
2684 | \1...\2\ | |
2685 | #else\ | |
2686 | \1\2\ | |
2687 | #endif/' \ | |
2688 | < $infile > ${DESTDIR}/fixinc.tmp | |
2689 | rm -f ${DESTFILE} | |
2690 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
2691 | fi # end of select 'if' | |
2692 | ;; # case end for file name test | |
2693 | esac | |
2694 | ||
2695 | ||
2696 | # | |
2697 | # Fix Sunos_Matherr_Decl | |
2698 | # | |
2699 | case "${file}" in ./math.h ) | |
2700 | if ( test -z "`egrep 'matherr.*struct exception' ${file}`" | |
2701 | ) > /dev/null 2>&1 ; then | |
2702 | fixlist="${fixlist} | |
2703 | sunos_matherr_decl" | |
2704 | if [ ! -r ${DESTFILE} ] | |
2705 | then infile=${file} | |
2706 | else infile=${DESTFILE} ; fi | |
2707 | ||
2708 | sed -e '/^struct exception/,$b' \ | |
2709 | -e '/matherr/i\ | |
2710 | struct exception; | |
2711 | ' \ | |
2712 | < $infile > ${DESTDIR}/fixinc.tmp | |
2713 | rm -f ${DESTFILE} | |
2714 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
2715 | fi # end of bypass 'if' | |
2716 | ;; # case end for file name test | |
2717 | esac | |
2718 | ||
2719 | ||
2720 | # | |
2721 | # Fix Sunos_Strlen | |
2722 | # | |
2723 | case "${file}" in ./strings.h ) | |
2724 | if ( test -n "`egrep 'int[ ]*strlen' ${file}`" | |
2725 | ) > /dev/null 2>&1 ; then | |
2726 | fixlist="${fixlist} | |
2727 | sunos_strlen" | |
2728 | if [ ! -r ${DESTFILE} ] | |
2729 | then infile=${file} | |
2730 | else infile=${DESTFILE} ; fi | |
2731 | ||
2732 | sed -e 's/int[ ]*strlen();/__SIZE_TYPE__ strlen();/' \ | |
2733 | < $infile > ${DESTDIR}/fixinc.tmp | |
2734 | rm -f ${DESTFILE} | |
2735 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
2736 | fi # end of select 'if' | |
2737 | ;; # case end for file name test | |
2738 | esac | |
2739 | ||
2740 | ||
2741 | # | |
2742 | # Fix Systypes | |
2743 | # | |
2744 | case "${file}" in ./sys/types.h | \ | |
2745 | ./stdlib.h | \ | |
2746 | ./sys/stdtypes.h | \ | |
2747 | ./stddef.h | \ | |
2748 | ./memory.h | \ | |
2749 | ./unistd.h ) | |
2750 | if ( test -n "`egrep 'typedef[ ]+[a-z_][ a-z_]*[ ](size|ptrdiff|wchar)_t' ${file}`" | |
2751 | ) > /dev/null 2>&1 ; then | |
2752 | fixlist="${fixlist} | |
2753 | systypes" | |
2754 | if [ ! -r ${DESTFILE} ] | |
2755 | then infile=${file} | |
2756 | else infile=${DESTFILE} ; fi | |
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/' \ | |
2787 | < $infile > ${DESTDIR}/fixinc.tmp | |
2788 | rm -f ${DESTFILE} | |
2789 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
2790 | fi # end of select 'if' | |
2791 | ;; # case end for file name test | |
2792 | esac | |
2793 | ||
2794 | ||
2795 | # | |
2796 | # Fix Systypes_Stdlib_Size_T | |
2797 | # | |
2798 | case "${file}" in ./sys/types.h | \ | |
2799 | ./stdlib.h ) | |
2800 | if ( test -n "`egrep 'typedef[ ][ ]*[A-Za-z_][ A-Za-z_]*[ ]size_t' ${file}`" | |
2801 | ) > /dev/null 2>&1 ; then | |
2802 | if ( test -z "`egrep '_(GCC|BSD)_SIZE_T' ${file}`" | |
2803 | ) > /dev/null 2>&1 ; then | |
2804 | fixlist="${fixlist} | |
2805 | systypes_stdlib_size_t" | |
2806 | if [ ! -r ${DESTFILE} ] | |
2807 | then infile=${file} | |
2808 | else infile=${DESTFILE} ; fi | |
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 | ' \ | |
2817 | < $infile > ${DESTDIR}/fixinc.tmp | |
2818 | rm -f ${DESTFILE} | |
2819 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
2820 | fi # end of bypass 'if' | |
2821 | fi # end of select 'if' | |
2822 | ;; # case end for file name test | |
2823 | esac | |
2824 | ||
2825 | ||
2826 | # | |
2827 | # Fix Sysv68_String | |
2828 | # | |
2829 | case "${file}" in ./string.h ) | |
2830 | fixlist="${fixlist} | |
2831 | sysv68_string" | |
2832 | if [ ! -r ${DESTFILE} ] | |
2833 | then infile=${file} | |
2834 | else infile=${DESTFILE} ; fi | |
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/' \ | |
2847 | < $infile > ${DESTDIR}/fixinc.tmp | |
2848 | rm -f ${DESTFILE} | |
2849 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
2850 | ;; # case end for file name test | |
2851 | esac | |
2852 | ||
2853 | ||
2854 | # | |
2855 | # Fix Sysz_Stdlib_For_Sun | |
2856 | # | |
2857 | case "${file}" in ./stdlib.h ) | |
2858 | fixlist="${fixlist} | |
2859 | sysz_stdlib_for_sun" | |
2860 | if [ ! -r ${DESTFILE} ] | |
2861 | then infile=${file} | |
2862 | else infile=${DESTFILE} ; fi | |
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' \ | |
2869 | -e 's/char[ ]*\*[ ]*bsearch/void \* bsearch/g' \ | |
2870 | -e 's/int[ ][ ]*exit/void exit/g' \ | |
2871 | < $infile > ${DESTDIR}/fixinc.tmp | |
2872 | rm -f ${DESTFILE} | |
2873 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
2874 | ;; # case end for file name test | |
2875 | esac | |
2876 | ||
2877 | ||
2878 | # | |
2879 | # Fix Sysz_Stdtypes_For_Sun | |
2880 | # | |
2881 | case "${file}" in ./sys/stdtypes.h ) | |
2882 | fixlist="${fixlist} | |
2883 | sysz_stdtypes_for_sun" | |
2884 | if [ ! -r ${DESTFILE} ] | |
2885 | then infile=${file} | |
2886 | else infile=${DESTFILE} ; fi | |
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 | ' \ | |
2909 | < $infile > ${DESTDIR}/fixinc.tmp | |
2910 | rm -f ${DESTFILE} | |
2911 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
2912 | ;; # case end for file name test | |
2913 | esac | |
2914 | ||
2915 | ||
2916 | # | |
2917 | # Fix Tinfo_Cplusplus | |
2918 | # | |
2919 | case "${file}" in ./tinfo.h ) | |
2920 | if ( test -n "`egrep '[ ]_cplusplus' ${file}`" | |
2921 | ) > /dev/null 2>&1 ; then | |
2922 | fixlist="${fixlist} | |
2923 | tinfo_cplusplus" | |
2924 | if [ ! -r ${DESTFILE} ] | |
2925 | then infile=${file} | |
2926 | else infile=${DESTFILE} ; fi | |
2927 | ||
2928 | sed -e 's/[ ]_cplusplus/ __cplusplus/' \ | |
2929 | < $infile > ${DESTDIR}/fixinc.tmp | |
2930 | rm -f ${DESTFILE} | |
2931 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
2932 | fi # end of select 'if' | |
2933 | ;; # case end for file name test | |
2934 | esac | |
2935 | ||
2936 | ||
2937 | # | |
2938 | # Fix Ultrix_Fix_Fixproto | |
2939 | # | |
2940 | case "${file}" in ./sys/utsname.h ) | |
2941 | if ( test -n "`egrep 'ULTRIX' ${file}`" | |
2942 | ) > /dev/null 2>&1 ; then | |
2943 | fixlist="${fixlist} | |
2944 | ultrix_fix_fixproto" | |
2945 | if [ ! -r ${DESTFILE} ] | |
2946 | then infile=${file} | |
2947 | else infile=${DESTFILE} ; fi | |
2948 | ||
2949 | sed -e '/^[ ]*extern[ ]*int[ ]*uname();$/i\ | |
2950 | struct utsname; | |
2951 | ' \ | |
2952 | < $infile > ${DESTDIR}/fixinc.tmp | |
2953 | rm -f ${DESTFILE} | |
2954 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
2955 | fi # end of select 'if' | |
2956 | ;; # case end for file name test | |
2957 | esac | |
2958 | ||
2959 | ||
2960 | # | |
2961 | # Fix Ultrix_Atof_Param | |
2962 | # | |
2963 | case "${file}" in ./math.h ) | |
2964 | if ( test -n "`egrep 'atof\\([ ]*char' ${file}`" | |
2965 | ) > /dev/null 2>&1 ; then | |
2966 | fixlist="${fixlist} | |
2967 | ultrix_atof_param" | |
2968 | if [ ! -r ${DESTFILE} ] | |
2969 | then infile=${file} | |
2970 | else infile=${DESTFILE} ; fi | |
2971 | ||
2972 | sed -e 's@atof(\([ ]*char[ ]*\*[^)]*\))@atof(const \1)@' \ | |
2973 | < $infile > ${DESTDIR}/fixinc.tmp | |
2974 | rm -f ${DESTFILE} | |
2975 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
2976 | fi # end of select 'if' | |
2977 | ;; # case end for file name test | |
2978 | esac | |
2979 | ||
2980 | ||
2981 | # | |
2982 | # Fix Ultrix_Const | |
2983 | # | |
2984 | case "${file}" in ./stdio.h ) | |
2985 | fixlist="${fixlist} | |
2986 | ultrix_const" | |
2987 | if [ ! -r ${DESTFILE} ] | |
2988 | then infile=${file} | |
2989 | else infile=${DESTFILE} ; fi | |
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*);@' \ | |
3000 | < $infile > ${DESTDIR}/fixinc.tmp | |
3001 | rm -f ${DESTFILE} | |
3002 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
3003 | ;; # case end for file name test | |
3004 | esac | |
3005 | ||
3006 | ||
3007 | # | |
3008 | # Fix Ultrix_Ifdef | |
3009 | # | |
3010 | case "${file}" in ./sys/file.h ) | |
3011 | if ( test -n "`egrep '#ifdef KERNEL[ ]*[^ ]' ${file}`" | |
3012 | ) > /dev/null 2>&1 ; then | |
3013 | fixlist="${fixlist} | |
3014 | ultrix_ifdef" | |
3015 | if [ ! -r ${DESTFILE} ] | |
3016 | then infile=${file} | |
3017 | else infile=${DESTFILE} ; fi | |
3018 | ||
3019 | sed -e 's/#ifdef KERNEL/#if defined(KERNEL)/' \ | |
3020 | < $infile > ${DESTDIR}/fixinc.tmp | |
3021 | rm -f ${DESTFILE} | |
3022 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
3023 | fi # end of select 'if' | |
3024 | ;; # case end for file name test | |
3025 | esac | |
3026 | ||
3027 | ||
3028 | # | |
3029 | # Fix Ultrix_Nested_Cmnt | |
3030 | # | |
3031 | case "${file}" in ./rpc/svc.h ) | |
3032 | fixlist="${fixlist} | |
3033 | ultrix_nested_cmnt" | |
3034 | if [ ! -r ${DESTFILE} ] | |
3035 | then infile=${file} | |
3036 | else infile=${DESTFILE} ; fi | |
3037 | ||
3038 | sed -e 's@^\( \* int protocol; \)/\*@\1*/ /*@' \ | |
3039 | < $infile > ${DESTDIR}/fixinc.tmp | |
3040 | rm -f ${DESTFILE} | |
3041 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
3042 | ;; # case end for file name test | |
3043 | esac | |
3044 | ||
3045 | ||
3046 | # | |
3047 | # Fix Ultrix_Static | |
3048 | # | |
3049 | case "${file}" in ./machine/cpu.h ) | |
3050 | if ( test -n "`egrep '#include \"r[34]_cpu' ${file}`" | |
3051 | ) > /dev/null 2>&1 ; then | |
3052 | fixlist="${fixlist} | |
3053 | ultrix_static" | |
3054 | if [ ! -r ${DESTFILE} ] | |
3055 | then infile=${file} | |
3056 | else infile=${DESTFILE} ; fi | |
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>/' \ | |
3061 | < $infile > ${DESTDIR}/fixinc.tmp | |
3062 | rm -f ${DESTFILE} | |
3063 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
3064 | fi # end of select 'if' | |
3065 | ;; # case end for file name test | |
3066 | esac | |
3067 | ||
3068 | ||
3069 | # | |
3070 | # Fix Undefine_Null | |
3071 | # | |
3072 | if ( test -n "`egrep '^#[ ]*define[ ]*[ ]NULL[ \r]' ${file}`" | |
3073 | ) > /dev/null 2>&1 ; then | |
3074 | if ( test -z "`egrep '#[ ]*(ifn|un)def[ ]*[ ]NULL($|[ \r])' ${file}`" | |
3075 | ) > /dev/null 2>&1 ; then | |
3076 | fixlist="${fixlist} | |
3077 | undefine_null" | |
3078 | if [ ! -r ${DESTFILE} ] | |
3079 | then infile=${file} | |
3080 | else infile=${DESTFILE} ; fi | |
3081 | ||
3082 | sed -e '/^#[ ]*define[ ][ ]*NULL[ \r]/i\ | |
3083 | #undef NULL | |
3084 | ' \ | |
3085 | < $infile > ${DESTDIR}/fixinc.tmp | |
3086 | rm -f ${DESTFILE} | |
3087 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
3088 | fi # end of bypass 'if' | |
3089 | fi # end of select 'if' | |
3090 | ||
3091 | ||
3092 | # | |
3093 | # Fix Unixware7_Byteorder_Fix | |
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 | # | |
3123 | # Fix Va_I960_Macro | |
3124 | # | |
3125 | case "${file}" in ./arch/i960/archI960.h ) | |
3126 | if ( test -n "`egrep '__(vsiz|vali|vpad|alignof__)' ${file}`" | |
3127 | ) > /dev/null 2>&1 ; then | |
3128 | fixlist="${fixlist} | |
3129 | va_i960_macro" | |
3130 | if [ ! -r ${DESTFILE} ] | |
3131 | then infile=${file} | |
3132 | else infile=${DESTFILE} ; fi | |
3133 | ||
3134 | sed -e 's/__vsiz/__vxvsiz/' \ | |
3135 | -e 's/__vali/__vxvali/' \ | |
3136 | -e 's/__vpad/__vxvpad/' \ | |
3137 | -e 's/__alignof__/__vxalignof__/' \ | |
3138 | < $infile > ${DESTDIR}/fixinc.tmp | |
3139 | rm -f ${DESTFILE} | |
3140 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
3141 | fi # end of select 'if' | |
3142 | ;; # case end for file name test | |
3143 | esac | |
3144 | ||
3145 | ||
3146 | # | |
3147 | # Fix Void_Null | |
3148 | # | |
3149 | case "${file}" in ./curses.h | \ | |
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 ) | |
3160 | if ( test -n "`egrep '#[ ]*define[ ][ ]*NULL[ ].*void' ${file}`" | |
3161 | ) > /dev/null 2>&1 ; then | |
3162 | fixlist="${fixlist} | |
3163 | void_null" | |
3164 | if [ ! -r ${DESTFILE} ] | |
3165 | then infile=${file} | |
3166 | else infile=${DESTFILE} ; fi | |
3167 | ||
3168 | sed -e 's/^#[ ]*define[ ]*NULL[ ]*((void[ ]*\*)0)/#define NULL 0/' \ | |
3169 | < $infile > ${DESTDIR}/fixinc.tmp | |
3170 | rm -f ${DESTFILE} | |
3171 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
3172 | fi # end of select 'if' | |
3173 | ;; # case end for file name test | |
3174 | esac | |
3175 | ||
3176 | ||
3177 | # | |
3178 | # Fix Vxworks_Gcc_Problem | |
3179 | # | |
3180 | case "${file}" in ./types/vxTypesBase.h ) | |
3181 | if ( test -n "`egrep '__GNUC_TYPEOF_FEATURE_BROKEN_USE_DEFAULT_UNTIL_FIXED__' ${file}`" | |
3182 | ) > /dev/null 2>&1 ; then | |
3183 | fixlist="${fixlist} | |
3184 | vxworks_gcc_problem" | |
3185 | if [ ! -r ${DESTFILE} ] | |
3186 | then infile=${file} | |
3187 | else infile=${DESTFILE} ; fi | |
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 | ' \ | |
3211 | < $infile > ${DESTDIR}/fixinc.tmp | |
3212 | rm -f ${DESTFILE} | |
3213 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
3214 | fi # end of select 'if' | |
3215 | ;; # case end for file name test | |
3216 | esac | |
3217 | ||
3218 | ||
3219 | # | |
3220 | # Fix Vxworks_Needs_Vxtypes | |
3221 | # | |
3222 | case "${file}" in ./time.h ) | |
3223 | if ( test -n "`egrep 'uint_t[ ][ ]*_clocks_per_sec' ${file}`" | |
3224 | ) > /dev/null 2>&1 ; then | |
3225 | fixlist="${fixlist} | |
3226 | vxworks_needs_vxtypes" | |
3227 | if [ ! -r ${DESTFILE} ] | |
3228 | then infile=${file} | |
3229 | else infile=${DESTFILE} ; fi | |
3230 | ||
3231 | sed -e 's/uint_t/unsigned int/' \ | |
3232 | < $infile > ${DESTDIR}/fixinc.tmp | |
3233 | rm -f ${DESTFILE} | |
3234 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
3235 | fi # end of select 'if' | |
3236 | ;; # case end for file name test | |
3237 | esac | |
3238 | ||
3239 | ||
3240 | # | |
3241 | # Fix Vxworks_Needs_Vxworks | |
3242 | # | |
3243 | case "${file}" in ./sys/stat.h ) | |
3244 | if ( test -n "`egrep '#[ ]define[ ][ ]*__INCstath' ${file}`" | |
3245 | ) > /dev/null 2>&1 ; then | |
3246 | if ( test '(' -r types/vxTypesOld.h ')' -a \ | |
3247 | '(' -n "`egrep '#include' $file`" ')' -a \ | |
3248 | '(' -n "`egrep ULONG $file`" ')' | |
3249 | ) > /dev/null 2>&1 ; then | |
3250 | fixlist="${fixlist} | |
3251 | vxworks_needs_vxworks" | |
3252 | if [ ! -r ${DESTFILE} ] | |
3253 | then infile=${file} | |
3254 | else infile=${DESTFILE} ; fi | |
3255 | ||
3256 | sed -e '/#[ ]define[ ][ ]*__INCstath/a\ | |
3257 | #include <types/vxTypesOld.h> | |
3258 | ' \ | |
3259 | < $infile > ${DESTDIR}/fixinc.tmp | |
3260 | rm -f ${DESTFILE} | |
3261 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
3262 | fi # end of test expression 'if' | |
3263 | fi # end of select 'if' | |
3264 | ;; # case end for file name test | |
3265 | esac | |
3266 | ||
3267 | ||
3268 | # | |
3269 | # Fix Vxworks_Time | |
3270 | # | |
3271 | case "${file}" in ./time.h ) | |
3272 | if ( test -n "`egrep 'VOIDFUNCPTR' ${file}`" | |
3273 | ) > /dev/null 2>&1 ; then | |
3274 | if ( test '(' -r vxWorks.h ')' | |
3275 | ) > /dev/null 2>&1 ; then | |
3276 | fixlist="${fixlist} | |
3277 | vxworks_time" | |
3278 | if [ ! -r ${DESTFILE} ] | |
3279 | then infile=${file} | |
3280 | else infile=${DESTFILE} ; fi | |
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' \ | |
3293 | < $infile > ${DESTDIR}/fixinc.tmp | |
3294 | rm -f ${DESTFILE} | |
3295 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
3296 | fi # end of test expression 'if' | |
3297 | fi # end of select 'if' | |
3298 | ;; # case end for file name test | |
3299 | esac | |
3300 | ||
3301 | ||
3302 | # | |
3303 | # Fix X11_Class | |
3304 | # | |
3305 | case "${file}" in ./X11/ShellP.h ) | |
3306 | if ( test -z "`egrep '__cplusplus' ${file}`" | |
3307 | ) > /dev/null 2>&1 ; then | |
3308 | fixlist="${fixlist} | |
3309 | x11_class" | |
3310 | if [ ! -r ${DESTFILE} ] | |
3311 | then infile=${file} | |
3312 | else infile=${DESTFILE} ; fi | |
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 | ' \ | |
3322 | < $infile > ${DESTDIR}/fixinc.tmp | |
3323 | rm -f ${DESTFILE} | |
3324 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
3325 | fi # end of bypass 'if' | |
3326 | ;; # case end for file name test | |
3327 | esac | |
3328 | ||
3329 | ||
3330 | # | |
3331 | # Fix X11_Class_Usage | |
3332 | # | |
3333 | case "${file}" in ./Xm/BaseClassI.h ) | |
3334 | if ( test -z "`egrep '__cplusplus' ${file}`" | |
3335 | ) > /dev/null 2>&1 ; then | |
3336 | fixlist="${fixlist} | |
3337 | x11_class_usage" | |
3338 | if [ ! -r ${DESTFILE} ] | |
3339 | then infile=${file} | |
3340 | else infile=${DESTFILE} ; fi | |
3341 | ||
3342 | sed -e 's/ class[)]/ c_class)/g' \ | |
3343 | < $infile > ${DESTDIR}/fixinc.tmp | |
3344 | rm -f ${DESTFILE} | |
3345 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
3346 | fi # end of bypass 'if' | |
3347 | ;; # case end for file name test | |
3348 | esac | |
3349 | ||
3350 | ||
3351 | # | |
3352 | # Fix X11_New | |
3353 | # | |
3354 | case "${file}" in ./Xm/Traversal.h ) | |
3355 | if ( test -z "`egrep '__cplusplus' ${file}`" | |
3356 | ) > /dev/null 2>&1 ; then | |
3357 | fixlist="${fixlist} | |
3358 | x11_new" | |
3359 | if [ ! -r ${DESTFILE} ] | |
3360 | then infile=${file} | |
3361 | else infile=${DESTFILE} ; fi | |
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' \ | |
3372 | < $infile > ${DESTDIR}/fixinc.tmp | |
3373 | rm -f ${DESTFILE} | |
3374 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
3375 | fi # end of bypass 'if' | |
3376 | ;; # case end for file name test | |
3377 | esac | |
3378 | ||
3379 | ||
3380 | # | |
3381 | # Fix X11_Sprintf | |
3382 | # | |
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 | |
3387 | fixlist="${fixlist} | |
3388 | x11_sprintf" | |
3389 | if [ ! -r ${DESTFILE} ] | |
3390 | then infile=${file} | |
3391 | else infile=${DESTFILE} ; fi | |
3392 | ||
3393 | sed -e 's,^extern char \* sprintf();$,#ifndef __STDC__\ | |
3394 | extern char * sprintf();\ | |
3395 | #endif /* !defined __STDC__ */,' \ | |
3396 | < $infile > ${DESTDIR}/fixinc.tmp | |
3397 | rm -f ${DESTFILE} | |
3398 | mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE} | |
3399 | fi # end of select 'if' | |
3400 | ;; # case end for file name test | |
3401 | esac | |
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 | # | |
3406 | if ( test ! -f ${DESTFILE} || \ | |
3407 | cmp ${file} ${DESTFILE} ) > /dev/null 2>&1 | |
3408 | then | |
3409 | rm -f ${DESTFILE} | |
3410 | else | |
3411 | echo "Fixed ${file}:${fixlist}" | |
3412 | ||
3413 | # Find any include directives that use "file". | |
3414 | # | |
3415 | dir=`echo ${file} | sed -e s';/[^/]*$;;'` | |
3416 | ddir=${DESTDIR}/$dir | |
3417 | ||
3418 | for include in ` | |
3419 | egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${DESTFILE} | | |
3420 | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'` | |
3421 | do | |
3422 | required="$required ${SRCDIR} $dir/$include ${ddir}/$include" | |
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 | |
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 | |
3449 | if test $VERBOSE -gt 2 | |
3450 | then echo Copied $2 ; fi | |
3451 | for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' $3 | | |
3452 | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'` | |
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 | |
3459 | fi | |
3460 | shift; shift; shift | |
3461 | done | |
3462 | set x $newreq | |
3463 | shift | |
3464 | done | |
3465 | ||
3466 | if test $VERBOSE -gt 2 | |
3467 | then echo 'Cleaning up DONE files.' ; fi | |
3468 | cd $LIB | |
3469 | find . -name DONE -exec rm -f '{}' ';' | |
3470 | ||
3471 | if test $VERBOSE -gt 1 | |
3472 | then echo 'Cleaning up unneeded directories:' ; fi | |
3473 | cd $LIB | |
3474 | all_dirs=`find . -type d \! -name '.' -print | sort -r` | |
3475 | for file in $all_dirs; do | |
3476 | rmdir $LIB/$file > /dev/null 2>&1 | |
3477 | done | |
3478 | ||
3479 | if test $VERBOSE -gt 0 | |
3480 | then echo fixincludes is done ; fi | |
3481 | ||
3482 | # # # # # # # # # # # # # # # # # # # # # | |
3483 | # | |
3484 | # End of for INPUT directories | |
3485 | # | |
3486 | done | |
3487 | # | |
3488 | # # # # # # # # # # # # # # # # # # # # # | |
3489 | ||
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 |