]> gcc.gnu.org Git - gcc.git/blob - gcc/fixinc.svr4
(ieeefp.h): Delete definitions of __i860 and __m88k.
[gcc.git] / gcc / fixinc.svr4
1 #! /bin/sh
2 #
3 # fixinc.svr4 -- Install modified versions of certain ANSI-incompatible
4 # native System V Release 4 system include files.
5 #
6 # Written by Ron Guilmette (rfg@ncd.com).
7 #
8 # This file is part of GNU CC.
9 #
10 # GNU CC is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; either version 2, or (at your option)
13 # any later version.
14 #
15 # GNU CC is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU General Public License for more details.
19 #
20 # You should have received a copy of the GNU General Public License
21 # along with GNU CC; see the file COPYING. If not, write to
22 # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
23 #
24 # This script munges the native include files provided with System V
25 # Release 4 systems so as to remove things which are violations of the
26 # ANSI C standard. Once munged, the resulting new system include files
27 # are placed in a directory that GNU C will search *before* searching
28 # the /usr/include directory. This script should work properly for most
29 # System V Release 4 systems. For other types of systems, you should
30 # use the `fixincludes' script instead.
31 #
32 # See README-fixinc for more information.
33
34 # Directory where gcc sources (and sometimes special include files) live.
35 SRCDIR=${3-${SRCDIR-.}}
36
37 # Directory containing the original header files.
38 INPUT=${2-${INPUT-/usr/include}}
39
40 # Fail if no arg to specify a directory for the output.
41 if [ x$1 = x ]
42 then echo fixincludes: no output directory specified
43 exit 1
44 fi
45
46 # Directory in which to store the results.
47 LIB=${1?"fixincludes: output directory not specified"}
48
49 # Make sure it exists.
50 if [ ! -d $LIB ]; then
51 mkdir $LIB || exit 1
52 fi
53
54 ORIG_DIR=`pwd`
55
56 # Make LIB absolute if it is relative.
57 # Don't do this if not necessary, since may screw up automounters.
58 case $LIB in
59 /*)
60 ;;
61 *)
62 cd $LIB; LIB=`${PWDCMD-pwd}`
63 ;;
64 esac
65
66 echo 'Building fixincludes in ' ${LIB}
67
68 # Determine whether this filesystem has symbolic links.
69 if ln -s X $LIB/ShouldNotExist 2>/dev/null; then
70 rm -f $LIB/ShouldNotExist
71 LINKS=true
72 else
73 LINKS=false
74 fi
75
76 echo 'Making directories:'
77 cd ${INPUT}
78 if $LINKS; then
79 files=`ls -LR | sed -n s/:$//p`
80 else
81 files=`find . -type d -print | sed '/^.$/d'`
82 fi
83 for file in $files; do
84 rm -rf $LIB/$file
85 if [ ! -d $LIB/$file ]
86 then mkdir $LIB/$file
87 fi
88 done
89
90 # treetops gets an alternating list
91 # of old directories to copy
92 # and the new directories to copy to.
93 treetops="${INPUT} ${LIB}"
94
95 if $LINKS; then
96 echo 'Making internal symbolic directory links'
97 for file in $files; do
98 dest=`ls -ld $file | sed -n 's/.*-> //p'`
99 if [ "$dest" ]; then
100 cwd=`pwd`
101 # In case $dest is relative, get to $file's dir first.
102 cd ${INPUT}
103 cd `echo ./$file | sed -n 's&[^/]*$&&p'`
104 # Check that the target directory exists.
105 # Redirections changed to avoid bug in sh on Ultrix.
106 (cd $dest) > /dev/null 2>&1
107 if [ $? = 0 ]; then
108 cd $dest
109 # X gets the dir that the link actually leads to.
110 x=`pwd`
111 # If link leads back into ${INPUT},
112 # make a similar link here.
113 if expr $x : "${INPUT}/.*" > /dev/null; then
114 # Y gets the actual target dir name, relative to ${INPUT}.
115 y=`echo $x | sed -n "s&${INPUT}/&&p"`
116 echo $file '->' $y ': Making link'
117 rm -fr ${LIB}/$file > /dev/null 2>&1
118 ln -s ${LIB}/$y ${LIB}/$file > /dev/null 2>&1
119 else
120 # If the link is to outside ${INPUT},
121 # treat this directory as if it actually contained the files.
122 # This line used to have $dest instead of $x.
123 # $dest seemed to be wrong for links found in subdirectories
124 # of ${INPUT}. Does this change break anything?
125 treetops="$treetops $x ${LIB}/$file"
126 fi
127 fi
128 cd $cwd
129 fi
130 done
131 fi
132
133 set - $treetops
134 while [ $# != 0 ]; do
135 # $1 is an old directory to copy, and $2 is the new directory to copy to.
136 echo "Finding header files in $1:"
137 cd ${INPUT}
138 cd $1
139 files=`find . -name '*.h' -type f -print`
140 echo 'Checking header files:'
141 for file in $files; do
142 if [ -r $file ]; then
143 cp $file $2/$file >/dev/null 2>&1 || echo "Can't copy $file"
144 chmod +w $2/$file
145 chmod a+r $2/$file
146
147 # The following have been removed from the sed command below
148 # because it is more useful to leave these things in.
149 # The only reason to remove them was for -pedantic,
150 # which isn't much of a reason. -- rms.
151 # /^[ ]*#[ ]*ident/d
152
153 # This code makes Solaris SCSI fail, because it changes the
154 # alignment within some critical structures. See <sys/scsi/impl/commands.h>.
155 # s/u_char\([ ][ ]*[a-zA-Z0-9_][a-zA-Z0-9_]*[ ]*:[ ]*[0-9][0-9]*\)/u_int\1/
156 # Disable these also, since they probably aren't safe either.
157 # s/u_short\([ ][ ]*[a-zA-Z0-9_][a-zA-Z0-9_]*[ ]*:[ ]*[0-9][0-9]*\)/u_int\1/
158 # s/ushort\([ ][ ]*[a-zA-Z0-9_][a-zA-Z0-9_]*[ ]*:[ ]*[0-9][0-9]*\)/u_int\1/
159 # s/evcm_t\([ ][ ]*[a-zA-Z0-9_][a-zA-Z0-9_]*[ ]*:[ ]*[0-9][0-9]*\)/u_int\1/
160 # s/Pbyte\([ ][ ]*[a-zA-Z0-9_][a-zA-Z0-9_]*[ ]*:[ ]*SEQSIZ\)/unsigned int\1/
161
162 # The change of u_char, etc, to u_int
163 # applies to bit fields.
164 sed -e '
165 s%^\([ ]*#[ ]*endif[ ]*\)\([^/ ].*\)$%\1/* \2 */%
166 s%^\([ ]*#[ ]*else[ ]*\)\([^/ ].*\)$%\1/* \2 */%
167 s/#lint(on)/defined(lint)/g
168 s/#lint(off)/!defined(lint)/g
169 s/#machine(\([^)]*\))/defined(__\1__)/g
170 s/#system(\([^)]*\))/defined(__\1__)/g
171 s/#cpu(\([^)]*\))/defined(__\1__)/g
172 /#[a-z]*if.*[ (]m68k/ s/\([^_]\)m68k/\1__m68k__/g
173 /#[a-z]*if.*[ (]__i386\([^_]\)/ s/__i386/__i386__/g
174 /#[a-z]*if.*[ (]i386/ s/\([^_]\)i386/\1__i386__/g
175 /#[a-z]*if.*[ (]sparc/ s/\([^_]\)sparc/\1__sparc__/g
176 /#[a-z]*if.*[ (]mc68000/ s/\([^_]\)mc68000/\1__mc68000__/g
177 /#[a-z]*if.*[ (]vax/ s/\([^_]\)vax/\1__vax__/g
178 /#[a-z]*if.*[ (]sun/ s/\([^_]\)\(sun[a-z0-9]*\)\([^a-z0-9_]\)/\1__\2__\3/g
179 /#[a-z]*if.*[ (]sun/ s/\([^_]\)\(sun[a-z0-9]*\)$/\1__\2__/g
180 /#[a-z]*if.*[ (]ns32000/ s/\([^_]\)ns32000/\1__ns32000__/g
181 /#[a-z]*if.*[ (]pyr/ s/\([^_]\)pyr/\1__pyr__/g
182 /#[a-z]*if.*[ (]is68k/ s/\([^_]\)is68k/\1__is68k__/g
183 s/__STDC__ == 0/!defined (__STRICT_ANSI__)/g
184 s/__STDC__ != 0/defined (__STRICT_ANSI__)/g
185 s/__STDC__ - 0 == 0/!defined (__STRICT_ANSI__)/g
186 ' $2/$file > $2/$file.sed
187 mv $2/$file.sed $2/$file
188 if cmp $file $2/$file >/dev/null 2>&1; then
189 rm $2/$file
190 else
191 echo Fixed $file
192 fi
193 fi
194 done
195 shift; shift
196 done
197
198 # Fix first broken decl of getcwd present on some svr4 systems.
199
200 file=stdlib.h
201 base=`basename $file`
202 if [ -r ${LIB}/$file ]; then
203 file_to_fix=${LIB}/$file
204 else
205 if [ -r ${INPUT}/$file ]; then
206 file_to_fix=${INPUT}/$file
207 else
208 file_to_fix=""
209 fi
210 fi
211 if [ \! -z "$file_to_fix" ]; then
212 echo Checking $file_to_fix
213 sed -e 's/getcwd(char \*, int)/getcwd(char *, size_t)/' $file_to_fix > /tmp/$base
214 if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \
215 true
216 else
217 echo Fixed $file_to_fix
218 rm -f ${LIB}/$file
219 cp /tmp/$base ${LIB}/$file
220 chmod a+r ${LIB}/$file
221 fi
222 rm -f /tmp/$base
223 fi
224
225 # Fix second broken decl of getcwd present on some svr4 systems. Also
226 # fix the incorrect decl of profil present on some svr4 systems.
227
228 file=unistd.h
229 base=`basename $file`
230 if [ -r ${LIB}/$file ]; then
231 file_to_fix=${LIB}/$file
232 else
233 if [ -r ${INPUT}/$file ]; then
234 file_to_fix=${INPUT}/$file
235 else
236 file_to_fix=""
237 fi
238 fi
239 if [ \! -z "$file_to_fix" ]; then
240 echo Checking $file_to_fix
241 sed -e 's/getcwd(char \*, int)/getcwd(char *, size_t)/' $file_to_fix \
242 | sed -e 's/profil(unsigned short \*, unsigned int, unsigned int, unsigned int)/profil(unsigned short *, size_t, int, unsigned)/' > /tmp/$base
243 if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \
244 true
245 else
246 echo Fixed $file_to_fix
247 rm -f ${LIB}/$file
248 cp /tmp/$base ${LIB}/$file
249 chmod a+r ${LIB}/$file
250 fi
251 rm -f /tmp/$base
252 fi
253
254 # Fix the definition of NULL in <sys/param.h> so that it is conditional
255 # and so that it is correct for both C and C++.
256
257 file=sys/param.h
258 base=`basename $file`
259 if [ -r ${LIB}/$file ]; then
260 file_to_fix=${LIB}/$file
261 else
262 if [ -r ${INPUT}/$file ]; then
263 file_to_fix=${INPUT}/$file
264 else
265 file_to_fix=""
266 fi
267 fi
268 if [ \! -z "$file_to_fix" ]; then
269 echo Checking $file_to_fix
270 cp $file_to_fix /tmp/$base
271 chmod +w /tmp/$base
272 chmod a+r /tmp/$base
273 sed -e '/^#define[ ]*NULL[ ]*0$/c\
274 #ifndef NULL\
275 #ifdef __cplusplus\
276 #define __NULL_TYPE\
277 #else /* !defined(__cplusplus) */\
278 #define __NULL_TYPE (void *)\
279 #endif /* !defined(__cplusplus) */\
280 #define NULL (__NULL_TYPE 0)\
281 #endif /* !defined(NULL) */' /tmp/$base > /tmp/$base.sed
282 if cmp $file_to_fix /tmp/$base.sed >/dev/null 2>&1; then \
283 true
284 else
285 echo Fixed $file_to_fix
286 rm -f ${LIB}/$file
287 cp /tmp/$base.sed ${LIB}/$file
288 chmod a+r ${LIB}/$file
289 fi
290 rm -f /tmp/$base /tmp/$base.sed
291 fi
292
293 # Likewise fix the definition of NULL in <stdio.h> so that it is conditional
294 # and so that it is correct for both C and C++.
295
296 file=stdio.h
297 base=`basename $file`
298 if [ -r ${LIB}/$file ]; then
299 file_to_fix=${LIB}/$file
300 else
301 if [ -r ${INPUT}/$file ]; then
302 file_to_fix=${INPUT}/$file
303 else
304 file_to_fix=""
305 fi
306 fi
307 if [ \! -z "$file_to_fix" ]; then
308 echo Checking $file_to_fix
309 cp $file_to_fix /tmp/$base
310 chmod +w /tmp/$base
311 sed -e '/^#define[ ]*NULL[ ]*0$/c\
312 #ifdef __cplusplus\
313 #define __NULL_TYPE\
314 #else /* !defined(__cplusplus) */\
315 #define __NULL_TYPE (void *)\
316 #endif /* !defined(__cplusplus) */\
317 #define NULL (__NULL_TYPE 0)' /tmp/$base > /tmp/$base.sed
318 if cmp $file_to_fix /tmp/$base.sed >/dev/null 2>&1; then \
319 true
320 else
321 echo Fixed $file_to_fix
322 rm -f ${LIB}/$file
323 cp /tmp/$base.sed ${LIB}/$file
324 chmod a+r ${LIB}/$file
325 fi
326 rm -f /tmp/$base /tmp/$base.sed
327 fi
328
329 # Likewise fix the definition of NULL in <dbm.h> so that it is conditional
330 # and so that it is correct for both C and C++.
331
332 file=dbm.h
333 base=`basename $file`
334 if [ -r ${LIB}/$file ]; then
335 file_to_fix=${LIB}/$file
336 else
337 if [ -r ${INPUT}/$file ]; then
338 file_to_fix=${INPUT}/$file
339 else
340 file_to_fix=""
341 fi
342 fi
343 if [ \! -z "$file_to_fix" ]; then
344 echo Checking $file_to_fix
345 cp $file_to_fix /tmp/$base
346 chmod +w /tmp/$base
347 sed -e '/^#define[ ]*NULL[ ]*((char \*) 0)$/c\
348 #ifndef NULL\
349 #ifdef __cplusplus\
350 #define __NULL_TYPE\
351 #else /* !defined(__cplusplus) */\
352 #define __NULL_TYPE (void *)\
353 #endif /* !defined(__cplusplus) */\
354 #define NULL (__NULL_TYPE 0)\
355 #endif /* !defined(NULL) */' /tmp/$base > /tmp/$base.sed
356 if cmp $file_to_fix /tmp/$base.sed >/dev/null 2>&1; then \
357 true
358 else
359 echo Fixed $file_to_fix
360 rm -f ${LIB}/$file
361 cp /tmp/$base.sed ${LIB}/$file
362 chmod a+r ${LIB}/$file
363 fi
364 rm -f /tmp/$base /tmp/$base.sed
365 fi
366
367 # Add a prototyped declaration of mmap to <sys/mman.h>.
368
369 file=sys/mman.h
370 base=`basename $file`
371 if [ -r ${LIB}/$file ]; then
372 file_to_fix=${LIB}/$file
373 else
374 if [ -r ${INPUT}/$file ]; then
375 file_to_fix=${INPUT}/$file
376 else
377 file_to_fix=""
378 fi
379 fi
380 if [ \! -z "$file_to_fix" ]; then
381 echo Checking $file_to_fix
382 cp $file_to_fix /tmp/$base
383 chmod +w /tmp/$base
384 sed -e '/^extern caddr_t mmap();$/c\
385 #ifdef __STDC__\
386 extern caddr_t mmap (caddr_t addr, size_t len, int prot, int flags,\
387 int fd, off_t off);\
388 #else /* !defined(__STDC__) */\
389 extern caddr_t mmap ();\
390 #endif /* !defined(__STDC__) */' /tmp/$base > /tmp/$base.sed
391 if cmp $file_to_fix /tmp/$base.sed >/dev/null 2>&1; then \
392 true
393 else
394 echo Fixed $file_to_fix
395 rm -f ${LIB}/$file
396 cp /tmp/$base.sed ${LIB}/$file
397 chmod a+r ${LIB}/$file
398 fi
399 rm -f /tmp/$base /tmp/$base.sed
400 fi
401
402 # Fix declarations of `ftw' and `nftw' in <ftw.h>.
403
404 file=ftw.h
405 base=`basename $file`
406 if [ -r ${LIB}/$file ]; then
407 file_to_fix=${LIB}/$file
408 else
409 if [ -r ${INPUT}/$file ]; then
410 file_to_fix=${INPUT}/$file
411 else
412 file_to_fix=""
413 fi
414 fi
415 if [ \! -z "$file_to_fix" ]; then
416 echo Checking $file_to_fix
417 cp $file_to_fix /tmp/$base
418 chmod +w /tmp/$base
419 sed -e '/^extern int ftw(const/c\
420 #if !defined(_STYPES)\
421 static\
422 #else\
423 extern\
424 #endif\
425 int ftw(const char *, int (*)(const char *, const struct stat *, int), int);' \
426 -e '/^extern int nftw/c\
427 #if defined(_STYPES)\
428 static\
429 #else\
430 extern\
431 #endif\
432 int nftw(const char *, int (*)(const char *, const struct stat *, int, struct FTW *),int, int);' \
433 -e '/^extern int ftw(),/c\
434 #if !defined(_STYPES)\
435 static\
436 #else\
437 extern\
438 #endif\
439 int ftw();\
440 #if defined(_STYPES)\
441 static\
442 #else\
443 extern\
444 #endif\
445 int nftw();' /tmp/$base > /tmp/$base.sed
446 if cmp $file_to_fix /tmp/$base.sed >/dev/null 2>&1; then \
447 true
448 else
449 echo Fixed $file_to_fix
450 rm -f ${LIB}/$file
451 cp /tmp/$base.sed ${LIB}/$file
452 chmod a+r ${LIB}/$file
453 fi
454 rm -f /tmp/$base /tmp/$base.sed
455 fi
456
457 # Add a `static' declaration of `getrnge' into <regexp.h>.
458
459 # Don't do this if there is already a `static void getrnge' declaration
460 # present, since this would cause a redeclaration error. Solaris 2.x has
461 # such a declaration.
462
463 file=regexp.h
464 base=`basename $file`
465 if [ -r ${LIB}/$file ]; then
466 file_to_fix=${LIB}/$file
467 else
468 if [ -r ${INPUT}/$file ]; then
469 file_to_fix=${INPUT}/$file
470 else
471 file_to_fix=""
472 fi
473 fi
474 if [ \! -z "$file_to_fix" ]; then
475 echo Checking $file_to_fix
476 if grep "static void getrnge" $file_to_fix > /dev/null; then
477 true
478 else
479 cp $file_to_fix /tmp/$base
480 chmod +w /tmp/$base
481 sed -e '/^static int[ ]*size;/c\
482 static int size ;\
483 \
484 static int getrnge ();' /tmp/$base > /tmp/$base.sed
485 if cmp $file_to_fix /tmp/$base.sed >/dev/null 2>&1; then \
486 true
487 else
488 echo Fixed $file_to_fix
489 rm -f ${LIB}/$file
490 cp /tmp/$base.sed ${LIB}/$file
491 chmod a+r ${LIB}/$file
492 fi
493 fi
494 rm -f /tmp/$base /tmp/$base.sed
495 fi
496
497 # Disable apparent native compiler optimization cruft in SVR4.2 <string.h>
498 # that is visible to any ANSI compiler using this include. Simply
499 # delete the lines that #define some string functions to internal forms.
500
501 file=string.h
502 base=`basename $file`
503 if [ -r ${LIB}/$file ]; then
504 file_to_fix=${LIB}/$file
505 else
506 if [ -r ${INPUT}/$file ]; then
507 file_to_fix=${INPUT}/$file
508 else
509 file_to_fix=""
510 fi
511 fi
512 if [ \! -z "$file_to_fix" ]; then
513 echo Checking $file_to_fix
514 cp $file_to_fix /tmp/$base
515 chmod +w /tmp/$base
516 sed -e '/#define.*__std_hdr_/d' /tmp/$base > /tmp/$base.sed
517 if cmp $file_to_fix /tmp/$base.sed >/dev/null 2>&1; then \
518 true
519 else
520 echo Fixed $file_to_fix
521 rm -f ${LIB}/$file
522 cp /tmp/$base.sed ${LIB}/$file
523 chmod a+r ${LIB}/$file
524 fi
525 rm -f /tmp/$base /tmp/$base.sed
526 fi
527
528 # Delete any #defines of `__i386' which may be present in <ieeefp.h>. They
529 # tend to conflict with the compiler's own definition of this symbol. (We
530 # will use the compiler's definition.)
531 # Likewise __sparc, for Solaris, and __i860, and (this is a guess) __m88k.
532
533 file=ieeefp.h
534 base=`basename $file`
535 if [ -r ${LIB}/$file ]; then
536 file_to_fix=${LIB}/$file
537 else
538 if [ -r ${INPUT}/$file ]; then
539 file_to_fix=${INPUT}/$file
540 else
541 file_to_fix=""
542 fi
543 fi
544 if [ \! -z "$file_to_fix" ]; then
545 echo Checking $file_to_fix
546 cp $file_to_fix /tmp/$base
547 chmod +w /tmp/$base
548 sed -e '/#define[ ]*__i386 /d' -e '/#define[ ]*__sparc /d' \
549 -e '/#define[ ]*__i860 /d' -e '/#define[ ]*__m88k /d' \
550 /tmp/$base > /tmp/$base.sed
551 if cmp $file_to_fix /tmp/$base.sed >/dev/null 2>&1; then \
552 true
553 else
554 echo Fixed $file_to_fix
555 rm -f ${LIB}/$file
556 cp /tmp/$base.sed ${LIB}/$file
557 chmod a+r ${LIB}/$file
558 fi
559 rm -f /tmp/$base /tmp/$base.sed
560 fi
561
562 # Add a #define of _SIGACTION_ into <sys/signal.h>.
563 # Also fix types of SIG_DFL, SIG_ERR, SIG_IGN, and SIG_HOLD.
564
565 file=sys/signal.h
566 base=`basename $file`
567 if [ -r ${LIB}/$file ]; then
568 file_to_fix=${LIB}/$file
569 else
570 if [ -r ${INPUT}/$file ]; then
571 file_to_fix=${INPUT}/$file
572 else
573 file_to_fix=""
574 fi
575 fi
576 if [ \! -z "$file_to_fix" ]; then
577 echo Checking $file_to_fix
578 cp $file_to_fix /tmp/$base
579 chmod +w /tmp/$base
580 sed -e '/^struct sigaction {/c\
581 #define _SIGACTION_\
582 struct sigaction {' \
583 -e '1,$s/(void *(\*)())/(void (*)(int))/' /tmp/$base > /tmp/$base.sed
584 if cmp $file_to_fix /tmp/$base.sed >/dev/null 2>&1; then \
585 true
586 else
587 echo Fixed $file_to_fix
588 rm -f ${LIB}/$file
589 cp /tmp/$base.sed ${LIB}/$file
590 chmod a+r ${LIB}/$file
591 fi
592 rm -f /tmp/$base /tmp/$base.sed
593 fi
594
595 # Fix declarations of `makedev', `major', and `minor' in <sys/mkdev.h>.
596
597 file=sys/mkdev.h
598 base=`basename $file`
599 if [ -r ${LIB}/$file ]; then
600 file_to_fix=${LIB}/$file
601 else
602 if [ -r ${INPUT}/$file ]; then
603 file_to_fix=${INPUT}/$file
604 else
605 file_to_fix=""
606 fi
607 fi
608 if [ \! -z "$file_to_fix" ]; then
609 echo Checking $file_to_fix
610 cp $file_to_fix /tmp/$base
611 chmod +w /tmp/$base
612 sed -e '/^dev_t makedev(const/c\
613 static dev_t makedev(const major_t, const minor_t);' \
614 -e '/^dev_t makedev()/c\
615 static dev_t makedev();' \
616 -e '/^major_t major(const/c\
617 static major_t major(const dev_t);' \
618 -e '/^major_t major()/c\
619 static major_t major();' \
620 -e '/^minor_t minor(const/c\
621 static minor_t minor(const dev_t);' \
622 -e '/^minor_t minor()/c\
623 static minor_t minor();' /tmp/$base > /tmp/$base.sed
624 if cmp $file_to_fix /tmp/$base.sed >/dev/null 2>&1; then \
625 true
626 else
627 echo Fixed $file_to_fix
628 rm -f ${LIB}/$file
629 cp /tmp/$base.sed ${LIB}/$file
630 chmod a+r ${LIB}/$file
631 fi
632 rm -f /tmp/$base /tmp/$base.sed
633 fi
634
635 # Fix reference to NMSZ in <sys/adv.h>.
636
637 file=sys/adv.h
638 base=`basename $file`
639 if [ -r ${LIB}/$file ]; then
640 file_to_fix=${LIB}/$file
641 else
642 if [ -r ${INPUT}/$file ]; then
643 file_to_fix=${INPUT}/$file
644 else
645 file_to_fix=""
646 fi
647 fi
648 if [ \! -z "$file_to_fix" ]; then
649 echo Checking $file_to_fix
650 sed 's/\[NMSZ\]/\[RFS_NMSZ\]/g' $file_to_fix > /tmp/$base
651 if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \
652 true
653 else
654 echo Fixed $file_to_fix
655 rm -f ${LIB}/$file
656 cp /tmp/$base ${LIB}/$file
657 chmod a+r ${LIB}/$file
658 fi
659 rm -f /tmp/$base
660 fi
661
662 # Fix reference to NC_NPI_RAW in <sys/netcspace.h>. Also fix types of
663 # array initializers.
664
665 file=sys/netcspace.h
666 base=`basename $file`
667 if [ -r ${LIB}/$file ]; then
668 file_to_fix=${LIB}/$file
669 else
670 if [ -r ${INPUT}/$file ]; then
671 file_to_fix=${INPUT}/$file
672 else
673 file_to_fix=""
674 fi
675 fi
676 if [ \! -z "$file_to_fix" ]; then
677 echo Checking $file_to_fix
678 sed 's/NC_NPI_RAW/NC_TPI_RAW/g' $file_to_fix \
679 | sed 's/NC_/(unsigned long) NC_/' > /tmp/$base
680 if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \
681 true
682 else
683 echo Fixed $file_to_fix
684 rm -f ${LIB}/$file
685 cp /tmp/$base ${LIB}/$file
686 chmod a+r ${LIB}/$file
687 fi
688 rm -f /tmp/$base
689 fi
690
691 # Conditionalize all of <fs/rfs/rf_cache.h> on _KERNEL being defined.
692
693 file=fs/rfs/rf_cache.h
694 base=`basename $file`
695 if [ -r ${LIB}/$file ]; then
696 file_to_fix=${LIB}/$file
697 else
698 if [ -r ${INPUT}/$file ]; then
699 file_to_fix=${INPUT}/$file
700 else
701 file_to_fix=""
702 fi
703 fi
704 if [ \! -z "$file_to_fix" ]; then
705 echo Checking $file_to_fix
706 if grep _KERNEL $file_to_fix > /dev/null; then
707 true
708 else
709 echo '#ifdef _KERNEL' > /tmp/$base
710 cat $file_to_fix >> /tmp/$base
711 echo '#endif /* defined(_KERNEL) */' >> /tmp/$base
712 echo Fixed $file_to_fix
713 rm -f ${LIB}/$file
714 cp /tmp/$base ${LIB}/$file
715 chmod a+r ${LIB}/$file
716 rm -f /tmp/$base
717 fi
718 fi
719
720 # Conditionalize all of <sys/erec.h> on _KERNEL being defined.
721
722 file=sys/erec.h
723 base=`basename $file`
724 if [ -r ${LIB}/$file ]; then
725 file_to_fix=${LIB}/$file
726 else
727 if [ -r ${INPUT}/$file ]; then
728 file_to_fix=${INPUT}/$file
729 else
730 file_to_fix=""
731 fi
732 fi
733 if [ \! -z "$file_to_fix" ]; then
734 echo Checking $file_to_fix
735 if grep _KERNEL $file_to_fix > /dev/null; then
736 true
737 else
738 echo '#ifdef _KERNEL' > /tmp/$base
739 cat $file_to_fix >> /tmp/$base
740 echo '#endif /* defined(_KERNEL) */' >> /tmp/$base
741 echo Fixed $file_to_fix
742 rm -f ${LIB}/$file
743 cp /tmp/$base ${LIB}/$file
744 chmod a+r ${LIB}/$file
745 rm -f /tmp/$base
746 fi
747 fi
748
749 # Conditionalize all of <sys/err.h> on _KERNEL being defined.
750
751 file=sys/err.h
752 base=`basename $file`
753 if [ -r ${LIB}/$file ]; then
754 file_to_fix=${LIB}/$file
755 else
756 if [ -r ${INPUT}/$file ]; then
757 file_to_fix=${INPUT}/$file
758 else
759 file_to_fix=""
760 fi
761 fi
762 if [ \! -z "$file_to_fix" ]; then
763 echo Checking $file_to_fix
764 if grep _KERNEL $file_to_fix > /dev/null; then
765 true
766 else
767 echo '#ifdef _KERNEL' > /tmp/$base
768 cat $file_to_fix >> /tmp/$base
769 echo '#endif /* defined(_KERNEL) */' >> /tmp/$base
770 echo Fixed $file_to_fix
771 rm -f ${LIB}/$file
772 cp /tmp/$base ${LIB}/$file
773 chmod a+r ${LIB}/$file
774 rm -f /tmp/$base
775 fi
776 fi
777
778 # Conditionalize all of <sys/char.h> on _KERNEL being defined.
779
780 file=sys/char.h
781 base=`basename $file`
782 if [ -r ${LIB}/$file ]; then
783 file_to_fix=${LIB}/$file
784 else
785 if [ -r ${INPUT}/$file ]; then
786 file_to_fix=${INPUT}/$file
787 else
788 file_to_fix=""
789 fi
790 fi
791 if [ \! -z "$file_to_fix" ]; then
792 echo Checking $file_to_fix
793 if grep _KERNEL $file_to_fix > /dev/null; then
794 true
795 else
796 echo '#ifdef _KERNEL' > /tmp/$base
797 cat $file_to_fix >> /tmp/$base
798 echo '#endif /* defined(_KERNEL) */' >> /tmp/$base
799 echo Fixed $file_to_fix
800 rm -f ${LIB}/$file
801 cp /tmp/$base ${LIB}/$file
802 chmod a+r ${LIB}/$file
803 rm -f /tmp/$base
804 fi
805 fi
806
807 # Conditionalize all of <sys/getpages.h> on _KERNEL being defined.
808
809 file=sys/getpages.h
810 base=`basename $file`
811 if [ -r ${LIB}/$file ]; then
812 file_to_fix=${LIB}/$file
813 else
814 if [ -r ${INPUT}/$file ]; then
815 file_to_fix=${INPUT}/$file
816 else
817 file_to_fix=""
818 fi
819 fi
820 if [ \! -z "$file_to_fix" ]; then
821 echo Checking $file_to_fix
822 if grep _KERNEL $file_to_fix > /dev/null; then
823 true
824 else
825 echo '#ifdef _KERNEL' > /tmp/$base
826 cat $file_to_fix >> /tmp/$base
827 echo '#endif /* defined(_KERNEL) */' >> /tmp/$base
828 echo Fixed $file_to_fix
829 rm -f ${LIB}/$file
830 cp /tmp/$base ${LIB}/$file
831 chmod a+r ${LIB}/$file
832 rm -f /tmp/$base
833 fi
834 fi
835
836 # Conditionalize all of <sys/map.h> on _KERNEL being defined.
837
838 file=sys/map.h
839 base=`basename $file`
840 if [ -r ${LIB}/$file ]; then
841 file_to_fix=${LIB}/$file
842 else
843 if [ -r ${INPUT}/$file ]; then
844 file_to_fix=${INPUT}/$file
845 else
846 file_to_fix=""
847 fi
848 fi
849 if [ \! -z "$file_to_fix" ]; then
850 echo Checking $file_to_fix
851 if grep _KERNEL $file_to_fix > /dev/null; then
852 true
853 else
854 echo '#ifdef _KERNEL' > /tmp/$base
855 cat $file_to_fix >> /tmp/$base
856 echo '#endif /* defined(_KERNEL) */' >> /tmp/$base
857 echo Fixed $file_to_fix
858 rm -f ${LIB}/$file
859 cp /tmp/$base ${LIB}/$file
860 chmod a+r ${LIB}/$file
861 rm -f /tmp/$base
862 fi
863 fi
864
865 # Conditionalize all of <sys/cmn_err.h> on _KERNEL being defined.
866
867 file=sys/cmn_err.h
868 base=`basename $file`
869 if [ -r ${LIB}/$file ]; then
870 file_to_fix=${LIB}/$file
871 else
872 if [ -r ${INPUT}/$file ]; then
873 file_to_fix=${INPUT}/$file
874 else
875 file_to_fix=""
876 fi
877 fi
878 if [ \! -z "$file_to_fix" ]; then
879 echo Checking $file_to_fix
880 if grep _KERNEL $file_to_fix > /dev/null; then
881 true
882 else
883 echo '#ifdef _KERNEL' > /tmp/$base
884 cat $file_to_fix >> /tmp/$base
885 echo '#endif /* defined(_KERNEL) */' >> /tmp/$base
886 echo Fixed $file_to_fix
887 rm -f ${LIB}/$file
888 cp /tmp/$base ${LIB}/$file
889 chmod a+r ${LIB}/$file
890 rm -f /tmp/$base
891 fi
892 fi
893
894 # Conditionalize all of <sys/kdebugger.h> on _KERNEL being defined.
895
896 file=sys/kdebugger.h
897 base=`basename $file`
898 if [ -r ${LIB}/$file ]; then
899 file_to_fix=${LIB}/$file
900 else
901 if [ -r ${INPUT}/$file ]; then
902 file_to_fix=${INPUT}/$file
903 else
904 file_to_fix=""
905 fi
906 fi
907 if [ \! -z "$file_to_fix" ]; then
908 echo Checking $file_to_fix
909 if grep _KERNEL $file_to_fix > /dev/null; then
910 true
911 else
912 echo '#ifdef _KERNEL' > /tmp/$base
913 cat $file_to_fix >> /tmp/$base
914 echo '#endif /* defined(_KERNEL) */' >> /tmp/$base
915 echo Fixed $file_to_fix
916 rm -f ${LIB}/$file
917 cp /tmp/$base ${LIB}/$file
918 chmod a+r ${LIB}/$file
919 rm -f /tmp/$base
920 fi
921 fi
922
923 # Conditionalize some of <netinet/in.h> on _KERNEL being defined.
924
925 file=netinet/in.h
926 base=`basename $file`
927 if [ -r ${LIB}/$file ]; then
928 file_to_fix=${LIB}/$file
929 else
930 if [ -r ${INPUT}/$file ]; then
931 file_to_fix=${INPUT}/$file
932 else
933 file_to_fix=""
934 fi
935 fi
936 if [ \! -z "$file_to_fix" ]; then
937 echo Checking $file_to_fix
938 if grep _KERNEL $file_to_fix > /dev/null; then
939 true
940 else
941 sed -e '/#ifdef INKERNEL/i\
942 #ifdef _KERNEL' \
943 -e '/#endif[ ]*\/\* INKERNEL \*\//a\
944 #endif /* _KERNEL */' \
945 $file_to_fix > ${LIB}/${file}.sed
946 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
947 echo Fixed $file_to_fix
948 fi
949 fi
950
951 # Conditionalize some of <sys/endian.h> on __GNUC__ and __GNUG__.
952
953 file=sys/endian.h
954 base=`basename $file`
955 if [ -r ${LIB}/$file ]; then
956 file_to_fix=${LIB}/$file
957 else
958 if [ -r ${INPUT}/$file ]; then
959 file_to_fix=${INPUT}/$file
960 else
961 file_to_fix=""
962 fi
963 fi
964 if [ \! -z "$file_to_fix" ]; then
965 echo Checking $file_to_fix
966 if grep __GNUC__ $file_to_fix > /dev/null; then
967 true
968 else
969 sed -e '/# ifdef __STDC__/i\
970 # if !defined (__GNUC__) && !defined (__GNUG__)' \
971 -e '/# include <sys\/byteorder.h>/s/ / /'\
972 -e '/# include <sys\/byteorder.h>/i\
973 # endif /* !defined (__GNUC__) && !defined (__GNUG__) */'\
974 $file_to_fix > ${LIB}/${file}.sed
975 rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
976 echo Fixed $file_to_fix
977 fi
978 fi
979
980 # Commented out because tmcconne@sedona.intel.com says we don't clearly need it
981 # and the text in types.h is not erroneous.
982 ## In sys/types.h, don't name the enum for booleans.
983 #
984 #file=sys/types.h
985 #base=`basename $file`
986 #if [ -r ${LIB}/$file ]; then
987 # file_to_fix=${LIB}/$file
988 #else
989 # if [ -r ${INPUT}/$file ]; then
990 # file_to_fix=${INPUT}/$file
991 # else
992 # file_to_fix=""
993 # fi
994 #fi
995 #if [ \! -z "$file_to_fix" ]; then
996 # echo Checking $file_to_fix
997 # if grep "enum boolean" $file_to_fix > /dev/null; then
998 # sed -e 's/enum boolean/enum/' ${LIB}/$file > ${LIB}/${file}.sed
999 # rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
1000 # echo Fixed $file_to_fix
1001 # else
1002 # true
1003 # fi
1004 #fi
1005
1006 # Remove useless extern keyword from struct forward declarations in
1007 # <sys/stream.h> and <sys/strsubr.h>
1008
1009 file=sys/stream.h
1010 base=`basename $file`
1011 if [ -r ${LIB}/$file ]; then
1012 file_to_fix=${LIB}/$file
1013 else
1014 if [ -r ${INPUT}/$file ]; then
1015 file_to_fix=${INPUT}/$file
1016 else
1017 file_to_fix=""
1018 fi
1019 fi
1020 if [ \! -z "$file_to_fix" ]; then
1021 echo Checking $file_to_fix
1022 sed -e '
1023 s/extern struct stdata;/struct stdata;/g
1024 s/extern struct strevent;/struct strevent;/g
1025 ' $file_to_fix > /tmp/$base
1026 if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \
1027 true
1028 else
1029 echo Fixed $file_to_fix
1030 rm -f ${LIB}/$file
1031 cp /tmp/$base ${LIB}/$file
1032 chmod a+r ${LIB}/$file
1033 fi
1034 rm -f /tmp/$base
1035 fi
1036
1037 file=sys/strsubr.h
1038 base=`basename $file`
1039 if [ -r ${LIB}/$file ]; then
1040 file_to_fix=${LIB}/$file
1041 else
1042 if [ -r ${INPUT}/$file ]; then
1043 file_to_fix=${INPUT}/$file
1044 else
1045 file_to_fix=""
1046 fi
1047 fi
1048 if [ \! -z "$file_to_fix" ]; then
1049 echo Checking $file_to_fix
1050 sed -e '
1051 s/extern struct strbuf;/struct strbuf;/g
1052 s/extern struct uio;/struct uio;/g
1053 s/extern struct thread;/struct thread;/g
1054 s/extern struct proc;/struct proc;/g
1055 ' $file_to_fix > /tmp/$base
1056 if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \
1057 true
1058 else
1059 echo Fixed $file_to_fix
1060 rm -f ${LIB}/$file
1061 cp /tmp/$base ${LIB}/$file
1062 chmod a+r ${LIB}/$file
1063 fi
1064 rm -f /tmp/$base
1065 fi
1066
1067 # Put storage class at start of decl, to avoid warning.
1068 file=rpc/types.h
1069 base=`basename $file`
1070 if [ -r ${LIB}/$file ]; then
1071 file_to_fix=${LIB}/$file
1072 else
1073 if [ -r ${INPUT}/$file ]; then
1074 file_to_fix=${INPUT}/$file
1075 else
1076 file_to_fix=""
1077 fi
1078 fi
1079 if [ \! -z "$file_to_fix" ]; then
1080 echo Checking $file_to_fix
1081 sed -e '
1082 s/const extern/extern const/g
1083 ' $file_to_fix > /tmp/$base
1084 if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \
1085 true
1086 else
1087 echo Fixed $file_to_fix
1088 rm -f ${LIB}/$file
1089 cp /tmp/$base ${LIB}/$file
1090 chmod a+r ${LIB}/$file
1091 fi
1092 rm -f /tmp/$base
1093 fi
1094
1095 # Convert functions to prototype form, and fix arg names in <sys/stat.h>.
1096
1097 file=sys/stat.h
1098 base=`basename $file`
1099 if [ -r ${LIB}/$file ]; then
1100 file_to_fix=${LIB}/$file
1101 else
1102 if [ -r ${INPUT}/$file ]; then
1103 file_to_fix=${INPUT}/$file
1104 else
1105 file_to_fix=""
1106 fi
1107 fi
1108 if [ \! -z "$file_to_fix" ]; then
1109 echo Checking $file_to_fix
1110 cp $file_to_fix /tmp/$base
1111 chmod +w /tmp/$base
1112 sed -e '/^stat(/{
1113 N
1114 N
1115 s/(.*)\n/( /
1116 s/;\n/, /
1117 s/;$/)/
1118 }' \
1119 -e '/^lstat(/{
1120 N
1121 N
1122 s/(.*)\n/( /
1123 s/;\n/, /
1124 s/;$/)/
1125 }' \
1126 -e '/^fstat(/{
1127 N
1128 N
1129 s/(.*)\n/( /
1130 s/;\n/, /
1131 s/;$/)/
1132 }' \
1133 -e '/^mknod(/{
1134 N
1135 N
1136 N
1137 s/(.*)\n/( /
1138 s/;\n/, /g
1139 s/;$/)/
1140 }' \
1141 -e '1,$s/\([^A-Za-z]\)path\([^A-Za-z]\)/\1__path\2/g' \
1142 -e '1,$s/\([^A-Za-z]\)buf\([^A-Za-z]\)/\1__buf\2/g' \
1143 -e '1,$s/\([^A-Za-z]\)fd\([^A-Za-z]\)/\1__fd\2/g' \
1144 -e '1,$s/ret\([^u]\)/__ret\1/g' \
1145 -e '1,$s/\([^_]\)mode\([^_]\)/\1__mode\2/g' \
1146 -e '1,$s/\([^_r]\)dev\([^_]\)/\1__dev\2/g' /tmp/$base > /tmp/$base.sed
1147 if cmp $file_to_fix /tmp/$base.sed >/dev/null 2>&1; then \
1148 true
1149 else
1150 echo Fixed $file_to_fix
1151 rm -f ${LIB}/$file
1152 cp /tmp/$base.sed ${LIB}/$file
1153 chmod a+r ${LIB}/$file
1154 fi
1155 rm -f /tmp/$base /tmp/$base.sed
1156 fi
1157
1158 # Sony NEWSOS 5.0 does not support the complete ANSI C standard.
1159
1160 if [ -x /bin/sony ]; then
1161 if /bin/sony; then
1162
1163 # Change <stdio.h> to not define __filbuf, __flsbuf, and __iob
1164
1165 file=stdio.h
1166 base=`basename $file`
1167 if [ -r ${LIB}/$file ]; then
1168 file_to_fix=${LIB}/$file
1169 else
1170 if [ -r ${INPUT}/$file ]; then
1171 file_to_fix=${INPUT}/$file
1172 else
1173 file_to_fix=""
1174 fi
1175 fi
1176 if [ \! -z "$file_to_fix" ]; then
1177 echo Checking $file_to_fix
1178 cp $file_to_fix /tmp/$base
1179 chmod +w /tmp/$base
1180 sed -e '
1181 s/__filbuf/_filbuf/g
1182 s/__flsbuf/_flsbuf/g
1183 s/__iob/_iob/g
1184 ' /tmp/$base > /tmp/$base.sed
1185 mv /tmp/$base.sed /tmp/$base
1186 if cmp $file_to_fix /tmp/$base.sed >/dev/null 2>&1; then
1187 true
1188 else
1189 echo Fixed $file_to_fix
1190 rm -f ${LIB}/$file
1191 cp /tmp/$base ${LIB}/$file
1192 chmod a+r ${LIB}/$file
1193 fi
1194 rm -f /tmp/$base
1195 fi
1196
1197 # Change <ctype.h> to not define __ctype
1198
1199 file=ctype.h
1200 base=`basename $file`
1201 if [ -r ${LIB}/$file ]; then
1202 file_to_fix=${LIB}/$file
1203 else
1204 if [ -r ${INPUT}/$file ]; then
1205 file_to_fix=${INPUT}/$file
1206 else
1207 file_to_fix=""
1208 fi
1209 fi
1210 if [ \! -z "$file_to_fix" ]; then
1211 echo Checking $file_to_fix
1212 cp $file_to_fix /tmp/$base
1213 chmod +w /tmp/$base
1214 sed -e '
1215 s/__ctype/_ctype/g
1216 ' /tmp/$base > /tmp/$base.sed
1217 mv /tmp/$base.sed /tmp/$base
1218 if cmp $file_to_fix /tmp/$base.sed >/dev/null 2>&1; then
1219 true
1220 else
1221 echo Fixed $file_to_fix
1222 rm -f ${LIB}/$file
1223 cp /tmp/$base ${LIB}/$file
1224 chmod a+r ${LIB}/$file
1225 fi
1226 rm -f /tmp/$base
1227 fi
1228 fi
1229 fi
1230
1231 # In limits.h, put #ifndefs around things that are supposed to be defined
1232 # in float.h to avoid redefinition errors if float.h is included first.
1233 # Solaris 2.1 has this problem.
1234
1235 file=limits.h
1236 base=`basename $file`
1237 if [ -r ${LIB}/$file ]; then
1238 file_to_fix=${LIB}/$file
1239 else
1240 if [ -r ${INPUT}/$file ]; then
1241 file_to_fix=${INPUT}/$file
1242 else
1243 file_to_fix=""
1244 fi
1245 fi
1246 if [ \! -z "$file_to_fix" ]; then
1247 echo Checking $file_to_fix
1248 sed -e '/[ ]FLT_MIN[ ]/i\
1249 #ifndef FLT_MIN'\
1250 -e '/[ ]FLT_MIN[ ]/a\
1251 #endif'\
1252 -e '/[ ]FLT_MAX[ ]/i\
1253 #ifndef FLT_MAX'\
1254 -e '/[ ]FLT_MAX[ ]/a\
1255 #endif'\
1256 -e '/[ ]FLT_DIG[ ]/i\
1257 #ifndef FLT_DIG'\
1258 -e '/[ ]FLT_DIG[ ]/a\
1259 #endif'\
1260 -e '/[ ]DBL_MIN[ ]/i\
1261 #ifndef DBL_MIN'\
1262 -e '/[ ]DBL_MIN[ ]/a\
1263 #endif'\
1264 -e '/[ ]DBL_MAX[ ]/i\
1265 #ifndef DBL_MAX'\
1266 -e '/[ ]DBL_MAX[ ]/a\
1267 #endif'\
1268 -e '/[ ]DBL_DIG[ ]/i\
1269 #ifndef DBL_DIG'\
1270 -e '/[ ]DBL_DIG[ ]/a\
1271 #endif' $file_to_fix > /tmp/$base
1272 if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \
1273 true
1274 else
1275 echo Fixed $file_to_fix
1276 rm -f ${LIB}/$file
1277 cp /tmp/$base ${LIB}/$file
1278 chmod a+r ${LIB}/$file
1279 fi
1280 rm -f /tmp/$base
1281 fi
1282
1283 # Completely replace <sys/varargs.h> with a file that includes gcc's
1284 # stdarg.h or varargs.h files as appropriate.
1285
1286 file=sys/varargs.h
1287 if [ -r ${INPUT}/$file ]; then
1288 echo Replacing $file
1289 cat > ${LIB}/$file << EOF
1290 /* This file was generated by fixincludes. */
1291 #ifndef _SYS_VARARGS_H
1292 #define _SYS_VARARGS_H
1293
1294 #ifdef __STDC__
1295 #include <stdarg.h>
1296 #else
1297 #include <varargs.h>
1298 #endif
1299
1300 #endif /* _SYS_VARARGS_H */
1301 EOF
1302 chmod a+r ${LIB}/$file
1303 fi
1304
1305 echo 'Removing unneeded directories:'
1306 cd $LIB
1307 files=`find . -type d -print | sort -r`
1308 for file in $files; do
1309 rmdir $LIB/$file > /dev/null 2>&1
1310 done
1311
1312 if $LINKS; then
1313 echo 'Making internal symbolic non-directory links'
1314 cd ${INPUT}
1315 files=`find . -type l -print`
1316 for file in $files; do
1317 dest=`ls -ld $file | sed -n 's/.*-> //p'`
1318 if expr "$dest" : '[^/].*' > /dev/null; then
1319 target=${LIB}/`echo file | sed "s|[^/]*\$|$dest|"`
1320 if [ -f $target ]; then
1321 ln -s $dest ${LIB}/$file >/dev/null 2>&1
1322 fi
1323 fi
1324 done
1325 fi
1326
1327 cd ${ORIG_DIR}
1328
1329 echo 'Replacing <sys/byteorder.h>'
1330 rm -f ${LIB}/sys/byteorder.h
1331 cp ${SRCDIR}/byteorder.h ${LIB}/sys/byteorder.h
1332
1333 exit 0
1334
This page took 0.110813 seconds and 6 git commands to generate.