+def add_compile_config_file(p_info, config):
+ '''Execute the proper configuration command(s)
+ in the product build directory.
+
+ :param p_info Config: The specific config of the product
+ :param config Config: The global configuration
+ '''
+ # Create the compile config
+ compile_cfg = src.pyconf.Config()
+ for prod_name in p_info.depend:
+ if prod_name not in compile_cfg:
+ compile_cfg.addMapping(prod_name,
+ src.pyconf.Mapping(compile_cfg),
+ "")
+ prod_dep_info = src.product.get_product_config(config, prod_name, False)
+ compile_cfg[prod_name] = prod_dep_info.version
+ # Write it in the install directory of the product
+ compile_cfg_path = os.path.join(p_info.install_dir, src.CONFIG_FILENAME)
+ f = open(compile_cfg_path, 'w')
+ compile_cfg.__save__(f)
+ f.close()
+