diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2013-03-31 01:35:19 +0100 |
---|---|---|
committer | Johannes Berg <johannes@sipsolutions.net> | 2013-03-31 01:35:19 +0100 |
commit | 69f20651c12f1595abb4297d47265dd7f56e1154 (patch) | |
tree | 612ab82b720458dd971f567e2ea9c16e761613d9 /gentree.py | |
parent | 29879860f4acced68c000fd30c5f0a87c1aa873e (diff) |
disable impossible symbols
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Diffstat (limited to 'gentree.py')
-rwxr-xr-x | gentree.py | 28 |
1 files changed, 27 insertions, 1 deletions
@@ -10,7 +10,7 @@ import argparse, sys, os, errno, shutil, re, subprocess # find self source_dir = os.path.abspath(os.path.dirname(sys.argv[0])) sys.path.append(os.path.join(source_dir, 'lib')) -import kconfig, git, patch +import kconfig, git, patch, make def read_copy_list(kerneldir, copyfile): ret = [] @@ -262,4 +262,30 @@ def main(): git_debug_snapshot(args, "rename config symbol usage") + # disable unbuildable Kconfig symbols and stuff Makefiles that doesn't exist + maketree = make.MakeTree(os.path.join(args.outdir, 'Makefile.kernel')) + disable_kconfig = [] + disable_makefile = [] + for sym in maketree.get_impossible_symbols(): + if sym[:7] == 'CPTCFG_': + disable_kconfig.append(sym[7:]) + else: + disable_makefile.append(sym[7:]) + + configtree.disable_symbols(disable_kconfig) + git_debug_snapshot(args, "disable impossible kconfig symbols") + + regexes = [] + for some_symbols in [disable_makefile[i:i + 50] for i in range(0, len(disable_makefile), 50)]: + r = '(CONFIG_(' + '|'.join([s for s in some_symbols]) + '))' + regexes.append(re.compile(r, re.MULTILINE)) + for f in maketree.get_makefiles(): + data = open(f, 'r').read() + for r in regexes: + data = r.sub(r'IMPOSSIBLE_\2', data) + fo = open(f, 'w') + fo.write(data) + fo.close() + git_debug_snapshot(args, "disable unsatisfied Makefile parts") + main() |