modtool: deconflict module include guards from main volk
authorNathan West <nathan.west@nrl.navy.mil>
Mon, 13 Mar 2017 16:25:35 +0000 (12:25 -0400)
committerA. Maitland Bottoms <bottoms@debian.org>
Sun, 27 Aug 2017 17:44:55 +0000 (18:44 +0100)
Gbp-Pq: Name 0009-modtool-deconflict-module-include-guards-from-main-v.patch

python/volk_modtool/volk_modtool_generate.py

index 83e0d26fecc1ba22caca8406ba30a534148493f8..6040a7d9e53509ec199c8419a688283bbd53de6d 100644 (file)
@@ -98,6 +98,9 @@ class volk_modtool:
             os.makedirs(os.path.join(self.my_dict['destination'], 'volk_' + self.my_dict['name'], 'kernels/volk_' + self.my_dict['name']))
 
         current_kernel_names = self.get_current_kernels()
+        need_ifdef_updates = ["constant.h", "volk_complex.h", "volk_malloc.h", "volk_prefs.h",
+                              "volk_common.h", "volk_cpu.tmpl.h", "volk_config_fixed.tmpl.h",
+                              "volk_typedefs.h", "volk.tmpl.h"]
         for root, dirnames, filenames in os.walk(self.my_dict['base']):
             for name in filenames:
                 t_table = map(lambda a: re.search(a, name), current_kernel_names)
@@ -107,10 +110,7 @@ class volk_modtool:
                     instring = open(infile, 'r').read()
                     outstring = re.sub(self.volk, 'volk_' + self.my_dict['name'], instring)
                     # Update the header ifdef guards only where needed
-                    if((name == "constants.h") or
-                       (name == "volk_complex.h") or
-                       (name == "volk_malloc.h") or
-                       (name == "volk_prefs.h")):
+                    if name in need_ifdef_updates:
                         outstring = re.sub(self.volk_included, 'INCLUDED_VOLK_' + self.my_dict['name'].upper(), outstring)
                     newname = re.sub(self.volk, 'volk_' + self.my_dict['name'], name)
                     relpath = os.path.relpath(infile, self.my_dict['base'])