From 8f8470e01fd60067c058acd8789875013add9796 Mon Sep 17 00:00:00 2001 From: Richard Stallman Date: Thu, 11 Nov 1993 08:20:12 +0000 Subject: [PATCH] Copy files needed for other files at the very end. From-SVN: r6067 --- gcc/fixincludes | 56 +++++++++++++++++++++++++------------------------ 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/gcc/fixincludes b/gcc/fixincludes index bb28e3d12a0..f4ae5e68354 100755 --- a/gcc/fixincludes +++ b/gcc/fixincludes @@ -337,33 +337,6 @@ while [ $# != 0 ]; do shift; shift done -# Make sure that any include files referenced using double quotes -# exist in the fixed directory. -while [ -n "$required" ]; do - newreq= - set x $required - shift - while [ $# != 0 ]; do - # $1 is the directory to copy from, $2 is the unfixed file, - # $3 is the fixed file name. - cd ${INPUT} - cd $1 - if [ -r $2 ] && [ ! -r $3 ]; then - cp $2 $3 >/dev/null 2>&1 || echo "Can't copy $2" - chmod +w $3 2>/dev/null - chmod a+r $3 2>/dev/null - echo Copied $2 - for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' $3 | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do - dir=`echo $2 | sed -e s'|/[^/]*$||'` - dir2=`echo $3 | sed -e s'|/[^/]*$||'` - newreq="$newreq $1 $dir/$include $dir2/$include" - done - fi - shift; shift; shift - done - required=$newreq -done - cd ${INPUT} # Install the proper definition of size_t in header files that it comes from. @@ -1376,6 +1349,35 @@ if $LINKS; then done fi +# Make sure that any include files referenced using double quotes +# exist in the fixed directory. This comes last since otherwise +# we might end up deleting some of these files "because they don't +# need any change." +while [ -n "$required" ]; do + newreq= + set x $required + shift + while [ $# != 0 ]; do + # $1 is the directory to copy from, $2 is the unfixed file, + # $3 is the fixed file name. + cd ${INPUT} + cd $1 + if [ -r $2 ] && [ ! -r $3 ]; then + cp $2 $3 >/dev/null 2>&1 || echo "Can't copy $2" + chmod +w $3 2>/dev/null + chmod a+r $3 2>/dev/null + echo Copied $2 + for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' $3 | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do + dir=`echo $2 | sed -e s'|/[^/]*$||'` + dir2=`echo $3 | sed -e s'|/[^/]*$||'` + newreq="$newreq $1 $dir/$include $dir2/$include" + done + fi + shift; shift; shift + done + required=$newreq +done + echo 'Cleaning up DONE files.' cd $LIB find . -name DONE -exec rm -f '{}' ';'