⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fixincludes

📁 gcc库的原代码,对编程有很大帮助.
💻
📖 第 1 页 / 共 5 页
字号:
  sed -e '/\(.*template\)/s/template//' \      -e '/extern.*volatile.*void.*abort/s/volatile//' ${LIB}/$file > ${LIB}/${file}.sed  rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file  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  fifi# NeXT 3.2 includes the keyword volatile in the abort() and # exit() function prototypes. That conflicts with the # built-in functions.file=ansi/stdlib.hif [ -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/nullfiif [ -r ${LIB}/$file ]; then  echo Fixing $file  sed -e '/extern.*volatile.*void.*exit/s/volatile//' \      -e '/extern.*volatile.*void.*abort/s/volatile//' ${LIB}/$file > ${LIB}/${file}.sed  rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file  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  fifi# NeXT 2.0 defines 'int wait(union wait*)', which conflicts with Posix.1.# Note that version 3 of the NeXT system has wait.h in a different directory,# so that this code won't do anything.  But wait.h in version 3 has a# conditional, so it doesn't need this fix.  So everything is okay.file=sys/wait.hif [ -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/nullfiif [ -r ${LIB}/$file ] \  && grep 'wait[(]union wait' ${LIB}/$file >/dev/null; then  echo Fixing $file, bad wait formal  sed -e 's@wait(union wait@wait(void@' ${LIB}/$file > ${LIB}/${file}.sed  rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file  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  fifi# Don't use or define the name va_list in stdio.h.# This is for ANSI and also to interoperate properly with gcc's varargs.h.file=stdio.hif [ -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/nullfiif [ -r ${LIB}/$file ]; then  echo Fixing $file, use of va_list  # Arrange for stdio.h to use stdarg.h to define __gnuc_va_list  if egrep "__need___va_list" ${LIB}/$file >/dev/null 2>&1; then    touch ${LIB}/${file}.sed  else    (echo "#define __need___va_list"     echo "#include <stdarg.h>") > ${LIB}/${file}.sed  fi  # Use __gnuc_va_list in arg types in place of va_list.  # On 386BSD use __gnuc_va_list instead of _VA_LIST_. We're hoping the  # trailing parentheses and semicolon save all other systems from this.  # Define __va_list__ (something harmless and unused) instead of va_list.  # Don't claim to have defined va_list.  sed -e 's@ va_list @ __gnuc_va_list @' \      -e 's@ va_list)@ __gnuc_va_list)@' \      -e 's@ _BSD_VA_LIST_));@ __gnuc_va_list));@' \      -e 's@ _VA_LIST_));@ __gnuc_va_list));@' \      -e 's@ va_list@ __va_list__@' \      -e 's@\*va_list@*__va_list__@' \      -e 's@ __va_list)@ __gnuc_va_list)@' \      -e 's@GNUC_VA_LIST@GNUC_Va_LIST@' \      -e 's@_NEED___VA_LIST@_NEED___Va_LIST@' \      -e 's@VA_LIST@DUMMY_VA_LIST@' \      -e 's@_Va_LIST@_VA_LIST@' \    ${LIB}/$file >> ${LIB}/${file}.sed    rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file  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  fifi# Cancel out ansi_compat.h on Ultrix.  Replace it with empty file.file=ansi_compat.hif [ -r $file ] && [ ! -r ${LIB}/$file ]; then  if grep -s ULTRIX $file; then    echo "/* This file intentionally left blank.  */" > $LIB/$file  fifi# parameter to atof not const on DECstation Ultrix V4.0 and NEWS-OS 4.2R.# also get rid of bogus inline definitions in HP-UX 8.0file=math.hif [ -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/nullfiif [ -r ${LIB}/$file ]; then  echo Fixing $file, non-const arg  sed -e 's@atof(\([ 	]*char[ 	]*\*[^)]*\))@atof(const \1)@' \      -e 's@inline int abs(int [a-z][a-z]*) {.*}@extern "C" int abs(int);@' \      -e 's@inline double abs(double [a-z][a-z]*) {.*}@@' \      -e 's@inline int sqr(int [a-z][a-z]*) {.*}@@' \      -e 's@inline double sqr(double [a-z][a-z]*) {.*}@@' \    ${LIB}/$file > ${LIB}/${file}.sed  rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file  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  fifi# fix bogus recursive stdlib.h in NEWS-OS 4.0Cfile=stdlib.hif [ -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/nullfiif [ -r ${LIB}/$file ]; then  echo Fixing $file, recursive inclusion  sed -e '/^#include <stdlib.h>/i\#if 0' \      -e '/^#include <stdlib.h>/a\#endif' \    ${LIB}/$file > ${LIB}/${file}.sed  rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file  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  fifi# Avoid nested comments on Ultrix 4.3.file=rpc/svc.hif [ -r $file ] && [ ! -r ${LIB}/$file ]; then  mkdir ${LIB}/rpc 2>/dev/null  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/nullfiif [ -r ${LIB}/$file ]; then  echo Fixing $file, nested comment  sed -e 's@^\( \*	int protocol;  \)/\*@\1*/ /*@' \    ${LIB}/$file > ${LIB}/$file.sed  rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file  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  fifi# This file in RISC/os uses /**/ to concatenate two tokens.file=bsd43/bsd43_.hif [ -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/nullfiif [ -r ${LIB}/$file ]; then  sed -e 's|/\*\*/|##|' ${LIB}/$file > ${LIB}/${file}.sed  rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file  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  fififile=rpc/rpc.hif [ -r $file ] && [ ! -r ${LIB}/$file ]; then  mkdir ${LIB}/rpc 2>/dev/null  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/nullfiif [ -r ${LIB}/$file ]; then  echo Fixing $file, nested comment  sed -e 's@^\(/\*.*rpc/auth_des.h>.*\)/\*@\1*/ /*@' \    ${LIB}/$file > ${LIB}/$file.sed  rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file  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  fifi# In limits.h, put #ifndefs around things that are supposed to be defined# in float.h to avoid redefinition errors if float.h is included first.# On HP/UX this patch does not work, because on HP/UX limits.h uses# multi line comments and the inserted #endif winds up inside the# comment.  Fortunately, HP/UX already uses #ifndefs in limits.h; if# we find a #ifndef FLT_MIN we assume that all the required #ifndefs# are there, and we do not add them ourselves.for file in limits.h sys/limits.h; do  if [ -r $file ] && [ ! -r ${LIB}/$file ]; then    mkdir ${LIB}/sys 2>/dev/null    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 egrep 'ifndef[ 	]+FLT_MIN' ${LIB}/$file >/dev/null; then      true    else      echo Fixing $file      sed -e '/[ 	]FLT_MIN[ 	]/i\#ifndef FLT_MIN'\	  -e '/[ 	]FLT_MIN[ 	]/a\#endif'\	  -e '/[ 	]FLT_MAX[ 	]/i\#ifndef FLT_MAX'\	  -e '/[ 	]FLT_MAX[ 	]/a\#endif'\	  -e '/[ 	]FLT_DIG[ 	]/i\#ifndef FLT_DIG'\	  -e '/[ 	]FLT_DIG[ 	]/a\#endif'\	  -e '/[ 	]DBL_MIN[ 	]/i\#ifndef DBL_MIN'\	  -e '/[ 	]DBL_MIN[ 	]/a\#endif'\	  -e '/[ 	]DBL_MAX[ 	]/i\#ifndef DBL_MAX'\	  -e '/[ 	]DBL_MAX[ 	]/a\#endif'\	  -e '/[ 	]DBL_DIG[ 	]/i\#ifndef DBL_DIG'\	  -e '/[ 	]DBL_DIG[ 	]/a\#endif'\	${LIB}/$file > ${LIB}/${file}.sed      rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file    fi    if cmp $file ${LIB}/$file >/dev/null 2>&1; then      echo Deleting ${LIB}/$file\; no fixes were needed.      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  fidone# In math.h, put #ifndefs around things that might be defined in a gcc# specific math-*.h file.file=math.hif [ -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/nullfiif [ -r ${LIB}/$file ]; then  echo Fixing $file  sed -e '/define[ 	]HUGE_VAL[ 	]/i\#ifndef HUGE_VAL'\      -e '/define[ 	]HUGE_VAL[ 	]/a\#endif'\    ${LIB}/$file > ${LIB}/${file}.sed  rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file  # In addition, copy the definition of DBL_MAX from float.h  # if math.h requires one.  The Lynx math.h requires it.  if egrep '#define[ 	]*HUGE_VAL[ 	]+DBL_MAX' $file >/dev/null 2>&1; then    if egrep '#define[ 	]+DBL_MAX[ 	]+' $file >/dev/null 2>&1; then      true;    else      dbl_max_def=`egrep 'define[ 	]+DBL_MAX[ 	]+.*' float.h 2>/dev/null`      if [ "$dbl_max_def" != "" ]; then        dbl_max_def=`echo $dbl_max_def | sed 's/.*define[ 	]*DBL_MAX[ 	]*//'`        sed -e "/define[ 	]HUGE_VAL[ 	]DBL_MAX/s/DBL_MAX/$dbl_max_def/" \          ${LIB}/$file > ${LIB}/${file}.sed	rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file      fi    fi  fi  if cmp $file ${LIB}/$file >/dev/null 2>&1; then    echo Deleting ${LIB}/$file\; no fixes were needed.    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  fifi# Remove erroneous parentheses in sym.h on Alpha OSF/1.file=sym.hif [ -r $file 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -