--- gcc/fixincludes 2018/04/24 16:44:56 1.1.1.4 +++ gcc/fixincludes 2018/04/24 16:45:52 1.1.1.5 @@ -8,45 +8,47 @@ # 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 +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 <