aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1993-10-12 19:51:26 +0000
committerRichard Stallman <rms@gnu.org>1993-10-12 19:51:26 +0000
commit40f1c86ccabe8abfca33d8b86bce6a793d9ff025 (patch)
tree1a5dd8d6f8a94d7a922e85fa8f129f942756931e
parent64791b18b89002e1abd71d9a7d4d37c2f5612ce1 (diff)
downloadgcc-40f1c86ccabe8abfca33d8b86bce6a793d9ff025.zip
gcc-40f1c86ccabe8abfca33d8b86bce6a793d9ff025.tar.gz
gcc-40f1c86ccabe8abfca33d8b86bce6a793d9ff025.tar.bz2
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
-rwxr-xr-xgcc/fixincludes38
1 files changed, 24 insertions, 14 deletions
diff --git a/gcc/fixincludes b/gcc/fixincludes
index fd117ed..626dbf8 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 <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