[MPlayer-dev-eng] [PATCH] clean up tests in configure
Rich Felker
dalias at aerifal.cx
Thu Jun 30 18:41:56 CEST 2005
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...
Rich
More information about the MPlayer-dev-eng
mailing list