Print this page
cw: give cw(1onbld) a new interface allowing for multiple arbitrary shadows

Split Close
Expand all
Collapse all
          --- old/usr/src/tools/ndrgen/ndrgen.sh
          +++ new/usr/src/tools/ndrgen/ndrgen.sh
↓ open down ↓ 69 lines elided ↑ open up ↑
  70   70  done
  71   71  
  72   72  if [[ $CC_FLAG = "y" ]] ; then
  73   73          shift $(($OPTIND - 1))
  74   74  
  75   75          if [[ $# -lt 1 ]] ; then
  76   76                  ndrgen_usage "C pre-processor path is missing"
  77   77          else
  78   78                  CC=$1
  79   79                  shift $(($OPTIND - 1))
  80      -
  81      -                # Check for cw being invoked with -_cc or -_gcc
  82      -                if [[ $1 = "-_cc" || $1 = "-_gcc" ]] ; then
  83      -                        CC_ARG=$1
  84      -                        shift $(($OPTIND - 1))
  85      -                fi
  86   80          fi
  87   81  fi
  88   82  
  89   83  if [[ $CC = "" ]] ; then
  90   84          ndrgen_usage "C pre-processor is not defined"
  91   85  fi
  92   86  
  93      -if [ ! -f $CC ] || [ ! -x $CC ] ; then
       87 +# Remove the non-cw options
       88 +CC=${CC%% -- *}
       89 +
       90 +if [ ! -f ${CC%% *} ] || [ ! -x ${CC%% *} ] ; then
  94   91          ndrgen_usage "cannot run $CC"
  95   92  fi
  96   93  
  97   94  for i
  98   95  do
  99   96          if [[ ! -r $i ]] ; then
 100   97                  print "$PROGNAME: ERROR: cannot read $i"
 101   98                  exit 1
 102   99          fi
 103  100  
 104  101          BASENAME=`basename $i .ndl`
 105  102          TMP_NAME=$BASENAME.ndl.c
 106  103  
 107  104          cp $i $TMP_NAME
 108  105  
 109      -        if $CC $CC_ARG -E  -D__a64 -D__EXTENSIONS__ -D_FILE_OFFSET_BITS=64 \
      106 +        if $CC  -E  -D__a64 -D__EXTENSIONS__ -D_FILE_OFFSET_BITS=64 \
 110  107                  -I. -I${INCDIR} -I${INCDIR}/ndl -DNDRGEN $TMP_NAME | \
 111  108                  $NDRPROG > $BASENAME.raw
 112  109          then
 113  110                  touch ${BASENAME}_ndr.c
 114  111                  ndrgen_copy_header $i ${BASENAME}_ndr.c
 115  112  
 116  113                  cat - << EOF >> ${BASENAME}_ndr.c
 117  114  /*
 118  115   * Please do not edit this file.
 119  116   * It was generated using ndrgen.
↓ open down ↓ 17 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX