[MPlayer-dev-eng] [PATCH] clean up tests in configure

Rich Felker dalias at aerifal.cx
Thu Jun 30 18:44:13 CEST 2005


On Thu, Jun 30, 2005 at 02:45:44PM +0300, Ivan Kalvachev wrote:
> On 6/30/05, Diego Biurrun <diego at biurrun.de> wrote:
> > On Fri, Jun 10, 2005 at 12:28:22AM -0700, Corey Hickey wrote:
> > > I recently came upon this:
> > >
> > > [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major"
> > > = 3 ] && [ "$_cc_minor" -ge 4 ]))
> > >
> > > ...over which I prefer:
> > >
> > > test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq
> > > 3 -a "$_cc_minor" -ge 4
> > >
> > > ...but I foolishly decided to make a more substantial patch than a
> > > one-line change. I found 44 tests in configure that I could clean up
> > > slightly.
> > 
> > I'm tempted to apply this, object quickly or live with the consequences
> > ;)
> > 
> > Diego
> > 
> 
> Well, as somebody else should have said this new syntax may be faster,
> consuming less memory but it is more hackinsh and hard to understand
> and modify (easier to make mistakes).
> 
> 
> How about using [[ ]] and (( )). AFAI can read `man bash` they do not
> invoke subshell and are as readable as ().
> We must check how portable this is.

WTF? These sound like nonsense bash extensions. There's already {}..

> Probably `test` should be less used as it invokes external command (on
> another side, i still wonder why I have /usr/bin/[  ;)

Neither invoked external command.

> But if we should choose to have faster configure and to have easy to
> read&modify configure I choose the second.

I choose the former. :) It's already too damn slow like autosh*t...

Rich




More information about the MPlayer-dev-eng mailing list