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 Thu, Dec 04, 2014 at 09:30:54PM +0100, 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.
> 
> 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"

These CHECK_LIB* functions are the non-pkg-config codepath, so it is really
wrong to put PKG_CHECK_MODULE calls in here IMHO.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

--
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]