This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]