[pulseaudio-discuss] [PATCH] build-sys: Check for necessary programs in bootstrap.sh

Maarten Bosmans mkbosmans at gmail.com
Thu Jul 28 05:21:15 PDT 2011


2011/7/28 Colin Guthrie <gmane at colin.guthr.ie>:
> 'Twas brillig, and Maarten Bosmans at 27/07/11 13:13 did gyre and gimble:
>> +# Other necessary programs
>> +glib-gettextize --version >/dev/null || DIE=1
>> +intltoolize --version >/dev/null || DIE=1
>> +$LIBTOOLIZE --version >/dev/null || DIE=1
>> +test "$DIE" = 1 && exit 1
>> +
>
> Seems OK, but it would be nicer if we told the user why we died.... e.g.
> due to which missing binary...

Well, previously the script hung because the possibly non-existant
binary (gettextize) was used in a pipe.

I choose this approach with the DIE variable over exiting immediately,
because one can see all missing programs in one failed bootstrap
attempt. (Something similar would be great for the pkg-config
dependencies in configure, it can be frustrating to install/compile
dependencies one-by-one, only to see configure fail at the next
package check. Just continuing configure and listing all missing
dependencies before aborting would be much better, but that approach
is not very common in autotools based packages, as far as I can see)

Only checking once for DIE=1 does indeed loose the ability to report
which program specifically is missing, but as I only redirectid stdout
to /dev/null, the bash command line helpfully outputs to stderror as
follows (in Dutch):

+ pkg-config --version
+ _glib-gettextize --version
./bootstrap.sh: regel 71: _glib-gettextize: opdracht niet gevonden
+ DIE=1
+ intltoolize --version
+ _libtoolize --version
./bootstrap.sh: regel 73: _libtoolize: opdracht niet gevonden
+ DIE=1
+ test 1 = 1
+ exit 1

So I think that is clear enough.

Maarten

> Applied for now anyway.
>
> Col
>
> --
>
> Colin Guthrie
> gmane(at)colin.guthr.ie
> http://colin.guthr.ie/
>
> Day Job:
>  Tribalogic Limited [http://www.tribalogic.net/]
> Open Source:
>  Mageia Contributor [http://www.mageia.org/]
>  PulseAudio Hacker [http://www.pulseaudio.org/]
>  Trac Hacker [http://trac.edgewall.org/]
>
> _______________________________________________
> pulseaudio-discuss mailing list
> pulseaudio-discuss at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
>


More information about the pulseaudio-discuss mailing list