[PATCH rtems-net-legacy v2] bsp_drivers: Use os.path for compatibility with non Unix host

Vijay Kumar Banerjee vijay at rtems.org
Mon Apr 19 17:30:32 UTC 2021


---
 bsp_drivers.py | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/bsp_drivers.py b/bsp_drivers.py
index 3ca10c6..ec25c23 100644
--- a/bsp_drivers.py
+++ b/bsp_drivers.py
@@ -36,18 +36,18 @@ def bsp_files(bld):
     include_dirs = {}
     include_files = []
 
-    special_case_dirs = {'atsamv': './bsps/arm/atsam',
-                         'lm32_evr': './bsps/lm32',
-                         'lpc24xx_ea': './bsps/arm/shared/'}
+    special_case_dirs = {'atsamv': os.path.expanduser('bsps/arm/atsam'),
+                         'lm32_evr': os.path.expanduser('bsps/lm32'),
+                         'lpc24xx_ea': os.path.expanduser('bsps/arm/shared/')}
     special_case_sources = {'leon2':
-                            ['./bsps/shared/grlib/net/network_interface_add.c',
-                             './bsps/shared/grlib/net/greth.c'],
+                            [os.path.expanduser('bsps/shared/grlib/net/network_interface_add.c'),
+                             os.path.expanduser('bsps/shared/grlib/net/greth.c')],
                             'leon3':
-                            ['./bsps/shared/grlib/net/network_interface_add.c',
-                             './bsps/shared/grlib/net/greth.c'],
+                            [os.path.expanduser('bsps/shared/grlib/net/network_interface_add.c'),
+                             os.path.expanduser('bsps/shared/grlib/net/greth.c')],
                             'griscv':
-                            ['./bsps/shared/grlib/net/network_interface_add.c',
-                             './bsps/shared/grlib/net/greth.c']}
+                            [os.path.expanduser('bsps/shared/grlib/net/network_interface_add.c'),
+                             os.path.expanduser('bsps/shared/grlib/net/greth.c')]}
 
     bsp_list = bld.env.RTEMS_ARCH_BSP_LIST
 
@@ -57,7 +57,7 @@ def bsp_files(bld):
         include_dirs[bsp] = []
         source_files[bsp] = []
         if bsp not in special_case_dirs:
-            source_dir = os.walk(os.path.join('./bsps', arch, bsp))
+            source_dir = os.walk(os.path.join('bsps', arch, bsp))
         else:
             source_dir = os.walk(special_case_dirs[bsp])
         for root, dirs, files in source_dir:
@@ -70,5 +70,5 @@ def bsp_files(bld):
                         include_dirs[bsp].append(root)
             if bsp in special_case_sources:
                 source_files[bsp].extend(special_case_sources[bsp])
-        include_dirs[bsp].append(os.path.join('./bsps', arch, bsp, 'net'))
+        include_dirs[bsp].append(os.path.join('bsps', arch, bsp, 'net'))
     return (include_dirs, source_files)
-- 
2.26.2



More information about the devel mailing list