diff options
Diffstat (limited to 'gcc/fixproto')
-rwxr-xr-x | gcc/fixproto | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/gcc/fixproto b/gcc/fixproto index dd4234a0636..67241eaead1 100755 --- a/gcc/fixproto +++ b/gcc/fixproto @@ -4,7 +4,7 @@ # fixproto TARGET-DIR SOURCE-DIR-ALL SOURCE-DIR-STD # # COPYRIGHT -# Copyright (C) 1993 Free Software Foundation, Inc. +# Copyright (C) 1993, 1994 Free Software Foundation, Inc. # This file is part of GNU CC. # # GNU CC is free software; you can redistribute it and/or modify @@ -329,15 +329,27 @@ for code in ALL STD ; do rm -f fixtmp.c fixtmp.i done # check for broken assert.h that needs stdio.h - if test -f $abs_source_dir/assert.h -a \! -f $abs_target_dir/assert.h \ - && grep 'stderr' $abs_source_dir/assert.h >/dev/null - then - if grep 'include.*stdio.h' $abs_source_dir/assert.h >/dev/null - then true - else - echo 'Fixing broken assert.h (needs stdio.h)' - cat $abs_source_dir/assert.h >$abs_target_dir/assert.h - echo '#include <stdio.h>' >>$abs_target_dir/assert.h + if test -f $abs_source_dir/assert.h -a \! -f $abs_target_dir/assert.h; then + if grep 'stderr' $abs_source_dir/assert.h >/dev/null ; then + if grep 'include.*stdio.h' $abs_source_dir/assert.h >/dev/null ; then + true + else + echo 'Fixing broken assert.h (needs stdio.h)' + cat $abs_source_dir/assert.h >$abs_target_dir/assert.h + echo '#include <stdio.h>' >>$abs_target_dir/assert.h + fi + fi + if grep 'exit *(' $abs_source_dir/assert.h >/dev/null || + grep 'abort *(' $abs_source_dir/assert.h >/dev/null ; then + if grep 'include.*stdlib.h' $abs_source_dir/assert.h >/dev/null ; then + true + else + echo 'Fixing broken assert.h (needs stdlib.h)' + if test ! -f $abs_target_dir/assert.h ; then + cat $abs_source_dir/assert.h >$abs_target_dir/assert.h + fi + echo '#include <stdlib.h>' >>$abs_target_dir/assert.h + fi fi fi done_dirs="$done_dir $rel_source_dir" |