Re: [PATCH] Update LIBVIRT_CHECK_LIB and LIBVIRT_CHECK_LIB_ALT to use pkg-config

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

 



On 12/04/2014 11:59 PM, Eric Blake wrote:
On 12/04/2014 03:36 PM, Pavel Hrdina wrote:
On 12/04/2014 09:41 PM, Eric Blake wrote:
On 12/04/2014 01:30 PM, Pavel Hrdina wrote:
For example on FreeBSD the "yajl" library is located at "/usr/local/lib"
and it's not in default LIBS and therefore the configure fails that
"yajl" not installed.

We can use the "PKG_CHECK_MODULES" to get the correct library path in
case the library provides pkg-config file definition, otherwise the old
approach is used.

This feels a bit awkward.  Shouldn't we instead be fixing
m4/virt-yajl.m4 to use LIBVIRT_CHECK_PKG?  That is, shouldn't yajl be
using pkg-config everywhere, and not just on FreeBSD?


Hi, it will use the pkg-config everywhere. I don't know the exact
reason why yajl and sasl don't use the LIBVIRT_CHECK_PKG but it seems
that it's because we support two different major versions of yajl and
the have some changes in API and ABI so we have to check which version
is installed in the system and define appropriate macros.

See the 'src/util/virjson.c' that we have "WITH_YAJL" and "WITH_YAJL2".
The LIBVIRT_CHECK_PKG doesn't count with the possibility of alternative
versions of libraries.

Hmm, I wonder if we can reuse some of the logic currently in
configure.ac that probes whether gnutls is at version 2.x or 3.x by
directly probing '$PKG_CONFIG --exists ...', and then going on to
PKG_CHECK_MODULES once we know which of the two library flavors we are
dealing with.  That is, I still think we are better off patching
virt/m4-yajl.m4 (the one library where we know we have pkg_config
information, but aren't using it right) than changing virt/m4-lib.m4 to
affect all libraries (where we aren't sure the libraries are using
pkg_config to begin with).



In that case we know that "audit, libcap-ng, libsasl2, libselinux and
yajl" supports the pkg-config. It means that we can rewrite all of the
to use LIBVIRT_CHECK_PKG and for the yajl ans libsasl2 we will have to
create a new macro called "LIBVIRT_CHECK_PKG_ALT".

Pavel


--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]