From 40f1c86ccabe8abfca33d8b86bce6a793d9ff025 Mon Sep 17 00:00:00 2001 From: Richard Stallman Date: Tue, 12 Oct 1993 19:51:26 +0000 Subject: [PATCH] If a file is referenced with double quotes from a fixed file, make sure it is copied into the fixed include directory. Remove DPS/XDPSlib.h special-case code. From-SVN: r5753 --- gcc/fixincludes | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/gcc/fixincludes b/gcc/fixincludes index fd117ed1b44..626dbf85d70 100755 --- a/gcc/fixincludes +++ b/gcc/fixincludes @@ -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 -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",,' ${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 -- 2.30.2