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

Oded Shimon ods15 at ods15.dyndns.org
Thu Jun 30 18:46:45 CEST 2005


On Thu, Jun 30, 2005 at 12:41:56PM -0400, Rich Felker wrote:
> On Thu, Jun 30, 2005 at 07:18:32PM +0300, Oded Shimon wrote:
> > 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.
> > > 
> > > Probably `test` should be less used as it invokes external command (on
> > > another side, i still wonder why I have /usr/bin/[  ;)
> > 
> > 19:07) ods15 at linux15:~ $ which test
> > test: shell built-in command
> > 19:08) ods15 at linux15:~ $ which [
> > [: shell built-in command
> > 19:07) ods15 at linux15:~ $ bash
> > ods15 at linux15:~$ which test
> > /usr/bin/test
> > ods15 at linux15:~$ which [
> > /usr/bin/[
> > 
> > Damn. bash sucks. zsh is better. :P
> 
> Why? bash has these builtin too. It just does not have "which"
> builtin, so `which which` gets run instead. :)
> 
> > No speed improvement, don't bother.
> > Most of ./configure's slowness is the _hundrends_ of gcc invokes. Nice 
> > proof of that is when i use tcc instead of gcc, ./configure takes about 1 
> > second or so, as opposed to 1 minute.
> > 
> > ok, maybe i exaggurated.
> > 
> > 
> > ./configure  8.23s user 2.52s system 63% cpu 16.932 total
> > ./configure --cc=tcc --disable-gcc-checking  1.79s user 1.38s system 97% cpu 3.265 total
> 
> Hahahaha! How long til mplayer support building with tcc? I'm hating
> gcc more and more by the minute...

I did mention I got it to actually compile once. The big pain were all the 
vlc's (i also found that way some horrible non-standard code in MPlayer, 
int a[x][y]; ...). But you do have to give credit to gcc - at the end of it 
all, the tcc MPlayer couldn't play MPEG-4 right (there were weird green 
blocks everywhere..), and it was about 4 times slower than the gcc one.
Oh, I also needed to disable ALL x86 asm for it to work, but that wasn't 
the major cause of the slow down believe it or not. a gcc MPlayer with all 
x86 disabled was still 2-3 times faster. Hey, maybe it's possible the bad 
decoding didn't work right caused a major slow down, who knows. :)

BTW, _ALL_ of MPlayer compiled in about 10 seconds. My sucky vesafb tty was 
slowing down the make output...

- ods15




More information about the MPlayer-dev-eng mailing list