[waf] Support --bundled-clang=5.0.1

This commit is contained in:
Fangrui Song 2017-12-21 18:52:16 -08:00 committed by GitHub
parent ba1ca37326
commit ca02ee4339

23
wscript
View File

@ -34,7 +34,7 @@ elif sys.platform.startswith('freebsd'):
# It is either 'linux2' or 'linux3' before Python 3.3 # It is either 'linux2' or 'linux3' before Python 3.3
elif sys.platform.startswith('linux'): elif sys.platform.startswith('linux'):
# These executable depend on libtinfo.so.5 # These executable depend on libtinfo.so.5
CLANG_TARBALL_NAME = 'clang+llvm-$version-linux-x86_64-ubuntu14.04' CLANG_TARBALL_NAME = 'clang+llvm-$version-x86_64-linux-gnu-ubuntu-14.04'
elif sys.platform == 'win32': elif sys.platform == 'win32':
CLANG_TARBALL_NAME = 'LLVM-$version-win64' CLANG_TARBALL_NAME = 'LLVM-$version-win64'
CLANG_TARBALL_EXT = '.exe' CLANG_TARBALL_EXT = '.exe'
@ -79,7 +79,7 @@ def options(opt):
grp.add_option('--use-system-clang', dest='use_system_clang', default=False, action='store_true', grp.add_option('--use-system-clang', dest='use_system_clang', default=False, action='store_true',
help='enable use of clang from the system') help='enable use of clang from the system')
grp.add_option('--bundled-clang', dest='bundled_clang', default='4.0.0', grp.add_option('--bundled-clang', dest='bundled_clang', default='4.0.0',
help='bundled clang version, downloaded from https://releases.llvm.org/ , e.g. 4.0.0 5.0.0') help='bundled clang version, downloaded from https://releases.llvm.org/ , e.g. 4.0.0 5.0.1')
grp.add_option('--llvm-config', dest='llvm_config', default='llvm-config', grp.add_option('--llvm-config', dest='llvm_config', default='llvm-config',
help='specify path to llvm-config for automatic configuration [default: %default]') help='specify path to llvm-config for automatic configuration [default: %default]')
grp.add_option('--clang-prefix', dest='clang_prefix', default='', grp.add_option('--clang-prefix', dest='clang_prefix', default='',
@ -173,22 +173,9 @@ def configure(ctx):
else: else:
global CLANG_TARBALL_NAME, CLANG_TARBALL_EXT global CLANG_TARBALL_NAME, CLANG_TARBALL_EXT
# TODO Remove these after dropping clang 4 (after we figure out how to index Chrome) # TODO Remove after 5.0.1 is stable
if ctx.options.bundled_clang[0] == '4': if ctx.options.bundled_clang == '5.0.0' and sys.platform.startswith('linux'):
CLANG_TARBALL_EXT = '.tar.xz' CLANG_TARBALL_NAME = 'clang+llvm-$version-linux-x86_64-ubuntu14.04'
if sys.platform == 'darwin':
CLANG_TARBALL_NAME = 'clang+llvm-$version-x86_64-apple-darwin'
elif sys.platform.startswith('freebsd'):
CLANG_TARBALL_NAME = 'clang+llvm-$version-amd64-unknown-freebsd10'
elif sys.platform.startswith('linux'):
# These executable depend on libtinfo.so.5
CLANG_TARBALL_NAME = 'clang+llvm-$version-x86_64-linux-gnu-ubuntu-14.04'
elif sys.platform == 'win32':
CLANG_TARBALL_NAME = 'LLVM-$version-win64'
CLANG_TARBALL_EXT = '.exe'
else:
sys.stderr.write('ERROR: releases.llvm.org does not provide pre-built binaries for your platform {0}\n'.format(sys.platform))
sys.exit(1)
CLANG_TARBALL_NAME = string.Template(CLANG_TARBALL_NAME).substitute(version=ctx.options.bundled_clang) CLANG_TARBALL_NAME = string.Template(CLANG_TARBALL_NAME).substitute(version=ctx.options.bundled_clang)
# Directory clang has been extracted to. # Directory clang has been extracted to.