[PATCH rtems-lwip v2 1/7] lwip.py: Change arch and bsp check method

Duc Doan dtbpkmte at gmail.com
Tue Sep 6 16:20:29 UTC 2022


---
 lwip.py | 30 +++++++++++++++++-------------
 1 file changed, 17 insertions(+), 13 deletions(-)

diff --git a/lwip.py b/lwip.py
index 84eef2c..9db5348 100644
--- a/lwip.py
+++ b/lwip.py
@@ -99,6 +99,8 @@ def build(bld):
     drv_incl = []
     arch_lib_path = rtems.arch_bsp_lib_path(bld.env.RTEMS_VERSION,
                                             bld.env.RTEMS_ARCH_BSP)
+    arch = rtems.arch(bld.env.RTEMS_ARCH_BSP)
+    bsp = rtems.bsp(bld.env.RTEMS_ARCH_BSP)
     with open('file-import.json', 'r') as cf:
         files = json.load(cf)
         for f in files['files-to-import']:
@@ -118,27 +120,29 @@ def build(bld):
                     sources.append(os.path.join(path, name))
         return sources
 
-    # These files will not compile for BSPs other than TMS570
-    if bld.env.RTEMS_ARCH_BSP.startswith('arm-rtems6-tms570ls3137_hdk'):
-        drv_incl.append('uLan/ports/driver/tms570_emac')
-        drv_incl.append('uLan/ports/os')
-        driver_source.extend(walk_sources('uLan/ports/driver/tms570_emac'))
+    if arch == 'arm':
+        # These files will not compile for BSPs other than TMS570
+        if bsp.startswith('tms570ls3137_hdk'):
+            drv_incl.append('uLan/ports/driver/tms570_emac')
+            drv_incl.append('uLan/ports/os')
+            driver_source.extend(walk_sources('uLan/ports/driver/tms570_emac'))
+
+        # These files will only compile for BeagleBone BSPs
+        if bsp.startswith('beaglebone'):
+            driver_source.extend(walk_sources('rtemslwip/beaglebone'))
+            drv_incl.append('rtemslwip/beaglebone')
+            drv_incl.append('cpsw/src/include')
+            driver_source.extend(walk_sources('cpsw/src'))
 
-    # These files will only compile for BeagleBone BSPs
-    if bld.env.RTEMS_ARCH_BSP.startswith('arm-rtems6-beaglebone'):
-        driver_source.extend(walk_sources('rtemslwip/beaglebone'))
-        drv_incl.append('rtemslwip/beaglebone')
-        drv_incl.append('cpsw/src/include')
-        driver_source.extend(walk_sources('cpsw/src'))
 
     # These files will only compile for BSPs on Xilinx hardware
     is_xilinx_bsp = False
     is_aarch64_bsp = False
     is_qemu = False
-    if bld.env.RTEMS_ARCH_BSP.startswith('aarch64-rtems6-xilinx_zynqmp'):
+    if arch == 'aarch64' and bsp.startswith('xilinx_zynqmp'):
         is_xilinx_bsp = True
         is_aarch64_bsp = True
-    if bld.env.RTEMS_ARCH_BSP.endswith('_qemu'):
+    if bsp.endswith('_qemu'):
         is_qemu = True
     if is_xilinx_bsp:
         drv_incl.extend(xilinx_drv_incl)
-- 
2.37.2



More information about the devel mailing list