From 6d4526729a8361917e35cc05bec604cd17070f0c Mon Sep 17 00:00:00 2001 From: manfred Date: Fri, 27 Mar 1998 00:01:08 +0000 Subject: [PATCH] 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 --- gcc/fixincludes | 43 ++----------------------------------------- gcc/fixproto | 27 ++++++++++++++++++++++++--- 2 files changed, 26 insertions(+), 44 deletions(-) diff --git a/gcc/fixincludes b/gcc/fixincludes index 22d6c0e..8ed09c0 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 ' >>${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 -#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 b7e8564..dfeb596 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 <>tmp.h < +EOF + fi + cat >>tmp.h </dev/null + exit 0 -- 2.7.4