[v2,2/2] package/pkg-meson: use host-pkg-config to find host libraries.
diff mbox series

Message ID 20200210155548.31928-2-nicolas.cavallari@green-communications.fr
State New
Headers show
  • [v2,1/2] pkgconf: Add a host-pkg-config wrapper script.
Related show

Commit Message

Nicolas Cavallari Feb. 10, 2020, 3:55 p.m. UTC
meson makes a distinction between 'native' (i.e. host) dependencies
and 'host' (i.e. target) dependencies and can use a different pkg-config
binary for each case.

Currently, pkg-meson only pass the target pkg-config and meson
automatically guesses the host pkg-config by searching PATH, which finds
host/bin/pkg-config, which is the target pkg-config wrapper script.

As a result, meson uses the target pkg-config to find host dependencies,
with possibly incorrect results.

This patch causes meson to use host/bin/host-pkg-config directly to find
host dependencies, using the apparently recommended method[1] of
specifing the PKG_CONFIG environment variable.

[1] https://github.com/mesonbuild/meson/issues/1849

Signed-off-by: Nicolas Cavallari <nicolas.cavallari@green-communications.fr>

I tested that the following packages still compile:
- libglib2
- gst1-plugins-bad
- gst1-plugins-base
- gst1-plugins-good
- gst1-plugins-ugly
- gstreamer1
- libdrm
- mesa3d
 package/pkg-meson.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff mbox series

diff --git a/package/pkg-meson.mk b/package/pkg-meson.mk
index 642b715938..09687cc960 100644
--- a/package/pkg-meson.mk
+++ b/package/pkg-meson.mk
@@ -81,7 +81,8 @@  define $(2)_CONFIGURE_CMDS
 	    ) \
 	    package/meson/cross-compilation.conf.in \
 	    > $$($$(PKG)_SRCDIR)/build/cross-compilation.conf
-	PATH=$$(BR_PATH) $$($$(PKG)_CONF_ENV) $$(MESON) \
+	$$($$(PKG)_CONF_ENV) $$(MESON) \
 		--prefix=/usr \
 		--libdir=lib \
 		--default-library=$(if $(BR2_STATIC_LIBS),static,shared) \