[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 Fri, Jan 11, 2013 at 10:01:45AM -0700, Eric Blake wrote:
> 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.

As structured today we're obviously checking for all libraries separately
from hypervisors. My intent long term though is that we introduce macros
for the hypervisors which conditionally require the libraries. This is
sort of inspired by the way gnulib does dependancies between its various
m4 modules.

Amd of course  --with-qemu shoudl default to check, so you'd get something
like this printed

 Checking if QEMU can be enabled....no. missing yajl, gnutls, sasl

|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

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