Bug 1519308 - Try toolchain-prefixed pkg-config. r=froydnj

When doing cross-compiles for Desktop, system pkg-config is going to be
looking for .pc files for the host, but systems setup for cross-compiles
come with a toolchain-prefixed pkg-config, which we should be looking
for.

Differential Revision: https://phabricator.services.mozilla.com/D16318

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Mike Hommey 2019-01-11 23:56:19 +00:00
parent 7fe599273b
commit 482de8b58a
3 changed files with 9 additions and 6 deletions

View File

@ -5,10 +5,10 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
@depends('--enable-compile-environment')
def pkg_config(compile_env):
if compile_env:
return ('pkg-config',)
@depends(toolchain_prefix, when=compile_environment)
def pkg_config(prefixes):
return tuple('{}pkg-config'.format(p)
for p in (prefixes or ()) + ('',))
pkg_config = check_prog('PKG_CONFIG', pkg_config, allow_missing=True)

View File

@ -123,13 +123,14 @@ js_option(env='MOZ_PGO', help='Build with profile guided optimizations')
set_config('MOZ_PGO', depends('MOZ_PGO')(lambda x: bool(x)))
include('build/moz.configure/toolchain.configure',
when='--enable-compile-environment')
include('build/moz.configure/pkg.configure')
# Make this assignment here rather than in pkg.configure to avoid
# requiring this file in unit tests.
add_old_configure_assignment('PKG_CONFIG', pkg_config)
include('build/moz.configure/toolchain.configure',
when='--enable-compile-environment')
include('build/moz.configure/memory.configure',
when='--enable-compile-environment')
include('build/moz.configure/headers.configure',

View File

@ -648,6 +648,8 @@ class TestChecksConfigure(unittest.TestCase):
def get_result(cmd, args=[], extra_paths=None):
return self.get_result(textwrap.dedent('''\
option('--disable-compile-environment', help='compile env')
compile_environment = depends(when='--enable-compile-environment')(lambda: True)
toolchain_prefix = depends(when=True)(lambda: None)
include('%(topsrcdir)s/build/moz.configure/util.configure')
include('%(topsrcdir)s/build/moz.configure/checks.configure')
include('%(topsrcdir)s/build/moz.configure/pkg.configure')