OSDN Git Service

If a file is referenced with double quotes from
authorrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 12 Oct 1993 19:51:26 +0000 (19:51 +0000)
committerrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 12 Oct 1993 19:51:26 +0000 (19:51 +0000)
a fixed file, make sure it is copied into the fixed include directory.

Remove DPS/XDPSlib.h special-case code.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@5753 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/fixincludes

index fd117ed..626dbf8 100755 (executable)
@@ -223,6 +223,7 @@ if $LINKS; then
   done
 fi
 
+required=
 set x $treetops
 shift
 while [ $# != 0 ]; do
@@ -324,6 +325,11 @@ while [ $# != 0 ]; do
           rm $2/$file
        else
           echo Fixed $file
+          # Find any include directives that use "file".
+          for include in `egrep '^[    ]*#[    ]*include[      ]*"[^/]' $2/$file | sed -e 's/^[        ]*#[    ]*include[      ]*"\([^"]*\)".*$/\1/'`; do
+             dir=`echo $file | sed -e s'|/[^/]*$||'`
+             required="$required $1 $dir/$include $2/$dir/$include"
+          done
        fi
       fi
     fi
@@ -331,6 +337,24 @@ while [ $# != 0 ]; do
   shift; shift
 done
 
+# Make sure that any include files referenced using double quotes
+# exist in the fixed directory.
+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
+  fi
+  shift; shift; shift
+done
+
 cd ${INPUT}
 
 # Install the proper definition of size_t in header files that it comes from.
@@ -476,20 +500,6 @@ if [ -r ${LIB}/$file ] ; then
   fi
 fi
 
-# Fix AIX use of "XDPS.h" to refer to <DPS/XDPS.h>
-file=DPS/XDPSlib.h
-if [ -r $file ] && [ ! -r ${LIB}/$file ] ; then
-  cp $file ${LIB}/$file
-fi
-if [ -r ${LIB}/$file ] ; then
-  echo Fixing $file
-  sed -e 's,"XDPS.h",<DPS/XDPS.h>,' ${LIB}/$file > ${LIB}/${file}.sed
-  rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
-  if cmp $file ${LIB}/$file >/dev/null 2>&1; then
-    rm ${LIB}/$file
-  fi
-fi
-
 # Fix an error in this file: the #if says _cplusplus, not the double
 # underscore __cplusplus that it should be
 file=tinfo.h