2 # Install modified versions of certain ANSI-incompatible system header files
3 # which are fixed to work correctly with ANSI C
4 # and placed in a directory that GNU C will search.
6 # See README-fixinc for more information.
8 # Directory containing the original header files.
9 # (This was named INCLUDES, but that conflicts with a name in Makefile.in.)
10 INPUT
=${2-${INPUT-/usr/include}}
12 # Directory in which to store the results.
13 LIB
=${1?"fixincludes: output directory not specified"}
15 # Define PWDCMD as a command to use to get the working dir
16 # in the form that we want.
20 # On an Apollo, discard everything before `/usr'.
21 PWDCMD
="eval pwd | sed -e 's,.*/usr/,/usr/,'"
28 # Make sure it exists.
29 if [ ! -d $LIB ]; then
33 # Make LIB absolute only if needed to avoid problems with the amd.
38 cd $LIB; LIB
=`${PWDCMD}`
42 # Fail if no arg to specify a directory for the output.
44 then echo fixincludes
: no output directory specified
48 echo Building fixed headers
in ${LIB}
50 # Determine whether this system has symbolic links.
51 if ln -s X
$LIB/ShouldNotExist
2>/dev
/null
; then
52 rm -f $LIB/ShouldNotExist
54 elif ln -s X
/tmp
/ShouldNotExist
2>/dev
/null
; then
55 rm -f /tmp
/ShouldNotExist
61 echo Finding directories and links to directories
63 # Find all directories and all symlinks that point to directories.
64 # Put the list in $files.
65 # Each time we find a symlink, add it to newdirs
66 # so that we do another find within the dir the link points to.
67 # Note that $files may have duplicates in it;
68 # later parts of this file are supposed to ignore them.
71 while [ -n "$dirs" ] && [ $levels -gt 0 ]
73 levels
=`expr $levels - 1`
77 echo " Searching $INPUT/$d"
83 # Find all directories under $d, relative to $d, excluding $d itself.
84 files
="$files `find $d -type d -print | \
85 sed -e '/\/\.$/d' -e '/^\.$/d'`"
86 # Find all links to directories.
87 # Using `-exec test -d' in find fails on some systems,
88 # and trying to run test via sh fails on others,
89 # so this is the simplest alternative left.
90 # First find all the links, then test each one.
93 theselinks
=`find $d -type l -print`
94 for d1
in $theselinks --dummy--
96 # If the link points to a directory,
97 # add that dir to $newdirs
101 if [ "`ls -ld $d1 | sed -n 's/.*-> //p'`" != "." ]
103 newdirs
="$newdirs $d1"
113 echo "All directories (including links to directories):"
116 for file in $files; do
118 if [ ! -d $LIB/$file ]
119 then mkdir
$LIB/$file
124 # treetops gets an alternating list
125 # of old directories to copy
126 # and the new directories to copy to.
127 treetops
="${INPUT} ${LIB}"
130 echo 'Making symbolic directory links'
131 for file in $files; do
132 dest
=`ls -ld $file | sed -n 's/.*-> //p'`
135 # In case $dest is relative, get to $file's dir first.
137 cd `echo ./$file | sed -n 's&[^/]*$&&p'`
138 # Check that the target directory exists.
139 # Redirections changed to avoid bug in sh on Ultrix.
140 (cd $dest) > /dev
/null
2>&1
143 # X gets the dir that the link actually leads to.
145 # If a link points to ., make a similar link to .
146 if [ $x = $INPUT ]; then
147 echo $file '->' .
': Making link'
148 rm -fr ${LIB}/$file > /dev
/null
2>&1
149 ln -s .
${LIB}/$file > /dev
/null
2>&1
150 # If link leads back into ${INPUT},
151 # make a similar link here.
152 elif expr $x : "${INPUT}/.*" > /dev
/null
; then
153 # Y gets the actual target dir name, relative to ${INPUT}.
154 y
=`echo $x | sed -n "s&${INPUT}/&&p"`
155 # DOTS is the relative path from ${LIB}/$file's dir back to ${LIB}.
157 sed -e 's@^./@@' -e 's@/./@/@g' -e 's@[^/][^/]*@..@g' -e 's@..$@@'`
158 echo $file '->' $dots$y ': Making link'
159 rm -fr ${LIB}/$file > /dev
/null
2>&1
160 ln -s $dots$y ${LIB}/$file > /dev
/null
2>&1
162 # If the link is to a dir $target outside ${INPUT},
163 # repoint the link at ${INPUT}/root$target
164 # and process $target into ${INPUT}/root$target
165 # treat this directory as if it actually contained the files.
166 echo $file '->' root
$x ': Making link'
167 if [ -d $LIB/root
$x ]
173 while [ x
$dirname != x
]; do
174 component
=`echo $dirname | sed -e 's|/.*$||'`
175 mkdir
$component >/dev
/null
2>&1
177 dirmade
=$dirmade/$component
178 dirname=`echo $dirname | sed -e 's|[^/]*/||'`
181 # Duplicate directory structure created in ${LIB}/$file in new
183 for file2
in $files; do
186 dupdir
=${LIB}/root
$x/`echo $file2 | sed -n "s|^${file}/||p"`
187 echo "Duplicating ${file}'s ${dupdir}"
198 # DOTS is the relative path from ${LIB}/$file's dir back to ${LIB}.
200 sed -e 's@^./@@' -e 's@/./@/@g' -e 's@[^/][^/]*@..@g' -e 's@..$@@'`
201 rm -fr ${LIB}/$file > /dev
/null
2>&1
202 ln -s ${dots}root
$x ${LIB}/$file > /dev
/null
2>&1
203 treetops
="$treetops $x ${LIB}/root$x"
214 while [ $# != 0 ]; do
215 # $1 is an old directory to copy, and $2 is the new directory to copy to.
218 # The same dir can appear more than once in treetops.
219 # There's no need to scan it more than once.
225 echo Fixing directory
$1 into
$2
226 # Check .h files which are symlinks as well as those which are files.
227 # A link to a header file will not be processed by anything but this.
229 files
=`find . -name '*.h' \( -type f -o -type l \) -print`
231 files
=`find . -name '*.h' -type f -print`
233 echo Checking header files
235 # Note that BSD43_* are used on recent MIPS systems.
236 for file in $files; do
237 # This call to egrep is essential, since checking a file with egrep
238 # is much faster than actually trying to fix it.
239 # It is also essential that most files *not* match!
240 # Thus, matching every #endif is unacceptable.
241 # But the argument to egrep must be kept small, or many versions of egrep
242 # won't be able to handle it.
244 # We use the pattern [!-.0-~] instead of [^/ ] to match a noncomment
245 # following #else or #endif because some buggy egreps think [^/] matches
246 # newline, and they thus think `#else ' matches `#e[ndiflse]*[ ]+[^/ ]'.
248 # We use the pattern [^a-zA-Z0-9_][_a-ce-km-z][a-z0-9] to match an identifier
249 # following #if or #elif that is not surrounded by __. The `a-ce-km-z'
250 # in this pattern lacks `d' and `l'; this means we don't worry about
251 # identifiers starting with `d' or `l'. This is OK, since none of the
252 # identifiers below start with `d' or `l'. It also greatly improves
253 # performance, since many files contain lines of the form `#if ... defined ...'
255 if egrep '//|[ _]_IO|CTRL|^#define.NULL|^#e[nl][ds][ief]*[ ]+[!-.0-~]|^#[el]*if.*[^a-zA-Z0-9_][_a-ce-km-zA-Z][a-zA-Z0-9]' $file >/dev
/null
; then
256 if [ -r $file ]; then
257 cp $file $2/$file >/dev
/null
2>&1 \
258 ||
echo "Can't copy $file"
261 # Here is how the sed commands in braces work.
262 # (It doesn't work to put the comments inside the sed commands.)
263 # Surround each word with spaces, to simplify matching below.
264 # ANSIfy each pre-ANSI machine-dependent symbol
265 # by surrounding it with __ __.
266 # Remove the spaces that we inserted around each word.
271 s%^\([ ]*#[ ]*else\)[ ]*/[^*].*%\1%
272 s%^\([ ]*#[ ]*else\)[ ]*[^/ ].*%\1%
273 s%^\([ ]*#[ ]*endif\)[ ]*/[^*].*%\1%
274 s%^\([ ]*#[ ]*endif\)[ ]*\*[^/].*%\1%
275 s%^\([ ]*#[ ]*endif\)[ ]*[^/* ].*%\1%
276 /\/\/[^*]/ s|//\(.*\)$|/*\1*/|
277 /[ ]_IO[A-Z]*[ ]*(/ s/\(_IO[A-Z]*[ ]*(\)\(.\),/\1'\''\2'\'',/
278 /[ ]BSD43__IO[A-Z]*[ ]*(/ s/(\(.\),/('\''\1'\'',/
279 /#define._IO/ s/'\''\([cgxtf]\)'\''/\1/g
280 /#define.BSD43__IO/ s/'\''\([cgx]\)'\''/\1/g
281 /[^A-Z0-9_]CTRL[ ]*(/ s/\([^'\'']\))/'\''\1'\'')/
282 /[^A-Z0-9]_CTRL[ ]*(/ s/\([^'\'']\))/'\''\1'\'')/
283 /#define[ ]*[ ]CTRL/ s/'\''\([cgx]\)'\''/\1/g
284 /#define[ ]*[ ]_CTRL/ s/'\''\([cgx]\)'\''/\1/g
285 /#define.BSD43_CTRL/ s/'\''\([cgx]\)'\''/\1/g
287 s/[a-zA-Z0-9_][a-zA-Z0-9_]*/ & /g
289 s/ bsd4\([0-9]\) / __bsd4\1__ /g
290 s/ _*host_mips / __host_mips__ /g
291 s/ _*i386 / __i386__ /g
293 s/ is68k / __is68k__ /g
294 s/ m68k / __m68k__ /g
295 s/ mc680\([0-9]\)0 / __mc680\10__ /g
296 s/ m88k / __m88k__ /g
297 s/ _*mips / __mips__ /g
298 s/ news\([0-9]*\) / __news\1__ /g
299 s/ ns32000 / __ns32000__ /g
300 s/ pdp11 / __pdp11__ /g
302 s/ sony_news / __sony_news__ /g
303 s/ sparc / __sparc__ /g
304 s/ sun\([a-z0-9]*\) / __sun\1__ /g
305 s/ tower\([_0-9]*\) / __tower\1__ /g
306 s/ u370 / __u370__ /g
307 s/ u3b\([0-9]*\) / __u3b\1__ /g
308 s/ unix / __unix__ /g
310 s/ _*MIPSE\([LB]\) / __MIPSE\1__ /g
311 s/ _*R\([34]\)000 / __R\1000__ /g
312 s/ _*SYSTYPE_\([A-Z0-9]*\) / __SYSTYPE_\1__ /g
314 s/ \([a-zA-Z0-9_][a-zA-Z0-9_]*\) /\1/g
316 /^#define.NULL[ ]/ i\
318 ' $2/$file > $2/$file.
319 mv $2/$file.
$2/$file
320 if cmp $file $2/$file >/dev
/null
2>&1; then
324 # Find any include directives that use "file".
325 for include
in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' $2/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
326 dir
=`echo $file | sed -e s'|/[^/]*$||'`
327 required
="$required $1 $dir/$include $2/$dir/$include"
338 # Install the proper definition of the three standard types in header files
339 # that they come from.
340 for file in sys
/types.h stdlib.h sys
/stdtypes.h stddef.h memory.h unistd.h
; do
341 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
342 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
343 chmod +w
${LIB}/$file 2>/dev
/null
344 chmod a
+r
${LIB}/$file 2>/dev
/null
347 if [ -r ${LIB}/$file ]; then
348 echo Fixing size_t
, ptrdiff_t and wchar_t
in $file
350 -e '/typedef[ ][ ]*[a-z_][ a-z_]*[ ]size_t/i\
351 #ifndef __SIZE_TYPE__\
352 #define __SIZE_TYPE__ long unsigned int\
355 -e 's/typedef[ ][ ]*[a-z_][ a-z_]*[ ]size_t/typedef __SIZE_TYPE__ size_t/' \
356 -e '/typedef[ ][ ]*[a-z_][ a-z_]*[ ]ptrdiff_t/i\
357 #ifndef __PTRDIFF_TYPE__\
358 #define __PTRDIFF_TYPE__ long int\
361 -e 's/typedef[ ][ ]*[a-z_][ a-z_]*[ ]ptrdiff_t/typedef __PTRDIFF_TYPE__ ptrdiff_t/' \
362 -e '/typedef[ ][ ]*[a-z_][ a-z_]*[ ]wchar_t/i\
363 #ifndef __WCHAR_TYPE__\
364 #define __WCHAR_TYPE__ int\
367 -e 's/typedef[ ][ ]*[a-z_][ a-z_]*[ ]wchar_t/typedef __WCHAR_TYPE__ wchar_t/' \
368 ${LIB}/$file > ${LIB}/${file}.
sed
369 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
370 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
376 # Fix one other error in this file: a mismatched quote not inside a C comment.
377 file=sundev
/vuid_event.h
378 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
379 mkdir
${LIB}/sundev
2>/dev
/null
380 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
381 chmod +w
${LIB}/$file 2>/dev
/null
382 chmod a
+r
${LIB}/$file 2>/dev
/null
385 if [ -r ${LIB}/$file ]; then
386 echo Fixing
$file comment
387 sed -e "s/doesn't/does not/" ${LIB}/$file > ${LIB}/${file}.
sed
388 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
389 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
394 # Fix these Sun OS files to avoid an invalid identifier in an #ifdef.
395 file=sunwindow
/win_cursor.h
396 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
397 # mkdir ${LIB}/sunwindow 2>/dev/null
398 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
399 chmod +w
${LIB}/$file 2>/dev
/null
401 if [ -r ${LIB}/$file ]; then
403 sed -e "s/ecd.cursor/ecd_cursor/" ${LIB}/$file > ${LIB}/${file}.
sed
404 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
405 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
409 file=sunwindow
/win_lock.h
410 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
411 # mkdir ${LIB}/sunwindow 2>/dev/null
412 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
413 chmod +w
${LIB}/$file 2>/dev
/null
415 if [ -r ${LIB}/$file ]; then
417 sed -e "s/ecd.cursor/ecd_cursor/" ${LIB}/$file > ${LIB}/${file}.
sed
418 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
419 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
424 # Fix this Sun file to avoid interfering with stddef.h.
426 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
427 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
428 chmod +w
${LIB}/$file 2>/dev
/null
429 chmod a
+r
${LIB}/$file 2>/dev
/null
432 if [ -r ${LIB}/$file ]; then
434 sed -e '/[ ]size_t.*;/i\
441 -e '/[ ]ptrdiff_t.*;/i\
442 #ifndef _GCC_PTRDIFF_T\
443 #define _GCC_PTRDIFF_T
445 -e '/[ ]ptrdiff_t.*;/a\
448 -e '/[ ]wchar_t.*;/i\
449 #ifndef _GCC_WCHAR_T\
452 -e '/[ ]wchar_t.*;/a\
454 ' ${LIB}/$file > ${LIB}/${file}.
sed
455 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
456 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
461 # Fix this ARM/RISCiX file to avoid interfering with the use of __wchar_t
464 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
465 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
466 chmod +w
${LIB}/$file 2>/dev
/null
467 chmod a
+r
${LIB}/$file 2>/dev
/null
470 if [ -r ${LIB}/$file ]; then
472 sed -e "s/\(#[ ]*ifndef[ ]*\)__wchar_t/\1_GCC_WCHAR_T/" \
473 -e "s/\(#[ ]*define[ ]*\)__wchar_t/\1_GCC_WCHAR_T/" \
474 ${LIB}/$file > ${LIB}/${file}.
sed
475 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
476 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
481 # Fix this file to avoid interfering with stddef.h, but don't mistakenly
482 # match ssize_t present in AIX for the ps/2, or typedefs which use (but do not
485 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
486 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
487 chmod +w
${LIB}/$file 2>/dev
/null
488 chmod a
+r
${LIB}/$file 2>/dev
/null
491 if [ -r ${LIB}/$file ]; then
493 sed -e '/typedef[ ][ ]*[A-Za-z_][ A-Za-z_]*[ ]size_t/i\
497 -e '/typedef[ ][ ]*[A-Za-z_][ A-Za-z_]*[ ]size_t/a\
499 ' ${LIB}/$file > ${LIB}/${file}.
sed
500 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
501 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
506 # Fix HP's use of ../machine/inline.h to refer to
507 # /usr/include/machine/inline.h
509 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
510 cp $file ${LIB}/$file
512 if [ -r ${LIB}/$file ] ; then
514 sed -e 's,"../machine/inline.h",<machine/inline.h>,' \
515 -e 's,"../machine/psl.h",<machine/psl.h>,' \
516 ${LIB}/$file > ${LIB}/${file}.
sed
517 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
518 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
523 # Fix an error in this file: the #if says _cplusplus, not the double
524 # underscore __cplusplus that it should be
526 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
527 mkdir
${LIB}/rpcsvc
2>/dev
/null
528 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
529 chmod +w
${LIB}/$file 2>/dev
/null
530 chmod a
+r
${LIB}/$file 2>/dev
/null
533 if [ -r ${LIB}/$file ]; then
534 echo Fixing
$file, __cplusplus macro
535 sed -e 's/[ ]_cplusplus/ __cplusplus/' ${LIB}/$file > ${LIB}/${file}.
sed
536 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
537 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
542 # Fix an error in this file: a missing semi-colon at the end of the statsswtch
543 # structure definition.
545 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
546 mkdir
${LIB}/rpcsvc
2>/dev
/null
547 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
548 chmod +w
${LIB}/$file 2>/dev
/null
549 chmod a
+r
${LIB}/$file 2>/dev
/null
552 if [ -r ${LIB}/$file ]; then
553 echo Fixing
$file, definition of statsswtch
554 sed -e 's/boottime$/boottime;/' ${LIB}/$file > ${LIB}/${file}.
sed
555 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
556 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
561 # Fix an error in this file: a missing semi-colon at the end of the nodeent
562 # structure definition.
563 file=netdnet
/dnetdb.h
564 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
565 mkdir
${LIB}/netdnet
2>/dev
/null
566 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
567 chmod +w
${LIB}/$file 2>/dev
/null
568 chmod a
+r
${LIB}/$file 2>/dev
/null
571 if [ -r ${LIB}/$file ]; then
572 echo Fixing
$file, definition of nodeent
573 sed -e 's/char.*na_addr *$/char *na_addr;/' ${LIB}/$file > ${LIB}/${file}.
sed
574 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
575 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
580 # Check for bad #ifdef line (in Ultrix 4.1)
582 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
583 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
584 chmod +w
${LIB}/$file 2>/dev
/null
585 chmod a
+r
${LIB}/$file 2>/dev
/null
588 if [ -r ${LIB}/$file ]; then
589 echo Fixing
$file, bad \
#ifdef line
590 sed -e 's/#ifdef KERNEL/#if defined(KERNEL)/' ${LIB}/$file > ${LIB}/${file}.
sed
591 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
592 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
597 # Check for superfluous `static' (in Ultrix 4.2)
598 # On Ultrix 4.3, includes of other files (r3_cpu.h,r4_cpu.h) is broken.
600 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
601 mkdir
${LIB}/machine
2>/dev
/null
602 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
603 chmod +w
${LIB}/$file 2>/dev
/null
604 chmod a
+r
${LIB}/$file 2>/dev
/null
607 if [ -r ${LIB}/$file ]; then
608 echo Fixing
$file, superfluous static and broken includes of other files.
609 sed -e 's/^static struct tlb_pid_state/struct tlb_pid_state/' \
610 -e 's/^#include "r3_cpu\.h"$/#include <machine\/r3_cpu\.h>/' \
611 -e 's/^#include "r4_cpu\.h"$/#include <machine\/r4_cpu\.h>/' \
612 ${LIB}/$file > ${LIB}/${file}.
sed
613 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
614 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
617 # This file has an alternative name, mips/cpu.h. Fix that name, too.
618 if cmp machine
/cpu.h mips
/cpu.h
> /dev
/null
2>&1; then
619 mkdir
${LIB}/mips
2>&-
620 # Don't remove the file first, they may be the same file!
621 ln ${LIB}/$file ${LIB}/mips
/cpu.h
> /dev
/null
2>&1
626 # Incorrect sprintf declaration in X11/Xmu.h
628 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
629 mkdir
${LIB}/X11
2>/dev
/null
630 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
631 chmod +w
${LIB}/$file 2>/dev
/null
632 chmod a
+r
${LIB}/$file 2>/dev
/null
635 if [ -r ${LIB}/$file ]; then
636 echo Fixing
$file sprintf declaration
637 sed -e 's,^extern char \* sprintf();$,#ifndef __STDC__\
638 extern char * sprintf();\
639 #endif /* !defined __STDC__ */,' ${LIB}/$file > ${LIB}/${file}.
sed
640 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
641 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
646 # Incorrect sprintf declaration in X11/Xmu/Xmu.h
647 # (It's not clear whether the right file name is this or X11/Xmu.h.)
649 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
650 mkdir
${LIB}/X11
/Xmu
2>/dev
/null
651 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
652 chmod +w
${LIB}/$file 2>/dev
/null
653 chmod a
+r
${LIB}/$file 2>/dev
/null
656 if [ -r ${LIB}/$file ]; then
657 echo Fixing
$file sprintf declaration
658 sed -e 's,^extern char \* sprintf();$,#ifndef __STDC__\
659 extern char * sprintf();\
660 #endif /* !defined __STDC__ */,' ${LIB}/$file > ${LIB}/${file}.
sed
661 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
662 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
667 # Check for missing ';' in struct
669 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
670 mkdir
${LIB}/netinet
2>/dev
/null
671 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
672 chmod +w
${LIB}/$file 2>/dev
/null
673 chmod a
+r
${LIB}/$file 2>/dev
/null
676 if [ -r ${LIB}/$file ]; then
678 sed -e '/^struct/,/^};/s/}$/};/' ${LIB}/$file > ${LIB}/${file}.
sed
679 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
680 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
685 # Fix the CAT macro in SunOS memvar.h.
686 file=pixrect
/memvar.h
687 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
688 mkdir
${LIB}/pixrect
2>/dev
/null
689 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
690 chmod +w
${LIB}/$file 2>/dev
/null
691 chmod a
+r
${LIB}/$file 2>/dev
/null
694 if [ -r ${LIB}/$file ]; then
696 sed -e '/^#define.CAT(a,b)/ i\
698 #define CAT(a,b) a##b\
700 /^#define.CAT(a,b)/ a\
702 ' ${LIB}/$file > ${LIB}/${file}.
sed
703 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
704 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
709 # Check for yet more missing ';' in struct (in SunOS 4.0.x)
711 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
712 mkdir
${LIB}/rpcsvc
2>/dev
/null
713 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
714 chmod +w
${LIB}/$file 2>/dev
/null
715 chmod a
+r
${LIB}/$file 2>/dev
/null
718 if [ -r ${LIB}/$file ]; then
720 sed -e '/^struct/,/^};/s/_cnt$/_cnt;/' ${LIB}/$file > ${LIB}/${file}.
sed
721 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
722 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
727 # Fix return type of exit and abort in <stdlib.h> on SunOS 4.1.
728 # Also wrap protection around size_t for m88k-sysv3 systems.
730 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
731 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
732 chmod +w
${LIB}/$file 2>/dev
/null
733 chmod a
+r
${LIB}/$file 2>/dev
/null
736 if [ -r ${LIB}/$file ]; then
738 sed -e 's/int abort/void abort/g' \
739 -e 's/int free/void free/g' \
740 -e 's/char \* calloc/void \* calloc/g' \
741 -e 's/char \* malloc/void \* malloc/g' \
742 -e 's/char \* realloc/void \* realloc/g' \
743 -e 's/int exit/void exit/g' \
744 -e '/typedef[ a-zA-Z_]*[ ]size_t[ ]*;/i\
748 -e '/typedef[ a-zA-Z_]*[ ]size_t[ ]*;/a\
751 ${LIB}/$file > ${LIB}/${file}.
sed
752 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
753 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
758 # Fix return type of free and {c,m,re}alloc in <malloc.h> on SunOS 4.1.
760 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
761 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
762 chmod +w
${LIB}/$file 2>/dev
/null
763 chmod a
+r
${LIB}/$file 2>/dev
/null
766 if [ -r ${LIB}/$file ]; then
768 sed -e 's/typedef[ ]char \* malloc_t/typedef void \* malloc_t/g' \
769 -e 's/int[ ][ ]*free/void free/g' \
770 ${LIB}/$file > ${LIB}/${file}.
sed
771 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
772 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
777 # Fix bogus #ifdef in <hsfs/hsfs_spec.h> on SunOS 4.1.
778 file=hsfs
/hsfs_spec.h
779 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
780 mkdir
${LIB}/hsfs
2>/dev
/null
781 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
782 chmod +w
${LIB}/$file 2>/dev
/null
783 chmod a
+r
${LIB}/$file 2>/dev
/null
786 if [ -r ${LIB}/$file ]; then
788 sed -e 's/\#ifdef __i386__ || __vax__/\#if __i386__ || __vax__/g' \
789 ${LIB}/$file > ${LIB}/${file}.
790 rm -f ${LIB}/$file; mv ${LIB}/${file}. ${LIB}/$file
791 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
796 # Fix bogus #ifdef in <hsfs/hsnode.h> on SunOS 4.1.
798 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
799 mkdir
${LIB}/hsfs
2>/dev
/null
800 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
801 chmod +w
${LIB}/$file 2>/dev
/null
802 chmod a
+r
${LIB}/$file 2>/dev
/null
805 if [ -r ${LIB}/$file ]; then
807 sed -e 's/\#ifdef __i386__ || __sun4c__/\#if __i386__ || __sun4c__/g' \
808 ${LIB}/$file > ${LIB}/${file}.
sed
809 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
810 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
815 # Fix bogus #ifdef in <hsfs/iso_spec.h> on SunOS 4.1.
817 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
818 mkdir
${LIB}/hsfs
2>/dev
/null
819 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
820 chmod +w
${LIB}/$file 2>/dev
/null
821 chmod a
+r
${LIB}/$file 2>/dev
/null
824 if [ -r ${LIB}/$file ]; then
826 sed -e 's/\#ifdef __i386__ || __vax__/\#if __i386__ || __vax__/g' \
827 ${LIB}/$file > ${LIB}/${file}.
sed
828 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
829 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
834 # Incorrect #include in Sony News-OS 3.2.
835 file=machine
/machparam.h
836 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
837 mkdir
${LIB}/machine
2>/dev
/null
838 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
839 chmod +w
${LIB}/$file 2>/dev
/null
840 chmod a
+r
${LIB}/$file 2>/dev
/null
843 if [ -r ${LIB}/$file ]; then
844 echo Fixing
$file, incorrect \
#include
845 sed -e 's@"../machine/endian.h"@<machine/endian.h>@' \
846 ${LIB}/$file > ${LIB}/${file}.
847 rm -f ${LIB}/$file; mv ${LIB}/${file}. ${LIB}/$file
848 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
853 # Multiline comment after typedef on IRIX 4.0.1.
855 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
856 mkdir
${LIB}/sys
2>/dev
/null
857 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
858 chmod +w
${LIB}/$file 2>/dev
/null
859 chmod a
+r
${LIB}/$file 2>/dev
/null
862 if [ -r ${LIB}/$file ]; then
863 echo Fixing
$file, comment
in the middle of \
#ifdef
864 sed -e 's@type of the result@type of the result */@' \
865 -e 's@of the sizeof@/* of the sizeof@' \
866 ${LIB}/$file > ${LIB}/${file}.
sed
867 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
868 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
873 # Turning // comments into /* */ comments trashes this IRIX 4.0.1
874 # header file, which embeds // comments inside multi-line /* */
875 # comments. If this looks like the IRIX header file, we refix it by
876 # just throwing away the // comments.
878 if [ -r ${LIB}/$file ]; then
879 if egrep indigo.esd
${LIB}/$file > /dev
/null
; then
880 echo Fixing
$file, overeager
sed script
882 sed -e 's|//.*$||g' $file > ${LIB}/$file
883 chmod +w
${LIB}/$file 2>/dev
/null
884 chmod a
+r
${LIB}/$file 2>/dev
/null
888 # Some IRIX header files contains the string "//"
889 for file in elf_abi.h elf.h
; do
890 if [ -r ${LIB}/$file ]; then
891 echo Fixing
$file, overeager
sed script
892 sed -e 's|"/\*"\*/|"//"|' ${LIB}/$file > ${LIB}/${file}.
sed
893 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
894 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
900 # IRIX 4.0.5 <rpc/auth.h> uses struct sockaddr in prototype without
901 # previous definition.
903 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
904 mkdir
${LIB}/rpc
2>/dev
/null
905 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
906 chmod +w
${LIB}/$file 2>/dev
/null
907 chmod a
+r
${LIB}/$file 2>/dev
/null
910 if [ -r ${LIB}/$file ]; then
911 echo Fixing
$file, undefined
type
912 sed -e '/authdes_create.*struct sockaddr/i\
915 ${LIB}/$file > ${LIB}/$file.
sed
916 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
917 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
922 # IRIX 4.0.5 <rpc/xdr.h> uses struct __file_s in prototype without previous
925 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
926 mkdir
${LIB}/rpc
2>/dev
/null
927 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
928 chmod +w
${LIB}/$file 2>/dev
/null
929 chmod a
+r
${LIB}/$file 2>/dev
/null
932 if [ -r ${LIB}/$file ]; then
933 echo Fixing
$file, undefined
type
934 sed -e '/xdrstdio_create.*struct __file_s/i\
937 ${LIB}/$file > ${LIB}/$file.
sed
938 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
939 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
944 # Same problem with a file from SunOS 4.1.3 : a header file containing
945 # the string "//" embedded in "/**/"
946 file=sbusdev
/audiovar.h
947 if [ -r ${LIB}/$file ]; then
948 echo Fixing
$file, overeager
sed script
950 sed -e 's|//.*$||g' $file > ${LIB}/$file
951 chmod +w
${LIB}/$file 2>/dev
/null
952 chmod a
+r
${LIB}/$file 2>/dev
/null
955 # Fix non-ANSI memcpy declaration that conflicts with gcc's builtin
956 # declaration on Sun OS 4.x. We must only fix this on Sun OS 4.x, because
957 # many other systems have similar text but correct versions of the file.
958 # To ensure only Sun's is fixed, we grep for a likely unique string.
960 if [ -r $file ] && egrep '/\* @\(#\)memory\.h 1\.[2-4] 8./../.. SMI; from S5R2 1\.2 \*/' $file > /dev
/null
; then
961 if [ ! -r ${LIB}/$file ]; then
962 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
963 chmod +w
${LIB}/$file 2>/dev
/null
964 chmod a
+r
${LIB}/$file 2>/dev
/null
966 if [ -r ${LIB}/$file ]; then
968 cat > ${LIB}/$file << EOF
969 /* This file was generated by fixincludes */
974 extern void *memccpy();
975 extern void *memchr();
976 extern void *memcpy();
977 extern void *memset();
979 extern char *memccpy();
980 extern char *memchr();
981 extern char *memcpy();
982 extern char *memset();
983 #endif /* __STDC__ */
987 #endif /* __memory_h__ */
992 # parameters not const on DECstation Ultrix V4.0.
994 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
995 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
996 chmod +w
${LIB}/$file 2>/dev
/null
997 chmod a
+r
${LIB}/$file 2>/dev
/null
1000 if [ -r ${LIB}/$file ]; then
1001 echo Fixing
$file, non-const arg
1002 sed -e 's@perror( char \*__s );@perror( const char *__s );@' \
1003 -e 's@fputs( char \*__s,@fputs( const char *__s,@' \
1004 -e 's@fopen( char \*__filename, char \*__type );@fopen( const char *__filename, const char *__type );@' \
1005 -e 's@fwrite( void \*__ptr,@fwrite( const void *__ptr,@' \
1006 -e 's@fscanf( FILE \*__stream, char \*__format,@fscanf( FILE *__stream, const char *__format,@' \
1007 -e 's@scanf( char \*__format,@scanf( const char *__format,@' \
1008 -e 's@sscanf( char \*__s, char \*__format,@sscanf( const char *__s, const char *__format,@' \
1009 ${LIB}/$file > ${LIB}/${file}.
sed
1010 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
1011 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
1016 # parameters conflict with C++ new on rs/6000
1017 for file in stdio.h unistd.h
; do
1018 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
1019 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
1020 chmod +w
${LIB}/$file 2>/dev
/null
1023 if [ -r ${LIB}/$file ]; then
1024 echo Fixing
$file, parameter name conflicts
1025 sed -e 's@rename(const char \*old, const char \*new)@rename(const char *_old, const char *_new)@' \
1026 ${LIB}/$file > ${LIB}/${file}.
sed
1027 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
1028 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
1034 # function class(double x) conflicts with C++ keyword on rs/6000
1036 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
1037 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
1038 chmod +w
${LIB}/$file 2>/dev
/null
1039 chmod a
+r
${LIB}/$file 2>/dev
/null
1042 if [ -r ${LIB}/$file ]; then
1043 if grep 'class[(]' ${LIB}/$file >/dev
/null
; then
1045 sed -e '/class[(]/i\
1050 ' ${LIB}/$file > ${LIB}/${file}.
sed
1051 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
1052 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
1058 # Wrong fchmod prototype on RS/6000.
1060 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
1061 mkdir
${LIB}/sys
2>/dev
/null
1062 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
1063 chmod +w
${LIB}/$file 2>/dev
/null
1064 chmod a
+r
${LIB}/$file 2>/dev
/null
1067 if [ -r ${LIB}/$file ]; then
1068 echo Fixing
$file, fchmod prototype
1069 sed -e 's/fchmod(char \*/fchmod(int/' \
1070 ${LIB}/$file > ${LIB}/$file.
sed
1071 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
1072 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
1077 # There are several name conflicts with C++ reserved words in X11
1078 # header files. These are fixed in some versions, so don't do the
1079 # fixes if we find __cplusplus in the file. These were found on the
1082 # class in X11/ShellP.h
1084 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
1085 mkdir
${LIB}/sys
2>/dev
/null
1086 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
1087 chmod +w
${LIB}/$file 2>/dev
/null
1088 chmod a
+r
${LIB}/$file 2>/dev
/null
1091 if [ -r ${LIB}/$file ]; then
1092 if grep __cplusplus
${LIB}/$file >/dev
/null
2>/dev
/null
; then
1095 echo Fixing
$file, field class
1096 sed -e '/char [*]class;/i\
1101 -e '/char [*]class;/a\
1103 ' ${LIB}/$file > ${LIB}/${file}.
sed
1104 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
1106 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
1110 # new in Xm/Traversal.h
1112 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
1113 mkdir
${LIB}/sys
2>/dev
/null
1114 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
1115 chmod +w
${LIB}/$file 2>/dev
/null
1116 chmod a
+r
${LIB}/$file 2>/dev
/null
1119 if [ -r ${LIB}/$file ]; then
1120 if grep __cplusplus
${LIB}/$file >/dev
/null
2>/dev
/null
; then
1123 echo Fixing
$file, uses of new
1124 sed -e '/Widget old, new;/i\
1129 -e '/Widget old, new;/a\
1132 -e 's/Widget new,/Widget c_new,/g' ${LIB}/$file > ${LIB}/${file}.
sed
1133 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
1135 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
1139 # class in Xm/BaseClassI.h
1140 file=Xm
/BaseClassI.h
1141 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
1142 mkdir
${LIB}/sys
2>/dev
/null
1143 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
1144 chmod +w
${LIB}/$file 2>/dev
/null
1145 chmod a
+r
${LIB}/$file 2>/dev
/null
1148 if [ -r ${LIB}/$file ]; then
1149 if grep __cplusplus
${LIB}/$file >/dev
/null
2>/dev
/null
; then
1152 echo Fixing
$file, prototype parameter name
1153 sed -e 's/ class[)]/ c_class)/g' ${LIB}/$file > ${LIB}/${file}.
sed
1154 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
1156 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
1162 # NeXT 2.0 defines 'int wait(union wait*)', which conflicts with Posix.1.
1163 # Note that version 3 of the NeXT system has wait.h in a different directory,
1164 # so that this code won't do anything. But wait.h in version 3 has a
1165 # conditional, so it doesn't need this fix. So everything is okay.
1167 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
1168 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
1169 chmod +w
${LIB}/$file 2>/dev
/null
1172 if [ -r ${LIB}/$file ] \
1173 && grep 'wait[(]union wait' ${LIB}/$file >/dev
/null
; then
1174 echo Fixing
$file, bad
wait formal
1175 sed -e 's@wait(union wait@wait(void@' ${LIB}/$file > ${LIB}/${file}.
sed
1176 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
1177 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
1182 # Don't use or define the name va_list in stdio.h.
1183 # This is for ANSI and also to interoperate properly with gcc's varargs.h.
1185 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
1186 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
1187 chmod +w
${LIB}/$file 2>/dev
/null
1188 chmod a
+r
${LIB}/$file 2>/dev
/null
1191 if [ -r ${LIB}/$file ]; then
1192 echo Fixing
$file, use of va_list
1193 # Arrange for stdio.h to use stdarg.h to define __gnuc_va_list
1194 (echo "#define __need___va_list"
1195 echo "#include <stdarg.h>") > ${LIB}/${file}.
sed
1196 # Use __gnuc_va_list in arg types in place of va_list.
1197 # On 386BSD use __gnuc_va_list instead of _VA_LIST_. We're hoping the
1198 # trailing parentheses and semicolon save all other systems from this.
1199 # Define __va_list__ (something harmless and unused) instead of va_list.
1200 # Don't claim to have defined va_list.
1201 sed -e 's@ va_list @ __gnuc_va_list @' \
1202 -e 's@ va_list)@ __gnuc_va_list)@' \
1203 -e 's@ _VA_LIST_));@ __gnuc_va_list));@' \
1204 -e 's@ va_list@ __va_list__@' \
1205 -e 's@\*va_list@*__va_list__@' \
1206 -e 's@ __va_list)@ __gnuc_va_list)@' \
1207 -e 's@_NEED___VA_LIST@_NEED___Va_LIST@' \
1208 -e 's@VA_LIST@DUMMY_VA_LIST@' \
1209 -e 's@_NEED___Va_LIST@_NEED___VA_LIST@' \
1210 ${LIB}/$file >> ${LIB}/${file}.
sed
1212 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
1213 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
1218 # Cancel out ansi_compat.h on Ultrix. Replace it with empty file.
1220 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
1221 if grep -s ULTRIX
$file; then
1222 echo "/* This file intentionally left blank. */" > $LIB/$file
1226 # parameter to atof not const on DECstation Ultrix V4.0.
1227 # also get rid of bogus inline definitions in HP-UX 8.0
1229 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
1230 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
1231 chmod +w
${LIB}/$file 2>/dev
/null
1232 chmod a
+r
${LIB}/$file 2>/dev
/null
1235 if [ -r ${LIB}/$file ]; then
1236 echo Fixing
$file, non-const arg
1237 sed -e 's@atof( char \*__nptr );@atof( const char *__nptr );@' \
1238 -e 's@inline int abs(int [a-z][a-z]*) {.*}@@' \
1239 -e 's@inline double abs(double [a-z][a-z]*) {.*}@@' \
1240 -e 's@inline int sqr(int [a-z][a-z]*) {.*}@@' \
1241 -e 's@inline double sqr(double [a-z][a-z]*) {.*}@@' \
1242 ${LIB}/$file > ${LIB}/${file}.
sed
1243 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
1244 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
1249 # Avoid nested comments on Ultrix 4.3.
1251 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
1252 mkdir
${LIB}/rpc
2>/dev
/null
1253 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
1254 chmod +w
${LIB}/$file 2>/dev
/null
1255 chmod a
+r
${LIB}/$file 2>/dev
/null
1258 if [ -r ${LIB}/$file ]; then
1259 echo Fixing
$file, nested comment
1260 sed -e 's@^\( \* int protocol; \)/\*@\1*/ /*@' \
1261 ${LIB}/$file > ${LIB}/$file.
sed
1262 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
1263 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
1268 # This file in RISC/os uses /**/ to concatenate two tokens.
1270 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
1271 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
1272 chmod +w
${LIB}/$file 2>/dev
/null
1273 chmod a
+r
${LIB}/$file 2>/dev
/null
1275 if [ -r ${LIB}/$file ]; then
1276 sed -e 's|/\*\*/|##|' ${LIB}/$file > ${LIB}/${file}.
sed
1277 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
1278 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
1284 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
1285 mkdir
${LIB}/rpc
2>/dev
/null
1286 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
1287 chmod +w
${LIB}/$file 2>/dev
/null
1288 chmod a
+r
${LIB}/$file 2>/dev
/null
1291 if [ -r ${LIB}/$file ]; then
1292 echo Fixing
$file, nested comment
1293 sed -e 's@^\(/\*.*rpc/auth_des.h>.*\)/\*@\1*/ /*@' \
1294 ${LIB}/$file > ${LIB}/$file.
sed
1295 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
1296 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
1301 # In limits.h, put #ifndefs around things that are supposed to be defined
1302 # in float.h to avoid redefinition errors if float.h is included first.
1303 # On HP/UX this patch does not work, because on HP/UX limits.h uses
1304 # multi line comments and the inserted #endif winds up inside the
1305 # comment. Fortunately, HP/UX already uses #ifndefs in limits.h; if
1306 # we find a #ifndef FLT_MIN we assume that all the required #ifndefs
1307 # are there, and we do not add them ourselves.
1308 for file in limits.h sys
/limits.h
; do
1309 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
1310 mkdir
${LIB}/sys
2>/dev
/null
1311 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
1312 chmod +w
${LIB}/$file 2>/dev
/null
1313 chmod a
+r
${LIB}/$file 2>/dev
/null
1316 if [ -r ${LIB}/$file ]; then
1317 if egrep 'ifndef[ ]+FLT_MIN' ${LIB}/$file >/dev
/null
; then
1321 sed -e '/[ ]FLT_MIN[ ]/i\
1324 -e '/[ ]FLT_MIN[ ]/a\
1327 -e '/[ ]FLT_MAX[ ]/i\
1330 -e '/[ ]FLT_MAX[ ]/a\
1333 -e '/[ ]FLT_DIG[ ]/i\
1336 -e '/[ ]FLT_DIG[ ]/a\
1339 -e '/[ ]DBL_MIN[ ]/i\
1342 -e '/[ ]DBL_MIN[ ]/a\
1345 -e '/[ ]DBL_MAX[ ]/i\
1348 -e '/[ ]DBL_MAX[ ]/a\
1351 -e '/[ ]DBL_DIG[ ]/i\
1354 -e '/[ ]DBL_DIG[ ]/a\
1357 ${LIB}/$file > ${LIB}/${file}.
sed
1358 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
1360 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
1361 echo Deleting
${LIB}/$file\
; no fixes were needed.
1367 # In math.h, put #ifndefs around things that might be defined in a gcc
1368 # specific math-*.h file.
1370 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
1371 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
1372 chmod +w
${LIB}/$file 2>/dev
/null
1373 chmod a
+r
${LIB}/$file 2>/dev
/null
1376 if [ -r ${LIB}/$file ]; then
1378 sed -e '/define[ ]HUGE_VAL[ ]/i\
1381 -e '/define[ ]HUGE_VAL[ ]/a\
1384 ${LIB}/$file > ${LIB}/${file}.
sed
1385 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
1387 # In addition, copy the definition of DBL_MAX from float.h
1388 # if math.h requires one. The Lynx math.h requires it.
1389 if egrep '#define[ ]*HUGE_VAL[ ]+DBL_MAX' $file >/dev
/null
2>&1; then
1390 if egrep '#define[ ]+DBL_MAX[ ]+' $file >/dev
/null
2>&1; then
1393 dbl_max_def
=`egrep 'define[ ]+DBL_MAX[ ]+.*' float.h 2>/dev/null`
1394 if [ "$dbl_max_def" != "" ]; then
1395 dbl_max_def
=`echo $dbl_max_def | sed 's/.*define[ ]*DBL_MAX[ ]*//'`
1396 sed -e "/define[ ]HUGE_VAL[ ]DBL_MAX/s/DBL_MAX/$dbl_max_def/" \
1397 ${LIB}/$file > ${LIB}/${file}.
sed
1398 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
1403 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
1404 echo Deleting
${LIB}/$file\
; no fixes were needed.
1409 # Remove erroneous parentheses in sym.h on Alpha OSF/1.
1411 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
1412 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
1413 chmod +w
${LIB}/$file 2>/dev
/null
1414 chmod a
+r
${LIB}/$file 2>/dev
/null
1417 if [ -r ${LIB}/$file ]; then
1419 sed -e 's/#ifndef(__mips64)/#ifndef __mips64/' \
1420 ${LIB}/$file > ${LIB}/${file}.
sed
1421 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
1422 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
1427 # Correct the return type for strlen in string.h on Lynx.
1428 # Correct the argument type for ffs in string.h on Alpha OSF/1 V2.0.
1430 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
1431 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
1432 chmod +w
${LIB}/$file 2>/dev
/null
1433 chmod a
+r
${LIB}/$file 2>/dev
/null
1436 if [ -r ${LIB}/$file ]; then
1438 sed -e 's/extern[ ]*int[ ]*strlen();/extern unsigned int strlen();/' \
1439 -e 's/extern[ ]*int[ ]*ffs[ ]*(long);/extern int ffs(int);/' \
1440 ${LIB}/$file > ${LIB}/${file}.
sed
1441 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
1442 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
1447 # Delete the '#define void int' line from curses.h on Lynx
1449 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
1450 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
1451 chmod +w
${LIB}/$file 2>/dev
/null
1452 chmod a
+r
${LIB}/$file 2>/dev
/null
1455 if [ -r ${LIB}/$file ]; then
1457 sed -e '/#define[ ][ ]*void[ ]int/d' \
1458 ${LIB}/$file > ${LIB}/${file}.
sed
1459 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
1460 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
1465 # For C++, avoid any typedef or macro definition of bool, and use the
1466 # built in type instead.
1467 for files
in curses.h
; do
1468 if [ -r $file ] && egrep bool
$file >/dev
/null
2>&1; then
1469 if [ ! -r ${LIB}/$file ]; then
1470 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
1471 chmod +w
${LIB}/$file 2>/dev
/null
1472 chmod a
+r
${LIB}/$file 2>/dev
/null
1476 sed -e '/^#[ ]*define[ ][ ]*bool[ ][ ]*char[ ]*$/i\
1477 #ifndef __cplusplus'\
1478 -e '/^#[ ]*define[ ][ ]*bool[ ][ ]*char[ ]*$/a\
1480 -e '/^typedef[ ][ ]*char[ ][ ]*bool;[ ]*$/i\
1481 #ifndef __cplusplus'\
1482 -e '/^typedef[ ][ ]*char[ ][ ]*bool;[ ]*$/a\
1484 ${LIB}/$file > ${LIB}/${file}.
sed
1485 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
1486 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
1492 # Fix incorrect S_IF* definitions on m88k-sysv3.
1494 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
1495 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
1496 chmod +w
${LIB}/$file 2>/dev
/null
1497 chmod a
+r
${LIB}/$file 2>/dev
/null
1500 if [ -r ${LIB}/$file ]; then
1502 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)/' \
1503 -e 's/^\(#define[ ]*S_IS[A-Z]*(m)\)[ ]*(m[ ]*&[ ]*\(0[0-9]*\)[ ]*)/\1 (((m)\&S_IFMT)==\2)/' \
1504 ${LIB}/$file > ${LIB}/${file}.
sed
1505 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
1506 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
1511 # Fix getopt declarations in stdio.h and stdlib.h on Alpha OSF/1 and AIX.
1512 for file in stdio.h stdlib.h
; do
1513 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
1514 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
1515 chmod +w
${LIB}/$file 2>/dev
/null
1516 chmod a
+r
${LIB}/$file 2>/dev
/null
1519 if [ -r ${LIB}/$file ]; then
1520 echo Fixing
$file, getopt declaration
1521 sed -e 's/getopt(int, char \*\[\],[ ]*char \*)/getopt(int, char *const[], const char *)/' \
1522 ${LIB}/$file > ${LIB}/${file}.
sed
1523 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
1524 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
1530 # Determine if we're on Interactive Unix 2.2 or later, in which case we
1531 # need to fix some additional files. This is the same test for ISC that
1533 if test -d /etc
/conf
/kconfig.d \
1534 && grep _POSIX_VERSION
/usr
/include
/sys
/unistd.h
>/dev
/null
2>&1; then
1535 echo "Fixing ISC __STDC__ goof in several files..."
1536 for name
in stdio.h math.h ctype.h sys
/limits.h sys
/fcntl.h sys
/dirent.h
; do
1538 if test -r ${LIB}/$name; then
1543 # On Interactive 2.2, certain traditional Unix definitions
1544 # (notably getc and putc in stdio.h) are omitted if __STDC__ is
1545 # defined, not just if _POSIX_SOURCE is defined. This makes it
1546 # impossible to compile any nontrivial program except with -posix.
1548 's/!defined(__STDC__) && !defined(_POSIX_SOURCE)/!defined(_POSIX_SOURCE)/' \
1549 < $file > ${LIB}/$name.
1550 mv ${LIB}/$name.
${LIB}/$name
1553 echo "Fixing ISC fmod declaration"
1554 # This one's already been fixed for other things.
1556 sed 's/fmod(double)/fmod(double, double)/' <$file >$file.
1559 echo "Fixing nested comments in ISC <sys/limits.h>"
1561 sed '/CHILD_MAX/s,/\* Max, Max,' < ${INPUT}/$file >${LIB}/$file.
1562 sed '/OPEN_MAX/s,/\* Max, Max,' < ${LIB}/$file.
>${LIB}/$file
1565 # These files in Sun OS 4.x use /**/ to concatenate tokens.
1566 for file in sparc
/asm_linkage.h sun
3/asm_linkage.h sun3x
/asm_linkage.h \
1567 sun
4/asm_linkage.h sun4c
/asm_linkage.h sun4m
/asm_linkage.h \
1568 sun4c
/debug
/asm_linkage.h sun4m
/debug
/asm_linkage.h
;
1570 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
1571 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
1572 chmod +w
${LIB}/$file 2>/dev
/null
1573 chmod a
+r
${LIB}/$file 2>/dev
/null
1576 if [ -r ${LIB}/$file ]; then
1577 sed -e 's|/\*\*/|##|g' ${LIB}/$file > ${LIB}/${file}.
sed
1578 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
1579 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
1585 # These files in ARM/RISCiX use /**/ to concatenate tokens.
1586 for file in arm
/as_support.h
arm
/mc_type.h
arm
/xcb.h dev
/chardefmac.h \
1587 dev
/ps_irq.h dev
/screen.h dev
/scsi.h sys
/tty.h Xm.acorn
/XmP.h
1589 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
1590 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
1591 chmod +w
${LIB}/$file 2>/dev
/null
1592 chmod a
+r
${LIB}/$file 2>/dev
/null
1595 if [ -r ${LIB}/$file ]; then
1596 sed -e 's|/\*\*/|##|g' ${LIB}/$file > ${LIB}/${file}.
sed
1597 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
1598 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
1604 # math.h on SunOS 4 puts the declaration of matherr before the definition
1605 # of struct exception, so the prototype (added by fixproto) causes havoc.
1607 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
1608 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
1609 chmod +w
${LIB}/$file 2>/dev
/null
1610 chmod a
+r
${LIB}/$file 2>/dev
/null
1613 if [ -r ${LIB}/$file ]; then
1614 echo Fixing
$file, matherr declaration
1615 sed -e '/^struct exception/,$b' \
1619 ${LIB}/$file > ${LIB}/${file}.
sed
1620 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
1621 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
1626 # assert.h on HP/UX is not C++ ready, even though NO_IMPLICIT_EXTERN_C
1627 # is defined on HP/UX.
1629 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
1630 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
1631 chmod +w
${LIB}/$file 2>/dev
/null
1632 chmod a
+r
${LIB}/$file 2>/dev
/null
1635 if [ -r ${LIB}/$file ]; then
1636 if egrep '"C"' ${LIB}/$file >/dev
/null
2>/dev
/null
; then
1640 echo '#ifdef __cplusplus
1642 #endif' > ${LIB}/${file}.
sed
1643 cat ${LIB}/${file} >> ${LIB}/${file}.
sed
1644 echo '#ifdef __cplusplus
1646 #endif' >> ${LIB}/${file}.
sed
1647 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
1648 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
1654 # check for broken assert.h that needs stdio.h or stdlib.h
1656 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
1657 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
1658 chmod +w
${LIB}/$file 2>/dev
/null
1659 chmod a
+r
${LIB}/$file 2>/dev
/null
1662 if [ -r ${LIB}/$file ]; then
1663 if grep 'stderr' ${LIB}/$file >/dev
/null
2>/dev
/null
; then
1664 if grep 'include.*stdio.h' ${LIB}/$file >/dev
/null
2>/dev
/null
; then
1667 echo "Fixing $file (needs stdio.h)"
1668 echo '#include <stdio.h>' >>${LIB}/$file
1671 if grep 'exit *(' ${LIB}/$file >/dev
/null
2>/dev
/null ||
1672 grep 'abort *(' ${LIB}/$file >/dev
/null
2>/dev
/null
; then
1673 if grep 'include.*stdlib.h' ${LIB}/$file >/dev
/null
2>/dev
/null
; then
1676 echo "Fixing $file (needs stdlib.h)"
1677 echo '#include <stdlib.h>' >>${LIB}/$file
1680 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
1685 # Fix return value of sbrk in unistd.h on Alpha OSF/1 V2.0
1687 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
1688 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
1689 chmod +w
${LIB}/$file 2>/dev
/null
1690 chmod a
+r
${LIB}/$file 2>/dev
/null
1693 if [ -r ${LIB}/$file ]; then
1694 echo Fixing
$file, sbrk declaration
1695 sed -e 's/char\([ ]*\*[ ]*sbrk[ ]*(\)/void\1/' \
1696 ${LIB}/$file > ${LIB}/${file}.
sed
1697 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
1698 if cmp $file ${LIB}/$file >/dev
/null
2>&1; then
1703 # This file on SunOS 4 has a very large macro. When the sed loop
1704 # tries pull it in, it overflows the pattern space size of the SunOS
1705 # sed (GNU sed does not have this problem). Since the file does not
1706 # require fixing, we remove it from the fixed directory.
1707 file=sundev
/ipi_error.h
1708 if [ -r ${LIB}/$file ]; then
1709 echo "Removing incorrect fix to SunOS <sundev/ipi_error.h>"
1713 # Put cpp wrappers around these include files to avoid redeclaration
1714 # errors during multiple inclusion on m88k-tektronix-sysv3.
1715 for file in time.h sys
/time.h
; do
1716 if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
1717 cp $file ${LIB}/$file >/dev
/null
2>&1 ||
echo "Can't copy $file"
1718 chmod +w
${LIB}/$file 2>/dev
/null
1720 if [ -r ${LIB}/$file ]; then
1721 echo Fixing
$file, to protect against multiple inclusion.
1722 cpp_wrapper
=`echo $file | sed -e 's,\.,_,g' -e 's,/,_,g'`
1723 (echo "#ifndef __GCC_GOT_${cpp_wrapper}_"
1724 echo "#define __GCC_GOT_${cpp_wrapper}_"
1726 echo '#endif /* !_GCC_GOT_'${cpp_wrapper}_' */') > ${LIB}/${file}.new
1727 rm -f ${LIB}/$file; mv ${LIB}/${file}.new ${LIB}/$file
1731 echo 'Removing unneeded directories:'
1733 files
=`find . -type d -print | sort -r`
1734 for file in $files; do
1735 rmdir $LIB/$file > /dev
/null
2>&1
1739 echo 'Making internal symbolic non-directory links'
1741 files
=`find . -type l -print`
1742 for file in $files; do
1743 dest
=`ls -ld $file | sed -n 's/.*-> //p'`
1744 if expr "$dest" : '[^/].*' > /dev
/null
; then
1745 target
=${LIB}/`echo file | sed "s|[^/]*\$|$dest|"`
1746 if [ -f $target ]; then
1747 ln -s $dest ${LIB}/$file >/dev
/null
2>&1
1753 # Make sure that any include files referenced using double quotes
1754 # exist in the fixed directory. This comes last since otherwise
1755 # we might end up deleting some of these files "because they don't
1757 while [ -n "$required" ]; do
1761 while [ $# != 0 ]; do
1762 # $1 is the directory to copy from, $2 is the unfixed file,
1763 # $3 is the fixed file name.
1766 if [ -r $2 ] && [ ! -r $3 ]; then
1767 cp $2 $3 >/dev
/null
2>&1 ||
echo "Can't copy $2"
1768 chmod +w
$3 2>/dev
/null
1769 chmod a
+r
$3 2>/dev
/null
1771 for include
in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' $3 | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
1772 dir
=`echo $2 | sed -e s'|/[^/]*$||'`
1773 dir2
=`echo $3 | sed -e s'|/[^/]*$||'`
1774 newreq
="$newreq $1 $dir/$include $dir2/$include"
1782 echo 'Cleaning up DONE files.'
1784 find .
-name DONE
-exec rm -f '{}' ';'