1#!/usr/bin/env python 2 3import os 4import sys 5 6import version 7 8version_string = '%s.%s.%s' % (version.major, version.minor, version.patch) 9 10if len(sys.argv) < 2: 11 print sys.stderr, "Usage: %s <Version.inc.in>" 12 sys.exit(1) 13 14with open(sys.argv[1], 'r') as f: 15 replacements = { 16 '@CLANG_VERSION@': version_string, 17 '@CLANG_VERSION_MAJOR@': version.major, 18 '@CLANG_VERSION_MINOR@': version.minor, 19 '@CLANG_VERSION_PATCHLEVEL@': version.patch, 20 '@CLANG_HAS_VERSION_PATCHLEVEL@': '1', 21 } 22 23 for line in f: 24 line = line.strip() 25 for replace, to in replacements.iteritems(): 26 line = line.replace(replace, to) 27 print line 28