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