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

Ivan Kalvachev ikalvachev at gmail.com
Thu Jun 30 13:45:44 CEST 2005


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.

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

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

Ivan Kalvachev
  iive




More information about the MPlayer-dev-eng mailing list