Skip to content

Commit

Permalink
Bug 1516228 - Add a configure check for llvm-objdump. r=firefox-build…
Browse files Browse the repository at this point in the history
…-system-reviewers,mshal

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

--HG--
extra : moz-landing-system : lando
  • Loading branch information
glandium committed Jan 24, 2019
1 parent ca51063 commit 96f7f53
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
3 changes: 3 additions & 0 deletions build/moz.configure/init.configure
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down
23 changes: 23 additions & 0 deletions moz.configure
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 96f7f53

Please sign in to comment.