avoid libfdt checks adding full paths to pkg-config
authorChristian Ehrhardt <christian.ehrhardt@canonical.com>
Wed, 2 Sep 2020 11:10:30 +0000 (13:10 +0200)
committerDavid Marchand <david.marchand@redhat.com>
Tue, 15 Sep 2020 13:19:34 +0000 (15:19 +0200)
commite356aa46ad983d84c1585b96b26795a6a9c5b4fd
treea24b03fda145ec8c54e24d46dea654f66b7b8f60
parente41d27a68df6939bef97a4afa6ffc32eb8b2c2c1
avoid libfdt checks adding full paths to pkg-config

The checks for libfdt try dependency() first which would only work if
a pkg-config would be present but libfdt has none.
Then it probes for the lib path itself via cc.find_library.

But later it adds the result of either probe to ext_deps which ends up
in build and also the resulting pkg-config to contain toolchain versioned
paths in Libs.private like:
  /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libfdt.so
which obviously breaks on toolchain updates.

In general libs used multiple times - ipn3ke + ifpga in this case - are
checked centrally in config/meson.build so move it there and fix the
adding of dependencies to not use the full file path.

The result is libfdt in pkg-config now showing up as:
  Libs.private: -pthread -lm -ldl -lnuma -lfdt -lpcap

Fixes: e1defba4cf66 ("raw/ifpga/base: support device tree")
Cc: stable@dpdk.org
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Reviewed-by: Luca Boccassi <bluca@debian.org>
Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
config/meson.build
drivers/net/ipn3ke/meson.build
drivers/raw/ifpga/meson.build