Always honor pkg-config command coming from the user

Desktop / Chromium - Tomasz Figa [chromium.org] - 16 July 2017 00:12 EDT

When building from within a ChromiumOS chroot (and any other Gentoo-base system), the right command to call pkg-config is specified up front and needs to be honored. However currently Chromium build system always calls 'pkg-config' directly if --sysroot is given to the build. This ignores any necessary setup done by the board sysroot pkg-config wrapper used on ChromiumOS and causes host's paths being pulled into the build. Precisely, PKG_CONFIG_PATH is not being unset and PKG_CONFIG_SYSROOT_DIR is not being set to the sysroot path.

Fix this by always using the specified pkg-config binary, even if sysroot is given. Even though, the problem could be fixed up by adding necessary setup to Chromium's pkg-config wrapper, it is not the right solution, as the setup is inherently sysroot specific and only the external build system is aware of necessary configuration to be done.

Bug: 743366 Test: Build chromeos-chrome with host's /usr/lib64/pkgconfig/dbus-1.pc chmodded to a-r. Change-Id: I6e80dbaa94510e31aa5000c6cc31ca32b5e5cbe4 Reviewed-on: https://chromium-review.googlesource.com/572666

cf2215d Always honor pkg-config command coming from the user
build/config/linux/pkg-config.py | 8 ++++----
build/config/linux/pkg_config.gni | 12 +++++++-----
2 files changed, 11 insertions(+), 9 deletions(-)

Upstream: git.chromium.org


  • Share