dtc: Use pkg-config to locate libyaml
authorPavel Modilaynen <pavel.modilaynen@axis.com>
Fri, 12 Jul 2019 11:52:19 +0000 (13:52 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 4 Jan 2020 18:17:09 +0000 (19:17 +0100)
commit1332e29038a35c81200f1677ef760d3919a1ddf1
tree4e68501ae692d490c5b031cc5b2ed8c9c80684cf
parent139ca605c35eb3cc3dbee53803b89ea37b01367b
dtc: Use pkg-config to locate libyaml

[ Upstream commit 067c650c456e758f933aaf87a202f841d34be269 ]

Using Makefile's wildcard with absolute path to detect
the presence of libyaml results in false-positive
detection when cross-compiling e.g. in yocto environment.
The latter results in build error:
| scripts/dtc/yamltree.o: In function `yaml_propval_int':
| yamltree.c: undefined reference to `yaml_sequence_start_event_initialize'
| yamltree.c: undefined reference to `yaml_emitter_emit'
| yamltree.c: undefined reference to `yaml_scalar_event_initialize'
...
Use pkg-config to locate libyaml to address this scenario.

Signed-off-by: Pavel Modilaynen <pavel.modilaynen@axis.com>
[robh: silence stderr]
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
scripts/dtc/Makefile