]> git.baikalelectronics.ru Git - kernel.git/commit
scripts/dtc: use pkg-config to include <yaml.h> in non-standard path
authorMasahiro Yamada <masahiroy@kernel.org>
Tue, 5 May 2020 10:03:19 +0000 (19:03 +0900)
committerRob Herring <robh@kernel.org>
Mon, 8 Jun 2020 19:14:00 +0000 (13:14 -0600)
commitd5d0dabbdbd7a62c4cc0455f40bb45ef5bcc5091
tree1298c3e8472ab01c2dc52cbec0c29f895b1cc1c3
parent4cfaebeed73c0f4cd45094b851ee38965366f115
scripts/dtc: use pkg-config to include <yaml.h> in non-standard path

Commit 09f68c6e793f ("dtc: Use pkg-config to locate libyaml") added
'pkg-config --libs' to link libyaml installed in a non-standard
location.

yamltree.c includes <yaml.h>, but that commit did not add the search
path for <yaml.h>. If /usr/include/yaml.h does not exist, it fails to
build. A user can explicitly pass HOSTCFLAGS to work around it, but
the policy is not consistent.

There are two ways to deal with libraries in a non-default location.

[1] Use HOSTCFLAGS and HOSTLDFLAGS for additional search paths for
    headers and libraries.
    They are documented in Documentation/kbuild/kbuild.rst

    $ make HOSTCFLAGS='-I <prefix>/include' HOSTLDFLAGS='-L <prefix>/lib'

[2] Use pkg-config

    'pkg-config --cflags' for querying the header search path
    'pkg-config --libs'   for querying the lib and its path

If we go with pkg-config, use [2] consistently. Do not mix up
[1] and [2].

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Rob Herring <robh@kernel.org>
scripts/dtc/Makefile