aboutsummaryrefslogtreecommitdiff
path: root/gcc/fixincludes
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1993-11-11 08:20:12 +0000
committerRichard Stallman <rms@gnu.org>1993-11-11 08:20:12 +0000
commit8f8470e01fd60067c058acd8789875013add9796 (patch)
tree558408aeaaff050f5c86e174104bb2f430fc9ed8 /gcc/fixincludes
parentfa27d320291cfa133977affdb9786f4320ac74fe (diff)
downloadgcc-8f8470e01fd60067c058acd8789875013add9796.zip
gcc-8f8470e01fd60067c058acd8789875013add9796.tar.gz
gcc-8f8470e01fd60067c058acd8789875013add9796.tar.bz2
Copy files needed for other files at the very end.
From-SVN: r6067
Diffstat (limited to 'gcc/fixincludes')
-rwxr-xr-xgcc/fixincludes56
1 files changed, 29 insertions, 27 deletions
diff --git a/gcc/fixincludes b/gcc/fixincludes
index bb28e3d..f4ae5e6 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 '{}' ';'