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. Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx> --- m4/virt-lib.m4 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/m4/virt-lib.m4 b/m4/virt-lib.m4 index 75b9b1d..2401034 100644 --- a/m4/virt-lib.m4 +++ b/m4/virt-lib.m4 @@ -78,6 +78,8 @@ AC_DEFUN([LIBVIRT_CHECK_LIB],[ if test "x$with_var" != "xyes" && test "x$with_var" != "xcheck" ; then cflags_var="-I$with_var/include" libs_var="-L$with_var/lib" + else + PKG_CHECK_MODULES(check_name, library_name, [], [true]) fi CFLAGS="$CFLAGS $cflags_var" LIBS="$LIBS $libs_var" @@ -211,6 +213,8 @@ AC_DEFUN([LIBVIRT_CHECK_LIB_ALT],[ if test "x$with_var" != "xyes" && test "x$with_var" != "xcheck" ; then cflags_var="-I$with_var/include" libs_var="-L$with_var/lib" + else + PKG_CHECK_MODULES(check_name, library_name, [], [true]) fi CFLAGS="$CFLAGS $cflags_var" LIBS="$LIBS $libs_var" -- 2.0.4 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list