[BACK]Return to cpp.sh CVS log [TXT][DIR] Up to [local] / src / usr.bin / cpp

Diff for /src/usr.bin/cpp/cpp.sh between version 1.8 and 1.9

version 1.8, 2010/05/03 18:34:01 version 1.9, 2013/12/09 02:35:09
Line 1 
Line 1 
 #!/bin/sh  #!/bin/ksh
 #       $OpenBSD$  #       $OpenBSD$
   
 #  #
Line 43 
Line 43 
 TRAD=-traditional  TRAD=-traditional
 DGNUC="@GNUC@"  DGNUC="@GNUC@"
 STDINC="-I/usr/include"  STDINC="-I/usr/include"
 DOLLAR="@dollaropt@"  set -A OPTS
 OPTS=""  set -A INCS -- "-nostdinc"
 INCS="-nostdinc"  
 FOUNDFILES=false  FOUNDFILES=false
   
 CPP=/usr/libexec/cpp  CPP=/usr/libexec/cpp
Line 72 
Line 71 
         -notraditional)          -notraditional)
                 TRAD=                  TRAD=
                 ;;                  ;;
           # options that take an argument and that should be sorted before
           # the $STDINC option
           -I | -imacros | -include | -idirafter | -iprefix | -iwithprefix | \
           -iwithprefixbefore | -isysroot | -imultilib | -isystem | -iquote)
                   INCS[${#INCS[@]}]=$A
                   INCS[${#INCS[@]}]=$1
                   shift
                   ;;
         -I*)          -I*)
                 INCS="$INCS $A"                  INCS[${#INCS[@]}]=$A
                 ;;                  ;;
           # other options that take an argument
           -MF | -MT | -MQ | -x | -D | -U | -o | -A)
                   OPTS[${#OPTS[@]}]=$A
                   OPTS[${#OPTS[@]}]=$1
                   shift
                   ;;
         -U__GNUC__)          -U__GNUC__)
                 DGNUC=                  DGNUC=
                   OPTS[${#OPTS[@]}]=$A
                 ;;                  ;;
         -imacros|-include|-idirafter|-iprefix|-iwithprefix)  
                 INCS="$INCS '$A' '$1'"  
                 shift  
                 ;;  
         -*)          -*)
                 OPTS="$OPTS '$A'"                  OPTS[${#OPTS[@]}]=$A
                 ;;                  ;;
         *)          *)
                 FOUNDFILES=true                  FOUNDFILES=true
                 eval $CPP $TRAD $DGNUC $DOLLAR $INCS $STDINC $OPTS $A || exit $?                  $CPP $TRAD $DGNUC "${INCS[@]}" $STDINC "${OPTS[@]}" "$A" ||
                           exit
                 ;;                  ;;
         esac          esac
 done  done
Line 95 
Line 106 
 if ! $FOUNDFILES  if ! $FOUNDFILES
 then  then
         # read standard input          # read standard input
         eval exec $CPP $TRAD $DGNUC $DOLLAR $INCS $STDINC $OPTS          exec $CPP $TRAD $DGNUC "${INCS[@]}" $STDINC "${OPTS[@]}"
 fi  fi
   
 exit 0  exit 0

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9