From: Paolo Bonzini <pbonzini@redhat.com>
To: John Snow <jsnow@redhat.com>, qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, stefanha@redhat.com
Subject: Re: [Qemu-devel] [PATCH] configure: improve multiarch support for pkgconfig
Date: Fri, 10 Apr 2015 14:06:17 +0200 [thread overview]
Message-ID: <5527BCB9.8080307@redhat.com> (raw)
In-Reply-To: <1428615372-615-1-git-send-email-jsnow@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.
>
> Signed-off-by: John Snow <jsnow@redhat.com>
> ---
> 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
>
next prev parent reply other threads:[~2015-04-10 12:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-09 21:36 [Qemu-devel] [PATCH] configure: improve multiarch support for pkgconfig John Snow
2015-04-10 12:06 ` Paolo Bonzini [this message]
2015-04-10 12:21 ` Stefan Hajnoczi
2015-04-10 12:55 ` Peter Maydell
2015-04-10 14:06 ` John Snow
2015-04-10 13:59 ` Gerd Hoffmann
2015-04-10 14:15 ` John Snow
2015-04-10 14:24 ` Gerd Hoffmann
2015-04-10 12:24 ` Daniel P. Berrange
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5527BCB9.8080307@redhat.com \
--to=pbonzini@redhat.com \
--cc=jsnow@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.