[hipl-commit] [tiny] Rev 3747: Fixed build with all modules disabled.

  • From: Tim Just <tim.just@xxxxxxxxxxxxxx>
  • To: hipl-commit@xxxxxxxxxxxxx
  • Date: Tue, 30 Mar 2010 19:28:42 +0300

Committer: Tim Just <tim.just@xxxxxxxxxxxxxx>
Date: 30/03/2010 at 19:28:42
Revision: 3747
Revision-id: tim.just@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Branch nick: tiny

Log:
  Fixed build with all modules disabled.
  
  Building failed when all modules where disabled, because the needed header
  files where not created. Now the application list is defined in
  process_modules.py and the needed header files are generated also in the
  case that all modules are disabled.

Modified:
  M  process_modules.py

=== modified file 'process_modules.py'
--- process_modules.py  2010-03-30 15:54:55 +0000
+++ process_modules.py  2010-03-30 16:28:26 +0000
@@ -16,7 +16,7 @@
 WARNING_STRING += 'Do NOT edit!'
 
 # Parses the XML document at 'path' and returns a dictionary with module info
-def parse_module_info(path, applications, required_modules):
+def parse_module_info(path, required_modules):
 
     file = open(path, "r")
     dom = xml.dom.minidom.parse(file)
@@ -62,12 +62,11 @@
     for current_app in dom.getElementsByTagName('application'):
         app_info = {}
         name = str(current_app.attributes['name'].value)
-        applications.add(name)
         app_info['header_file'] = 
str(current_app.attributes['header_file'].value)
         app_info['init_function'] = 
str(current_app.attributes['init_function'].value)
         module_info['application'][name] = app_info
 
-    return (applications, module_name, module_info, required_modules)
+    return (module_name, module_info, required_modules)
 
 # Tries to read the XML configuration files for all sub-folders in the given
 # directory and returns a dictionary containing the module information
@@ -76,7 +75,6 @@
     # Initialize output variable
     module_info = {}
     required_modules = set()
-    applications = set()
 
     # Iterate through all sub directories in MODULES_DIR
     for current_module in glob.glob(MODULES_DIR + '/*/'):
@@ -93,9 +91,8 @@
 
         try:
             path = os.path.join(current_module, MODULE_INFO_FILE)
-            (applications, module_name, info, required_modules) = 
parse_module_info(path,
-                                                                       
applications,
-                                                                       
required_modules)
+            (module_name, info, required_modules) = parse_module_info(path,
+                                                                      
required_modules)
             print '|    state:        ' + 'ENABLED'
             print '|    version:      ' + info['version'] + '\n|'
             module_info[module_name] = info
@@ -104,7 +101,7 @@
             print '\'' + path + '\' failed!'
             print '|    ...ignoring this directory\n|'
 
-    return (applications, module_info, required_modules)
+    return (module_info, required_modules)
 
 # Checks the module_info data structure for missing dependencies and conflicts
 # between modules. Returns a
@@ -183,6 +180,9 @@
             hdr_file = open(hdr_file_path, 'w')
             try:
                 app_string = 'HIP_MODULES_' + current_app.upper() + 
'_MODULES_H'
+                init_function_string = 'static int (*' + current_app
+                init_function_string += '_init_functions[])(void) = {'
+
                 hdr_file.write('/* ' + WARNING_STRING + ' */\n')
                 hdr_file.write('#ifndef ' + app_string + '\n')
                 hdr_file.write('#define ' + app_string + '\n')
@@ -213,12 +213,7 @@
                             hdr_file.write(', ')
                         hdr_file.write('"' + module + '"')
                         first_loop = False
-                    hdr_file.write('};')
-
-                    hdr_file.write('\n\n')
-                    init_function_string = 'static int (*' + current_app
-                    init_function_string += '_init_functions[' + num_modules
-                    init_function_string += '])(void) = {'
+                    hdr_file.write('};\n\n')
                     hdr_file.write(init_function_string)
 
                     first_loop = True
@@ -270,6 +265,7 @@
 def main():
     srcdir = None
     disabled_modules = None
+    applications = set(['hipd'])
 
     try:
         opts, args = getopt.getopt(sys.argv[1:],
@@ -289,8 +285,8 @@
     if disabled_modules:
         disabled_modules = disabled_modules.rsplit(',')
 
-    (applications, module_info, required_modules) = 
read_module_info(os.path.join(srcdir, MODULES_DIR),
-                                                                     
disabled_modules)
+    (module_info, required_modules) = read_module_info(os.path.join(srcdir, 
MODULES_DIR),
+                                                       disabled_modules)
 
     (includes, init_functions) = process_module_info(module_info)

Other related posts:

  • » [hipl-commit] [tiny] Rev 3747: Fixed build with all modules disabled. - Tim Just