Auto-detect Clang version. Remove hard-coded Clang version in dist-files.mk

This commit is contained in:
Anirudha Bose 2014-10-03 11:56:13 +05:30 committed by sftnight
parent ade6726f11
commit 3b8577fc5f
2 changed files with 62 additions and 51 deletions

View File

@ -257,10 +257,11 @@ def set_version():
print('Revision: ' + REVISION)
def set_ext():
def set_vars():
global EXEEXT
global SHLIBEXT
box_draw("Set binary/library extensions")
global CLANG_VERSION
box_draw("Set variables")
if not os.path.isfile(os.path.join(LLVM_OBJ_ROOT, 'test', 'lit.site.cfg')):
exec_subprocess_call('make lit.site.cfg', os.path.join(LLVM_OBJ_ROOT, 'test'))
@ -271,9 +272,17 @@ def set_ext():
elif re.match('^config.llvm_exe_ext = ', line):
EXEEXT = re.sub('^config.llvm_exe_ext = ', '', line).replace('"', '').strip()
if not os.path.isfile(os.path.join(LLVM_OBJ_ROOT, 'tools', 'clang', 'include', 'clang', 'Basic', 'Version.inc')):
exec_subprocess_call('make Version.inc', os.path.join(LLVM_OBJ_ROOT, 'tools', 'clang', 'include', 'clang', 'Basic'))
with open(os.path.join(LLVM_OBJ_ROOT, 'tools', 'clang', 'include', 'clang', 'Basic', 'Version.inc'), 'r') as Version_inc:
for line in Version_inc:
if re.match('^#define CLANG_VERSION ', line):
CLANG_VERSION = re.sub('^#define CLANG_VERSION ', '', line).strip()
print('EXEEXT: ' + EXEEXT)
print('SHLIBEXT: ' + SHLIBEXT)
print('CLANG_VERSION: ' + CLANG_VERSION)
def compile(arg):
global prefix
@ -334,7 +343,7 @@ def compile(arg):
def install_prefix():
set_ext()
set_vars()
box_draw("Filtering Cling's libraries and binaries")
for line in fileinput.input(os.path.join(CLING_SRC_DIR, 'tools', 'packaging', 'dist-files.mk'), inplace=True):
@ -342,6 +351,8 @@ def install_prefix():
print(line.replace('@EXEEXT@', EXEEXT), end=' ')
elif '@SHLIBEXT@' in line:
print(line.replace('@SHLIBEXT@', SHLIBEXT), end=' ')
elif '@CLANG_VERSION@' in line:
print(line.replace('@CLANG_VERSION@', CLANG_VERSION), end=' ')
else:
print(line, end=' ')

View File

@ -1115,53 +1115,53 @@ INCLUDE_LLVM_C_FILES := \
# CAUTION: The trailing space above is needed. DO NOT delete.
LIB_CLANG_HEADERS := \
lib/clang/3.5/include/altivec.h \
lib/clang/3.5/include/ammintrin.h \
lib/clang/3.5/include/arm_neon.h \
lib/clang/3.5/include/avx2intrin.h \
lib/clang/3.5/include/avxintrin.h \
lib/clang/3.5/include/bmi2intrin.h \
lib/clang/3.5/include/bmiintrin.h \
lib/clang/3.5/include/cpuid.h \
lib/clang/3.5/include/emmintrin.h \
lib/clang/3.5/include/f16cintrin.h \
lib/clang/3.5/include/float.h \
lib/clang/3.5/include/fma4intrin.h \
lib/clang/3.5/include/fmaintrin.h \
lib/clang/3.5/include/immintrin.h \
lib/clang/3.5/include/Intrin.h \
lib/clang/3.5/include/iso646.h \
lib/clang/3.5/include/limits.h \
lib/clang/3.5/include/lzcntintrin.h \
lib/clang/3.5/include/mm3dnow.h \
lib/clang/3.5/include/mmintrin.h \
lib/clang/3.5/include/mm_malloc.h \
lib/clang/3.5/include/module.map \
lib/clang/3.5/include/nmmintrin.h \
lib/clang/3.5/include/pmmintrin.h \
lib/clang/3.5/include/popcntintrin.h \
lib/clang/3.5/include/prfchwintrin.h \
lib/clang/3.5/include/rdseedintrin.h \
lib/clang/3.5/include/rtmintrin.h \
lib/clang/3.5/include/shaintrin.h \
lib/clang/3.5/include/smmintrin.h \
lib/clang/3.5/include/stdalign.h \
lib/clang/3.5/include/stdarg.h \
lib/clang/3.5/include/stdbool.h \
lib/clang/3.5/include/stddef.h \
lib/clang/3.5/include/stdint.h \
lib/clang/3.5/include/stdnoreturn.h \
lib/clang/3.5/include/tbmintrin.h \
lib/clang/3.5/include/tgmath.h \
lib/clang/3.5/include/tmmintrin.h \
lib/clang/3.5/include/unwind.h \
lib/clang/3.5/include/varargs.h \
lib/clang/3.5/include/__wmmintrin_aes.h \
lib/clang/3.5/include/wmmintrin.h \
lib/clang/3.5/include/__wmmintrin_pclmul.h \
lib/clang/3.5/include/x86intrin.h \
lib/clang/3.5/include/xmmintrin.h \
lib/clang/3.5/include/xopintrin.h
lib/clang/@CLANG_VERSION@/include/altivec.h \
lib/clang/@CLANG_VERSION@/include/ammintrin.h \
lib/clang/@CLANG_VERSION@/include/arm_neon.h \
lib/clang/@CLANG_VERSION@/include/avx2intrin.h \
lib/clang/@CLANG_VERSION@/include/avxintrin.h \
lib/clang/@CLANG_VERSION@/include/bmi2intrin.h \
lib/clang/@CLANG_VERSION@/include/bmiintrin.h \
lib/clang/@CLANG_VERSION@/include/cpuid.h \
lib/clang/@CLANG_VERSION@/include/emmintrin.h \
lib/clang/@CLANG_VERSION@/include/f16cintrin.h \
lib/clang/@CLANG_VERSION@/include/float.h \
lib/clang/@CLANG_VERSION@/include/fma4intrin.h \
lib/clang/@CLANG_VERSION@/include/fmaintrin.h \
lib/clang/@CLANG_VERSION@/include/immintrin.h \
lib/clang/@CLANG_VERSION@/include/Intrin.h \
lib/clang/@CLANG_VERSION@/include/iso646.h \
lib/clang/@CLANG_VERSION@/include/limits.h \
lib/clang/@CLANG_VERSION@/include/lzcntintrin.h \
lib/clang/@CLANG_VERSION@/include/mm3dnow.h \
lib/clang/@CLANG_VERSION@/include/mmintrin.h \
lib/clang/@CLANG_VERSION@/include/mm_malloc.h \
lib/clang/@CLANG_VERSION@/include/module.map \
lib/clang/@CLANG_VERSION@/include/nmmintrin.h \
lib/clang/@CLANG_VERSION@/include/pmmintrin.h \
lib/clang/@CLANG_VERSION@/include/popcntintrin.h \
lib/clang/@CLANG_VERSION@/include/prfchwintrin.h \
lib/clang/@CLANG_VERSION@/include/rdseedintrin.h \
lib/clang/@CLANG_VERSION@/include/rtmintrin.h \
lib/clang/@CLANG_VERSION@/include/shaintrin.h \
lib/clang/@CLANG_VERSION@/include/smmintrin.h \
lib/clang/@CLANG_VERSION@/include/stdalign.h \
lib/clang/@CLANG_VERSION@/include/stdarg.h \
lib/clang/@CLANG_VERSION@/include/stdbool.h \
lib/clang/@CLANG_VERSION@/include/stddef.h \
lib/clang/@CLANG_VERSION@/include/stdint.h \
lib/clang/@CLANG_VERSION@/include/stdnoreturn.h \
lib/clang/@CLANG_VERSION@/include/tbmintrin.h \
lib/clang/@CLANG_VERSION@/include/tgmath.h \
lib/clang/@CLANG_VERSION@/include/tmmintrin.h \
lib/clang/@CLANG_VERSION@/include/unwind.h \
lib/clang/@CLANG_VERSION@/include/varargs.h \
lib/clang/@CLANG_VERSION@/include/__wmmintrin_aes.h \
lib/clang/@CLANG_VERSION@/include/wmmintrin.h \
lib/clang/@CLANG_VERSION@/include/__wmmintrin_pclmul.h \
lib/clang/@CLANG_VERSION@/include/x86intrin.h \
lib/clang/@CLANG_VERSION@/include/xmmintrin.h \
lib/clang/@CLANG_VERSION@/include/xopintrin.h
# CAUTION: The trailing space above is needed. DO NOT delete.
SHARE_FILES := \