[libvirt] [PATCH 3/3] m4: Check for rl_completion_quote_character

Andrea Bolognani abologna at redhat.com
Tue Jan 16 10:13:19 UTC 2018

On Mon, 2018-01-15 at 18:51 +0100, Michal Privoznik wrote:
> > At least FreeBSD ships it, though:
> > 
> >   # pkg list readline | grep pc$
> >   /usr/local/libdata/pkgconfig/readline.pc
> is this GNU readline? I've heard that FreeBSD is ditching GNU software.

FreeBSD (starting with version 11) does, indeed, not ship GNU
readline in their base system, which is great because you can then
simply install it from ports (or using pkgng, as seen above) and it
will work without any fiddling. Now, wouldn't it be great if Apple
did the same thing? :)

> > > >   * if readline's pkg-config file is not available, try linking
> > > >     against it the old way. This will succeed on oldish versions
> > > >     like the one shipped with CentOS but fail because of missing
> > > >     functions on macOS.
> 1: ^^^
> > > I should have commented earlier too - what good it is to switch to
> > > pkg-config if we're keeping the old way of detecting the library (with
> > > this patch included) anyway?
> > 
> > We wouldn't need to include this patch: we could just assume
> > a readline new enough to provide a .pc file contains all the
> > functionality we need.
> Well, what if isn't? We would just disable readline? We can't because
> you're advocating for linking the old way [1]. However, that wouldn't
> work on systems where we require more than just -lreadline (which is
> current situation). Currently, the problem is that my code requires this
> rl_completion_quote_character variable from readline.h. It's not a
> function, it's a variable. And if not present, compilation fails. So
> what should we do if pkg-config fails?

My whole idea was based on the assumption that the .pc file would
be shipped by the OS if it was in the readline sources, which as
we've seen is unfortunately not the case, so going down that path
is not feasible. Your patch is currently the only option; sorry if
I made it sound like I was claiming otherwise.

Andrea Bolognani / Red Hat / Virtualization

More information about the libvir-list mailing list