OSDN Git Service

Copy files needed for other files at the very end.
authorrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 11 Nov 1993 08:20:12 +0000 (08:20 +0000)
committerrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 11 Nov 1993 08:20:12 +0000 (08:20 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@6067 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/fixincludes

index bb28e3d..f4ae5e6 100755 (executable)
@@ -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 '{}' ';'