All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH-FOR-NEXT v1 3/6] pkgconf: add host-pkg-config wrapper
Date: Wed, 21 Feb 2018 22:50:10 +0100	[thread overview]
Message-ID: <20180221225010.4b4228aa@windsurf.lan> (raw)
In-Reply-To: <20180221142801.28997-4-gael.portay@savoirfairelinux.com>

Hello,

+Peter, Yann, Arnout, there's a question below about a small change but
has a big impact.

On Wed, 21 Feb 2018 09:27:58 -0500, Ga?l PORTAY wrote:
> The host-pkg-config wrapper gets package data compiled for host.
> 
> Signed-off-by: Ga?l PORTAY <gael.portay@savoirfairelinux.com>
> ---
>  package/pkgconf/host-pkg-config | 4 ++++
>  package/pkgconf/pkgconf.mk      | 6 ++++--
>  2 files changed, 8 insertions(+), 2 deletions(-)
>  create mode 100644 package/pkgconf/host-pkg-config
> 
> diff --git a/package/pkgconf/host-pkg-config b/package/pkgconf/host-pkg-config
> new file mode 100644
> index 0000000000..3362a3f927
> --- /dev/null
> +++ b/package/pkgconf/host-pkg-config
> @@ -0,0 +1,4 @@
> +#!/bin/sh
> +PKGCONFDIR=$(dirname "$0")
> +DEFAULT_PKG_CONFIG_PATH=${PKGCONFDIR}/../lib/pkgconfig:${PKGCONFDIR}/../share/pkgconfig
> +PKG_CONFIG_PATH=${PKG_CONFIG_PATH:-${DEFAULT_PKG_CONFIG_PATH}} exec ${PKGCONFDIR}/pkgconf "$@"

I've been thinking about this for a while, and I remember having a
discussion about this with some other Buildroot developer a while ago.
I think the most correct thing to do would be:

 $(HOST_DIR)/bin/pkg-config returns results valid for native compilation

 $(HOST_DIR)/bin/<tuple>-pkg-config returns results valid for cross-compilation

I.e, the current pkg-config wrapper should be renamed
<tuple>-pkg-config, and pkg-config should behave like a normal native
pkg-config, except that it provides results for libraries located in
$(HOST_DIR).

The autoconf PKG_CHECK_MODULES() macro uses PKG_PROG_PKG_CONFIG(),
which internally uses AC_PATH_TOOL(). And AC_PATH_TOOL() will first
search for the program with the host machine tuple, and warn if the
program cannot be found with this tuple. From
https://www.gnu.org/software/autoconf/manual/autoconf-2.68/html_node/Generic-Programs.html:

"""
When cross-compiling, this macro will issue a warning if no program
prefixed with the host type could be found. For more information, see
Specifying Target Triplets. 
"""

I know this change will:

 - Potentially break a number of packages we have in Buildroot, which
   directly use pkg-config without first trying to use
   <tuple>-pkg-config

 - Potentially break a number of downstream users who are using
   pkg-config.

However:

 - It would solve that once you add $(HOST_DIR)/bin to your PATH, you
   cannot anymore do native builds because "pkg-config" returns results
   that are not relevant for native builds. I already saw a number of
   people affected by this.

 - It would comply with the standard autoconf expectations.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
http://bootlin.com

  reply	other threads:[~2018-02-21 21:50 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-21 14:27 [Buildroot] [PATCH-FOR-NEXT v1 0/6] Qt5 bump latest version to 5.10.1 Gaël PORTAY
2018-02-21 14:27 ` [Buildroot] [PATCH-FOR-NEXT v1 1/6] package: add libnpsr host package Gaël PORTAY
2018-02-21 21:27   ` Thomas Petazzoni
2018-02-22 14:29     ` Gaël PORTAY
2018-02-22 16:38       ` Baruch Siach
2018-02-21 14:27 ` [Buildroot] [PATCH-FOR-NEXT v1 2/6] package: add libnss " Gaël PORTAY
2018-02-21 21:32   ` Thomas Petazzoni
2018-02-21 14:27 ` [Buildroot] [PATCH-FOR-NEXT v1 3/6] pkgconf: add host-pkg-config wrapper Gaël PORTAY
2018-02-21 21:50   ` Thomas Petazzoni [this message]
2018-02-22  9:27     ` Arnout Vandecappelle
2018-02-22  9:41       ` Thomas Petazzoni
2018-02-22 10:56         ` Arnout Vandecappelle
2018-02-25 20:38           ` Thomas De Schampheleire
2018-02-25 20:53             ` Yann E. MORIN
2018-02-25 21:56               ` Thomas De Schampheleire
2018-02-21 14:27 ` [Buildroot] [PATCH-FOR-NEXT v1 4/6] qt5: bump latest version to 5.10.1 Gaël PORTAY
2018-02-21 21:56   ` Thomas Petazzoni
2018-02-23 18:32   ` Peter Seiderer
2018-02-21 14:28 ` [Buildroot] [PATCH-FOR-NEXT v1 5/6] qt5webengine: satisfy new requirements for 5.10 Gaël PORTAY
2018-02-21 21:58   ` Thomas Petazzoni
2018-02-22 14:42     ` Gaël PORTAY
2018-02-21 14:28 ` [Buildroot] [PATCH-FOR-NEXT v1 6/6] qt5webengine: set ninja host pkg-config tool Gaël PORTAY
2018-02-21 21:59   ` Thomas Petazzoni
2018-02-22 14:44     ` Gaël PORTAY

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=20180221225010.4b4228aa@windsurf.lan \
    --to=thomas.petazzoni@bootlin.com \
    --cc=buildroot@busybox.net \
    /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.