aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1993-06-14 21:48:40 +0000
committerRichard Stallman <rms@gnu.org>1993-06-14 21:48:40 +0000
commit315198ab9d659c8326e0a449aaa910ee2de6bece (patch)
treeeb7f1b0a8931b1cf29bd17f9b6531d3c8faa18ab /gcc
parent3008222343f1160e317ac2528719a855e6b79b88 (diff)
downloadgcc-315198ab9d659c8326e0a449aaa910ee2de6bece.zip
gcc-315198ab9d659c8326e0a449aaa910ee2de6bece.tar.gz
gcc-315198ab9d659c8326e0a449aaa910ee2de6bece.tar.bz2
(stdio.h math.h ctype.h sys/{limits.h,fcntl.h,dirent.h}):
Fix STDC/POSIX and other things for Interactive Unix 2.2 or later. From-SVN: r4678
Diffstat (limited to 'gcc')
-rwxr-xr-xgcc/fixincludes35
1 files changed, 35 insertions, 0 deletions
diff --git a/gcc/fixincludes b/gcc/fixincludes
index f97c3d0..13a493b 100755
--- a/gcc/fixincludes
+++ b/gcc/fixincludes
@@ -1062,6 +1062,41 @@ then
ln -s ${INPUT}/multimedia/audio_hdr.h ${LIB}/multimedia 2>/dev/null
fi
+# Determine if we're on Interactive Unix 2.2 or later, in which case we
+# need to fix some additional files. This is the same test for ISC that
+# Autoconf uses.
+if test -d /etc/conf/kconfig.d \
+ && grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1; then
+ echo "Fixing ISC __STDC__ goof in several files..."
+ for name in stdio.h math.h ctype.h sys/limits.h sys/fcntl.h sys/dirent.h; do
+ echo $name
+ if test -r ${LIB}/$name; then
+ file=${LIB}/$name
+ else
+ file=${INPUT}/$name
+ fi
+ # On Interactive 2.2, certain traditional Unix definitions
+ # (notably getc and putc in stdio.h) are omitted if __STDC__ is
+ # defined, not just if _POSIX_SOURCE is defined. This makes it
+ # impossible to compile any nontrivial program except with -posix.
+ sed \
+'s/!defined(__STDC__) && !defined(_POSIX_SOURCE)/!defined(_POSIX_SOURCE)/' \
+ < $file > ${LIB}/$name.
+ mv ${LIB}/$name. ${LIB}/$name
+ done
+
+ echo "Fixing ISC fmod declaration"
+ # This one's already been fixed for other things.
+ file=${LIB}/math.h
+ sed 's/fmod(double)/fmod(double, double)/' <$file >$file.
+ mv $file. $file
+
+ echo "Fixing nested comments in ISC <sys/limits.h>"
+ file=sys/limits.h
+ sed '/CHILD_MAX/s,/\* Max, Max,' < ${INPUT}/$file >${LIB}/$file.
+ sed '/OPEN_MAX/s,/\* Max, Max,' < ${LIB}/$file. >${LIB}/$file
+fi
+
# These files on Ultrix 4.2 put comments around instances of #endif
# __mips. When the sed expression turns that into #endif /* __mips */
# the comment ends prematurely.