From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44270) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YgXhd-00042E-75 for qemu-devel@nongnu.org; Fri, 10 Apr 2015 08:06:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YgXhY-0008E6-4h for qemu-devel@nongnu.org; Fri, 10 Apr 2015 08:06:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50995) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YgXhX-0008Dt-On for qemu-devel@nongnu.org; Fri, 10 Apr 2015 08:06:24 -0400 Message-ID: <5527BCB9.8080307@redhat.com> Date: Fri, 10 Apr 2015 14:06:17 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1428615372-615-1-git-send-email-jsnow@redhat.com> In-Reply-To: <1428615372-615-1-git-send-email-jsnow@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] configure: improve multiarch support for pkgconfig List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Snow , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, stefanha@redhat.com 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. >=20 > Signed-off-by: John Snow > --- > configure | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) >=20 > 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 > =20 > ########################################## > +# pkg-config multi-arch probe > + > +if $cc -print-multiarch >/dev/null 2>&1; then > + mlibdir=3D$($cc -print-multiarch $QEMU_CFLAGS) > +fi > +if test -z "${mlibdir}"; then > + mlibdir=3D$($cc --print-multi-os-directory $QEMU_CFLAGS) > +fi > + > +if [ -n "${mlibdir}" ] && [ -d "/usr/lib/${mlibdir}/pkgconfig" ]; then > + export PKG_CONFIG_LIBDIR=3D"/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=3D`$pkgconfig --variable pc_path pkg-config` if [ -n "$orig_libdir" ]; then export PKG_CONFIG_LIBDIR=3D$(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 > =20 > if test "$linux_user" =3D "yes"; then >=20