Add a configure check for llvm-objdump draft
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 09 Jan 2019 11:37:14 +0900
changeset 1804967 a8eb811c0831c6796522a3248089d05a0cbd7a71
parent 1804863 fc92b47c6b766cfa08d1913f89581e631f87c322
child 1804968 4e35647d7bb5705cd4e64320d46d3e92551e91d5
child 1804983 869902a768d6ca2fb694393b394fff5c0d468863
push id326356
push usermh@glandium.org
push dateWed, 09 Jan 2019 07:19:01 +0000
treeherdertry@d19a7c0412e3 [default view] [failures only]
milestone66.0a1
Add a configure check for llvm-objdump
moz.configure
--- a/moz.configure
+++ b/moz.configure
@@ -576,16 +576,39 @@ def nsis_flags(host):
     if host.kernel != 'WINNT':
         return '-nocd'
     return ''
 
 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')
+
+
 # Fallthrough to autoconf-based configure
 include('build/moz.configure/old.configure')
 
 @depends(check_build_environment, build_project)
 @imports('__sandbox__')
 @imports('glob')
 def config_status_deps(build_env, build_project):