qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] configure: improve multiarch support for pkgcon


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH] configure: improve multiarch support for pkgconfig
Date: Fri, 10 Apr 2015 14:06:17 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0


On 09/04/2015 23:36, John Snow wrote:
> This will improve the multi-arch compilation for hosts using gcc.
> configurations using clang won't see an improvement, but also won't
> see a regression.
> 
> Signed-off-by: John Snow <address@hidden>
> ---
>  configure | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/configure b/configure
> index 826d6fd..d27729a 100755
> --- a/configure
> +++ b/configure
> @@ -1759,6 +1759,20 @@ if ! has "$pkg_config_exe"; then
>  fi
>  
>  ##########################################
> +# pkg-config multi-arch probe
> +
> +if $cc -print-multiarch >/dev/null 2>&1; then
> +    mlibdir=$($cc -print-multiarch $QEMU_CFLAGS)
> +fi
> +if test -z "${mlibdir}"; then
> +    mlibdir=$($cc --print-multi-os-directory $QEMU_CFLAGS)
> +fi
> +
> +if [ -n "${mlibdir}" ] && [ -d "/usr/lib/${mlibdir}/pkgconfig" ]; then
> +    export PKG_CONFIG_LIBDIR="/usr/lib/${mlibdir}/pkgconfig"
> +fi

This is not enough.  It doesn't work unfortunately for cross compilers.

I would replace the third "if" with something like:

  orig_libdir=`$pkgconfig --variable pc_path pkg-config`
  if [ -n "$orig_libdir" ]; then
     export PKG_CONFIG_LIBDIR=$(echo $orig_libdir | sed \
         -e "s,???/pkgconfig:,???/${mlibdir}/pkgconfig:," -e t \
         -e "s,???/pkgconfig$,???/${mlibdir}/pkgconfig,g")
     export PKG_CONFIG_LIBDIR
  else
     echo Some warning about an old version of pkg-config?
     # proceed without setting PKG_CONFIG_LIBDIR then
  fi

The ??? are because for multiarch you probably should match
/lib/pkgconfig, but for multilib you cannot because it wouldn't match
/usr/lib64/pkgconfig.  So probably it needs two completely different sed
invocations.

Paolo

> +##########################################
>  # NPTL probe
>  
>  if test "$linux_user" = "yes"; then
> 



reply via email to

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