aboutsummaryrefslogtreecommitdiff
path: root/gcc/fixproto
diff options
context:
space:
mode:
authorManfred Hollstein <manfred@gcc.gnu.org>1998-03-27 00:01:08 +0000
committerManfred Hollstein <manfred@gcc.gnu.org>1998-03-27 00:01:08 +0000
commit7a790837802bf1c9dffa1b4e9aa50b2ca9262032 (patch)
tree105d22c5b0200933d68e743087d6973b0fd7efc1 /gcc/fixproto
parent1ab0e56783d64b4dafbe32e76a2a971a6850cff4 (diff)
downloadgcc-7a790837802bf1c9dffa1b4e9aa50b2ca9262032.zip
gcc-7a790837802bf1c9dffa1b4e9aa50b2ca9262032.tar.gz
gcc-7a790837802bf1c9dffa1b4e9aa50b2ca9262032.tar.bz2
Makefile.in (stmp-fixinc): If we're actually fixing include files...
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. From-SVN: r18852
Diffstat (limited to 'gcc/fixproto')
-rwxr-xr-xgcc/fixproto27
1 files changed, 24 insertions, 3 deletions
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 <<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