This is the mail archive of the cygwin mailing list for the Cygwin 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]

command fails: expr "-L/usr/lib/gcc/i686-pc-cygwin/4.3.4" : "-L\(.*\)"


Hi. libtool from "hunspell" package fails with "expr: syntax error"
when compiling. Does anyone know a proper fix?

After writing a wrapper for "expr" which just prints params I've found
that libtool calls:
      expr "-L/usr/lib/gcc/i686-pc-cygwin/4.3.4" : "-L\(.*\)"

This doesnt fail on Linux with coreutils 7.6, but fails on Cygwin with
coreutils 7.0 (latest for now). Is it a bug of coreutils 7.0?

Adding "--" helps, so I wrote a wrapper for "expr" and put in in PATH:
**********************************************************************
    #!/bin/sh
    
    # Adds "--" before 1st unknown parameter starting with "-"
    
    #echo /bin/expr "$@" >&2
    
    known="--help --hel --he --h --version --versio --versi --vers --ver --ve --v"
    known="$known --bignum --bignu --bign --big --bi --b --no-bignum --no-bignu --no-bign --no-big --no-bi --no-b --no- --no --n"
    
    starting=
    
    while [ "$1" ]; do
      case "${1}" in
      -- )
        break
        ;;
      -* )
        found=
        for k in $known; do
         [ "$1" = "$k" ] && { found=y; break; }
        done
        if [ -z "$found" ] ; then
          starting="$starting --"
          break
        fi
        ;;
      * )
        break
        ;;
      esac
      starting="$starting $1"
      shift
    done
    
    #echo /bin/expr $starting "$@" >&2
    /bin/expr $starting "$@"
**********************************************************************



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


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