diff options
author | manfred <manfred@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-03-27 00:01:08 +0000 |
---|---|---|
committer | manfred <manfred@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-03-27 00:01:08 +0000 |
commit | 6d4526729a8361917e35cc05bec604cd17070f0c (patch) | |
tree | 105d22c5b0200933d68e743087d6973b0fd7efc1 | |
parent | 2f6cf5f15ad8d390a6dbb2d30be0bdd23f74bdb1 (diff) | |
download | gcc-6d4526729a8361917e35cc05bec604cd17070f0c.tar.gz |
a
* Makefile.in (stmp-fixinc): If we're actually fixing include
files, copy gcc's assert.h into the fixed include dir.
* fixincludes (assert.h): Avoid any attempts to fix a probably
broken system specific assert.h file.
* fixproto (stdlib.h): Make sure, it'll contain a definition of
size_t.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@18852 138bc75d-0d04-0410-961f-82ee72b054a4
-rwxr-xr-x | gcc/fixincludes | 43 | ||||
-rwxr-xr-x | gcc/fixproto | 27 |
2 files changed, 26 insertions, 44 deletions
diff --git a/gcc/fixincludes b/gcc/fixincludes index 22d6c0e26a2..8ed09c040c3 100755 --- a/gcc/fixincludes +++ b/gcc/fixincludes @@ -2371,9 +2371,9 @@ struct exception; fi fi -# assert.h and sys/mman.h on HP/UX are not C++ ready, even though +# sys/mman.h on HP/UX is not C++ ready, even though # NO_IMPLICIT_EXTERN_C is defined on HP/UX. -for file in assert.h sys/mman.h; do +for file in sys/mman.h; do 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 @@ -2407,45 +2407,6 @@ extern "C" { fi done -# 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 2>/dev/null; then - if grep 'include.*stdio.h' ${LIB}/$file >/dev/null 2>/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 2>/dev/null || - grep 'abort *(' ${LIB}/$file >/dev/null 2>/dev/null; then - if grep 'include.*stdlib.h' ${LIB}/$file >/dev/null 2>/dev/null; then - true - else - echo "Fixing $file (needs stdlib.h)" - echo '#ifdef __cplusplus -#include <stdlib.h> -#endif' >>${LIB}/$file - fi - fi - if cmp $file ${LIB}/$file >/dev/null 2>&1; then - rm -f ${LIB}/$file - else - # Find any include directives that use "file". - for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${LIB}/$file | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do - dir=`echo $file | sed -e s'|/[^/]*$||'` - required="$required ${INPUT} $dir/$include ${LIB}/$dir/$include" - done - fi -fi - # Fix return value of sbrk in unistd.h on Alpha OSF/1 V2.0 file=unistd.h if [ -r $file ] && [ ! -r ${LIB}/$file ]; then diff --git a/gcc/fixproto b/gcc/fixproto index b7e85646470..dfeb5964c06 100755 --- a/gcc/fixproto +++ b/gcc/fixproto @@ -120,6 +120,7 @@ required_stdlib_h="abort abs atexit atof atoi atol bsearch calloc exit free gete required_unistd_h="_exit access alarm chdir chown close ctermid cuserid dup dup2 execl execle execlp execv execve execvp fork fpathconf getcwd getegid geteuid getgid getlogin getopt getpgrp getpid getppid getuid isatty link lseek pathconf pause pipe read rmdir setgid setpgid setsid setuid sleep sysconf tcgetpgrp tcsetpgrp ttyname unlink write" done_dirs="" +subdirs_made="" echo "" >fixproto.list for code in ALL STD ; do @@ -174,7 +175,9 @@ for code in ALL STD ; do abs_target_subdir=${abs_target_dir}/${rel_source_subdir} if [ \! -d $abs_target_subdir ] ; then - mkdir $abs_target_subdir + if mkdir $abs_target_subdir ; then + subdirs_made="$abs_target_subdir $subdirs_made" + fi fi # Append "/"; remove initial "./". Hence "." -> "" and "sys" -> "sys/". rel_source_prefix=`echo $rel_source_subdir | sed -e 's|$|/|' -e 's|^./||'` @@ -199,7 +202,9 @@ for code in ALL STD ; do # Create the dir where this file will go when fixed. xxdir=`echo ./$file | sed -e 's|/[^/]*$||'` if [ \! -d $abs_target_subdir/$xxdir ] ; then - mkdir $abs_target_subdir/$xxdir + if mkdir $abs_target_subdir/$xxdir ; then + subdirs_made="$abs_target_subdir/$xxdir $subdirs_made" + fi fi # Just in case we have edited out a symbolic link if [ -f $src_dir_std/$file -a -f $src_dir_std/$xxfile ] ; then @@ -264,10 +269,26 @@ do cat >tmp.h <<EOF #ifndef ${rel_source_ident} #define ${rel_source_ident} -#endif +EOF + if test $rel_source_file = stdlib.h + then + # Make sure it contains a definition of size_t. + cat >>tmp.h <<EOF + +#define __need_size_t +#include <stddef.h> +EOF + fi + cat >>tmp.h <<EOF + +#endif /* ${rel_source_ident} */ EOF ${FIX_HEADER} $rel_source_file tmp.h $abs_target_dir/$rel_source_file ${DEFINES} $include_path rm tmp.h fi done + +# Remove any directories that we made that are still empty. +rmdir $subdirs_made 2>/dev/null + exit 0 |