    modename="$modename: compile"
    # Get the compilation command and the source file.
    base_compile=
    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
    suppress_output=
    arg_mode=normal
    libobj=

    for arg
    do
      case "$arg_mode" in
      arg  )
        lastarg="$arg"  # do not "continue".  Instead, add this to base_compile
        arg_mode=normal
	;;

      target )
	libobj="$arg"
        arg_mode=normal
	continue
        ;;

      normal )
        # Accept any command-line options.
        case $arg in
        -o)
          if test -n "$libobj" ; then
            $echo "$modename: you cannot specify \`-o' more than once" 1>&2
            exit 1
          fi
          arg_mode=target
          continue
          ;;

        -static)
          build_old_libs=yes
          continue
          ;;

        -prefer-pic)
          pic_mode=yes
          continue
          ;;

        -prefer-non-pic)
          pic_mode=no
          continue
          ;;

        -Xcompiler)
          arg_mode=arg  #  the next one goes into the "base_compile" arg list
          continue      #  The current "srcfile" will be either retained or
          ;;            #  replaced later.  I would guess that would be a bug.

        -Wc,*)
          args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
          lastarg=
          save_ifs="$IFS"; IFS=','
          for arg in $args; do
            IFS="$save_ifs"

            # Double-quote args containing other shell metacharacters.
            # Many Bourne shells cannot handle close brackets correctly
            # in scan sets, so we specify it separately.
            case $arg in
              *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*|"")
              arg="\"$arg\""
              ;;
            esac
            lastarg="$lastarg $arg"
          done
          IFS="$save_ifs"
          lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`

          # Add the arguments to base_compile.
          base_compile="$base_compile $lastarg"
          continue
          ;;

        * )
          # Accept the current argument as the source file.
          # The previous "srcfile" becomes the current argument.
          #
          lastarg="$srcfile"
          srcfile="$arg"
          ;;
        esac  #  case $arg
        ;;
      esac    #  case $arg_mode

      # Aesthetically quote the previous argument.
      lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`

      case $lastarg in
      # Double-quote args containing other shell metacharacters.
      # Many Bourne shells cannot handle close brackets correctly
      # in scan sets, so we specify it separately.
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*|"")
        lastarg="\"$lastarg\""
        ;;
      esac

      base_compile="$base_compile $lastarg"
    done

# 
# Local Variables:
# mode:shell-script
# sh-indentation:2
# tab-width:8
# End:
