3 # DO NOT EDIT THIS FILE - it has been generated
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.
9 # This script contains 113 fixup scripts.
11 # See README-fixinc for more information.
13 # fixincludes copyright (c) 2000 The Free Software Foundation, Inc.
15 # fixincludes is free software.
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.
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.
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.
32 # # # # # # # # # # # # # # # # # # # # #
34 # Directory in which to store the results.
35 # Fail if no arg to specify a directory for the output.
38 echo fixincludes: no output directory specified
45 # Make sure it exists.
46 if [ ! -d $LIB ]; then
48 echo fixincludes: output dir '`'$LIB"' cannot be created"
52 ( cd $LIB && touch DONE && rm DONE ) || {
53 echo fixincludes: output dir '`'$LIB"' is an invalid directory"
58 FIXTESTS=$PWD/fixinc/fixtests
59 FIXFIXES=$PWD/fixinc/fixfixes
72 # Define what target system we're fixing.
74 if test -r ./Makefile; then
75 target_canonical="`sed -n -e 's,^target[ ]*=[ ]*\(.*\)$,\1,p' < Makefile`"
78 # If not from the Makefile, then try config.guess
80 if test -z "${target_canonical}" ; then
81 if test -x ./config.guess ; then
82 target_canonical="`config.guess`" ; fi
83 test -z "${target_canonical}" && target_canonical=unknown
85 export target_canonical
87 # # # # # # # # # # # # # # # # # # # # #
89 # Define PWDCMD as a command to use to get the working dir
90 # in the form that we want.
95 # On an Apollo, discard everything before `/usr'.
96 PWDCMD="eval pwd | sed -e 's,.*/usr/,/usr/,'"
100 # Original directory.
103 # Make LIB absolute only if needed to avoid problems with the amd.
108 cd $LIB; LIB=`${PWDCMD}`
112 if test $VERBOSE -gt 0
113 then echo Fixing headers into ${LIB} for ${target_canonical} target ; fi
115 # Determine whether this system has symbolic links.
116 if ln -s X $LIB/ShouldNotExist 2>/dev/null; then
117 rm -f $LIB/ShouldNotExist
119 elif ln -s X /tmp/ShouldNotExist 2>/dev/null; then
120 rm -f /tmp/ShouldNotExist
126 # # # # # # # # # # # # # # # # # # # # #
128 # Search each input directory for broken header files.
129 # This loop ends near the end of the file.
133 INPUTLIST="/usr/include"
138 for INPUT in ${INPUTLIST} ; do
142 cd ${INPUT} || continue
146 # # # # # # # # # # # # # # # # # # # # #
148 if test $VERBOSE -gt 1
149 then echo Finding directories and links to directories ; fi
151 # Find all directories and all symlinks that point to directories.
152 # Put the list in $all_dirs.
153 # Each time we find a symlink, add it to newdirs
154 # so that we do another find within the dir the link points to.
155 # Note that $all_dirs may have duplicates in it;
156 # later parts of this file are supposed to ignore them.
162 while [ -n "$dirs" ] && [ $levels -gt 0 ]
164 levels=`expr $levels - 1`
168 if test $VERBOSE -gt 1
169 then echo " Searching $INPUT/$d" ; fi
171 # Find all directories under $d, relative to $d, excluding $d itself.
172 # (The /. is needed after $d in case $d is a symlink.)
173 all_dirs="$all_dirs `find $d/. -type d -print | \
174 sed -e '/\/\.$/d' -e 's@/./@/@g'`"
175 # Find all links to directories.
176 # Using `-exec test -d' in find fails on some systems,
177 # and trying to run test via sh fails on others,
178 # so this is the simplest alternative left.
179 # First find all the links, then test each one.
182 theselinks=`find $d/. -type l -print | sed -e 's@/./@/@g'`
183 for d1 in $theselinks --dummy--
185 # If the link points to a directory,
186 # add that dir to $newdirs
189 all_dirs="$all_dirs $d1"
190 if [ "`ls -ld $d1 | sed -n 's/.*-> //p'`" != "." ]
192 newdirs="$newdirs $d1"
193 search_dirs="$search_dirs $d1"
202 # # # # # # # # # # # # # # # # # # # # #
205 if test $VERBOSE -gt 2
206 then echo "All directories (including links to directories):"
210 for file in $all_dirs; do
212 if [ ! -d $LIB/$file ]
213 then mkdir $LIB/$file
218 # # # # # # # # # # # # # # # # # # # # #
220 # treetops gets an alternating list
221 # of old directories to copy
222 # and the new directories to copy to.
226 if test $VERBOSE -gt 1
227 then echo 'Making symbolic directory links' ; fi
230 for sym_link in $search_dirs; do
232 dest=`ls -ld ${sym_link} | sed -n 's/.*-> //p'`
234 # In case $dest is relative, get to ${sym_link}'s dir first.
236 cd ./`echo ${sym_link} | sed 's;/[^/]*$;;'`
238 # Check that the target directory exists.
239 # Redirections changed to avoid bug in sh on Ultrix.
241 (cd $dest) > /dev/null 2>&1
245 # full_dest_dir gets the dir that the link actually leads to.
247 full_dest_dir=`${PWDCMD}`
249 # Canonicalize ${INPUT} now to minimize the time an
250 # automounter has to change the result of ${PWDCMD}.
252 cinput=`cd ${INPUT}; ${PWDCMD}`
254 # If a link points to ., make a similar link to .
256 if [ ${full_dest_dir} = ${cinput} ]; then
257 if test $VERBOSE -gt 2
258 then echo ${sym_link} '->' . ': Making self link' ; fi
259 rm -fr ${LIB}/${sym_link} > /dev/null 2>&1
260 ln -s . ${LIB}/${sym_link} > /dev/null 2>&1
262 # If link leads back into ${INPUT},
263 # make a similar link here.
265 elif expr ${full_dest_dir} : "${cinput}/.*" > /dev/null; then
266 # Y gets the actual target dir name, relative to ${INPUT}.
267 y=`echo ${full_dest_dir} | sed -n "s&${cinput}/&&p"`
268 # DOTS is the relative path from ${LIB}/${sym_link} back to ${LIB}.
269 dots=`echo "${sym_link}" |
270 sed -e 's@^./@@' -e 's@/./@/@g' -e 's@[^/][^/]*@..@g' -e 's@..$@@'`
271 if test $VERBOSE -gt 2
272 then echo ${sym_link} '->' $dots$y ': Making local link' ; fi
273 rm -fr ${LIB}/${sym_link} > /dev/null 2>&1
274 ln -s $dots$y ${LIB}/${sym_link} > /dev/null 2>&1
277 # If the link is to a dir $target outside ${INPUT},
278 # repoint the link at ${INPUT}/root$target
279 # and process $target into ${INPUT}/root$target
280 # treat this directory as if it actually contained the files.
282 if test $VERBOSE -gt 2
283 then echo ${sym_link} '->' root${full_dest_dir} ': Making rooted link'
285 if [ -d $LIB/root${full_dest_dir} ]
288 dirname=root${full_dest_dir}/
291 while [ x$dirname != x ]; do
292 component=`echo $dirname | sed -e 's|/.*$||'`
293 mkdir $component >/dev/null 2>&1
295 dirmade=$dirmade/$component
296 dirname=`echo $dirname | sed -e 's|[^/]*/||'`
300 # Duplicate directory structure created in ${LIB}/${sym_link} in new
303 for file2 in $all_dirs; do
306 dupdir=${LIB}/root${full_dest_dir}/`echo $file2 |
307 sed -n "s|^${sym_link}/||p"`
308 if test $VERBOSE -gt 2
309 then echo "Duplicating ${sym_link}'s ${dupdir}" ; fi
321 # Get the path from ${LIB} to ${sym_link}, accounting for symlinks.
323 parent=`echo "${sym_link}" | sed -e 's@/[^/]*$@@'`
324 libabs=`cd ${LIB}; ${PWDCMD}`
325 file2=`cd ${LIB}; cd $parent; ${PWDCMD} | sed -e "s@^${libabs}@@"`
327 # DOTS is the relative path from ${LIB}/${sym_link} back to ${LIB}.
329 dots=`echo "$file2" | sed -e 's@/[^/]*@../@g'`
330 rm -fr ${LIB}/${sym_link} > /dev/null 2>&1
331 ln -s ${dots}root${full_dest_dir} ${LIB}/${sym_link} > /dev/null 2>&1
332 treetops="$treetops ${sym_link} ${LIB}/root${full_dest_dir}"
338 # # # # # # # # # # # # # # # # # # # # #
343 while [ $# != 0 ]; do
344 # $1 is an old directory to copy, and $2 is the new directory to copy to.
346 SRCDIR=`cd ${INPUT} ; cd $1 ; ${PWDCMD}`
353 DESTDIR=`cd $1;${PWDCMD}`
357 # The same dir can appear more than once in treetops.
358 # There's no need to scan it more than once.
360 if [ -f ${DESTDIR}/DONE ]
363 touch ${DESTDIR}/DONE
364 if test $VERBOSE -gt 1
365 then echo Fixing directory ${SRCDIR} into ${DESTDIR} ; fi
367 # Check files which are symlinks as well as those which are files.
370 files=`if $LINKS; then
371 find ${FIND_BASE}/. -name '*.h' \( -type f -o -type l \) -print
373 find ${FIND_BASE}/. -name '*.h' -type f -print
375 sed -e 's;/\./;/;g' -e 's;//*;/;g' `
377 echo Checking header files
378 for file in $files; do
380 # Skip unreadable files, symlinks to directories and glibc files
381 if test ! -r "${file}" || test -d "${file}/." ; then
386 DESTFILE=${DESTDIR}/`echo ${file} | sed "s;${FIND_BASE}/;;" `
391 case "${file}" in ./sys/ki_iface.h )
392 if ( test -n "`egrep 'These definitions are for HP Internal developers' ${file}`"
393 ) > /dev/null 2>&1 ; then
394 echo "AAA_ki_iface bypassing file ${file}"
397 fi # end of select 'if'
398 ;; # case end for file name test
405 case "${file}" in ./sys/ki.h )
406 if ( test -n "`egrep '11.00 HP-UX LP64' ${file}`"
407 ) > /dev/null 2>&1 ; then
408 echo "AAA_ki bypassing file ${file}"
411 fi # end of select 'if'
412 ;; # case end for file name test
419 case "${file}" in ./sys/ki_calls.h )
420 if ( test -n "`egrep 'kthread_create_caller_t' ${file}`"
421 ) > /dev/null 2>&1 ; then
422 echo "AAA_ki_calls bypassing file ${file}"
425 fi # end of select 'if'
426 ;; # case end for file name test
433 case "${file}" in ./sys/ki_defs.h )
434 if ( test -n "`egrep 'Kernel Instrumentation Definitions' ${file}`"
435 ) > /dev/null 2>&1 ; then
436 echo "AAA_ki_defs bypassing file ${file}"
439 fi # end of select 'if'
440 ;; # case end for file name test
447 case "${file}" in ./sundev/ipi_error.h )
448 echo "AAA_bad_fixes bypassing file ${file}"
451 ;; # case end for file name test
458 case "${file}" in ./sys/time.h )
459 if ( test -n "`egrep '11.0 and later representation of ki time' ${file}`"
460 ) > /dev/null 2>&1 ; then
461 echo "AAA_time bypassing file ${file}"
464 fi # end of select 'if'
465 ;; # case end for file name test
470 # Fix Aab_Dgux_Int_Varargs
472 case "${file}" in ./_int_varargs.h )
473 echo "AAB_dgux_int_varargs replacing file ${file}" >&2
474 cat > ${DESTFILE} << '_EOF_'
475 #ifndef __INT_VARARGS_H
476 #define __INT_VARARGS_H
478 /************************************************************************/
479 /* _INT_VARARGS.H - Define the common stuff for varargs/stdarg/stdio. */
480 /************************************************************************/
483 ** This file is a DG internal header. Never include this
487 #ifndef ___int_features_h
488 #include <sys/_int_features.h>
491 #if !(defined(_VA_LIST) || defined(_VA_LIST_))
498 typedef void * va_list;
500 typedef char * va_list;
514 #else /* ! defined(__DCC__) */
517 int __va_arg; /* argument number */
518 int *__va_stk; /* start of args passed on stack */
519 int *__va_reg; /* start of args passed in regs */
522 #endif /* ! defined(__DCC__) */
526 #if defined(__GNUC__) || defined(__STDC__)
527 typedef void * va_list;
529 typedef char * va_list;
532 #endif /* _IX86_ANY */
534 #endif /* __LINT__ */
535 #endif /* !(defined(_VA_LIST) || defined(_VA_LIST_)) */
536 #endif /* #ifndef __INT_VARARGS_H */
541 ;; # case end for file name test
546 # Fix Aab_Fd_Zero_Asm_Posix_Types_H
548 case "${file}" in ./asm/posix_types.h )
549 case "$target_canonical" in i[34567]86-*-linux-gnu* )
550 if ( test -z "`egrep '} while' ${file}`"
551 ) > /dev/null 2>&1 ; then
552 echo "AAB_fd_zero_asm_posix_types_h replacing file ${file}" >&2
553 cat > ${DESTFILE} << '_EOF_'
554 /* This file fixes a bug in the __FD_ZERO macro
555 for older versions of the Linux kernel. */
556 #ifndef _POSIX_TYPES_H_WRAPPER
557 #include <features.h>
558 #include_next <asm/posix_types.h>
560 #if defined(__FD_ZERO) && !defined(__GLIBC__)
562 #define __FD_ZERO(fdsetp) \
565 __asm__ __volatile__("cld ; rep ; stosl" \
566 : "=&c" (__d0), "=&D" (__d1) \
567 : "a" (0), "0" (__FDSET_LONGS), \
568 "1" ((__kernel_fd_set *) (fdsetp)) :"memory"); \
572 #define _POSIX_TYPES_H_WRAPPER
573 #endif /* _POSIX_TYPES_H_WRAPPER */
578 fi # end of bypass 'if'
579 ;; # case end for machine type test
581 ;; # case end for file name test
586 # Fix Aab_Fd_Zero_Gnu_Types_H
588 case "${file}" in ./gnu/types.h )
589 case "$target_canonical" in i[34567]86-*-linux-gnu* )
590 echo "AAB_fd_zero_gnu_types_h replacing file ${file}" >&2
591 cat > ${DESTFILE} << '_EOF_'
592 /* This file fixes a bug in the __FD_ZERO macro present in glibc 1.x. */
593 #ifndef _TYPES_H_WRAPPER
594 #include <features.h>
595 #include_next <gnu/types.h>
597 #if defined(__FD_ZERO) && !defined(__GLIBC__)
599 # define __FD_ZERO(fdsetp) \
602 __asm__ __volatile__("cld ; rep ; stosl" \
603 : "=&c" (__d0), "=&D" (__d1) \
604 : "a" (0), "0" (__FDSET_LONGS), \
605 "1" ((__fd_set *) (fdsetp)) :"memory"); \
609 #define _TYPES_H_WRAPPER
610 #endif /* _TYPES_H_WRAPPER */
615 ;; # case end for machine type test
617 ;; # case end for file name test
622 # Fix Aab_Fd_Zero_Selectbits_H
624 case "${file}" in ./selectbits.h )
625 case "$target_canonical" in i[34567]86-*-linux-gnu* )
626 echo "AAB_fd_zero_selectbits_h replacing file ${file}" >&2
627 cat > ${DESTFILE} << '_EOF_'
628 /* This file fixes a bug in the __FD_ZERO macro present in glibc 2.0.x. */
629 #ifndef _SELECTBITS_H_WRAPPER
630 #include <features.h>
631 #include_next <selectbits.h>
633 #if defined(__FD_ZERO) && defined(__GLIBC__) \
634 && defined(__GLIBC_MINOR__) && __GLIBC__ == 2 \
635 && __GLIBC_MINOR__ == 0
637 #define __FD_ZERO(fdsetp) \
640 __asm__ __volatile__ ("cld; rep; stosl" \
641 : "=&c" (__d0), "=&D" (__d1) \
642 : "a" (0), "0" (sizeof (__fd_set) \
643 / sizeof (__fd_mask)), \
644 "1" ((__fd_mask *) (fdsetp)) \
649 #define _SELECTBITS_H_WRAPPER
650 #endif /* _SELECTBITS_H_WRAPPER */
655 ;; # case end for machine type test
657 ;; # case end for file name test
664 case "${file}" in ./memory.h )
665 if ( test -n "`egrep '/\\* @\\(#\\)(head/memory.h 50.1 |memory\\.h 1\\.[2-4] 8./../.. SMI; from S5R2 1\\.2 )\\*/' ${file}`"
666 ) > /dev/null 2>&1 ; then
667 echo "AAB_sun_memcpy replacing file ${file}" >&2
668 cat > ${DESTFILE} << '_EOF_'
669 /* This file was generated by fixincludes */
674 extern void *memccpy();
675 extern void *memchr();
676 extern void *memcpy();
677 extern void *memset();
679 extern char *memccpy();
680 extern char *memchr();
681 extern char *memcpy();
682 extern char *memset();
683 #endif /* __STDC__ */
687 #endif /* __memory_h__ */
692 fi # end of select 'if'
693 ;; # case end for file name test
698 # Fix Aab_Svr4_Replace_Byteorder
700 case "${file}" in ./sys/byteorder.h )
701 case "$target_canonical" in *-*-sysv4* | \
702 i[34567]86-*-sysv5* | \
703 i[34567]86-*-udk* | \
704 i[34567]86-*-solaris2.[0-4] | \
705 powerpcle-*-solaris2.[0-4] | \
706 sparc-*-solaris2.[0-4] )
707 echo "AAB_svr4_replace_byteorder replacing file ${file}" >&2
708 cat > ${DESTFILE} << '_EOF_'
709 #ifndef _SYS_BYTEORDER_H
710 #define _SYS_BYTEORDER_H
712 /* Functions to convert `short' and `long' quantities from host byte order
713 to (internet) network byte order (i.e. big-endian).
715 Written by Ron Guilmette (rfg@ncd.com).
717 This isn't actually used by GCC. It is installed by fixinc.svr4.
719 For big-endian machines these functions are essentially no-ops.
721 For little-endian machines, we define the functions using specialized
722 asm sequences in cases where doing so yields better code (e.g. i386). */
724 #if !defined (__GNUC__) && !defined (__GNUG__)
725 #error You lose! This file is only useful with GNU compilers.
728 #ifndef __BYTE_ORDER__
729 /* Byte order defines. These are as defined on UnixWare 1.1, but with
730 double underscores added at the front and back. */
731 #define __LITTLE_ENDIAN__ 1234
732 #define __BIG_ENDIAN__ 4321
733 #define __PDP_ENDIAN__ 3412
737 static __inline__ unsigned long htonl (unsigned long);
738 static __inline__ unsigned short htons (unsigned int);
739 static __inline__ unsigned long ntohl (unsigned long);
740 static __inline__ unsigned short ntohs (unsigned int);
741 #endif /* defined (__STDC__) */
743 #if defined (__i386__)
745 #ifndef __BYTE_ORDER__
746 #define __BYTE_ORDER__ __LITTLE_ENDIAN__
749 /* Convert a host long to a network long. */
751 /* We must use a new-style function definition, so that this will also
753 static __inline__ unsigned long
754 htonl (unsigned long __arg)
756 register unsigned long __result;
758 __asm__ ("xchg%B0 %b0,%h0
760 xchg%B0 %b0,%h0" : "=q" (__result) : "0" (__arg));
764 /* Convert a host short to a network short. */
766 static __inline__ unsigned short
767 htons (unsigned int __arg)
769 register unsigned short __result;
771 __asm__ ("xchg%B0 %b0,%h0" : "=q" (__result) : "0" (__arg));
775 #elif ((defined (__i860__) && !defined (__i860_big_endian__)) \
776 || defined (__ns32k__) || defined (__vax__) \
777 || defined (__spur__) || defined (__arm__))
779 #ifndef __BYTE_ORDER__
780 #define __BYTE_ORDER__ __LITTLE_ENDIAN__
783 /* For other little-endian machines, using C code is just as efficient as
784 using assembly code. */
786 /* Convert a host long to a network long. */
788 static __inline__ unsigned long
789 htonl (unsigned long __arg)
791 register unsigned long __result;
793 __result = (__arg >> 24) & 0x000000ff;
794 __result |= (__arg >> 8) & 0x0000ff00;
795 __result |= (__arg << 8) & 0x00ff0000;
796 __result |= (__arg << 24) & 0xff000000;
800 /* Convert a host short to a network short. */
802 static __inline__ unsigned short
803 htons (unsigned int __arg)
805 register unsigned short __result;
807 __result = (__arg << 8) & 0xff00;
808 __result |= (__arg >> 8) & 0x00ff;
812 #else /* must be a big-endian machine */
814 #ifndef __BYTE_ORDER__
815 #define __BYTE_ORDER__ __BIG_ENDIAN__
818 /* Convert a host long to a network long. */
820 static __inline__ unsigned long
821 htonl (unsigned long __arg)
826 /* Convert a host short to a network short. */
828 static __inline__ unsigned short
829 htons (unsigned int __arg)
834 #endif /* big-endian */
836 /* Convert a network long to a host long. */
838 static __inline__ unsigned long
839 ntohl (unsigned long __arg)
841 return htonl (__arg);
844 /* Convert a network short to a host short. */
846 static __inline__ unsigned short
847 ntohs (unsigned int __arg)
849 return htons (__arg);
856 ;; # case end for machine type test
858 ;; # case end for file name test
863 # Fix Aab_Ultrix_Ansi_Compat
865 case "${file}" in ./ansi_compat.h )
866 if ( test -n "`egrep 'ULTRIX' ${file}`"
867 ) > /dev/null 2>&1 ; then
868 echo "AAB_ultrix_ansi_compat replacing file ${file}" >&2
869 cat > ${DESTFILE} << '_EOF_'
870 /* This file intentionally left blank. */
875 fi # end of select 'if'
876 ;; # case end for file name test
883 case "${file}" in ./sys/wait.h )
884 if ( test -n "`egrep 'bos325,' ${file}`"
885 ) > /dev/null 2>&1 ; then
888 if [ ! -r ${DESTFILE} ]
890 else infile=${DESTFILE} ; fi
892 sed -e '/^extern pid_t wait3();$/i\
895 < $infile > ${DESTDIR}/fixinc.tmp
897 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
898 fi # end of select 'if'
899 ;; # case end for file name test
906 case "${file}" in ./sys/signal.h )
907 if ( test -n "`egrep 'typedef volatile int sig_atomic_t' ${file}`"
908 ) > /dev/null 2>&1 ; then
911 if [ ! -r ${DESTFILE} ]
913 else infile=${DESTFILE} ; fi
915 sed -e 's/typedef volatile int sig_atomic_t/typedef int sig_atomic_t/' \
916 < $infile > ${DESTDIR}/fixinc.tmp
918 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
919 fi # end of select 'if'
920 ;; # case end for file name test
927 case "${file}" in ./stdio.h | \
929 if ( test -n "`egrep 'getopt\\(int, char \\*\\[' ${file}`"
930 ) > /dev/null 2>&1 ; then
933 if [ ! -r ${DESTFILE} ]
935 else infile=${DESTFILE} ; fi
937 sed -e 's/getopt(int, char \*\[\],[ ]*char \*)/getopt(int, char *const[], const char *)/' \
938 < $infile > ${DESTDIR}/fixinc.tmp
940 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
941 fi # end of select 'if'
942 ;; # case end for file name test
949 case "${file}" in ./sym.h )
950 if ( test -n "`egrep '#ifndef\\(__mips64\\)' ${file}`"
951 ) > /dev/null 2>&1 ; then
954 if [ ! -r ${DESTFILE} ]
956 else infile=${DESTFILE} ; fi
958 sed -e 's/#ifndef(__mips64)/#ifndef __mips64/' \
959 < $infile > ${DESTDIR}/fixinc.tmp
961 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
962 fi # end of select 'if'
963 ;; # case end for file name test
970 case "${file}" in ./unistd.h )
971 if ( test -n "`egrep 'char[ ]*\\*[ ]*sbrk[ ]*\\(' ${file}`"
972 ) > /dev/null 2>&1 ; then
975 if [ ! -r ${DESTFILE} ]
977 else infile=${DESTFILE} ; fi
979 sed -e 's/char\([ ]*\*[ ]*sbrk[ ]*(\)/void\1/' \
980 < $infile > ${DESTDIR}/fixinc.tmp
982 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
983 fi # end of select 'if'
984 ;; # case end for file name test
989 # Fix Arm_Norcroft_Hint
991 case "${file}" in ./X11/Intrinsic.h )
992 if ( test -n "`egrep '___type p_type' ${file}`"
993 ) > /dev/null 2>&1 ; then
996 if [ ! -r ${DESTFILE} ]
998 else infile=${DESTFILE} ; fi
1000 sed -e 's/___type p_type/p_type/' \
1001 < $infile > ${DESTDIR}/fixinc.tmp
1003 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
1004 fi # end of select 'if'
1005 ;; # case end for file name test
1012 case "${file}" in ./stdlib.h )
1013 if ( test -n "`egrep '#[ ]*define[ ]*__wchar_t' ${file}`"
1014 ) > /dev/null 2>&1 ; then
1017 if [ ! -r ${DESTFILE} ]
1019 else infile=${DESTFILE} ; fi
1021 sed -e 's/\(#[ ]*ifndef[ ]*\)__wchar_t/\1_GCC_WCHAR_T/' \
1022 -e 's/\(#[ ]*define[ ]*\)__wchar_t/\1_GCC_WCHAR_T/' \
1023 < $infile > ${DESTDIR}/fixinc.tmp
1025 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
1026 fi # end of select 'if'
1027 ;; # case end for file name test
1034 case "${file}" in ./sys/param.h )
1035 if ( test -n "`egrep '#ifndef NOINLINE' ${file}`"
1036 ) > /dev/null 2>&1 ; then
1039 if [ ! -r ${DESTFILE} ]
1041 else infile=${DESTFILE} ; fi
1043 sed -e 's|#ifndef NOINLINE|#if !defined(NOINLINE) \&\& !defined(__GNUC__)|' \
1044 < $infile > ${DESTDIR}/fixinc.tmp
1046 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
1047 fi # end of select 'if'
1048 ;; # case end for file name test
1055 case "${file}" in ./curses.h | \
1056 ./curses_colr/curses.h | \
1059 if ( test -n "`egrep 'char[ ]+bool|bool[ ]+char' ${file}`"
1060 ) > /dev/null 2>&1 ; then
1061 if ( test -z "`egrep 'we must use the C\\+\\+ compiler'\\''s type' ${file}`"
1062 ) > /dev/null 2>&1 ; then
1065 if [ ! -r ${DESTFILE} ]
1067 else infile=${DESTFILE} ; fi
1069 sed -e '/^#[ ]*define[ ][ ]*bool[ ][ ]*char[ ]*$/i\
1072 -e '/^#[ ]*define[ ][ ]*bool[ ][ ]*char[ ]*$/a\
1075 -e '/^typedef[ ][ ]*char[ ][ ]*bool[ ]*;/i\
1078 -e '/^typedef[ ][ ]*char[ ][ ]*bool[ ]*;/a\
1081 -e '/^[ ]*typedef[ ][ ]*unsigned char[ ][ ]*bool[ ]*;/i\
1084 -e '/^[ ]*typedef[ ][ ]*unsigned char[ ][ ]*bool[ ]*;/a\
1087 -e '/^typedef[ ][ ]*int[ ][ ]*bool[ ]*;/i\
1090 -e '/^typedef[ ][ ]*int[ ][ ]*bool[ ]*;/a\
1093 -e '/^[ ]*typedef[ ][ ]*unsigned int[ ][ ]*bool[ ]*;/i\
1096 -e '/^[ ]*typedef[ ][ ]*unsigned int[ ][ ]*bool[ ]*;/a\
1099 < $infile > ${DESTDIR}/fixinc.tmp
1101 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
1102 fi # end of bypass 'if'
1103 fi # end of select 'if'
1104 ;; # case end for file name test
1109 # Fix Bad_Struct_Term
1111 case "${file}" in ./curses.h )
1112 if ( test -n "`egrep '^[ ]*typedef[ ]+struct[ ]+term[ ]*;' ${file}`"
1113 ) > /dev/null 2>&1 ; then
1116 if [ ! -r ${DESTFILE} ]
1118 else infile=${DESTFILE} ; fi
1120 sed -e 's/^[ ]*typedef[ ][ ]*\(struct[ ][ ]*term[ ]*;[ ]*\)$/\1/' \
1121 < $infile > ${DESTDIR}/fixinc.tmp
1123 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
1124 fi # end of select 'if'
1125 ;; # case end for file name test
1132 case "${file}" in ./sundev/vuid_event.h )
1135 if [ ! -r ${DESTFILE} ]
1137 else infile=${DESTFILE} ; fi
1139 sed -e 's/doesn'\''t/does not/' \
1140 < $infile > ${DESTDIR}/fixinc.tmp
1142 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
1143 ;; # case end for file name test
1150 case "${file}" in ./libgen.h | \
1164 if ( test -n "`egrep '^[ ]*#[ ]*pragma[ ][ ]*extern_prefix' ${file}`"
1165 ) > /dev/null 2>&1 ; then
1168 if [ ! -r ${DESTFILE} ]
1170 else infile=${DESTFILE} ; fi
1172 sed -e 's/^[ ]*#[ ]*define[ ]*\([^(]*\)\(([^)]*)\)[ ]*\(_.\)\1\2[ ]*$/#define \1 \3\1/' \
1173 < $infile > ${DESTDIR}/fixinc.tmp
1175 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
1176 fi # end of select 'if'
1177 ;; # case end for file name test
1182 # Fix Broken_Assert_Stdio
1184 case "${file}" in ./assert.h )
1185 if ( test -n "`egrep 'stderr' ${file}`"
1186 ) > /dev/null 2>&1 ; then
1187 if ( test -z "`egrep 'include.*stdio.h' ${file}`"
1188 ) > /dev/null 2>&1 ; then
1190 broken_assert_stdio"
1191 if [ ! -r ${DESTFILE} ]
1193 else infile=${DESTFILE} ; fi
1198 < $infile > ${DESTDIR}/fixinc.tmp
1200 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
1201 fi # end of bypass 'if'
1202 fi # end of select 'if'
1203 ;; # case end for file name test
1208 # Fix Broken_Assert_Stdlib
1210 case "${file}" in ./assert.h )
1211 if ( test -n "`egrep 'exit *\\(|abort *\\(' ${file}`"
1212 ) > /dev/null 2>&1 ; then
1213 if ( test -z "`egrep 'include.*stdlib.h' ${file}`"
1214 ) > /dev/null 2>&1 ; then
1216 broken_assert_stdlib"
1217 if [ ! -r ${DESTFILE} ]
1219 else infile=${DESTFILE} ; fi
1223 #include <stdlib.h>\
1226 < $infile > ${DESTDIR}/fixinc.tmp
1228 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
1229 fi # end of bypass 'if'
1230 fi # end of select 'if'
1231 ;; # case end for file name test
1236 # Fix Dec_Intern_Asm
1238 case "${file}" in ./c_asm.h )
1241 if [ ! -r ${DESTFILE} ]
1243 else infile=${DESTFILE} ; fi
1245 sed -e '/^[ ]*float[ ]*fasm/i\
1248 -e '/^[ ]*#[ ]*pragma[ ]*intrinsic([ ]*dasm/a\
1251 < $infile > ${DESTDIR}/fixinc.tmp
1253 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
1254 ;; # case end for file name test
1259 # Fix No_Double_Slash
1261 if ${FIXTESTS} ${file} double_slash
1265 if [ ! -r ${DESTFILE} ]
1267 else infile=${DESTFILE} ; fi
1268 ${FIXFIXES} ${file} no_double_slash < $infile > ${DESTDIR}/fixinc.tmp
1270 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
1271 fi # end of c_test 'if'
1277 case "${file}" in ./sunwindow/win_lock.h | \
1278 ./sunwindow/win_cursor.h )
1281 if [ ! -r ${DESTFILE} ]
1283 else infile=${DESTFILE} ; fi
1285 sed -e 's/ecd.cursor/ecd_cursor/' \
1286 < $infile > ${DESTDIR}/fixinc.tmp
1288 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
1289 ;; # case end for file name test
1294 # Fix Sco5_Stat_Wrappers
1296 case "${file}" in ./sys/stat.h )
1297 case "$target_canonical" in i*86-*-sco3.2v5* )
1300 if [ ! -r ${DESTFILE} ]
1302 else infile=${DESTFILE} ; fi
1304 sed -e '/^static int[ ]*[a-z]*stat(/i\
1313 #endif /* __cplusplus */\
1315 < $infile > ${DESTDIR}/fixinc.tmp
1317 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
1318 ;; # case end for machine type test
1320 ;; # case end for file name test
1325 # Fix End_Else_Label
1327 if ${FIXTESTS} ${file} else_endif_label
1331 if [ ! -r ${DESTFILE} ]
1333 else infile=${DESTFILE} ; fi
1334 ${FIXFIXES} ${file} else_endif_label < $infile > ${DESTDIR}/fixinc.tmp
1336 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
1337 fi # end of c_test 'if'
1343 case "${file}" in ./sys/spinlock.h )
1344 if ( test -n "`egrep 'include.*\"\\.\\./machine/' ${file}`"
1345 ) > /dev/null 2>&1 ; then
1348 if [ ! -r ${DESTFILE} ]
1350 else infile=${DESTFILE} ; fi
1352 sed -e 's,"../machine/inline.h",<machine/inline.h>,' \
1353 -e 's,"../machine/psl.h",<machine/psl.h>,' \
1354 < $infile > ${DESTDIR}/fixinc.tmp
1356 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
1357 fi # end of select 'if'
1358 ;; # case end for file name test
1365 case "${file}" in ./sys/file.h )
1366 if ( test -n "`egrep 'HPUX_SOURCE' ${file}`"
1367 ) > /dev/null 2>&1 ; then
1370 if [ ! -r ${DESTFILE} ]
1372 else infile=${DESTFILE} ; fi
1374 sed -e 's/(\.\.\.)/(struct file * ...)/' \
1375 < $infile > ${DESTDIR}/fixinc.tmp
1377 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
1378 fi # end of select 'if'
1379 ;; # case end for file name test
1386 case "${file}" in ./sys/mman.h | \
1388 if ( test -z "`egrep '\"C\"|__BEGIN_DECLS' ${file}`"
1389 ) > /dev/null 2>&1 ; then
1392 if [ ! -r ${DESTFILE} ]
1394 else infile=${DESTFILE} ; fi
1407 < $infile > ${DESTDIR}/fixinc.tmp
1409 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
1410 fi # end of bypass 'if'
1411 ;; # case end for file name test
1418 case "${file}" in ./sys/param.h )
1421 if [ ! -r ${DESTFILE} ]
1423 else infile=${DESTFILE} ; fi
1425 sed -e '/^#[ ]*define[ ]*MAXINT[ ]/i\
1428 -e '/^#[ ]*define[ ]*MAXINT[ ]/a\
1431 < $infile > ${DESTDIR}/fixinc.tmp
1433 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
1434 ;; # case end for file name test
1441 case "${file}" in ./sys/time.h )
1442 if ( test -n "`egrep '^extern struct sigevent;' ${file}`"
1443 ) > /dev/null 2>&1 ; then
1446 if [ ! -r ${DESTFILE} ]
1448 else infile=${DESTFILE} ; fi
1450 sed -e 's/^extern struct sigevent;/struct sigevent;/' \
1451 < $infile > ${DESTDIR}/fixinc.tmp
1453 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
1454 fi # end of select 'if'
1455 ;; # case end for file name test
1460 # Fix Hpux8_Bogus_Inlines
1462 case "${file}" in ./math.h )
1463 if ( test -n "`egrep 'inline' ${file}`"
1464 ) > /dev/null 2>&1 ; then
1466 hpux8_bogus_inlines"
1467 if [ ! -r ${DESTFILE} ]
1469 else infile=${DESTFILE} ; fi
1471 sed -e 's@inline int abs(int [a-z][a-z]*) {.*}@extern "C" int abs(int);@' \
1472 -e 's@inline double abs(double [a-z][a-z]*) {.*}@@' \
1473 -e 's@inline int sqr(int [a-z][a-z]*) {.*}@@' \
1474 -e 's@inline double sqr(double [a-z][a-z]*) {.*}@@' \
1475 < $infile > ${DESTDIR}/fixinc.tmp
1477 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
1478 fi # end of select 'if'
1479 ;; # case end for file name test
1484 # Fix Hpux11_Uint32_C
1486 case "${file}" in ./inttypes.h )
1487 if ( test -n "`egrep '^#define UINT32_C\\(__c\\)[ ]*__CONCAT__\\(__CONCAT_U__\\(__c\\),l\\)' ${file}`"
1488 ) > /dev/null 2>&1 ; then
1491 if [ ! -r ${DESTFILE} ]
1493 else infile=${DESTFILE} ; fi
1495 sed -e 's/^#define UINT32_C(__c)\([ ]*\)__CONCAT__(__CONCAT_U__(__c),l)/#define UINT32_C(__c)\1__CONCAT__(__c,ul)/' \
1496 < $infile > ${DESTDIR}/fixinc.tmp
1498 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
1499 fi # end of select 'if'
1500 ;; # case end for file name test
1505 # Fix Isc_Omits_With_Stdc
1507 case "${file}" in ./stdio.h | \
1513 if ( test -n "`egrep 'defined(__STDC__) && !defined(_POSIX_SOURCE)' ${file}`"
1514 ) > /dev/null 2>&1 ; then
1516 isc_omits_with_stdc"
1517 if [ ! -r ${DESTFILE} ]
1519 else infile=${DESTFILE} ; fi
1521 sed -e 's/!defined(__STDC__) && !defined(_POSIX_SOURCE)/!defined(_POSIX_SOURCE)/' \
1522 < $infile > ${DESTDIR}/fixinc.tmp
1524 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
1525 fi # end of select 'if'
1526 ;; # case end for file name test
1533 if ( test -n "`egrep 'define[ ]+[A-Z0-9_]+[ ]+[A-Z0-9_]+IO[A-Z]*[ ]*\\( *[^,'\\'']' ${file}`"
1534 ) > /dev/null 2>&1 ; then
1537 if [ ! -r ${DESTFILE} ]
1539 else infile=${DESTFILE} ; fi
1540 ${FIXFIXES} ${file} IO_use < $infile > ${DESTDIR}/fixinc.tmp
1542 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
1543 fi # end of select 'if'
1549 if ( test -n "`egrep 'define[ ]+[A-Z0-9_]+IO[A-Z]*\\(([a-zA-Z]).*'\\''\\1'\\''' ${file}`"
1550 ) > /dev/null 2>&1 ; then
1553 if [ ! -r ${DESTFILE} ]
1555 else infile=${DESTFILE} ; fi
1556 ${FIXFIXES} ${file} IO_defn < $infile > ${DESTDIR}/fixinc.tmp
1558 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
1559 fi # end of select 'if'
1563 # Fix Ctrl_Use_Quotes
1565 if ( test -n "`egrep 'define[ ]+[A-Z0-9_]+[ ]+[A-Z0-9_]+CTRL[ ]*\\( *[^,'\\'']' ${file}`"
1566 ) > /dev/null 2>&1 ; then
1569 if [ ! -r ${DESTFILE} ]
1571 else infile=${DESTFILE} ; fi
1572 ${FIXFIXES} ${file} CTRL_use < $infile > ${DESTDIR}/fixinc.tmp
1574 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
1575 fi # end of select 'if'
1579 # Fix Ctrl_Def_Quotes
1581 if ( test -n "`egrep 'define[ ]+[A-Z0-9_]+CTRL\\(([a-zA-Z]).*'\\''\\1'\\''' ${file}`"
1582 ) > /dev/null 2>&1 ; then
1585 if [ ! -r ${DESTFILE} ]
1587 else infile=${DESTFILE} ; fi
1588 ${FIXFIXES} ${file} CTRL_defn < $infile > ${DESTDIR}/fixinc.tmp
1590 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
1591 fi # end of select 'if'
1595 # Fix Ip_Missing_Semi
1597 case "${file}" in ./netinet/ip.h )
1598 if ( test -n "`egrep '}$' ${file}`"
1599 ) > /dev/null 2>&1 ; then
1602 if [ ! -r ${DESTFILE} ]
1604 else infile=${DESTFILE} ; fi
1606 sed -e '/^struct/,/^};/s/}$/};/' \
1607 < $infile > ${DESTDIR}/fixinc.tmp
1609 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
1610 fi # end of select 'if'
1611 ;; # case end for file name test
1616 # Fix Irix_Multiline_Cmnt
1618 case "${file}" in ./sys/types.h )
1620 irix_multiline_cmnt"
1621 if [ ! -r ${DESTFILE} ]
1623 else infile=${DESTFILE} ; fi
1625 sed -e 's@type of the result@type of the result */@' \
1626 -e 's@of the sizeof@/* of the sizeof@' \
1627 < $infile > ${DESTDIR}/fixinc.tmp
1629 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
1630 ;; # case end for file name test
1637 case "${file}" in ./rpc/auth.h )
1638 if ( test -n "`egrep 'authdes_create.*struct sockaddr' ${file}`"
1639 ) > /dev/null 2>&1 ; then
1642 if [ ! -r ${DESTFILE} ]
1644 else infile=${DESTFILE} ; fi
1646 sed -e '/authdes_create.*struct sockaddr/i\
1649 < $infile > ${DESTDIR}/fixinc.tmp
1651 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
1652 fi # end of select 'if'
1653 ;; # case end for file name test
1658 # Fix Irix_Struct__File
1660 case "${file}" in ./rpc/xdr.h )
1663 if [ ! -r ${DESTFILE} ]
1665 else infile=${DESTFILE} ; fi
1667 sed -e '/xdrstdio_create.*struct __file_s/i\
1670 < $infile > ${DESTDIR}/fixinc.tmp
1672 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
1673 ;; # case end for file name test
1678 # Fix Irix_Asm_Apostrophe
1680 case "${file}" in ./sys/asm.h )
1681 if ( test -n "`egrep '^[ ]*#.*[Ww]e'\\''re' ${file}`"
1682 ) > /dev/null 2>&1 ; then
1684 irix_asm_apostrophe"
1685 if [ ! -r ${DESTFILE} ]
1687 else infile=${DESTFILE} ; fi
1689 sed -e '/^[ ]*#/s/\([Ww]e\)'\''re/\1 are/' \
1690 < $infile > ${DESTDIR}/fixinc.tmp
1692 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
1693 fi # end of select 'if'
1694 ;; # case end for file name test
1701 case "${file}" in ./math.h )
1702 if ( test -n "`egrep 'fmod\\(double\\)' ${file}`"
1703 ) > /dev/null 2>&1 ; then
1706 if [ ! -r ${DESTFILE} ]
1708 else infile=${DESTFILE} ; fi
1710 sed -e 's/fmod(double)/fmod(double, double)/' \
1711 < $infile > ${DESTDIR}/fixinc.tmp
1713 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
1714 fi # end of select 'if'
1715 ;; # case end for file name test
1720 # Fix Motorola_Nested
1722 case "${file}" in ./limits.h | \
1724 case "$target_canonical" in m68k-motorola-sysv* )
1727 if [ ! -r ${DESTFILE} ]
1729 else infile=${DESTFILE} ; fi
1731 sed -e 's@^\(#undef[ ][ ]*PIPE_BUF[ ]*/\* max # bytes atomic in write to a\)$@\1 */@' \
1732 -e 's@\(/\*#define HUGE_VAL 3.40282346638528860e+38 \)\(/\*error value returned by Math lib\*/\)$@\1*/ \2@' \
1733 < $infile > ${DESTDIR}/fixinc.tmp
1735 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
1736 ;; # case end for machine type test
1738 ;; # case end for file name test
1743 # Fix Isc_Sys_Limits
1745 case "${file}" in ./sys/limits.h )
1746 if ( test -n "`egrep 'CHILD_MAX' ${file}`"
1747 ) > /dev/null 2>&1 ; then
1750 if [ ! -r ${DESTFILE} ]
1752 else infile=${DESTFILE} ; fi
1754 sed -e '/CHILD_MAX/s,/\* Max, Max,' \
1755 -e '/OPEN_MAX/s,/\* Max, Max,' \
1756 < $infile > ${DESTDIR}/fixinc.tmp
1758 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
1759 fi # end of select 'if'
1760 ;; # case end for file name test
1767 case "${file}" in ./sparc/asm_linkage.h | \
1768 ./sun3/asm_linkage.h | \
1769 ./sun3x/asm_linkage.h | \
1770 ./sun4/asm_linkage.h | \
1771 ./sun4c/asm_linkage.h | \
1772 ./sun4m/asm_linkage.h | \
1773 ./sun4c/debug/asm_linkage.h | \
1774 ./sun4m/debug/asm_linkage.h | \
1775 ./arm/as_support.h | \
1778 ./dev/chardefmac.h | \
1783 ./Xm.acorn/XmP.h | \
1785 if ( test -n "`egrep '/\\*\\*/' ${file}`"
1786 ) > /dev/null 2>&1 ; then
1789 if [ ! -r ${DESTFILE} ]
1791 else infile=${DESTFILE} ; fi
1793 sed -e 's|/\*\*/|##|g' \
1794 < $infile > ${DESTDIR}/fixinc.tmp
1796 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
1797 fi # end of select 'if'
1798 ;; # case end for file name test
1803 # Fix Limits_Ifndefs
1805 case "${file}" in ./limits.h | \
1807 if ( test -z "`egrep 'ifndef[ ]+FLT_MIN' ${file}`"
1808 ) > /dev/null 2>&1 ; then
1811 if [ ! -r ${DESTFILE} ]
1813 else infile=${DESTFILE} ; fi
1815 sed -e '/[ ]FLT_MIN[ ]/i\
1818 -e '/[ ]FLT_MIN[ ]/a\
1821 -e '/[ ]FLT_MAX[ ]/i\
1824 -e '/[ ]FLT_MAX[ ]/a\
1827 -e '/[ ]FLT_DIG[ ]/i\
1830 -e '/[ ]FLT_DIG[ ]/a\
1833 -e '/[ ]DBL_MIN[ ]/i\
1836 -e '/[ ]DBL_MIN[ ]/a\
1839 -e '/[ ]DBL_MAX[ ]/i\
1842 -e '/[ ]DBL_MAX[ ]/a\
1845 -e '/[ ]DBL_DIG[ ]/i\
1848 -e '/[ ]DBL_DIG[ ]/a\
1851 -e '/^\(\/\*#define HUGE_VAL 3\.[0-9e+]* *\)\/\*/s//\1/' \
1852 < $infile > ${DESTDIR}/fixinc.tmp
1854 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
1855 fi # end of bypass 'if'
1856 ;; # case end for file name test
1863 case "${file}" in ./curses.h )
1864 if ( test -n "`egrep '#[ ]*define[ ]+void[ ]+int' ${file}`"
1865 ) > /dev/null 2>&1 ; then
1868 if [ ! -r ${DESTFILE} ]
1870 else infile=${DESTFILE} ; fi
1872 sed -e '/#[ ]*define[ ][ ]*void[ ]int/d' \
1873 < $infile > ${DESTDIR}/fixinc.tmp
1875 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
1876 fi # end of select 'if'
1877 ;; # case end for file name test
1882 # Fix Lynxos_Fcntl_Proto
1884 case "${file}" in ./fcntl.h )
1885 if ( test -n "`egrep 'fcntl.*\\(int, int, int\\)' ${file}`"
1886 ) > /dev/null 2>&1 ; then
1889 if [ ! -r ${DESTFILE} ]
1891 else infile=${DESTFILE} ; fi
1893 sed -e 's/\(fcntl.*(int, int, \)int)/\1...)/' \
1894 < $infile > ${DESTDIR}/fixinc.tmp
1896 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
1897 fi # end of select 'if'
1898 ;; # case end for file name test
1903 # Fix M88k_Bad_Hypot_Opt
1905 case "${file}" in ./math.h )
1906 case "$target_canonical" in m88k-motorola-sysv3* )
1909 if [ ! -r ${DESTFILE} ]
1911 else infile=${DESTFILE} ; fi
1913 sed -e 's/extern double floor(), ceil(), fmod(), fabs();/extern double floor(), ceil(), fmod(), fabs _PARAMS((double));/' \
1914 -e '/^extern double hypot();$/a\
1915 \/* Workaround a stupid Motorola optimization if one\
1916 of x or y is 0.0 and the other is negative! *\/\
1918 static __inline__ double fake_hypot (double x, double y)\
1920 static __inline__ double fake_hypot (x, y)\
1924 return fabs (hypot (x, y));\
1926 #define hypot fake_hypot
1928 < $infile > ${DESTDIR}/fixinc.tmp
1930 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
1931 ;; # case end for machine type test
1933 ;; # case end for file name test
1940 case "${file}" in ./sys/stat.h )
1941 case "$target_canonical" in m88k-*-sysv3* )
1942 if ( test -n "`egrep '#define[ ]+S_IS[A-Z]*(m)[ ]' ${file}`"
1943 ) > /dev/null 2>&1 ; then
1946 if [ ! -r ${DESTFILE} ]
1948 else infile=${DESTFILE} ; fi
1950 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)/' \
1951 -e 's/^\(#define[ ]*S_IS[A-Z]*(m)\)[ ]*(m[ ]*&[ ]*\(0[0-9]*\)[ ]*)/\1 (((m)\&S_IFMT)==\2)/' \
1952 < $infile > ${DESTDIR}/fixinc.tmp
1954 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
1955 fi # end of select 'if'
1956 ;; # case end for machine type test
1958 ;; # case end for file name test
1963 # Fix M88k_Multi_Incl
1965 case "${file}" in ./time.h )
1966 case "$target_canonical" in m88k-tektronix-sysv3* )
1967 if ( test -z "`egrep '#ifndef' ${file}`"
1968 ) > /dev/null 2>&1 ; then
1971 if [ ! -r ${DESTFILE} ]
1973 else infile=${DESTFILE} ; fi
1974 ( echo Fixing $file, to protect against multiple inclusion. >&2
1975 cpp_wrapper=`echo $file | sed -e 's,\.,_,g' -e 's,/,_,g'`
1976 echo "#ifndef __GCC_GOT_${cpp_wrapper}_"
1977 echo "#define __GCC_GOT_${cpp_wrapper}_"
1979 echo "#endif /* ! __GCC_GOT_${cpp_wrapper}_ */" ) < $infile > ${DESTDIR}/fixinc.tmp
1981 # Shell scripts have the potential of removing the output
1982 # We interpret that to mean the file is not to be altered
1984 if test ! -f ${DESTDIR}/fixinc.tmp
1987 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
1988 fi # end of bypass 'if'
1989 ;; # case end for machine type test
1991 ;; # case end for file name test
1998 if ${FIXTESTS} ${file} machine_name
2002 if [ ! -r ${DESTFILE} ]
2004 else infile=${DESTFILE} ; fi
2005 ${FIXFIXES} ${file} machine_name < $infile > ${DESTDIR}/fixinc.tmp
2007 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
2008 fi # end of c_test 'if'
2012 # Fix Math_Exception
2014 case "${file}" in ./math.h )
2015 if ( test -n "`egrep 'struct exception' ${file}`"
2016 ) > /dev/null 2>&1 ; then
2017 if ( test -z "`egrep 'We have a problem when using C\\+\\+' ${file}`"
2018 ) > /dev/null 2>&1 ; then
2021 if [ ! -r ${DESTFILE} ]
2023 else infile=${DESTFILE} ; fi
2025 sed -e '/struct exception/i\
2027 #define exception __math_exception\
2030 -e '/struct exception/a\
2035 < $infile > ${DESTDIR}/fixinc.tmp
2037 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
2038 fi # end of bypass 'if'
2039 fi # end of select 'if'
2040 ;; # case end for file name test
2045 # Fix Math_Huge_Val_From_Dbl_Max
2047 case "${file}" in ./math.h )
2048 if ( test -n "`egrep 'define[ ]*HUGE_VAL[ ]*DBL_MAX' ${file}`"
2049 ) > /dev/null 2>&1 ; then
2050 if ( test -z "`egrep 'define[ ]*DBL_MAX' ${file}`"
2051 ) > /dev/null 2>&1 ; then
2053 math_huge_val_from_dbl_max"
2054 if [ ! -r ${DESTFILE} ]
2056 else infile=${DESTFILE} ; fi
2057 ( dbl_max_def=`egrep 'define[ ]+DBL_MAX[ ]+.*' float.h 2>/dev/null`
2059 if ( test -n "${dbl_max_def}" ) > /dev/null 2>&1
2060 then sed -e '/define[ ]*HUGE_VAL[ ]*DBL_MAX/s/DBL_MAX/'"$dbl_max_def/"
2062 fi ) < $infile > ${DESTDIR}/fixinc.tmp
2064 # Shell scripts have the potential of removing the output
2065 # We interpret that to mean the file is not to be altered
2067 if test ! -f ${DESTDIR}/fixinc.tmp
2070 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
2071 fi # end of bypass 'if'
2072 fi # end of select 'if'
2073 ;; # case end for file name test
2078 # Fix Math_Huge_Val_Ifndef
2080 case "${file}" in ./math/math.h )
2081 if ( test -n "`egrep 'define[ ]*HUGE_VAL' ${file}`"
2082 ) > /dev/null 2>&1 ; then
2084 math_huge_val_ifndef"
2085 if [ ! -r ${DESTFILE} ]
2087 else infile=${DESTFILE} ; fi
2089 sed -e '/define[ ]HUGE_VAL[ ]/i\
2092 -e '/define[ ]HUGE_VAL[ ]/a\
2095 < $infile > ${DESTDIR}/fixinc.tmp
2097 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
2098 fi # end of select 'if'
2099 ;; # case end for file name test
2104 # Fix Nested_Comment
2106 case "${file}" in ./rpc/rpc.h )
2109 if [ ! -r ${DESTFILE} ]
2111 else infile=${DESTFILE} ; fi
2113 sed -e 's@^\(/\*.*rpc/auth_des.h>.*\)/\*@\1*/ /*@' \
2114 < $infile > ${DESTDIR}/fixinc.tmp
2116 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
2117 ;; # case end for file name test
2122 # Fix News_Os_Recursion
2124 case "${file}" in ./stdlib.h )
2125 if ( test -n "`egrep '#include <stdlib.h>' ${file}`"
2126 ) > /dev/null 2>&1 ; then
2129 if [ ! -r ${DESTFILE} ]
2131 else infile=${DESTFILE} ; fi
2133 sed -e '/^#include <stdlib.h>/i\
2134 #ifdef BOGUS_RECURSION
2136 -e '/^#include <stdlib.h>/a\
2139 < $infile > ${DESTDIR}/fixinc.tmp
2141 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
2142 fi # end of select 'if'
2143 ;; # case end for file name test
2148 # Fix Next_Math_Prefix
2150 case "${file}" in ./ansi/math.h )
2151 if ( test -n "`egrep '^extern.*double.*__const__.*' ${file}`"
2152 ) > /dev/null 2>&1 ; then
2155 if [ ! -r ${DESTFILE} ]
2157 else infile=${DESTFILE} ; fi
2159 sed -e '/^extern.*double.*__const__.*sqrt(/s/__const__//' \
2160 -e '/^extern.*double.*__const__.*fabs(/s/__const__//' \
2161 -e '/^extern.*double.*__const__.*cos(/s/__const__//' \
2162 -e '/^extern.*double.*__const__.*hypot(/s/__const__//' \
2163 -e '/^extern.*double.*__const__.*sin(/s/__const__//' \
2164 < $infile > ${DESTDIR}/fixinc.tmp
2166 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
2167 fi # end of select 'if'
2168 ;; # case end for file name test
2175 case "${file}" in ./bsd/libc.h )
2176 if ( test -n "`egrep 'template' ${file}`"
2177 ) > /dev/null 2>&1 ; then
2180 if [ ! -r ${DESTFILE} ]
2182 else infile=${DESTFILE} ; fi
2184 sed -e '/\(.*template\)/s/template//' \
2185 -e '/extern.*volatile.*void.*abort/s/volatile//' \
2186 < $infile > ${DESTDIR}/fixinc.tmp
2188 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
2189 fi # end of select 'if'
2190 ;; # case end for file name test
2197 case "${file}" in ./ansi/stdlib.h )
2198 if ( test -n "`egrep 'volatile' ${file}`"
2199 ) > /dev/null 2>&1 ; then
2202 if [ ! -r ${DESTFILE} ]
2204 else infile=${DESTFILE} ; fi
2206 sed -e '/extern.*volatile.*void.*exit/s/volatile//' \
2207 -e '/extern.*volatile.*void.*abort/s/volatile//' \
2208 < $infile > ${DESTDIR}/fixinc.tmp
2210 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
2211 fi # end of select 'if'
2212 ;; # case end for file name test
2217 # Fix Next_Wait_Union
2219 case "${file}" in ./sys/wait.h )
2220 if ( test -n "`egrep 'wait\\(union wait' ${file}`"
2221 ) > /dev/null 2>&1 ; then
2224 if [ ! -r ${DESTFILE} ]
2226 else infile=${DESTFILE} ; fi
2228 sed -e 's@wait(union wait@wait(void@' \
2229 < $infile > ${DESTDIR}/fixinc.tmp
2231 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
2232 fi # end of select 'if'
2233 ;; # case end for file name test
2238 # Fix Nodeent_Syntax
2240 case "${file}" in ./netdnet/dnetdb.h )
2243 if [ ! -r ${DESTFILE} ]
2245 else infile=${DESTFILE} ; fi
2247 sed -e 's/char.*na_addr *$/char *na_addr;/' \
2248 < $infile > ${DESTDIR}/fixinc.tmp
2250 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
2251 ;; # case end for file name test
2256 # Fix Osf_Namespace_A
2258 case "${file}" in ./reg_types.h | \
2260 if ( test '(' -r reg_types.h ')' -a \
2261 '(' -r sys/lc_core.h ')' -a \
2262 '(' -n "`grep '} regex_t;' reg_types.h`" ')' -a \
2263 '(' -z "`grep __regex_t regex.h`" ')'
2264 ) > /dev/null 2>&1 ; then
2267 if [ ! -r ${DESTFILE} ]
2269 else infile=${DESTFILE} ; fi
2271 sed -e 's/regex_t/__regex_t/g' \
2272 -e 's/regoff_t/__regoff_t/g' \
2273 -e 's/regmatch_t/__regmatch_t/g' \
2274 < $infile > ${DESTDIR}/fixinc.tmp
2276 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
2277 fi # end of test expression 'if'
2278 ;; # case end for file name test
2283 # Fix Osf_Namespace_B
2285 case "${file}" in ./regex.h )
2286 if ( test '(' -r reg_types.h ')' -a \
2287 '(' -r sys/lc_core.h ')' -a \
2288 '(' -n "`grep '} regex_t;' reg_types.h`" ')' -a \
2289 '(' -z "`grep __regex_t regex.h`" ')'
2290 ) > /dev/null 2>&1 ; then
2293 if [ ! -r ${DESTFILE} ]
2295 else infile=${DESTFILE} ; fi
2297 sed -e '/#include <reg_types.h>/a\
2298 typedef __regex_t regex_t;\
2299 typedef __regoff_t regoff_t;\
2300 typedef __regmatch_t regmatch_t;
2302 < $infile > ${DESTDIR}/fixinc.tmp
2304 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
2305 fi # end of test expression 'if'
2306 ;; # case end for file name test
2311 # Fix Pthread_Page_Size
2313 case "${file}" in ./pthread.h )
2314 if ( test -n "`egrep '^int __page_size' ${file}`"
2315 ) > /dev/null 2>&1 ; then
2318 if [ ! -r ${DESTFILE} ]
2320 else infile=${DESTFILE} ; fi
2322 sed -e 's/^int __page_size/extern int __page_size/' \
2323 < $infile > ${DESTDIR}/fixinc.tmp
2325 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
2326 fi # end of select 'if'
2327 ;; # case end for file name test
2334 case "${file}" in ./stdio.h )
2335 if ( test -n "`egrep 'extern int .*, fread\\(\\), fwrite\\(\\)' ${file}`"
2336 ) > /dev/null 2>&1 ; then
2339 if [ ! -r ${DESTFILE} ]
2341 else infile=${DESTFILE} ; fi
2343 sed -e 's/^\(extern int fclose(), fflush()\), \(fread(), fwrite()\)\(.*\)$/extern unsigned int \2;\
2345 < $infile > ${DESTDIR}/fixinc.tmp
2347 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
2348 fi # end of select 'if'
2349 ;; # case end for file name test
2356 case "${file}" in ./math.h )
2357 if ( test -n "`egrep '[^a-zA-Z_]class\\(' ${file}`"
2358 ) > /dev/null 2>&1 ; then
2361 if [ ! -r ${DESTFILE} ]
2363 else infile=${DESTFILE} ; fi
2365 sed -e '/class[(]/i\
2371 < $infile > ${DESTDIR}/fixinc.tmp
2373 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
2374 fi # end of select 'if'
2375 ;; # case end for file name test
2382 case "${file}" in ./sys/stat.h )
2383 if ( test -n "`egrep 'fchmod\\(char' ${file}`"
2384 ) > /dev/null 2>&1 ; then
2387 if [ ! -r ${DESTFILE} ]
2389 else infile=${DESTFILE} ; fi
2391 sed -e 's/fchmod(char \*/fchmod(int/' \
2392 < $infile > ${DESTDIR}/fixinc.tmp
2394 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
2395 fi # end of select 'if'
2396 ;; # case end for file name test
2403 case "${file}" in ./stdio.h | \
2405 if ( test -n "`egrep 'const char new' ${file}`"
2406 ) > /dev/null 2>&1 ; then
2409 if [ ! -r ${DESTFILE} ]
2411 else infile=${DESTFILE} ; fi
2413 sed -e 's@rename(const char \*old, const char \*new)@rename(const char *_old, const char *_new)@' \
2414 < $infile > ${DESTDIR}/fixinc.tmp
2416 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
2417 fi # end of select 'if'
2418 ;; # case end for file name test
2425 case "${file}" in ./machine/machparam.h )
2426 if ( test -n "`egrep '\"\\.\\./machine/endian.h\"' ${file}`"
2427 ) > /dev/null 2>&1 ; then
2430 if [ ! -r ${DESTFILE} ]
2432 else infile=${DESTFILE} ; fi
2434 sed -e 's@"../machine/endian.h"@<machine/endian.h>@' \
2435 < $infile > ${DESTDIR}/fixinc.tmp
2437 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
2438 fi # end of select 'if'
2439 ;; # case end for file name test
2446 case "${file}" in ./rpcsvc/rstat.h )
2447 if ( test -n "`egrep 'boottime$' ${file}`"
2448 ) > /dev/null 2>&1 ; then
2451 if [ ! -r ${DESTFILE} ]
2453 else infile=${DESTFILE} ; fi
2455 sed -e 's/boottime$/boottime;/' \
2456 < $infile > ${DESTDIR}/fixinc.tmp
2458 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
2459 fi # end of select 'if'
2460 ;; # case end for file name test
2467 case "${file}" in ./stdio.h )
2468 if ( test -z "`egrep '__gnuc_va_list' ${file}`"
2469 ) > /dev/null 2>&1 ; then
2472 if [ ! -r ${DESTFILE} ]
2474 else infile=${DESTFILE} ; fi
2475 ( if ( egrep "__need___va_list" $file ) > /dev/null 2>&1 ; then
2478 echo "#define __need___va_list"
2479 echo "#include <stdarg.h>"
2482 sed -e 's@ va_list @ __gnuc_va_list @' \
2483 -e 's@ va_list)@ __gnuc_va_list)@' \
2484 -e 's@ _BSD_VA_LIST_))@ __gnuc_va_list))@' \
2485 -e 's@ _VA_LIST_));@ __gnuc_va_list));@' \
2486 -e 's@ va_list@ __not_va_list__@' \
2487 -e 's@\*va_list@*__not_va_list__@' \
2488 -e 's@ __va_list)@ __gnuc_va_list)@' \
2489 -e 's@GNUC_VA_LIST@GNUC_Va_LIST@' \
2490 -e 's@_NEED___VA_LIST@_NEED___Va_LIST@' \
2491 -e 's@VA_LIST@DUMMY_VA_LIST@' \
2492 -e 's@_Va_LIST@_VA_LIST@' ) < $infile > ${DESTDIR}/fixinc.tmp
2494 # Shell scripts have the potential of removing the output
2495 # We interpret that to mean the file is not to be altered
2497 if test ! -f ${DESTDIR}/fixinc.tmp
2500 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
2501 fi # end of bypass 'if'
2502 ;; # case end for file name test
2507 # Fix Sun_Bogus_Ifdef
2509 case "${file}" in ./hsfs/hsfs_spec.h | \
2511 if ( test -n "`egrep '#ifdef __i386__ || __vax__' ${file}`"
2512 ) > /dev/null 2>&1 ; then
2515 if [ ! -r ${DESTFILE} ]
2517 else infile=${DESTFILE} ; fi
2519 sed -e 's/\#ifdef __i386__ || __vax__/\#if __i386__ || __vax__/g' \
2520 < $infile > ${DESTDIR}/fixinc.tmp
2522 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
2523 fi # end of select 'if'
2524 ;; # case end for file name test
2529 # Fix Sun_Bogus_Ifdef_Sun4c
2531 case "${file}" in ./hsfs/hsnode.h )
2532 if ( test -n "`egrep '#ifdef __i386__ || __sun4c__' ${file}`"
2533 ) > /dev/null 2>&1 ; then
2535 sun_bogus_ifdef_sun4c"
2536 if [ ! -r ${DESTFILE} ]
2538 else infile=${DESTFILE} ; fi
2540 sed -e 's/\#ifdef __i386__ || __sun4c__/\#if __i386__ || __sun4c__/g' \
2541 < $infile > ${DESTDIR}/fixinc.tmp
2543 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
2544 fi # end of select 'if'
2545 ;; # case end for file name test
2552 case "${file}" in ./pixrect/memvar.h )
2553 if ( test -n "`egrep '^#define[ ]+CAT\\(a,b\\)' ${file}`"
2554 ) > /dev/null 2>&1 ; then
2557 if [ ! -r ${DESTFILE} ]
2559 else infile=${DESTFILE} ; fi
2561 sed -e '/^#define[ ]CAT(a,b)/ i\
2563 #define CAT(a,b) a##b\
2566 -e '/^#define[ ]CAT(a,b)/ a\
2569 < $infile > ${DESTDIR}/fixinc.tmp
2571 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
2572 fi # end of select 'if'
2573 ;; # case end for file name test
2580 case "${file}" in ./malloc.h )
2583 if [ ! -r ${DESTFILE} ]
2585 else infile=${DESTFILE} ; fi
2587 sed -e 's/typedef[ ]char \* malloc_t/typedef void \* malloc_t/g' \
2588 -e 's/int[ ][ ]*free/void free/g' \
2589 -e 's/char\([ ]*\*[ ]*malloc\)/void\1/g' \
2590 -e 's/char\([ ]*\*[ ]*realloc\)/void\1/g' \
2591 < $infile > ${DESTDIR}/fixinc.tmp
2593 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
2594 ;; # case end for file name test
2599 # Fix Sun_Rusers_Semi
2601 case "${file}" in ./rpcsvc/rusers.h )
2602 if ( test -n "`egrep '_cnt$' ${file}`"
2603 ) > /dev/null 2>&1 ; then
2606 if [ ! -r ${DESTFILE} ]
2608 else infile=${DESTFILE} ; fi
2610 sed -e '/^struct/,/^};/s/_cnt$/_cnt;/' \
2611 < $infile > ${DESTDIR}/fixinc.tmp
2613 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
2614 fi # end of select 'if'
2615 ;; # case end for file name test
2622 case "${file}" in ./sys/signal.h | \
2624 if ( test -n "`egrep '^void \\(\\*signal\\(\\)\\)\\(\\);' ${file}`"
2625 ) > /dev/null 2>&1 ; then
2628 if [ ! -r ${DESTFILE} ]
2630 else infile=${DESTFILE} ; fi
2632 sed -e '/^void (\*signal())();$/i\
2634 void (*signal(...))(...);\
2637 -e '/^void (\*signal())();$/a\
2640 < $infile > ${DESTDIR}/fixinc.tmp
2642 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
2643 fi # end of select 'if'
2644 ;; # case end for file name test
2649 # Fix Sun_Auth_Proto
2651 case "${file}" in ./rpc/auth.h | \
2655 if ( test -n "`egrep '\\(\\*[a-z][a-z_]*\\)\\(\\)' ${file}`"
2656 ) > /dev/null 2>&1 ; then
2659 if [ ! -r ${DESTFILE} ]
2661 else infile=${DESTFILE} ; fi
2663 sed -e 's/^\(.*(\*[a-z][a-z_]*)(\)\();.*\)/\
2669 < $infile > ${DESTDIR}/fixinc.tmp
2671 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
2672 fi # end of select 'if'
2673 ;; # case end for file name test
2678 # Fix Sunos_Matherr_Decl
2680 case "${file}" in ./math.h )
2681 if ( test -z "`egrep 'matherr.*struct exception' ${file}`"
2682 ) > /dev/null 2>&1 ; then
2685 if [ ! -r ${DESTFILE} ]
2687 else infile=${DESTFILE} ; fi
2689 sed -e '/^struct exception/,$b' \
2693 < $infile > ${DESTDIR}/fixinc.tmp
2695 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
2696 fi # end of bypass 'if'
2697 ;; # case end for file name test
2704 case "${file}" in ./strings.h )
2705 if ( test -n "`egrep 'int[ ]*strlen' ${file}`"
2706 ) > /dev/null 2>&1 ; then
2709 if [ ! -r ${DESTFILE} ]
2711 else infile=${DESTFILE} ; fi
2713 sed -e 's/int[ ]*strlen();/__SIZE_TYPE__ strlen();/' \
2714 < $infile > ${DESTDIR}/fixinc.tmp
2716 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
2717 fi # end of select 'if'
2718 ;; # case end for file name test
2725 case "${file}" in ./sys/types.h | \
2727 ./sys/stdtypes.h | \
2731 if ( test -n "`egrep 'typedef[ ]+[a-z_][ a-z_]*[ ](size|ptrdiff|wchar)_t' ${file}`"
2732 ) > /dev/null 2>&1 ; then
2735 if [ ! -r ${DESTFILE} ]
2737 else infile=${DESTFILE} ; fi
2739 sed -e '/^[ ]*\*[ ]*typedef unsigned int size_t;/N' \
2740 -e 's/^\([ ]*\*[ ]*typedef unsigned int size_t;\n[ ]*\*\/\)/\1\
2741 #ifndef __SIZE_TYPE__\
2742 #define __SIZE_TYPE__ long unsigned int\
2744 typedef __SIZE_TYPE__ size_t;\
2746 -e '/typedef[ ][ ]*[a-z_][ a-z_]*[ ]size_t/i\
2747 #ifndef __SIZE_TYPE__\
2748 #define __SIZE_TYPE__ long unsigned int\
2751 -e 's/typedef[ ][ ]*[a-z_][ a-z_]*[ ]size_t/typedef __SIZE_TYPE__ size_t/' \
2752 -e '/typedef[ ][ ]*[a-z_][ a-z_]*[ ]ptrdiff_t/i\
2753 #ifndef __PTRDIFF_TYPE__\
2754 #define __PTRDIFF_TYPE__ long int\
2757 -e 's/typedef[ ][ ]*[a-z_][ a-z_]*[ ]ptrdiff_t/typedef __PTRDIFF_TYPE__ ptrdiff_t/' \
2758 -e '/typedef[ ][ ]*[a-z_][ a-z_]*[ ]wchar_t/i\
2759 #ifndef __WCHAR_TYPE__\
2760 #define __WCHAR_TYPE__ int\
2764 -e '/typedef[ ][ ]*[a-z_][ a-z_]*[ ]wchar_t/a\
2767 -e 's/typedef[ ][ ]*[a-z_][ a-z_]*[ ]wchar_t/typedef __WCHAR_TYPE__ wchar_t/' \
2768 < $infile > ${DESTDIR}/fixinc.tmp
2770 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
2771 fi # end of select 'if'
2772 ;; # case end for file name test
2777 # Fix Systypes_For_Aix
2779 case "${file}" in ./sys/types.h )
2780 if ( test -n "`egrep 'typedef[ ][ ]*[A-Za-z_][ A-Za-z_]*[ ]size_t' ${file}`"
2781 ) > /dev/null 2>&1 ; then
2782 if ( test -z "`egrep '_GCC_SIZE_T' ${file}`"
2783 ) > /dev/null 2>&1 ; then
2786 if [ ! -r ${DESTFILE} ]
2788 else infile=${DESTFILE} ; fi
2790 sed -e '/typedef[ ][ ]*[A-Za-z_][ A-Za-z_]*[ ]size_t/i\
2791 #ifndef _GCC_SIZE_T\
2794 -e '/typedef[ ][ ]*[A-Za-z_][ A-Za-z_]*[ ]size_t/a\
2797 < $infile > ${DESTDIR}/fixinc.tmp
2799 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
2800 fi # end of bypass 'if'
2801 fi # end of select 'if'
2802 ;; # case end for file name test
2809 case "${file}" in ./string.h )
2812 if [ ! -r ${DESTFILE} ]
2814 else infile=${DESTFILE} ; fi
2816 sed -e 's/extern[ ]*int[ ]*strlen();/extern unsigned int strlen();/' \
2817 -e 's/extern[ ]*int[ ]*ffs[ ]*(long);/extern int ffs(int);/' \
2818 -e 's/strdup(char \*s1);/strdup(const char *s1);/' \
2819 -e '/^extern char$/N' \
2820 -e 's/^extern char\(\n \*memccpy(),\)$/extern void\1/' \
2821 -e '/^ strncmp(),$/N' \
2822 -e 's/^\( strncmp()\),\n\( strlen(),\)$/\1;\
2823 extern unsigned int\
2825 -e '/^extern int$/N' \
2826 -e 's/^extern int\(\n strlen(),\)/extern size_t\1/' \
2827 < $infile > ${DESTDIR}/fixinc.tmp
2829 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
2830 ;; # case end for file name test
2835 # Fix Sysz_Stdlib_For_Sun
2837 case "${file}" in ./stdlib.h )
2839 sysz_stdlib_for_sun"
2840 if [ ! -r ${DESTFILE} ]
2842 else infile=${DESTFILE} ; fi
2844 sed -e 's/int abort/void abort/g' \
2845 -e 's/int free/void free/g' \
2846 -e 's/char[ ]*\*[ ]*calloc/void \* calloc/g' \
2847 -e 's/char[ ]*\*[ ]*malloc/void \* malloc/g' \
2848 -e 's/char[ ]*\*[ ]*realloc/void \* realloc/g' \
2849 -e 's/char[ ]*\*[ ]*bsearch/void \* bsearch/g' \
2850 -e 's/int[ ][ ]*exit/void exit/g' \
2851 -e '/typedef[ a-zA-Z_]*[ ]size_t[ ]*;/i\
2852 #ifndef _GCC_SIZE_T\
2855 -e '/typedef[ a-zA-Z_]*[ ]size_t[ ]*;/a\
2858 < $infile > ${DESTDIR}/fixinc.tmp
2860 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
2861 ;; # case end for file name test
2866 # Fix Sysz_Stdtypes_For_Sun
2868 case "${file}" in ./sys/stdtypes.h )
2870 sysz_stdtypes_for_sun"
2871 if [ ! -r ${DESTFILE} ]
2873 else infile=${DESTFILE} ; fi
2875 sed -e '/[ ]size_t.*;/i\
2876 #ifndef _GCC_SIZE_T\
2879 -e '/[ ]size_t.*;/a\
2882 -e '/[ ]ptrdiff_t.*;/i\
2883 #ifndef _GCC_PTRDIFF_T\
2884 #define _GCC_PTRDIFF_T
2886 -e '/[ ]ptrdiff_t.*;/a\
2889 -e '/[ ]wchar_t.*;/i\
2890 #ifndef _GCC_WCHAR_T\
2891 #define _GCC_WCHAR_T
2893 -e '/[ ]wchar_t.*;/a\
2896 < $infile > ${DESTDIR}/fixinc.tmp
2898 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
2899 ;; # case end for file name test
2904 # Fix Tinfo_Cplusplus
2906 case "${file}" in ./tinfo.h )
2907 if ( test -n "`egrep '[ ]_cplusplus' ${file}`"
2908 ) > /dev/null 2>&1 ; then
2911 if [ ! -r ${DESTFILE} ]
2913 else infile=${DESTFILE} ; fi
2915 sed -e 's/[ ]_cplusplus/ __cplusplus/' \
2916 < $infile > ${DESTDIR}/fixinc.tmp
2918 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
2919 fi # end of select 'if'
2920 ;; # case end for file name test
2925 # Fix Ultrix_Fix_Fixproto
2927 case "${file}" in ./sys/utsname.h )
2928 if ( test -n "`egrep 'ULTRIX' ${file}`"
2929 ) > /dev/null 2>&1 ; then
2931 ultrix_fix_fixproto"
2932 if [ ! -r ${DESTFILE} ]
2934 else infile=${DESTFILE} ; fi
2936 sed -e '/^[ ]*extern[ ]*int[ ]*uname();$/i\
2939 < $infile > ${DESTDIR}/fixinc.tmp
2941 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
2942 fi # end of select 'if'
2943 ;; # case end for file name test
2948 # Fix Ultrix_Atof_Param
2950 case "${file}" in ./math.h )
2951 if ( test -n "`egrep 'atof\\([ ]*char' ${file}`"
2952 ) > /dev/null 2>&1 ; then
2955 if [ ! -r ${DESTFILE} ]
2957 else infile=${DESTFILE} ; fi
2959 sed -e 's@atof(\([ ]*char[ ]*\*[^)]*\))@atof(const \1)@' \
2960 < $infile > ${DESTDIR}/fixinc.tmp
2962 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
2963 fi # end of select 'if'
2964 ;; # case end for file name test
2971 case "${file}" in ./stdio.h )
2974 if [ ! -r ${DESTFILE} ]
2976 else infile=${DESTFILE} ; fi
2978 sed -e 's@perror( char \*__s );@perror( const char *__s );@' \
2979 -e 's@fputs( char \*__s,@fputs( const char *__s,@' \
2980 -e 's@fopen( char \*__filename, char \*__type );@fopen( const char *__filename, const char *__type );@' \
2981 -e 's@fwrite( void \*__ptr,@fwrite( const void *__ptr,@' \
2982 -e 's@fscanf( FILE \*__stream, char \*__format,@fscanf( FILE *__stream, const char *__format,@' \
2983 -e 's@scanf( char \*__format,@scanf( const char *__format,@' \
2984 -e 's@sscanf( char \*__s, char \*__format,@sscanf( const char *__s, const char *__format,@' \
2985 -e 's@popen(char \*, char \*);@popen(const char *, const char *);@' \
2986 -e 's@tempnam(char\*,char\*);@tempnam(const char*,const char*);@' \
2987 < $infile > ${DESTDIR}/fixinc.tmp
2989 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
2990 ;; # case end for file name test
2997 case "${file}" in ./sys/file.h )
2998 if ( test -n "`egrep '#ifdef KERNEL' ${file}`"
2999 ) > /dev/null 2>&1 ; then
3002 if [ ! -r ${DESTFILE} ]
3004 else infile=${DESTFILE} ; fi
3006 sed -e 's/#ifdef KERNEL/#if defined(KERNEL)/' \
3007 < $infile > ${DESTDIR}/fixinc.tmp
3009 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
3010 fi # end of select 'if'
3011 ;; # case end for file name test
3016 # Fix Ultrix_Nested_Cmnt
3018 case "${file}" in ./rpc/svc.h )
3021 if [ ! -r ${DESTFILE} ]
3023 else infile=${DESTFILE} ; fi
3025 sed -e 's@^\( \* int protocol; \)/\*@\1*/ /*@' \
3026 < $infile > ${DESTDIR}/fixinc.tmp
3028 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
3029 ;; # case end for file name test
3036 case "${file}" in ./machine/cpu.h )
3037 if ( test -n "`egrep '#include \"r[34]_cpu' ${file}`"
3038 ) > /dev/null 2>&1 ; then
3041 if [ ! -r ${DESTFILE} ]
3043 else infile=${DESTFILE} ; fi
3045 sed -e 's/^static struct tlb_pid_state/struct tlb_pid_state/' \
3046 -e 's/^#include "r3_cpu\.h"$/#include <machine\/r3_cpu\.h>/' \
3047 -e 's/^#include "r4_cpu\.h"$/#include <machine\/r4_cpu\.h>/' \
3048 < $infile > ${DESTDIR}/fixinc.tmp
3050 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
3051 fi # end of select 'if'
3052 ;; # case end for file name test
3059 if ( test -n "`egrep '^#[ ]*define[ ]*[ ]NULL[ ]' ${file}`"
3060 ) > /dev/null 2>&1 ; then
3061 if ( test -z "`egrep '#[ ]*(ifn|un)def[ ]*[ ]NULL($|[ ])' ${file}`"
3062 ) > /dev/null 2>&1 ; then
3065 if [ ! -r ${DESTFILE} ]
3067 else infile=${DESTFILE} ; fi
3069 sed -e '/^#[ ]*define[ ][ ]*NULL[ ]/i\
3072 < $infile > ${DESTDIR}/fixinc.tmp
3074 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
3075 fi # end of bypass 'if'
3076 fi # end of select 'if'
3080 # Fix Unixware7_Byteorder_Fix
3082 case "${file}" in ./arpa/inet.h )
3083 case "$target_canonical" in *-*-sysv4* | \
3084 i[34567]86-*-sysv5* | \
3085 i[34567]86-*-udk* | \
3086 i[34567]86-*-solaris2.[0-4] | \
3087 powerpcle-*-solaris2.[0-4] | \
3088 sparc-*-solaris2.[0-4] )
3089 if ( test -n "`egrep 'in_port_t' ${file}`"
3090 ) > /dev/null 2>&1 ; then
3092 unixware7_byteorder_fix"
3093 if [ ! -r ${DESTFILE} ]
3095 else infile=${DESTFILE} ; fi
3097 sed -e '/^extern.*htons.*(in_port_t)/d' \
3098 -e '/^extern.*ntohs.*(in_port_t)/d' \
3099 < $infile > ${DESTDIR}/fixinc.tmp
3101 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
3102 fi # end of select 'if'
3103 ;; # case end for machine type test
3105 ;; # case end for file name test
3112 case "${file}" in ./arch/i960/archI960.h )
3113 if ( test -n "`egrep '__(vsiz|vali|vpad|alignof__)' ${file}`"
3114 ) > /dev/null 2>&1 ; then
3117 if [ ! -r ${DESTFILE} ]
3119 else infile=${DESTFILE} ; fi
3121 sed -e 's/__vsiz/__vxvsiz/' \
3122 -e 's/__vali/__vxvali/' \
3123 -e 's/__vpad/__vxvpad/' \
3124 -e 's/__alignof__/__vxalignof__/' \
3125 < $infile > ${DESTDIR}/fixinc.tmp
3127 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
3128 fi # end of select 'if'
3129 ;; # case end for file name test
3136 case "${file}" in ./curses.h | \
3147 if ( test -n "`egrep '#[ ]*define[ ][ ]*NULL[ ].*void' ${file}`"
3148 ) > /dev/null 2>&1 ; then
3151 if [ ! -r ${DESTFILE} ]
3153 else infile=${DESTFILE} ; fi
3155 sed -e 's/^#[ ]*define[ ]*NULL[ ]*((void[ ]*\*)0)/#define NULL 0/' \
3156 < $infile > ${DESTDIR}/fixinc.tmp
3158 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
3159 fi # end of select 'if'
3160 ;; # case end for file name test
3165 # Fix Vxworks_Gcc_Problem
3167 case "${file}" in ./types/vxTypesBase.h )
3168 if ( test -n "`egrep '__GNUC_TYPEOF_FEATURE_BROKEN_USE_DEFAULT_UNTIL_FIXED__' ${file}`"
3169 ) > /dev/null 2>&1 ; then
3171 vxworks_gcc_problem"
3172 if [ ! -r ${DESTFILE} ]
3174 else infile=${DESTFILE} ; fi
3176 sed -e 's/#ifdef __GNUC_TYPEOF_FEATURE_BROKEN_USE_DEFAULT_UNTIL_FIXED__/#if 1/' \
3178 #ifndef _GCC_SIZE_T\
3184 -e '/[ ]ptrdiff_t/i\
3185 #ifndef _GCC_PTRDIFF_T\
3186 #define _GCC_PTRDIFF_T
3188 -e '/[ ]ptrdiff_t/a\
3192 #ifndef _GCC_WCHAR_T\
3193 #define _GCC_WCHAR_T
3198 < $infile > ${DESTDIR}/fixinc.tmp
3200 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
3201 fi # end of select 'if'
3202 ;; # case end for file name test
3207 # Fix Vxworks_Needs_Vxtypes
3209 case "${file}" in ./time.h )
3210 if ( test -n "`egrep 'uint_t[ ][ ]*_clocks_per_sec' ${file}`"
3211 ) > /dev/null 2>&1 ; then
3213 vxworks_needs_vxtypes"
3214 if [ ! -r ${DESTFILE} ]
3216 else infile=${DESTFILE} ; fi
3218 sed -e 's/uint_t/unsigned int/' \
3219 < $infile > ${DESTDIR}/fixinc.tmp
3221 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
3222 fi # end of select 'if'
3223 ;; # case end for file name test
3228 # Fix Vxworks_Needs_Vxworks
3230 case "${file}" in ./sys/stat.h )
3231 if ( test -n "`egrep '#[ ]define[ ][ ]*__INCstath' ${file}`"
3232 ) > /dev/null 2>&1 ; then
3233 if ( test '(' -r types/vxTypesOld.h ')' -a \
3234 '(' -n "`egrep '#include' $file`" ')' -a \
3235 '(' -n "`egrep ULONG $file`" ')'
3236 ) > /dev/null 2>&1 ; then
3238 vxworks_needs_vxworks"
3239 if [ ! -r ${DESTFILE} ]
3241 else infile=${DESTFILE} ; fi
3243 sed -e '/#[ ]define[ ][ ]*__INCstath/a\
3244 #include <types/vxTypesOld.h>
3246 < $infile > ${DESTDIR}/fixinc.tmp
3248 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
3249 fi # end of test expression 'if'
3250 fi # end of select 'if'
3251 ;; # case end for file name test
3258 case "${file}" in ./time.h )
3259 if ( test -n "`egrep 'VOIDFUNCPTR' ${file}`"
3260 ) > /dev/null 2>&1 ; then
3261 if ( test '(' -r vxWorks.h ')'
3262 ) > /dev/null 2>&1 ; then
3265 if [ ! -r ${DESTFILE} ]
3267 else infile=${DESTFILE} ; fi
3269 sed -e '/VOIDFUNCPTR/i\
3270 #ifndef __gcc_VOIDFUNCPTR_defined\
3272 typedef void (*__gcc_VOIDFUNCPTR) (...);\
3274 typedef void (*__gcc_VOIDFUNCPTR) ();\
3276 #define __gcc_VOIDFUNCPTR_defined\
3279 -e 's/VOIDFUNCPTR/__gcc_VOIDFUNCPTR/g' \
3280 < $infile > ${DESTDIR}/fixinc.tmp
3282 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
3283 fi # end of test expression 'if'
3284 fi # end of select 'if'
3285 ;; # case end for file name test
3292 case "${file}" in ./X11/ShellP.h )
3293 if ( test -z "`egrep '__cplusplus' ${file}`"
3294 ) > /dev/null 2>&1 ; then
3297 if [ ! -r ${DESTFILE} ]
3299 else infile=${DESTFILE} ; fi
3301 sed -e '/char \*class;/i\
3306 -e '/char \*class;/a\
3309 < $infile > ${DESTDIR}/fixinc.tmp
3311 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
3312 fi # end of bypass 'if'
3313 ;; # case end for file name test
3318 # Fix X11_Class_Usage
3320 case "${file}" in ./Xm/BaseClassI.h )
3321 if ( test -z "`egrep '__cplusplus' ${file}`"
3322 ) > /dev/null 2>&1 ; then
3325 if [ ! -r ${DESTFILE} ]
3327 else infile=${DESTFILE} ; fi
3329 sed -e 's/ class[)]/ c_class)/g' \
3330 < $infile > ${DESTDIR}/fixinc.tmp
3332 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
3333 fi # end of bypass 'if'
3334 ;; # case end for file name test
3341 case "${file}" in ./Xm/Traversal.h )
3342 if ( test -z "`egrep '__cplusplus' ${file}`"
3343 ) > /dev/null 2>&1 ; then
3346 if [ ! -r ${DESTFILE} ]
3348 else infile=${DESTFILE} ; fi
3350 sed -e '/Widget old, new;/i\
3355 -e '/Widget old, new;/a\
3358 -e 's/Widget new,/Widget c_new,/g' \
3359 < $infile > ${DESTDIR}/fixinc.tmp
3361 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
3362 fi # end of bypass 'if'
3363 ;; # case end for file name test
3370 case "${file}" in ./X11/Xmu.h | \
3372 if ( test -n "`egrep 'sprintf\\(\\)' ${file}`"
3373 ) > /dev/null 2>&1 ; then
3376 if [ ! -r ${DESTFILE} ]
3378 else infile=${DESTFILE} ; fi
3380 sed -e 's,^extern char \* sprintf();$,#ifndef __STDC__\
3381 extern char * sprintf();\
3382 #endif /* !defined __STDC__ */,' \
3383 < $infile > ${DESTDIR}/fixinc.tmp
3385 mv -f ${DESTDIR}/fixinc.tmp ${DESTFILE}
3386 fi # end of select 'if'
3387 ;; # case end for file name test
3389 # IF the output has been removed OR it is unchanged,
3390 # THEN ensure the output is gone
3391 # ELSE look for local directory include syntax
3393 if ( test ! -f ${DESTFILE} || \
3394 cmp ${file} ${DESTFILE} ) > /dev/null 2>&1
3398 echo "Fixed ${file}:${fixlist}"
3400 # Find any include directives that use "file".
3402 dir=`echo ${file} | sed -e s';/[^/]*$;;'`
3403 ddir=${DESTDIR}/$dir
3406 egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${DESTFILE} |
3407 sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`
3409 required="$required ${SRCDIR} $dir/$include ${ddir}/$include"
3412 done # for file in $files
3416 ## Make sure that any include files referenced using double quotes
3417 ## exist in the fixed directory. This comes last since otherwise
3418 ## we might end up deleting some of these files "because they don't
3419 ## need any change."
3420 set x `echo $required`
3422 while [ $# != 0 ]; do
3424 while [ $# != 0 ]; do
3425 # $1 is the directory to copy from,
3426 # $2 is the unfixed file,
3427 # $3 is the fixed file name.
3432 if [ -r $2 ] && [ ! -r $3 ]; then
3433 cp $2 $3 >/dev/null 2>&1 || echo "Can't copy $2" >&2
3434 chmod +w $3 2>/dev/null
3435 chmod a+r $3 2>/dev/null
3436 if test $VERBOSE -gt 2
3437 then echo Copied $2 ; fi
3438 for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' $3 |
3439 sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`
3441 dir=`echo $2 | sed -e s'|/[^/]*$||'`
3442 dir2=`echo $3 | sed -e s'|/[^/]*$||'`
3443 newreq="$newreq $1 $dir/$include $dir2/$include"
3453 if test $VERBOSE -gt 2
3454 then echo 'Cleaning up DONE files.' ; fi
3456 find . -name DONE -exec rm -f '{}' ';'
3458 if test $VERBOSE -gt 1
3459 then echo 'Cleaning up unneeded directories:' ; fi
3461 all_dirs=`find . -type d \! -name '.' -print | sort -r`
3462 for file in $all_dirs; do
3463 rmdir $LIB/$file > /dev/null 2>&1
3466 if test $VERBOSE -gt 0
3467 then echo fixincludes is done ; fi
3469 # # # # # # # # # # # # # # # # # # # # #
3471 # End of for INPUT directories
3475 # # # # # # # # # # # # # # # # # # # # #
3477 if [ x${INSTALL_ASSERT_H} != x ] && [ -f ${srcdir}/assert.h ]
3480 rm -f include/assert.h
3481 cp ${srcdir}/assert.h include/assert.h || exit 1
3482 chmod a+r include/assert.h