summaryrefslogtreecommitdiff
path: root/gcc/fixinc.svr4
diff options
context:
space:
mode:
authorrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>1992-11-30 23:10:14 +0000
committerrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>1992-11-30 23:10:14 +0000
commitbe268bb3ae67a9541d1434e32a709d935678adf2 (patch)
tree6197405d2be8daf64bf321d1ce047f995afbe7e5 /gcc/fixinc.svr4
parentc21047db5b02476399e41eac8719ce9841fb1bc7 (diff)
downloadgcc-be268bb3ae67a9541d1434e32a709d935678adf2.tar.gz
(regexp.h): Don't add a getrnge declaration if a conflicting
declaration is already present. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@2823 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fixinc.svr4')
-rwxr-xr-xgcc/fixinc.svr430
1 files changed, 19 insertions, 11 deletions
diff --git a/gcc/fixinc.svr4 b/gcc/fixinc.svr4
index cae39fc3f41..b96b3def03f 100755
--- a/gcc/fixinc.svr4
+++ b/gcc/fixinc.svr4
@@ -467,6 +467,10 @@ fi
# Add a `static' declaration of `getrnge' into <regexp.h>.
+# Don't do this if there is already a `static void getrnge' declaration
+# present, since this would cause a redeclaration error. Solaris 2.x has
+# such a declaration.
+
file=regexp.h
base=`basename $file`
if [ -r ${LIB}/$file ]; then
@@ -480,22 +484,26 @@ else
fi
if [ \! -z "$file_to_fix" ]; then
echo Checking $file_to_fix
- cp $file_to_fix /tmp/$base
- chmod +w /tmp/$base
- ex /tmp/$base <<EOF
- /^static int[ ]*size;/c
+ if grep "static void getrnge" $file_to_fix > /dev/null; then
+ true
+ else
+ cp $file_to_fix /tmp/$base
+ chmod +w /tmp/$base
+ ex /tmp/$base <<EOF
+ /^static int[ ]*size;/c
static int size ;
static int getrnge ();
.
- wq
+ wq
EOF
- if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \
- echo No change needed in $file_to_fix
- else
- echo Fixed $file_to_fix
- rm -f ${LIB}/$file
- cp /tmp/$base ${LIB}/$file
+ if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \
+ No change needed in $file_to_fix
+ else
+ echo Fixed $file_to_fix
+ rm -f ${LIB}/$file
+ cp /tmp/$base ${LIB}/$file
+ fi
fi
rm -f /tmp/$base
fi