
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). -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org