This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Any idea what this is for? (fixincludes for svr4, _KERNEL)
- From: neroden at twcny dot rr dot com (Nathanael Nerode)
- To: bkorb at veritas dot com, gcc at gcc dot gnu dot org
- Date: Sat, 26 Jul 2003 00:32:51 -0400
- Subject: Any idea what this is for? (fixincludes for svr4, _KERNEL)
The following code is in fixinc.svr4. It wraps entire files with
#if _KERNEL. What I can't figure out is *WHY*. Is this just obsolete
cruft, or is there a known reason for it?
--
Nathanael Nerode <neroden at gcc.gnu.org>
http://home.twcny.rr.com/nerode/neroden/fdl.html
# 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.
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.
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.
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.
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.
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.
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.
file=sys/kdebugger.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