Annotation of gcc/fixincludes, revision 1.1.1.9

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.9 ! root       11: echo 'Making directories:'
        !            12: cd /usr/include
        !            13: files=`find . -type d -print`
        !            14: for file in $files; do
        !            15:   mkdir $LIB/$file > /dev/null 2>&1
        !            16: done
1.1.1.6   root       17: 
1.1.1.5   root       18: echo 'Finding header files:'
                     19: cd /usr/include
1.1.1.7   root       20: files=`find . -type f -print`
1.1.1.5   root       21: echo 'Checking header files:'
                     22: for file in $files; do
                     23:   if egrep -s '[       ]_IO[A-Z]*\(|#define._IO|CTRL' $file; then
                     24:     echo Fixing $file
                     25:     if [ -r $file ]; then
                     26:       cp $file ${LIB}/$file >/dev/null 2>&1    \
                     27:       || echo "Can't copy $file"
                     28:       chmod +w ${LIB}/$file
                     29:       ex ${LIB}/$file <<EOF
                     30:       g/[      ]_IO[A-Z]*(/s/(\(.\),/('\1',/
                     31:       g/#define._IO/s/'x'/x/g
1.1.1.8   root       32:       g/[^A-Z]CTRL[    ]*(/s/\(.\))/'\1')/
1.1.1.5   root       33:       g/#define.CTRL/s/'c'/c/g
                     34:       wq
                     35: EOF
1.1.1.8   root       36:       if cmp $file ${LIB}/$file >/dev/null 2>&1; then
                     37:          echo Deleting ${LIB}/$file\; no fixes were needed.
                     38:          rm ${LIB}/$file
                     39:       fi
1.1.1.5   root       40:     fi
1.1.1.2   root       41:   fi
                     42: done
                     43: 
1.1       root       44: 
1.1.1.5   root       45: # Fix one other error in this file: a mismatched quote not inside a C comment.
                     46: file=sundev/vuid_event.h
                     47: if [ -r $file ]; then
                     48:   if [ ! -r ${LIB}/$file ]; then
                     49:     cp $file ${LIB}/$file >/dev/null 2>&1      \
                     50:     || echo "Can't copy $file"
1.1.1.3   root       51:     chmod +w ${LIB}/$file
1.1.1.2   root       52:   fi
1.1.1.5   root       53: fi
1.1.1.4   root       54: 
1.1.1.5   root       55: if [ -r ${LIB}/sundev/vuid_event.h ]; then
                     56:   echo Fixing sundev/vuid_event.h comment
                     57:   ex ${LIB}/sundev/vuid_event.h <<EOF
                     58:   g/doesn't/s/doesn't/doesn''t/
                     59:   wq
1.1       root       60: EOF
1.1.1.8   root       61: fi

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.