On Mon, 2018-01-15 at 16:36 +0100, Michal Privoznik wrote:
> So, one way to solve this once and for all would be to:
>
> * try looking up readline through pkg-config. If that works,
> then we already know we're compiling against a recent
> readline version and everything will work;
I just found out that this will not work - even though there is
readline.pc.in in the readline repo, they are lacking rule to install
the .pc file. So nobody ships that. For instance, on my rawhide box:
[root@fedora ~]# rpm -q readline
readline-7.0-5.fc26.x86_64
[root@fedora ~]# rpm -ql readline | grep \.pc
[root@fedora ~]#
Ouch.
(Note the .pc file would be in the readline-devel package, not in
the runtime one. Still, I've checked on my Rawhide guest and it's
not there.)
At least FreeBSD ships it, though:
# pkg list readline | grep pc$
/usr/local/libdata/pkgconfig/readline.pc
Not sure about brew. Not having access to a macOS box is really
annoying in this kind of scenario.
> * 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.
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.
Therefore I think we should merge this patch and switch to
pkg-config
later (when distros have it).
Well, we're running out of time for 4.0.0 anyway, so
Reviewed-by: Andrea Bolognani <abologna(a)redhat.com>
to your patch and let's work on a better solution, assuming one
is even possible, later :)
--
Andrea Bolognani / Red Hat / Virtualization