pkgconf: Add pkgconf system lib and include path
authorThomas Preston <thomas.preston@codethink.co.uk>
Tue, 1 Oct 2019 12:41:31 +0000 (13:41 +0100)
committerArnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Sat, 19 Oct 2019 22:21:36 +0000 (00:21 +0200)
commit9cc8680fe54c0b8f5008158e36e2157127f03a7e
tree7f25d86b86b59a060df9d484b0d17e9e5867d86d
parent8905454daf4ad00c3fdfd6f5e1aa7475dcabf9e5
pkgconf: Add pkgconf system lib and include path

Buildroot does not reconfigure pkgconf system library and system include
dirs to STAGING_DIR. This means that pkgconf prints the sysroot system
library and system include dirs instead of letting the compiler handle
the logical sysroot. This breaks the -isystem compiler flag, as it
increases the priority of the system library and system include
directories. For example:

$ output/host/bin/pkg-config --cflags glib-2.0
-Ioutput/host/bin/../x86_64-buildroot-linux-gnu/sysroot/usr/include/glib-2.0
-Ioutput/host/bin/../x86_64-buildroot-linux-gnu/sysroot/usr/lib/glib-2.0/include
-Ioutput/host/bin/../x86_64-buildroot-linux-gnu/sysroot/usr/include

A header in `.../sysroot/usr/include` will be included before a header
in any directory specified with -isystem flags. Specifically, this
breaks the Chromium build system, which expects a C++ math.h in a
bundled LLVM C++ library, and gets a GNU C math.h instead.

Fix this by telling pkgconf about the sysroot's system library and
system include directories, so that it doesn't accidentally print them.

Signed-off-by: Thomas Preston <thomas.preston@codethink.co.uk>
[Arnout: change order of variables]
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
package/pkgconf/pkg-config.in