qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 2/2] configure: use pkg-config for obtaining xen


From: Stefano Stabellini
Subject: Re: [Qemu-devel] [PATCH 2/2] configure: use pkg-config for obtaining xen version
Date: Thu, 16 Mar 2017 13:20:40 -0700 (PDT)
User-agent: Alpine 2.10 (DEB 1266 2009-07-14)

On Thu, 16 Mar 2017, Juergen Gross wrote:
> Instead of trying to guess the Xen version to use by compiling various
> test programs first just ask the system via pkg-config. Only if it
> can't return the version fall back to the test program scheme.

That's OK, but why did you remove the Xen unstable test?


> Signed-off-by: Juergen Gross <address@hidden>
> ---
>  configure | 31 +++++++++++--------------------
>  1 file changed, 11 insertions(+), 20 deletions(-)
> 
> diff --git a/configure b/configure
> index aabf098..b43fbd5 100755
> --- a/configure
> +++ b/configure
> @@ -1983,26 +1983,12 @@ EOF
>      fi
>      xen=no
>  
> -  # Xen unstable
> -  elif
> -      cat > $TMPC <<EOF &&
> -#undef XC_WANT_COMPAT_DEVICEMODEL_API
> -#define __XEN_TOOLS__
> -#include <xendevicemodel.h>
> -int main(void) {
> -  xendevicemodel_handle *xd;
> -
> -  xd = xendevicemodel_open(0, 0);
> -  xendevicemodel_close(xd);
> -
> -  return 0;
> -}
> -EOF
> -      compile_prog "" "$xen_libs $xen_stable_libs -lxendevicemodel"
> -    then
> -    xen_stable_libs="$xen_stable_libs -lxendevicemodel"
> -    xen_ctrl_version=40900
> +  # Xen version via pkg-config (Xen 4.9.0 and newer)
> +  elif $pkg_config --exists xencontrol ; then
> +    xen_ctrl_version="$(printf '%d%02d%02d' \
> +      $($pkg_config --modversion xencontrol | sed 's/\./ /g') )"
>      xen=yes
> +
>    elif
>        cat > $TMPC <<EOF &&
>  /*
> @@ -2214,7 +2200,12 @@ EOF
>    fi
>  
>    if test "$xen" = yes; then
> -    if test $xen_ctrl_version -ge 40701  ; then
> +    if test $xen_ctrl_version -ge 40900 ; then
> +      xen_pc="xencontrol xenstore xenguest xenforeignmemory xengnttab 
> xenevtchn"
> +      xen_pc="$xen_pc xendevicemodel"
> +      xen_libs="$($pkg_config --libs $xen_pc)"
> +      QEMU_CFLAGS="$QEMU_CFLAGS $($pkg_config --cflags $xen_pc)"
> +    elif test $xen_ctrl_version -ge 40701 ; then
>        libs_softmmu="$xen_stable_libs $libs_softmmu"
>      fi
>      libs_softmmu="$xen_libs $libs_softmmu"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]