[PATCH 3/3] waf: Move glob operator ** to builder.py

Christian Mauderer list at c-mauderer.de
Thu Aug 10 18:14:34 UTC 2017


From: Christian Mauderer <oss at c-mauderer.de>

This allows a finer decision which headers should be installed.
---
 builder.py       | 26 +++++++++++++-------------
 libbsd_waf.py    | 30 +++++++++++++++---------------
 waf_generator.py |  4 ++--
 3 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/builder.py b/builder.py
index 92a83dd8..21173992 100755
--- a/builder.py
+++ b/builder.py
@@ -220,16 +220,16 @@ def headerPaths():
     normal installation path. """
 
     #         local path                      wildcard             dest path
-    return [('rtemsbsd/include',              '*.h',               ''),
+    return [('rtemsbsd/include',              '**/*.h',            ''),
             ('rtemsbsd/mghttpd',              'mongoose.h',        'mghttpd'),
-            ('freebsd/include',               '*.h',               ''),
-            ('freebsd/sys/bsm',               '*.h',               'bsm'),
-            ('freebsd/sys/cam',               '*.h',               'cam'),
-            ('freebsd/sys/net',               '*.h',               'net'),
-            ('freebsd/sys/net80211',          '*.h',               'net80211'),
-            ('freebsd/sys/netinet',           '*.h',               'netinet'),
-            ('freebsd/sys/netinet6',          '*.h',               'netinet6'),
-            ('freebsd/sys/netipsec',          '*.h',               'netipsec'),
+            ('freebsd/include',               '**/*.h',            ''),
+            ('freebsd/sys/bsm',               '**/*.h',            'bsm'),
+            ('freebsd/sys/cam',               '**/*.h',            'cam'),
+            ('freebsd/sys/net',               '**/*.h',            'net'),
+            ('freebsd/sys/net80211',          '**/*.h',            'net80211'),
+            ('freebsd/sys/netinet',           '**/*.h',            'netinet'),
+            ('freebsd/sys/netinet6',          '**/*.h',            'netinet6'),
+            ('freebsd/sys/netipsec',          '**/*.h',            'netipsec'),
             ('freebsd/crypto/openssl', '*.h', 'openssl'),
             ('freebsd/crypto/openssl/crypto', '*.h', 'openssl'),
             ('freebsd/crypto/openssl/crypto', '(opensslconf|opensslv|crypto).h', 'openssl'),
@@ -288,10 +288,10 @@ def headerPaths():
             ('freebsd/crypto/openssl/crypto/cmac', 'cmac.h',               'openssl'),
             ('freebsd/crypto/openssl/ssl', '(ssl|kssl|ssl2).h', 'openssl'),
             ('freebsd/crypto/openssl/ssl', '*.h', 'openssl'),
-            ('freebsd/sys/rpc',               '*.h',               'rpc'),
-            ('freebsd/sys/sys',               '*.h',               'sys'),
-            ('freebsd/sys/vm',                '*.h',               'vm'),
-            ('freebsd/sys/dev/mii',           '*.h',               'dev/mii'),
+            ('freebsd/sys/rpc',               '**/*.h',            'rpc'),
+            ('freebsd/sys/sys',               '**/*.h',            'sys'),
+            ('freebsd/sys/vm',                '**/*.h',            'vm'),
+            ('freebsd/sys/dev/mii',           '**/*.h',            'dev/mii'),
             ('mDNSResponder/mDNSCore',        'mDNSDebug.h',       ''),
             ('mDNSResponder/mDNSCore',        'mDNSEmbeddedAPI.h', ''),
             ('mDNSResponder/mDNSShared',      'dns_sd.h',          ''),
diff --git a/libbsd_waf.py b/libbsd_waf.py
index 4d69e628..499a85ad 100644
--- a/libbsd_waf.py
+++ b/libbsd_waf.py
@@ -187,7 +187,7 @@ def build(bld):
     for headers in header_build_copy_paths:
         target = os.path.join("build-include", headers[2])
         start_dir = bld.path.find_dir(headers[0])
-        for header in start_dir.ant_glob("**/" + headers[1]):
+        for header in start_dir.ant_glob(headers[1]):
             relsourcepath = header.path_from(start_dir)
             targetheader = os.path.join(target, relsourcepath)
             bld(features = 'subst',
@@ -2292,16 +2292,16 @@ def build(bld):
 
     # Installs.    
     bld.install_files("${PREFIX}/" + rtems.arch_bsp_lib_path(bld.env.RTEMS_VERSION, bld.env.RTEMS_ARCH_BSP), ["libbsd.a"])
-    header_paths = [('rtemsbsd/include', '*.h', ''),
+    header_paths = [('rtemsbsd/include', '**/*.h', ''),
                      ('rtemsbsd/mghttpd', 'mongoose.h', 'mghttpd'),
-                     ('freebsd/include', '*.h', ''),
-                     ('freebsd/sys/bsm', '*.h', 'bsm'),
-                     ('freebsd/sys/cam', '*.h', 'cam'),
-                     ('freebsd/sys/net', '*.h', 'net'),
-                     ('freebsd/sys/net80211', '*.h', 'net80211'),
-                     ('freebsd/sys/netinet', '*.h', 'netinet'),
-                     ('freebsd/sys/netinet6', '*.h', 'netinet6'),
-                     ('freebsd/sys/netipsec', '*.h', 'netipsec'),
+                     ('freebsd/include', '**/*.h', ''),
+                     ('freebsd/sys/bsm', '**/*.h', 'bsm'),
+                     ('freebsd/sys/cam', '**/*.h', 'cam'),
+                     ('freebsd/sys/net', '**/*.h', 'net'),
+                     ('freebsd/sys/net80211', '**/*.h', 'net80211'),
+                     ('freebsd/sys/netinet', '**/*.h', 'netinet'),
+                     ('freebsd/sys/netinet6', '**/*.h', 'netinet6'),
+                     ('freebsd/sys/netipsec', '**/*.h', 'netipsec'),
                      ('freebsd/crypto/openssl', '*.h', 'openssl'),
                      ('freebsd/crypto/openssl/crypto', '*.h', 'openssl'),
                      ('freebsd/crypto/openssl/crypto', '(opensslconf|opensslv|crypto).h', 'openssl'),
@@ -2360,10 +2360,10 @@ def build(bld):
                      ('freebsd/crypto/openssl/crypto/cmac', 'cmac.h', 'openssl'),
                      ('freebsd/crypto/openssl/ssl', '(ssl|kssl|ssl2).h', 'openssl'),
                      ('freebsd/crypto/openssl/ssl', '*.h', 'openssl'),
-                     ('freebsd/sys/rpc', '*.h', 'rpc'),
-                     ('freebsd/sys/sys', '*.h', 'sys'),
-                     ('freebsd/sys/vm', '*.h', 'vm'),
-                     ('freebsd/sys/dev/mii', '*.h', 'dev/mii'),
+                     ('freebsd/sys/rpc', '**/*.h', 'rpc'),
+                     ('freebsd/sys/sys', '**/*.h', 'sys'),
+                     ('freebsd/sys/vm', '**/*.h', 'vm'),
+                     ('freebsd/sys/dev/mii', '**/*.h', 'dev/mii'),
                      ('mDNSResponder/mDNSCore', 'mDNSDebug.h', ''),
                      ('mDNSResponder/mDNSCore', 'mDNSEmbeddedAPI.h', ''),
                      ('mDNSResponder/mDNSShared', 'dns_sd.h', ''),
@@ -2372,7 +2372,7 @@ def build(bld):
         ipath = os.path.join(rtems.arch_bsp_include_path(bld.env.RTEMS_VERSION, bld.env.RTEMS_ARCH_BSP), headers[2])
         start_dir = bld.path.find_dir(headers[0])
         bld.install_files("${PREFIX}/" + ipath,
-                          start_dir.ant_glob("**/" + headers[1]),
+                          start_dir.ant_glob(headers[1]),
                           cwd = start_dir,
                           relative_trick = True)
 
diff --git a/waf_generator.py b/waf_generator.py
index add4938c..a482623a 100755
--- a/waf_generator.py
+++ b/waf_generator.py
@@ -460,7 +460,7 @@ class ModuleManager(builder.ModuleManager):
         self.add('    for headers in header_build_copy_paths:')
         self.add('        target = os.path.join("%s", headers[2])' % (builder.buildInclude()))
         self.add('        start_dir = bld.path.find_dir(headers[0])')
-        self.add('        for header in start_dir.ant_glob("**/" + headers[1]):')
+        self.add('        for header in start_dir.ant_glob(headers[1]):')
         self.add('            relsourcepath = header.path_from(start_dir)')
         self.add('            targetheader = os.path.join(target, relsourcepath)')
         self.add('            bld(features = \'subst\',')
@@ -651,7 +651,7 @@ class ModuleManager(builder.ModuleManager):
         self.add('        ipath = os.path.join(rtems.arch_bsp_include_path(bld.env.RTEMS_VERSION, bld.env.RTEMS_ARCH_BSP), headers[2])')
         self.add('        start_dir = bld.path.find_dir(headers[0])')
         self.add('        bld.install_files("${PREFIX}/" + ipath,')
-        self.add('                          start_dir.ant_glob("**/" + headers[1]),')
+        self.add('                          start_dir.ant_glob(headers[1]),')
         self.add('                          cwd = start_dir,')
         self.add('                          relative_trick = True)')
         self.add('')
-- 
2.13.4




More information about the devel mailing list