Bug 1516228 - Add a configure check for llvm-objdump. r=mshal

Differential Revision: https://phabricator.services.mozilla.com/D17462
This commit is contained in:
Mike Hommey 2019-01-24 15:33:47 +00:00
parent fcbc8b9cd2
commit 1ddf551764
2 changed files with 26 additions and 0 deletions

View File

@ -9,6 +9,9 @@ include('checks.configure')
# Make `toolkit` available when toolkit/moz.configure is not included.
toolkit = dependable(None)
# Likewise with `bindgen_config_paths` when
# build/moz.configure/bindgen.configure is not included.
bindgen_config_paths = dependable(None)
option(env='DIST', nargs=1, help='DIST directory')

View File

@ -583,6 +583,29 @@ set_config('MAKENSISU_FLAGS', nsis_flags)
check_prog('7Z', ('7z', '7za'), allow_missing=True, when=target_is_windows)
@depends(c_compiler, bindgen_config_paths)
def llvm_objdump(c_compiler, bindgen_config_paths):
clang = None
if c_compiler and c_compiler.type == 'clang':
clang = c_compiler.compiler
elif c_compiler and c_compiler.type == 'clang-cl':
clang = os.path.join(os.path.dirname(c_compiler.compiler), 'clang')
elif bindgen_config_paths:
clang = bindgen_config_paths.clang_path
llvm_objdump = 'llvm-objdump'
if clang:
out = check_cmd_output(clang, '--print-prog-name=llvm-objdump',
onerror=lambda: None)
if out:
llvm_objdump = out.rstrip()
return (llvm_objdump,)
check_prog('LLVM_OBJDUMP', llvm_objdump, what='llvm-objdump',
when='--enable-compile-environment')
# Please do not add configure checks from here on.
# Fallthrough to autoconf-based configure