|
|
1.1.1.2 root 1: #! /bin/sh
1.1 root 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.
5: # This works properly on a Sun in system version 3.4;
6: # for other versions, you had better check.
7:
1.1.1.3 root 8: # Directory in which to store the results.
9: LIB=/usr/local/lib/gcc-include
10:
1.1.1.6 root 11: mkdir $LIB > /dev/null 2>&1
12:
1.1.1.5 root 13: echo 'Finding header files:'
14: cd /usr/include
1.1.1.7 root 15: files=`find . -type f -print`
1.1.1.5 root 16: echo 'Checking header files:'
17: for file in $files; do
18: if egrep -s '[ ]_IO[A-Z]*\(|#define._IO|CTRL' $file; then
19: echo Fixing $file
20: if [ -r $file ]; then
21: cp $file ${LIB}/$file >/dev/null 2>&1 \
22: || (mkdir `dirname ${LIB}/$file` \
23: && cp $file ${LIB}/$file) \
24: || echo "Can't copy $file"
25: chmod +w ${LIB}/$file
26: ex ${LIB}/$file <<EOF
27: g/[ ]_IO[A-Z]*(/s/(\(.\),/('\1',/
28: g/#define._IO/s/'x'/x/g
1.1.1.8 ! root 29: g/[^A-Z]CTRL[ ]*(/s/\(.\))/'\1')/
1.1.1.5 root 30: g/#define.CTRL/s/'c'/c/g
31: wq
32: EOF
1.1.1.8 ! root 33: if cmp $file ${LIB}/$file >/dev/null 2>&1; then
! 34: echo Deleting ${LIB}/$file\; no fixes were needed.
! 35: rm ${LIB}/$file
! 36: fi
1.1.1.5 root 37: fi
1.1.1.2 root 38: fi
39: done
40:
1.1 root 41:
1.1.1.5 root 42: # Fix one other error in this file: a mismatched quote not inside a C comment.
43: file=sundev/vuid_event.h
44: if [ -r $file ]; then
45: if [ ! -r ${LIB}/$file ]; then
46: cp $file ${LIB}/$file >/dev/null 2>&1 \
47: || (mkdir `dirname ${LIB}/$file` \
48: && cp $file ${LIB}/$file) \
49: || echo "Can't copy $file"
1.1.1.3 root 50: chmod +w ${LIB}/$file
1.1.1.2 root 51: fi
1.1.1.5 root 52: fi
1.1.1.4 root 53:
1.1.1.5 root 54: if [ -r ${LIB}/sundev/vuid_event.h ]; then
55: echo Fixing sundev/vuid_event.h comment
56: ex ${LIB}/sundev/vuid_event.h <<EOF
57: g/doesn't/s/doesn't/doesn''t/
58: wq
1.1 root 59: EOF
1.1.1.8 ! root 60: fi
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.