fixinc.svr4: Remove dead code.

* fixinc/fixinc.svr4: Remove dead code.  Remove now-unnecessary
	cleanup of junk after #else and #endif directives.  Collapse repeated
	clauses into for statment.

	* fixinc/fixincl.sh: GNU C -> GCC.  Add usage comment.

From-SVN: r69870
This commit is contained in:
Nathanael Nerode 2003-07-28 02:15:25 +00:00
parent a9f31c7e72
commit 447673ded1
3 changed files with 15 additions and 273 deletions

View File

@ -1,3 +1,11 @@
2003-07-27 Nathanael Nerode <neroden@gcc.gnu.org>
* fixinc/fixinc.svr4: Remove dead code. Remove now-unnecessary
cleanup of junk after #else and #endif directives. Collapse repeated
clauses into for statment.
* fixinc/fixincl.sh: GNU C -> GCC. Add usage comment.
2003-07-27 Zack Weinberg <zack@codesourcery.com> 2003-07-27 Zack Weinberg <zack@codesourcery.com>
* c-decl.c (struct c_scope): Remove keep_if_subblocks field. * c-decl.c (struct c_scope): Remove keep_if_subblocks field.

View File

@ -167,28 +167,9 @@ while [ $# != 0 ]; do
chmod +w $2/$file chmod +w $2/$file
chmod a+r $2/$file chmod a+r $2/$file
# The following have been removed from the sed command below
# because it is more useful to leave these things in.
# The only reason to remove them was for -pedantic,
# which isn't much of a reason. -- rms.
# /^[ ]*#[ ]*ident/d
# This code makes Solaris SCSI fail, because it changes the
# alignment within some critical structures. See <sys/scsi/impl/commands.h>.
# s/u_char\([ ][ ]*[a-zA-Z0-9_][a-zA-Z0-9_]*[ ]*:[ ]*[0-9][0-9]*\)/u_int\1/
# Disable these also, since they probably aren't safe either.
# s/u_short\([ ][ ]*[a-zA-Z0-9_][a-zA-Z0-9_]*[ ]*:[ ]*[0-9][0-9]*\)/u_int\1/
# s/ushort\([ ][ ]*[a-zA-Z0-9_][a-zA-Z0-9_]*[ ]*:[ ]*[0-9][0-9]*\)/u_int\1/
# s/evcm_t\([ ][ ]*[a-zA-Z0-9_][a-zA-Z0-9_]*[ ]*:[ ]*[0-9][0-9]*\)/u_int\1/
# s/Pbyte\([ ][ ]*[a-zA-Z0-9_][a-zA-Z0-9_]*[ ]*:[ ]*SEQSIZ\)/unsigned int\1/
# The change of u_char, etc, to u_int # The change of u_char, etc, to u_int
# applies to bit fields. # applies to bit fields.
sed -e ' sed -e '
s%^\([ ]*#[ ]*else\)[ ]*/[^*].*%\1%
s%^\([ ]*#[ ]*else\)[ ]*[^/ ].*%\1%
s%^\([ ]*#[ ]*endif\)[ ]*/[^*].*%\1%
s%^\([ ]*#[ ]*endif\)[ ]*[^/ ].*%\1%
s/#lint(on)/defined(lint)/g s/#lint(on)/defined(lint)/g
s/#lint(off)/!defined(lint)/g s/#lint(off)/!defined(lint)/g
s/#machine(\([^)]*\))/defined(__\1__)/g s/#machine(\([^)]*\))/defined(__\1__)/g
@ -801,211 +782,17 @@ if [ \! -z "$file_to_fix" ]; then
fi fi
# Conditionalize all of <fs/rfs/rf_cache.h> on _KERNEL being defined. # Conditionalize all of <fs/rfs/rf_cache.h> on _KERNEL being defined.
file=fs/rfs/rf_cache.h
base=`basename $file`.$$
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
if [ -r ${INPUT}/$file ]; then
file_to_fix=${INPUT}/$file
else
file_to_fix=""
fi
fi
if [ \! -z "$file_to_fix" ]; then
echo Checking $file_to_fix
if grep _KERNEL $file_to_fix > /dev/null; then
true
else
echo '#ifdef _KERNEL' > /tmp/$base
cat $file_to_fix >> /tmp/$base
echo '#endif /* defined(_KERNEL) */' >> /tmp/$base
echo Fixed $file_to_fix
rm -f ${LIB}/$file
cp /tmp/$base ${LIB}/$file
chmod a+r ${LIB}/$file
rm -f /tmp/$base
fi
fi
# Conditionalize all of <sys/erec.h> on _KERNEL being defined. # Conditionalize all of <sys/erec.h> on _KERNEL being defined.
file=sys/erec.h
base=`basename $file`.$$
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
if [ -r ${INPUT}/$file ]; then
file_to_fix=${INPUT}/$file
else
file_to_fix=""
fi
fi
if [ \! -z "$file_to_fix" ]; then
echo Checking $file_to_fix
if grep _KERNEL $file_to_fix > /dev/null; then
true
else
echo '#ifdef _KERNEL' > /tmp/$base
cat $file_to_fix >> /tmp/$base
echo '#endif /* defined(_KERNEL) */' >> /tmp/$base
echo Fixed $file_to_fix
rm -f ${LIB}/$file
cp /tmp/$base ${LIB}/$file
chmod a+r ${LIB}/$file
rm -f /tmp/$base
fi
fi
# Conditionalize all of <sys/err.h> on _KERNEL being defined. # Conditionalize all of <sys/err.h> on _KERNEL being defined.
file=sys/err.h
base=`basename $file`.$$
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
if [ -r ${INPUT}/$file ]; then
file_to_fix=${INPUT}/$file
else
file_to_fix=""
fi
fi
if [ \! -z "$file_to_fix" ]; then
echo Checking $file_to_fix
if grep _KERNEL $file_to_fix > /dev/null; then
true
else
echo '#ifdef _KERNEL' > /tmp/$base
cat $file_to_fix >> /tmp/$base
echo '#endif /* defined(_KERNEL) */' >> /tmp/$base
echo Fixed $file_to_fix
rm -f ${LIB}/$file
cp /tmp/$base ${LIB}/$file
chmod a+r ${LIB}/$file
rm -f /tmp/$base
fi
fi
# Conditionalize all of <sys/char.h> on _KERNEL being defined. # Conditionalize all of <sys/char.h> on _KERNEL being defined.
file=sys/char.h
base=`basename $file`.$$
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
if [ -r ${INPUT}/$file ]; then
file_to_fix=${INPUT}/$file
else
file_to_fix=""
fi
fi
if [ \! -z "$file_to_fix" ]; then
echo Checking $file_to_fix
if grep _KERNEL $file_to_fix > /dev/null; then
true
else
echo '#ifdef _KERNEL' > /tmp/$base
cat $file_to_fix >> /tmp/$base
echo '#endif /* defined(_KERNEL) */' >> /tmp/$base
echo Fixed $file_to_fix
rm -f ${LIB}/$file
cp /tmp/$base ${LIB}/$file
chmod a+r ${LIB}/$file
rm -f /tmp/$base
fi
fi
# Conditionalize all of <sys/getpages.h> on _KERNEL being defined. # Conditionalize all of <sys/getpages.h> on _KERNEL being defined.
file=sys/getpages.h
base=`basename $file`.$$
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
if [ -r ${INPUT}/$file ]; then
file_to_fix=${INPUT}/$file
else
file_to_fix=""
fi
fi
if [ \! -z "$file_to_fix" ]; then
echo Checking $file_to_fix
if grep _KERNEL $file_to_fix > /dev/null; then
true
else
echo '#ifdef _KERNEL' > /tmp/$base
cat $file_to_fix >> /tmp/$base
echo '#endif /* defined(_KERNEL) */' >> /tmp/$base
echo Fixed $file_to_fix
rm -f ${LIB}/$file
cp /tmp/$base ${LIB}/$file
chmod a+r ${LIB}/$file
rm -f /tmp/$base
fi
fi
# Conditionalize all of <sys/map.h> on _KERNEL being defined. # Conditionalize all of <sys/map.h> on _KERNEL being defined.
file=sys/map.h
base=`basename $file`.$$
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
if [ -r ${INPUT}/$file ]; then
file_to_fix=${INPUT}/$file
else
file_to_fix=""
fi
fi
if [ \! -z "$file_to_fix" ]; then
echo Checking $file_to_fix
if grep _KERNEL $file_to_fix > /dev/null; then
true
else
echo '#ifdef _KERNEL' > /tmp/$base
cat $file_to_fix >> /tmp/$base
echo '#endif /* defined(_KERNEL) */' >> /tmp/$base
echo Fixed $file_to_fix
rm -f ${LIB}/$file
cp /tmp/$base ${LIB}/$file
chmod a+r ${LIB}/$file
rm -f /tmp/$base
fi
fi
# Conditionalize all of <sys/cmn_err.h> on _KERNEL being defined. # Conditionalize all of <sys/cmn_err.h> on _KERNEL being defined.
file=sys/cmn_err.h
base=`basename $file`.$$
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
if [ -r ${INPUT}/$file ]; then
file_to_fix=${INPUT}/$file
else
file_to_fix=""
fi
fi
if [ \! -z "$file_to_fix" ]; then
echo Checking $file_to_fix
if grep _KERNEL $file_to_fix > /dev/null; then
true
else
echo '#ifdef _KERNEL' > /tmp/$base
cat $file_to_fix >> /tmp/$base
echo '#endif /* defined(_KERNEL) */' >> /tmp/$base
echo Fixed $file_to_fix
rm -f ${LIB}/$file
cp /tmp/$base ${LIB}/$file
chmod a+r ${LIB}/$file
rm -f /tmp/$base
fi
fi
# Conditionalize all of <sys/kdebugger.h> on _KERNEL being defined. # Conditionalize all of <sys/kdebugger.h> on _KERNEL being defined.
file=sys/kdebugger.h for file in fs/rfs/rf_cache.h sys/erec.h sys/err.h sys/char.h \
sys/getpages.h sys/map.h sys/cmn_err.h sys/kdebugger.h ; do
base=`basename $file`.$$ base=`basename $file`.$$
if [ -r ${LIB}/$file ]; then if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file file_to_fix=${LIB}/$file
@ -1032,36 +819,7 @@ if [ \! -z "$file_to_fix" ]; then
fi fi
fi fi
# Conditionalize some of <netinet/in.h> on _KERNEL being defined. done
# This has been taken out because it breaks on some versions of
# DYNIX/ptx, and it does not seem to do much good on any system.
# file=netinet/in.h
# base=`basename $file`.$$
# if [ -r ${LIB}/$file ]; then
# file_to_fix=${LIB}/$file
# else
# if [ -r ${INPUT}/$file ]; then
# file_to_fix=${INPUT}/$file
# else
# file_to_fix=""
# fi
# fi
# if [ \! -z "$file_to_fix" ]; then
# echo Checking $file_to_fix
# if grep _KERNEL $file_to_fix > /dev/null; then
# true
# else
# sed -e '/#ifdef INKERNEL/i\
# #ifdef _KERNEL
# ' \
# -e '/#endif[ ]*\/\* INKERNEL \*\//a\
# #endif /* _KERNEL */
# ' \
# $file_to_fix > ${LIB}/${file}.sed
# rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
# echo Fixed $file_to_fix
# fi
# fi
# Conditionalize some of <sys/endian.h> on __GNUC__ and __GNUG__. # Conditionalize some of <sys/endian.h> on __GNUC__ and __GNUG__.
@ -1094,32 +852,6 @@ if [ \! -z "$file_to_fix" ]; then
fi fi
fi fi
# Commented out because tmcconne@sedona.intel.com says we don't clearly need it
# and the text in types.h is not erroneous.
## In sys/types.h, don't name the enum for booleans.
#
#file=sys/types.h
#base=`basename $file`.$$
#if [ -r ${LIB}/$file ]; then
# file_to_fix=${LIB}/$file
#else
# if [ -r ${INPUT}/$file ]; then
# file_to_fix=${INPUT}/$file
# else
# file_to_fix=""
# fi
#fi
#if [ \! -z "$file_to_fix" ]; then
# echo Checking $file_to_fix
# if grep "enum boolean" $file_to_fix > /dev/null; then
# sed -e 's/enum boolean/enum/' ${LIB}/$file > ${LIB}/${file}.sed
# rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
# echo Fixed $file_to_fix
# else
# true
# fi
#fi
# Remove useless extern keyword from struct forward declarations in # Remove useless extern keyword from struct forward declarations in
# <sys/stream.h> and <sys/strsubr.h> # <sys/stream.h> and <sys/strsubr.h>

View File

@ -2,7 +2,7 @@
# #
# Install modified versions of certain ANSI-incompatible system header # Install modified versions of certain ANSI-incompatible system header
# files which are fixed to work correctly with ANSI C and placed in a # files which are fixed to work correctly with ANSI C and placed in a
# directory that GNU C will search. # directory that GCC will search.
# #
# See README-fixinc for more information. # See README-fixinc for more information.
# #
@ -27,6 +27,8 @@
# Boston, MA 02111-1307, USA. # Boston, MA 02111-1307, USA.
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Usage: fixincl.sh output-dir input-dir
# #
# Directory in which to store the results. # Directory in which to store the results.
# Fail if no arg to specify a directory for the output. # Fail if no arg to specify a directory for the output.