diff options
author | Brendan Kehoe <brendan@gcc.gnu.org> | 1997-02-24 18:29:09 -0500 |
---|---|---|
committer | Brendan Kehoe <brendan@gcc.gnu.org> | 1997-02-24 18:29:09 -0500 |
commit | e08cb549c8bc72226a27ee28415c9f7619710885 (patch) | |
tree | 7e18d525167d1c726ad1b91fb9118bde822b88bc /gcc | |
parent | 431c5c475ddf3fa535b27e0b3bb3c30c9e49e9dc (diff) | |
download | gcc-e08cb549c8bc72226a27ee28415c9f7619710885.zip gcc-e08cb549c8bc72226a27ee28415c9f7619710885.tar.gz gcc-e08cb549c8bc72226a27ee28415c9f7619710885.tar.bz2 |
* fixincludes: Fix need of prototypes for C++ in rpc/xdr.h on SunOS4.
From-SVN: r13676
Diffstat (limited to 'gcc')
-rwxr-xr-x | gcc/fixincludes | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc/fixincludes b/gcc/fixincludes index 880ca44..abb5df6 100755 --- a/gcc/fixincludes +++ b/gcc/fixincludes @@ -2777,6 +2777,36 @@ if [ -r ${LIB}/$file ]; then fi fi +# rpc/xdr.h on SunOS needs prototypes for its XDR->xdr_ops function pointers. +file=rpc/xdr.h +if [ -r $file ] && [ ! -r ${LIB}/$file ]; then + cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file" + chmod +w ${LIB}/$file 2>/dev/null + chmod a+r ${LIB}/$file 2>/dev/null +fi + +if [ -r ${LIB}/$file ]; then + echo "Checking for needed C++ prototype in $file" + sed -e 's/^\(.*\)\*\(x_.*\)();\(.*\)/\ +#ifdef __cplusplus\ +\1*\2(...);\3\ +#else\ +\1*\2();\3\ +#endif/g' \ + $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 -f ${LIB}/$file + else + # Find any include directives that use "file". + for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do + dir=`echo $file | sed -e s'|/[^/]*$||'` + required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include" + done + fi +fi + # This loop does not appear to do anything, because it uses file # rather than $file when setting target. It also appears to be # unnecessary, since the main loop processes symbolic links. |