aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <merrill@gnu.org>1994-06-18 21:51:42 +0000
committerJason Merrill <merrill@gnu.org>1994-06-18 21:51:42 +0000
commite5b3d86a4392f165037dee50f82979db3652c0d7 (patch)
treed81960a389fb9bbe9751bb2097b351c47e4e2ea4
parent6bfc4303bd3c97e2fa608ba135a29298483e0d26 (diff)
downloadgcc-e5b3d86a4392f165037dee50f82979db3652c0d7.zip
gcc-e5b3d86a4392f165037dee50f82979db3652c0d7.tar.gz
gcc-e5b3d86a4392f165037dee50f82979db3652c0d7.tar.bz2
include stdio.h and stdlib.h into assert.h as necessary
From-SVN: r7524
-rwxr-xr-xgcc/fixincludes31
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/fixincludes b/gcc/fixincludes
index 323ccac..d5762d7 100755
--- a/gcc/fixincludes
+++ b/gcc/fixincludes
@@ -1651,6 +1651,37 @@ extern "C" {
fi
fi
+# check for broken assert.h that needs stdio.h or stdlib.h
+file=assert.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
+ if grep 'stderr' ${LIB}/$file >/dev/null ; then
+ if grep 'include.*stdio.h' ${LIB}/$file >/dev/null ; then
+ true
+ else
+ echo "Fixing $file (needs stdio.h)"
+ echo '#include <stdio.h>' >>${LIB}/$file
+ fi
+ fi
+ if grep 'exit *(' ${LIB}/$file >/dev/null ||
+ grep 'abort *(' ${LIB}/$file >/dev/null ; then
+ if grep 'include.*stdlib.h' ${LIB}/$file >/dev/null ; then
+ true
+ else
+ echo "Fixing $file (needs stdlib.h)"
+ echo '#include <stdlib.h>' >>${LIB}/$file
+ fi
+ fi
+ if cmp $file ${LIB}/$file >/dev/null 2>&1; then
+ rm -f ${LIB}/$file
+ fi
+fi
+
# This file on SunOS 4 has a very large macro. When the sed loop
# tries pull it in, it overflows the pattern space size of the SunOS
# sed (GNU sed does not have this problem). Since the file does not