[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH 1/9] Add some autoconf helper macros for checking for libraries

On 01/11/2013 03:37 AM, Daniel P. Berrange wrote:
> On Thu, Jan 10, 2013 at 03:20:27PM -0700, Eric Blake wrote:
>> On 01/10/2013 01:18 PM, Daniel P. Berrange wrote:
>>> +
>>> +  if test $fail = 1; then
>>> +    AC_MSG_ERROR([You must install the lib]library_name[ library & headers to compile libvirt])
>> It would be really nice if you could run './configure' once and know
>> _all_ of the libraries to be installed, rather than having to run once
>> per library because each missing library aborts the script immediately.
>>  I can probably do that as a followup patch, where instead of directly
>> issuing the error, we instead append the latest error string to a series
>> of messages, then use a single m4_wrap to do AC_MSG_ERROR at the end of
>> all collected messages.  But that doesn't impact this patch.
> Hmm, I guess my vision is that in typical usage all the library/pkg
> tests will always default to 'check', so we'll test them all and report
> success/failure at the end. If you're actually using --with-sasl=yes,
> then I'm assuming you've looked at the configure script and decided
> what you need upfront.

But in reality, there are several instances where asking for one feature
implies that a particular library becomes mandatory.  For example, even
if you don't specify --with-yajl at all, merely compiling './configure
--with-qemu' on a system with qemu 1.x will behave as if you had done
--with-yajl=yes instead of --with-yajl=check.

Hmm, another thought - when do we decide which features need which
libraries?  One style is to probe for all libraries first, and then run
through features, failing the features that are lacking a dependent
library.  This would still benefit from the idea of listing all errors
at once, instead of one error per run.  However, if you disable features
(such as --without-libvirtd), checking for those libraries could be a
waste of configure time.

Another style would be to default all libraries to 'no', then run
through all features, and each feature changes the libraries it depends
on to either 'check' (if the dependency is optional) or 'yes' (if
mandatory), then do the library checks (hitting just the libraries that
are needed), and finally back to the feature checks to see the results
of the libraries.

But all of this is grounds for further improvement, and doesn't really
impact the usefulness of your current series.

Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]