bug-libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: libtool 2.4 args parsing incredibly slow


From: Ingo Krabbe
Subject: Re: libtool 2.4 args parsing incredibly slow
Date: Thu, 27 Jan 2011 08:52:51 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Thu, Jan 27, 2011 at 07:56:26AM +0100, Ralf Wildenhues wrote:
> 
> This can be just
>   case " $* " in
>   *\ --lt*)
> 
> >    for lt_wr_arg
> >    do
> >      case \$lt_wr_arg in
> > @@ -3202,7 +3204,8 @@ func_exec_program ()
> >      *) set x \"address@hidden" \"\$lt_wr_arg\"; shift;;
> >      esac
> >      shift
> > -  done
> > +  done ;;
> > +  esac
> >    func_exec_program_core \${1+\"address@hidden"}
> >  }
> > 
> I like this as a first measure.  But can we also reconsider detecting
> --lt-* flags only *early* in the command line?  Hmm, since we don't know
> which native options accept arguments, that's always painful when
> someone wants to be able to do TOOL='./tool --opt1 arg --opt2' and
> somebody else appends TOOLFLAGS=--lt-foo, but maybe we can let at least
> '--' delimit our search?
> 

Whats about the quite simple solution using sed?  Actually the sed call
should be faster for many arguments and is reasonable fast for short
command lines.

func_exec_program ()
{
  func_exec_program_core $(printf "\"%s\" " "$@" | sed \
      -e 's/"--lt-[^"]*"[ \t]*//g' \
      -e 's/^"\([^"]*\)"/\1/g' \
      -e 's/[ \t]*"\([^"]*\)"/ \1/g'
      )
}



reply via email to

[Prev in Thread] Current Thread [Next in Thread]