--- /dev/null
+#!/usr/bin/python3
+# -*- coding: utf-8 -*-
+
+from optparse import OptionParser
+import os
+
+def main():
+ parser = OptionParser(usage='usage: %prog [options] files...')
+ parser.description = 'Generate a table of the Graphviz compile ' \
+ 'configuration for different platforms from files generated by the ' \
+ './configure command.'
+ parser.add_option('-v', '--verbose', action='store_true',
+ dest='verbose', default=False,
+ help='Log info about what is going on')
+
+ (opts, args) = parser.parse_args()
+
+ table = {}
+ table_sections = []
+ component_names = {}
+ platforms = []
+
+ for filename in args:
+ os_path = os.path.dirname(filename)
+ os_version_id = os.path.basename(os_path)
+ os_id = os.path.basename(os.path.dirname(os_path))
+ platform = os_id.capitalize() + ' ' + os_version_id
+ if platform not in platforms:
+ platforms.append(platform)
+ fp = open(filename, 'r')
+ lines = fp.readlines()
+ for line in lines:
+ item = [item.strip() for item in line.split(':')]
+ if len(item) == 2:
+ if item[1] == '':
+ section_name = item[0]
+ if section_name not in table:
+ table[section_name] = {};
+ table_sections.append(section_name)
+ component_names[section_name] = []
+ else:
+ component_name, component_value = item;
+ if component_name not in table[section_name]:
+ table[section_name][component_name] = {};
+ component_names[section_name].append(component_name)
+ table[section_name][component_name][platform] = component_value
+
+# Python trick to get a main routine
+if __name__ == "__main__":
+ main()