--- gcc/fixincludes 2018/04/24 16:38:24 1.1 +++ gcc/fixincludes 2018/04/24 16:46:51 1.1.1.6 @@ -1,23 +1,56 @@ +#! /bin/sh # Install modified versions of certain ANSI-incompatible system header files # which are fixed to work correctly with ANSI C # and placed in a directory that GNU C will search. # This works properly on a Sun in system version 3.4; # for other versions, you had better check. -mkdir /usr/local/lib/gcc-include -mkdir /usr/local/lib/gcc-include/sys -cp /usr/include/sys/ioctl.h /usr/local/lib/gcc-include/sys/ioctl.h -chmod +w /usr/local/lib/gcc-include/sys/ioctl.h -ex /usr/local/lib/gcc-include/sys/ioctl.h < /dev/null 2>&1 + +echo 'Finding header files:' +cd /usr/include +files=`find . -print` +echo 'Checking header files:' +for file in $files; do + if egrep -s '[ ]_IO[A-Z]*\(|#define._IO|CTRL' $file; then + echo Fixing $file + if [ -r $file ]; then + cp $file ${LIB}/$file >/dev/null 2>&1 \ + || (mkdir `dirname ${LIB}/$file` \ + && cp $file ${LIB}/$file) \ + || echo "Can't copy $file" + chmod +w ${LIB}/$file + ex ${LIB}/$file </dev/null 2>&1 \ + || (mkdir `dirname ${LIB}/$file` \ + && cp $file ${LIB}/$file) \ + || echo "Can't copy $file" + chmod +w ${LIB}/$file + fi +fi -cp /usr/include/sys/ttychars.h /usr/local/lib/gcc-include/sys/ttychars.h -chmod +w /usr/local/lib/gcc-include/sys/ttychars.h -ex /usr/local/lib/gcc-include/sys/ttychars.h << EOF -g/CTRL/s/(\(.\))/('\1')/ -g/#define.CTRL/s/'c'/c/g -wq +if [ -r ${LIB}/sundev/vuid_event.h ]; then + echo Fixing sundev/vuid_event.h comment + ex ${LIB}/sundev/vuid_event.h <