Bug 1573264: Add configure support for detecting llvm-dlltool; r=glandium

In bug 1542830 I need to generate an import library from a .DEF file. The
`llvm-dlltool` utility is the tool to support this.

This change adds detection for the aforementioned utility and also configures
the required flags.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Aaron Klotz 2019-08-21 04:34:32 +00:00
Родитель ba36c4c9c2
Коммит 098248deb9
1 изменённых файлов: 29 добавлений и 0 удалений

Просмотреть файл

@ -1261,6 +1261,35 @@ def launcher(value, target):
set_config('MOZ_LAUNCHER_PROCESS', launcher)
set_define('MOZ_LAUNCHER_PROCESS', launcher)
# llvm-dlltool (Windows only)
# ==============================================================
@depends(build_project, target, '--enable-compile-environment')
def check_for_llvm_dlltool(build_project, target, compile_environment):
if build_project != 'browser':
return
if target.os != 'WINNT':
return
return compile_environment
llvm_dlltool = check_prog('LLVM_DLLTOOL', ('llvm-dlltool',),
what='llvm-dlltool', when=check_for_llvm_dlltool,
paths=toolchain_search_path)
@depends(target, when=llvm_dlltool)
def llvm_dlltool_flags(target):
arch = {
'x86': 'i386',
'x86_64': 'i386:x86-64',
'aarch64': 'arm64',
}[target.cpu]
return ['-m', arch]
set_config('LLVM_DLLTOOL_FLAGS', llvm_dlltool_flags)
# Maintenance service (Windows only)
# ==============================================================