summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrendan <brendan@138bc75d-0d04-0410-961f-82ee72b054a4>1997-06-06 02:23:14 +0000
committerbrendan <brendan@138bc75d-0d04-0410-961f-82ee72b054a4>1997-06-06 02:23:14 +0000
commitd80395d8c7d98dc141add74e8475d64045da562f (patch)
tree26be0e4f127e670234a5b432f5a944bc39c82254
parenteaa3d982324dd200aca5d21040ae4bd1a92d076b (diff)
downloadgcc-d80395d8c7d98dc141add74e8475d64045da562f.tar.gz
* fixinc.irix: Add declaration of __vfork to unistd.h.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@14159 138bc75d-0d04-0410-961f-82ee72b054a4
-rwxr-xr-xgcc/fixinc.irix35
1 files changed, 32 insertions, 3 deletions
diff --git a/gcc/fixinc.irix b/gcc/fixinc.irix
index 222097718fb..337289a121e 100755
--- a/gcc/fixinc.irix
+++ b/gcc/fixinc.irix
@@ -55,9 +55,9 @@ echo 'Building fixincludes in ' ${LIB}
#
# Note: For Irix, we deliberately don't try to create the directory trees,
-# since we only modify math.h and limits.h. If we ADD ANY OTHERS,
-# the "Making directories:" and symlinks code from fixinc.svr4 may
-# have to go back in.
+# since we only modify math.h, limits.h and unistd.h. If we
+# ADD ANY OTHERS, the "Making directories:" and symlinks code from
+# fixinc.svr4 may have to go back in.
# The Irix math.h defines struct exception, which conflicts with
# the class exception defined in the C++ file std/stdexcept.h. We
@@ -158,4 +158,33 @@ if [ \! -z "$file_to_fix" ]; then
rm -f /tmp/$base
fi
+# The Irix unistd.h will introduce a call to __vfork in its libc, but the
+# function is never actually prototyped.
+file=unistd.h
+base=`basename $file`
+if [ -r ${LIB}/$file ]; then
+ file_to_fix=${LIB}/$file
+else
+ if [ -r ${INPUT}/$file ]; then
+ file_to_fix=${INPUT}/$file
+ else
+ file_to_fix=""
+ fi
+fi
+if [ \! -z "$file_to_fix" ]; then
+ echo Checking $file_to_fix
+ sed -e '/__vfork/i\
+extern pid_t __vfork(void);'\
+ $file_to_fix > /tmp/$base
+ if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \
+ true
+ else
+ echo Fixed $file_to_fix
+ rm -f ${LIB}/$file
+ cp /tmp/$base ${LIB}/$file
+ chmod a+r ${LIB}/$file
+ fi
+ rm -f /tmp/$base
+fi
+
exit 0