--- gcc/fixincludes 2018/04/24 16:42:10 1.1.1.3 +++ gcc/fixincludes 2018/04/24 16:46:51 1.1.1.6 @@ -8,40 +8,49 @@ # Directory in which to store the results. LIB=/usr/local/lib/gcc-include -mkdir ${LIB} -for dir in sys sun sundev sunwindow; do - if [ -d /usr/include/$dir ]; then - mkdir ${LIB}/$dir +mkdir $LIB > /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 - ex ${LIB}/$file <