5 # SPDX-License-Identifier: GPL-2.0+
9 Move config options from headers to defconfig files.
11 Since Kconfig was introduced to U-Boot, we have worked on moving
12 config options from headers to Kconfig (defconfig).
14 This tool intends to help this tremendous work.
20 This tool takes one input file. (let's say 'recipe' file here.)
21 The recipe describes the list of config options you want to move.
22 Each line takes the form:
23 <config_name> <type> <default>
24 (the fields must be separated with whitespaces.)
26 <config_name> is the name of config option.
28 <type> is the type of the option. It must be one of bool, tristate,
31 <default> is the default value of the option. It must be appropriate
32 value corresponding to the option type. It must be either y or n for
33 the bool type. Tristate options can also take m (although U-Boot has
34 not supported the module feature).
36 You can add two or more lines in the recipe file, so you can move
37 multiple options at once.
39 Let's say, for example, you want to move CONFIG_CMD_USB and
42 The type should be bool, hex, respectively. So, the recipe file
43 should look like this:
47 CONFIG_SYS_TEXT_BASE hex 0x00000000
49 Next you must edit the Kconfig to add the menu entries for the configs
52 And then run this tool giving the file name of the recipe
54 $ tools/moveconfig.py recipe
56 The tool walks through all the defconfig files to move the config
57 options specified by the recipe file.
59 The log is also displayed on the terminal.
61 Each line is printed in the format
62 <defconfig_name> : <action>
64 <defconfig_name> is the name of the defconfig
65 (without the suffix _defconfig).
67 <action> shows what the tool did for that defconfig.
68 It looks like one of the followings:
71 This config option was moved to the defconfig
73 - Default value 'CONFIG_...'. Do nothing.
74 The value of this option is the same as default.
75 We do not have to add it to the defconfig.
77 - 'CONFIG_...' already exists in Kconfig. Do nothing.
78 This config option is already defined in Kconfig.
79 We do not need/want to touch it.
81 - Undefined. Do nothing.
82 This config option was not found in the config header.
85 - Failed to process. Skip.
86 An error occurred during processing this defconfig. Skipped.
87 (If -e option is passed, the tool exits immediately on error.)
89 Finally, you will be asked, Clean up headers? [y/n]:
91 If you say 'y' here, the unnecessary config defines are removed
92 from the config headers (include/configs/*.h).
93 It just uses the regex method, so you should not rely on it.
94 Just in case, please do 'git diff' to see what happened.
100 This tool runs configuration and builds include/autoconf.mk for every
101 defconfig. The config options defined in Kconfig appear in the .config
102 file (unless they are hidden because of unmet dependency.)
103 On the other hand, the config options defined by board headers are seen
104 in include/autoconf.mk. The tool looks for the specified options in both
105 of them to decide the appropriate action for the options. If the option
106 is found in the .config or the value is the same as the specified default,
107 the option does not need to be touched. If the option is found in
108 include/autoconf.mk, but not in the .config, and the value is different
109 from the default, the tools adds the option to the defconfig.
111 For faster processing, this tool handles multi-threading. It creates
112 separate build directories where the out-of-tree build is run. The
113 temporary build directories are automatically created and deleted as
114 needed. The number of threads are chosen based on the number of the CPU
115 cores of your system although you can change it via -j (--jobs) option.
121 Appropriate toolchain are necessary to generate include/autoconf.mk
122 for all the architectures supported by U-Boot. Most of them are available
123 at the kernel.org site, some are not provided by kernel.org.
125 The default per-arch CROSS_COMPILE used by this tool is specified by
126 the list below, CROSS_COMPILE. You may wish to update the list to
127 use your own. Instead of modifying the list directly, you can give
128 them via environments.
135 Surround each portion of the log with escape sequences to display it
136 in color on the terminal.
139 Specify a file containing a list of defconfigs to move
142 Peform a trial run that does not make any changes. It is useful to
143 see what is going to happen before one actually runs it.
146 Exit immediately if Make exits with a non-zero status while processing
150 Only cleanup the headers; skip the defconfig processing
153 Specify the number of threads to run simultaneously. If not specified,
154 the number of threads is the same as the number of CPU cores.
157 Show any build errors as boards are built
159 To see the complete list of supported options, run
161 $ tools/moveconfig.py -h
166 import multiprocessing
176 SHOW_GNU_MAKE = 'scripts/show-gnu-make'
179 # Here is the list of cross-tools I use.
180 # Most of them are available at kernel.org
181 # (https://www.kernel.org/pub/tools/crosstool/files/bin/), except the followings:
182 # arc: https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/releases
183 # blackfin: http://sourceforge.net/projects/adi-toolchain/files/
184 # nds32: http://osdk.andestech.com/packages/nds32le-linux-glibc-v1.tgz
185 # nios2: https://sourcery.mentor.com/GNUToolchain/subscription42545
186 # sh: http://sourcery.mentor.com/public/gnu_toolchain/sh-linux-gnu
188 # openrisc kernel.org toolchain is out of date, download latest one from
189 # http://opencores.org/or1k/OpenRISC_GNU_tool_chain#Prebuilt_versions
192 'aarch64': 'aarch64-linux-',
193 'arm': 'arm-unknown-linux-gnueabi-',
194 'avr32': 'avr32-linux-',
195 'blackfin': 'bfin-elf-',
196 'm68k': 'm68k-linux-',
197 'microblaze': 'microblaze-linux-',
198 'mips': 'mips-linux-',
199 'nds32': 'nds32le-linux-',
200 'nios2': 'nios2-linux-gnu-',
201 'openrisc': 'or1k-elf-',
202 'powerpc': 'powerpc-linux-',
203 'sh': 'sh-linux-gnu-',
204 'sparc': 'sparc-linux-',
211 STATE_SAVEDEFCONFIG = 3
214 ACTION_DEFAULT_VALUE = 1
215 ACTION_ALREADY_EXIST = 2
223 COLOR_PURPLE = '0;35'
225 COLOR_LIGHT_GRAY = '0;37'
226 COLOR_DARK_GRAY = '1;30'
227 COLOR_LIGHT_RED = '1;31'
228 COLOR_LIGHT_GREEN = '1;32'
229 COLOR_YELLOW = '1;33'
230 COLOR_LIGHT_BLUE = '1;34'
231 COLOR_LIGHT_PURPLE = '1;35'
232 COLOR_LIGHT_CYAN = '1;36'
235 ### helper functions ###
237 """Get the file object of '/dev/null' device."""
239 devnull = subprocess.DEVNULL # py3k
240 except AttributeError:
241 devnull = open(os.devnull, 'wb')
244 def check_top_directory():
245 """Exit if we are not at the top of source directory."""
246 for f in ('README', 'Licenses'):
247 if not os.path.exists(f):
248 sys.exit('Please run at the top of source directory.')
251 """Get the command name of GNU Make.
253 U-Boot needs GNU Make for building, but the command name is not
254 necessarily "make". (for example, "gmake" on FreeBSD).
255 Returns the most appropriate command name on your system.
257 process = subprocess.Popen([SHOW_GNU_MAKE], stdout=subprocess.PIPE)
258 ret = process.communicate()
259 if process.returncode:
260 sys.exit('GNU Make not found')
261 return ret[0].rstrip()
263 def color_text(color_enabled, color, string):
264 """Return colored string."""
266 return '\033[' + color + 'm' + string + '\033[0m'
270 def log_msg(color_enabled, color, defconfig, msg):
271 """Return the formated line for the log."""
272 return defconfig[:-len('_defconfig')].ljust(37) + ': ' + \
273 color_text(color_enabled, color, msg) + '\n'
275 def update_cross_compile():
276 """Update per-arch CROSS_COMPILE via environment variables
278 The default CROSS_COMPILE values are available
279 in the CROSS_COMPILE list above.
281 You can override them via environment variables
282 CROSS_COMPILE_{ARCH}.
284 For example, if you want to override toolchain prefixes
285 for ARM and PowerPC, you can do as follows in your shell:
287 export CROSS_COMPILE_ARM=...
288 export CROSS_COMPILE_POWERPC=...
292 for arch in os.listdir('arch'):
293 if os.path.exists(os.path.join('arch', arch, 'Makefile')):
296 # arm64 is a special case
297 archs.append('aarch64')
300 env = 'CROSS_COMPILE_' + arch.upper()
301 cross_compile = os.environ.get(env)
303 CROSS_COMPILE[arch] = cross_compile
305 def cleanup_one_header(header_path, patterns, dry_run):
306 """Clean regex-matched lines away from a file.
309 header_path: path to the cleaned file.
310 patterns: list of regex patterns. Any lines matching to these
311 patterns are deleted.
312 dry_run: make no changes, but still display log.
314 with open(header_path) as f:
315 lines = f.readlines()
318 for i, line in enumerate(lines):
319 for pattern in patterns:
320 m = pattern.search(line)
322 print '%s: %s: %s' % (header_path, i + 1, line),
326 if dry_run or not matched:
329 with open(header_path, 'w') as f:
330 for i, line in enumerate(lines):
334 def cleanup_headers(config_attrs, dry_run):
335 """Delete config defines from board headers.
338 config_attrs: A list of dictionaris, each of them includes the name,
339 the type, and the default value of the target config.
340 dry_run: make no changes, but still display log.
343 choice = raw_input('Clean up headers? [y/n]: ').lower()
345 if choice == 'y' or choice == 'n':
352 for config_attr in config_attrs:
353 config = config_attr['config']
354 patterns.append(re.compile(r'#\s*define\s+%s\W' % config))
355 patterns.append(re.compile(r'#\s*undef\s+%s\W' % config))
357 for dir in 'include', 'arch', 'board':
358 for (dirpath, dirnames, filenames) in os.walk(dir):
359 for filename in filenames:
360 if not fnmatch.fnmatch(filename, '*~'):
361 cleanup_one_header(os.path.join(dirpath, filename),
367 """A parser of .config and include/autoconf.mk."""
369 re_arch = re.compile(r'CONFIG_SYS_ARCH="(.*)"')
370 re_cpu = re.compile(r'CONFIG_SYS_CPU="(.*)"')
372 def __init__(self, config_attrs, options, build_dir):
373 """Create a new parser.
376 config_attrs: A list of dictionaris, each of them includes the name,
377 the type, and the default value of the target config.
378 options: option flags.
379 build_dir: Build directory.
381 self.config_attrs = config_attrs
382 self.options = options
383 self.build_dir = build_dir
385 def get_cross_compile(self):
386 """Parse .config file and return CROSS_COMPILE.
389 A string storing the compiler prefix for the architecture.
393 dotconfig = os.path.join(self.build_dir, '.config')
394 for line in open(dotconfig):
395 m = self.re_arch.match(line)
399 m = self.re_cpu.match(line)
403 assert arch, 'Error: arch is not defined in %s' % defconfig
406 if arch == 'arm' and cpu == 'armv8':
409 return CROSS_COMPILE.get(arch, '')
411 def parse_one_config(self, config_attr, defconfig_lines, autoconf_lines):
412 """Parse .config, defconfig, include/autoconf.mk for one config.
414 This function looks for the config options in the lines from
415 defconfig, .config, and include/autoconf.mk in order to decide
416 which action should be taken for this defconfig.
419 config_attr: A dictionary including the name, the type,
420 and the default value of the target config.
421 defconfig_lines: lines from the original defconfig file.
422 autoconf_lines: lines from the include/autoconf.mk file.
425 A tupple of the action for this defconfig and the line
426 matched for the config.
428 config = config_attr['config']
429 not_set = '# %s is not set' % config
431 if config_attr['type'] in ('bool', 'tristate') and \
432 config_attr['default'] == 'n':
435 default = config + '=' + config_attr['default']
437 for line in defconfig_lines:
439 if line.startswith(config + '=') or line == not_set:
440 return (ACTION_ALREADY_EXIST, line)
442 if config_attr['type'] in ('bool', 'tristate'):
445 value = '(undefined)'
447 for line in autoconf_lines:
449 if line.startswith(config + '='):
454 action = ACTION_DEFAULT_VALUE
455 elif value == '(undefined)':
456 action = ACTION_UNDEFINED
460 return (action, value)
462 def update_defconfig(self, defconfig):
463 """Parse files for the config options and update the defconfig.
465 This function parses the given defconfig, the generated .config
466 and include/autoconf.mk searching the target options.
467 Move the config option(s) to the defconfig or do nothing if unneeded.
468 Also, display the log to show what happened to this defconfig.
471 defconfig: defconfig name.
474 defconfig_path = os.path.join('configs', defconfig)
475 dotconfig_path = os.path.join(self.build_dir, '.config')
476 autoconf_path = os.path.join(self.build_dir, 'include', 'autoconf.mk')
479 with open(defconfig_path) as f:
480 defconfig_lines = f.readlines()
482 with open(autoconf_path) as f:
483 autoconf_lines = f.readlines()
485 for config_attr in self.config_attrs:
486 result = self.parse_one_config(config_attr, defconfig_lines,
488 results.append(result)
492 for (action, value) in results:
493 if action == ACTION_MOVE:
494 actlog = "Move '%s'" % value
495 log_color = COLOR_LIGHT_GREEN
496 elif action == ACTION_DEFAULT_VALUE:
497 actlog = "Default value '%s'. Do nothing." % value
498 log_color = COLOR_LIGHT_BLUE
499 elif action == ACTION_ALREADY_EXIST:
500 actlog = "'%s' already defined in Kconfig. Do nothing." % value
501 log_color = COLOR_LIGHT_PURPLE
502 elif action == ACTION_UNDEFINED:
503 actlog = "Undefined. Do nothing."
504 log_color = COLOR_DARK_GRAY
506 sys.exit("Internal Error. This should not happen.")
508 log += log_msg(self.options.color, log_color, defconfig, actlog)
510 # Some threads are running in parallel.
511 # Print log in one shot to not mix up logs from different threads.
514 with open(dotconfig_path, 'a') as f:
515 for (action, value) in results:
516 if action == ACTION_MOVE:
517 f.write(value + '\n')
519 os.remove(os.path.join(self.build_dir, 'include', 'config', 'auto.conf'))
520 os.remove(autoconf_path)
524 """A slot to store a subprocess.
526 Each instance of this class handles one subprocess.
527 This class is useful to control multiple threads
528 for faster processing.
531 def __init__(self, config_attrs, options, devnull, make_cmd):
532 """Create a new process slot.
535 config_attrs: A list of dictionaris, each of them includes the name,
536 the type, and the default value of the target config.
537 options: option flags.
538 devnull: A file object of '/dev/null'.
539 make_cmd: command name of GNU Make.
541 self.options = options
542 self.build_dir = tempfile.mkdtemp()
543 self.devnull = devnull
544 self.make_cmd = (make_cmd, 'O=' + self.build_dir)
545 self.parser = KconfigParser(config_attrs, options, self.build_dir)
546 self.state = STATE_IDLE
547 self.failed_boards = []
550 """Delete the working directory
552 This function makes sure the temporary directory is cleaned away
553 even if Python suddenly dies due to error. It should be done in here
554 because it is guranteed the destructor is always invoked when the
555 instance of the class gets unreferenced.
557 If the subprocess is still running, wait until it finishes.
559 if self.state != STATE_IDLE:
560 while self.ps.poll() == None:
562 shutil.rmtree(self.build_dir)
564 def add(self, defconfig, num, total):
565 """Assign a new subprocess for defconfig and add it to the slot.
567 If the slot is vacant, create a new subprocess for processing the
568 given defconfig and add it to the slot. Just returns False if
569 the slot is occupied (i.e. the current subprocess is still running).
572 defconfig: defconfig name.
575 Return True on success or False on failure
577 if self.state != STATE_IDLE:
579 cmd = list(self.make_cmd)
580 cmd.append(defconfig)
581 self.ps = subprocess.Popen(cmd, stdout=self.devnull,
582 stderr=subprocess.PIPE)
583 self.defconfig = defconfig
584 self.state = STATE_DEFCONFIG
590 """Check the status of the subprocess and handle it as needed.
592 Returns True if the slot is vacant (i.e. in idle state).
593 If the configuration is successfully finished, assign a new
594 subprocess to build include/autoconf.mk.
595 If include/autoconf.mk is generated, invoke the parser to
596 parse the .config and the include/autoconf.mk, and then set the
597 slot back to the idle state.
600 Return True if the subprocess is terminated, False otherwise
602 if self.state == STATE_IDLE:
605 if self.ps.poll() == None:
608 if self.ps.poll() != 0:
609 errmsg = 'Failed to process.'
610 errout = self.ps.stderr.read()
611 if errout.find('gcc: command not found') != -1:
612 errmsg = 'Compiler not found ('
613 errmsg += color_text(self.options.color, COLOR_YELLOW,
615 errmsg += color_text(self.options.color, COLOR_LIGHT_RED,
617 print >> sys.stderr, log_msg(self.options.color,
621 if self.options.verbose:
622 print >> sys.stderr, color_text(self.options.color,
623 COLOR_LIGHT_CYAN, errout)
624 if self.options.exit_on_error:
625 sys.exit("Exit on error.")
627 # If --exit-on-error flag is not set,
628 # skip this board and continue.
629 # Record the failed board.
630 self.failed_boards.append(self.defconfig)
631 self.state = STATE_IDLE
634 if self.state == STATE_AUTOCONF:
635 self.parser.update_defconfig(self.defconfig)
637 print ' %d defconfigs out of %d\r' % (self.num + 1, self.total),
640 """Save off the defconfig in a consistent way"""
641 cmd = list(self.make_cmd)
642 cmd.append('savedefconfig')
643 self.ps = subprocess.Popen(cmd, stdout=self.devnull,
644 stderr=subprocess.PIPE)
645 self.state = STATE_SAVEDEFCONFIG
648 if self.state == STATE_SAVEDEFCONFIG:
649 if not self.options.dry_run:
650 shutil.move(os.path.join(self.build_dir, 'defconfig'),
651 os.path.join('configs', self.defconfig))
652 self.state = STATE_IDLE
655 self.cross_compile = self.parser.get_cross_compile()
656 cmd = list(self.make_cmd)
657 if self.cross_compile:
658 cmd.append('CROSS_COMPILE=%s' % self.cross_compile)
659 cmd.append('KCONFIG_IGNORE_DUPLICATES=1')
660 cmd.append('include/config/auto.conf')
661 """This will be screen-scraped, so be sure the expected text will be
662 returned consistently on every machine by setting LANG=C"""
663 self.ps = subprocess.Popen(cmd, stdout=self.devnull,
664 env=dict(os.environ, LANG='C'),
665 stderr=subprocess.PIPE)
666 self.state = STATE_AUTOCONF
669 def get_failed_boards(self):
670 """Returns a list of failed boards (defconfigs) in this slot.
672 return self.failed_boards
676 """Controller of the array of subprocess slots."""
678 def __init__(self, config_attrs, options):
679 """Create a new slots controller.
682 config_attrs: A list of dictionaris containing the name, the type,
683 and the default value of the target CONFIG.
684 options: option flags.
686 self.options = options
688 devnull = get_devnull()
689 make_cmd = get_make_cmd()
690 for i in range(options.jobs):
691 self.slots.append(Slot(config_attrs, options, devnull, make_cmd))
693 def add(self, defconfig, num, total):
694 """Add a new subprocess if a vacant slot is found.
697 defconfig: defconfig name to be put into.
700 Return True on success or False on failure
702 for slot in self.slots:
703 if slot.add(defconfig, num, total):
708 """Check if there is a vacant slot.
711 Return True if at lease one vacant slot is found, False otherwise.
713 for slot in self.slots:
719 """Check if all slots are vacant.
722 Return True if all the slots are vacant, False otherwise.
725 for slot in self.slots:
730 def show_failed_boards(self):
731 """Display all of the failed boards (defconfigs)."""
734 for slot in self.slots:
735 failed_boards += slot.get_failed_boards()
737 if len(failed_boards) > 0:
738 msg = [ "The following boards were not processed due to error:" ]
741 print >> sys.stderr, color_text(self.options.color,
742 COLOR_LIGHT_RED, line)
744 with open('moveconfig.failed', 'w') as f:
745 for board in failed_boards:
746 f.write(board + '\n')
748 def move_config(config_attrs, options):
749 """Move config options to defconfig files.
752 config_attrs: A list of dictionaris, each of them includes the name,
753 the type, and the default value of the target config.
754 options: option flags
756 if len(config_attrs) == 0:
757 print 'Nothing to do. exit.'
760 print 'Move the following CONFIG options (jobs: %d)' % options.jobs
761 for config_attr in config_attrs:
762 print ' %s (type: %s, default: %s)' % (config_attr['config'],
764 config_attr['default'])
766 if options.defconfigs:
767 defconfigs = [line.strip() for line in open(options.defconfigs)]
768 for i, defconfig in enumerate(defconfigs):
769 if not defconfig.endswith('_defconfig'):
770 defconfigs[i] = defconfig + '_defconfig'
771 if not os.path.exists(os.path.join('configs', defconfigs[i])):
772 sys.exit('%s - defconfig does not exist. Stopping.' %
775 # All the defconfig files to be processed
777 for (dirpath, dirnames, filenames) in os.walk('configs'):
778 dirpath = dirpath[len('configs') + 1:]
779 for filename in fnmatch.filter(filenames, '*_defconfig'):
780 defconfigs.append(os.path.join(dirpath, filename))
782 slots = Slots(config_attrs, options)
784 # Main loop to process defconfig files:
785 # Add a new subprocess into a vacant slot.
786 # Sleep if there is no available slot.
787 for i, defconfig in enumerate(defconfigs):
788 while not slots.add(defconfig, i, len(defconfigs)):
789 while not slots.available():
790 # No available slot: sleep for a while
791 time.sleep(SLEEP_TIME)
793 # wait until all the subprocesses finish
794 while not slots.empty():
795 time.sleep(SLEEP_TIME)
798 slots.show_failed_boards()
800 def bad_recipe(filename, linenum, msg):
801 """Print error message with the file name and the line number and exit."""
802 sys.exit("%s: line %d: error : " % (filename, linenum) + msg)
804 def parse_recipe(filename):
805 """Parse the recipe file and retrieve the config attributes.
807 This function parses the given recipe file and gets the name,
808 the type, and the default value of the target config options.
811 filename: path to file to be parsed.
813 A list of dictionaris, each of them includes the name,
814 the type, and the default value of the target config.
819 for line in open(filename):
820 tokens = line.split()
822 bad_recipe(filename, linenum,
823 "%d fields in this line. Each line must contain 3 fields"
826 (config, type, default) = tokens
828 # prefix the option name with CONFIG_ if missing
829 if not config.startswith('CONFIG_'):
830 config = 'CONFIG_' + config
832 # sanity check of default values
834 if not default in ('y', 'n'):
835 bad_recipe(filename, linenum,
836 "default for bool type must be either y or n")
837 elif type == 'tristate':
838 if not default in ('y', 'm', 'n'):
839 bad_recipe(filename, linenum,
840 "default for tristate type must be y, m, or n")
841 elif type == 'string':
842 if default[0] != '"' or default[-1] != '"':
843 bad_recipe(filename, linenum,
844 "default for string type must be surrounded by double-quotations")
849 bad_recipe(filename, linenum,
850 "type is int, but default value is not decimal")
852 if len(default) < 2 or default[:2] != '0x':
853 bad_recipe(filename, linenum,
854 "default for hex type must be prefixed with 0x")
858 bad_recipe(filename, linenum,
859 "type is hex, but default value is not hexadecimal")
861 bad_recipe(filename, linenum,
862 "unsupported type '%s'. type must be one of bool, tristate, string, int, hex"
865 config_attrs.append({'config': config, 'type': type, 'default': default})
872 cpu_count = multiprocessing.cpu_count()
873 except NotImplementedError:
876 parser = optparse.OptionParser()
878 parser.add_option('-c', '--color', action='store_true', default=False,
879 help='display the log in color')
880 parser.add_option('-d', '--defconfigs', type='string',
881 help='a file containing a list of defconfigs to move')
882 parser.add_option('-n', '--dry-run', action='store_true', default=False,
883 help='perform a trial run (show log with no changes)')
884 parser.add_option('-e', '--exit-on-error', action='store_true',
886 help='exit immediately on any error')
887 parser.add_option('-H', '--headers-only', dest='cleanup_headers_only',
888 action='store_true', default=False,
889 help='only cleanup the headers')
890 parser.add_option('-j', '--jobs', type='int', default=cpu_count,
891 help='the number of jobs to run simultaneously')
892 parser.add_option('-v', '--verbose', action='store_true', default=False,
893 help='show any build errors as boards are built')
894 parser.usage += ' recipe_file\n\n' + \
895 'The recipe_file should describe config options you want to move.\n' + \
896 'Each line should contain config_name, type, default_value\n\n' + \
898 'CONFIG_FOO bool n\n' + \
899 'CONFIG_BAR int 100\n' + \
900 'CONFIG_BAZ string "hello"\n'
902 (options, args) = parser.parse_args()
908 config_attrs = parse_recipe(args[0])
910 update_cross_compile()
912 check_top_directory()
914 if not options.cleanup_headers_only:
915 move_config(config_attrs, options)
917 cleanup_headers(config_attrs, options.dry_run)
919 if __name__ == '__main__':