[rtems-libbsd commit] builder.py: addTargetSourceCPUDependentSourceFiles

Sebastian Huber sebh at rtems.org
Wed Sep 30 13:56:49 UTC 2015


Module:    rtems-libbsd
Branch:    master
Commit:    40f7d5cf7d5353dba29ebcde2d1a51fc66fb33fb
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=40f7d5cf7d5353dba29ebcde2d1a51fc66fb33fb

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Sep 25 14:14:04 2015 +0200

builder.py: addTargetSourceCPUDependentSourceFiles

Avoid and delete this function.

---

 builder.py | 19 +++++--------------
 libbsd.py  | 37 ++++++++++++-------------------------
 wscript    | 25 ++++++++++++-------------
 3 files changed, 29 insertions(+), 52 deletions(-)

diff --git a/builder.py b/builder.py
index 8059475..1f37bc9 100755
--- a/builder.py
+++ b/builder.py
@@ -450,23 +450,14 @@ class Module:
                                     RTEMSPathComposer(), NoConverter(), NoConverter(),
                                     assertSourceFile, sourceFileFragmentComposer)
 
-    def addCPUDependentSourceFiles(self, cpu, files, sourceFileFragmentComposer):
-        self.initCPUDependencies(cpu)
-        self.cpuDependentSourceFiles[cpu] += \
-            self.addFiles(files,
-                          CPUDependentPathComposer(), FromFreeBSDToRTEMSSourceConverter(),
-                          FromRTEMSToFreeBSDSourceConverter(), assertSourceFile,
-                          sourceFileFragmentComposer)
-
-    def addTargetSourceCPUDependentSourceFiles(self, targetCPUs, sourceCPU, files,
-                                               sourceFileFragmentComposer):
-        for cpu in targetCPUs:
+    def addCPUDependentSourceFiles(self, cpus, files, sourceFileFragmentComposer):
+        for cpu in cpus:
             self.initCPUDependencies(cpu)
             self.cpuDependentSourceFiles[cpu] += \
                 self.addFiles(files,
-                              TargetSourceCPUDependentPathComposer(cpu, sourceCPU),
-                              FromFreeBSDToRTEMSSourceConverter(), NoConverter(),
-                              assertSourceFile, sourceFileFragmentComposer)
+                              CPUDependentPathComposer(), FromFreeBSDToRTEMSSourceConverter(),
+                              FromRTEMSToFreeBSDSourceConverter(), assertSourceFile,
+                              sourceFileFragmentComposer)
 
     def addTest(self, testFragementComposer):
         self.files += [File(testFragementComposer.testName,
diff --git a/libbsd.py b/libbsd.py
index 24d4606..3f83cc3 100755
--- a/libbsd.py
+++ b/libbsd.py
@@ -1743,7 +1743,7 @@ def pci(mm):
         ]
     )
     mod.addCPUDependentSourceFiles(
-        'i386',
+        [ 'i386' ],
         [
             'sys/i386/i386/legacy.c',
             'sys/x86/pci/pci_bus.c',
@@ -2367,48 +2367,35 @@ def in_cksum(mm):
             'sys/mips/include/in_cksum.h',
         ]
     )
-    mod.addTargetSourceCPUDependentSourceFiles(
-        [ 'arm', 'avr', 'bfin', 'h8300', 'lm32', 'm32c', 'm32r', 'm68k',
-          'nios2', 'sh', 'sparc', 'v850' ],
-        'mips',
-        [
-            'sys/mips/mips/in_cksum.c',
-        ],
-	mm.generator['source']()
-    )
     mod.addCPUDependentSourceFiles(
-        'i386',
+        [ 'i386' ],
         [
             'sys/i386/i386/in_cksum.c',
         ],
 	mm.generator['source']()
     )
     mod.addCPUDependentSourceFiles(
-        'mips',
-        [
-            'sys/mips/mips/in_cksum.c',
-        ],
-	mm.generator['source']()
-    )
-    mod.addCPUDependentSourceFiles(
-        'powerpc',
+        [ 'powerpc' ],
         [
             'sys/powerpc/powerpc/in_cksum.c',
         ],
 	mm.generator['source']()
     )
     mod.addCPUDependentSourceFiles(
-	'sparc',
+	[ 'sparc64' ],
 	[
-            'sys/mips/mips/in_cksum.c',
+            'sys/sparc64/sparc64/in_cksum.c',
 	],
 	mm.generator['source']()
     )
     mod.addCPUDependentSourceFiles(
-	'sparc64',
-	[
-            'sys/sparc64/sparc64/in_cksum.c',
-	],
+        [
+            'arm', 'avr', 'bfin', 'h8300', 'lm32', 'm32c', 'm32r', 'm68k',
+            'mips', 'nios2', 'sh', 'sparc', 'v850'
+        ],
+        [
+            'sys/mips/mips/in_cksum.c',
+        ],
 	mm.generator['source']()
     )
     return mod
diff --git a/wscript b/wscript
index 673479f..88334e4 100644
--- a/wscript
+++ b/wscript
@@ -1053,42 +1053,41 @@ def build(bld):
               'rtemsbsd/telnetd/pty.c',
               'rtemsbsd/telnetd/telnetd.c']
     if bld.get_env()["RTEMS_ARCH"] == "arm":
-        source += ['freebsd/sys/arm/arm/in_cksum.c']
+        source += ['freebsd/sys/mips/mips/in_cksum.c']
     if bld.get_env()["RTEMS_ARCH"] == "avr":
-        source += ['freebsd/sys/avr/avr/in_cksum.c']
+        source += ['freebsd/sys/mips/mips/in_cksum.c']
     if bld.get_env()["RTEMS_ARCH"] == "bfin":
-        source += ['freebsd/sys/bfin/bfin/in_cksum.c']
+        source += ['freebsd/sys/mips/mips/in_cksum.c']
     if bld.get_env()["RTEMS_ARCH"] == "cflags":
         source += ['default']
     if bld.get_env()["RTEMS_ARCH"] == "h8300":
-        source += ['freebsd/sys/h8300/h8300/in_cksum.c']
+        source += ['freebsd/sys/mips/mips/in_cksum.c']
     if bld.get_env()["RTEMS_ARCH"] == "i386":
         source += ['freebsd/sys/i386/i386/in_cksum.c',
                    'freebsd/sys/i386/i386/legacy.c',
                    'freebsd/sys/x86/pci/pci_bus.c']
     if bld.get_env()["RTEMS_ARCH"] == "lm32":
-        source += ['freebsd/sys/lm32/lm32/in_cksum.c']
+        source += ['freebsd/sys/mips/mips/in_cksum.c']
     if bld.get_env()["RTEMS_ARCH"] == "m32c":
-        source += ['freebsd/sys/m32c/m32c/in_cksum.c']
+        source += ['freebsd/sys/mips/mips/in_cksum.c']
     if bld.get_env()["RTEMS_ARCH"] == "m32r":
-        source += ['freebsd/sys/m32r/m32r/in_cksum.c']
+        source += ['freebsd/sys/mips/mips/in_cksum.c']
     if bld.get_env()["RTEMS_ARCH"] == "m68k":
-        source += ['freebsd/sys/m68k/m68k/in_cksum.c']
+        source += ['freebsd/sys/mips/mips/in_cksum.c']
     if bld.get_env()["RTEMS_ARCH"] == "mips":
         source += ['freebsd/sys/mips/mips/in_cksum.c']
     if bld.get_env()["RTEMS_ARCH"] == "nios2":
-        source += ['freebsd/sys/nios2/nios2/in_cksum.c']
+        source += ['freebsd/sys/mips/mips/in_cksum.c']
     if bld.get_env()["RTEMS_ARCH"] == "powerpc":
         source += ['freebsd/sys/powerpc/powerpc/in_cksum.c']
     if bld.get_env()["RTEMS_ARCH"] == "sh":
-        source += ['freebsd/sys/sh/sh/in_cksum.c']
+        source += ['freebsd/sys/mips/mips/in_cksum.c']
     if bld.get_env()["RTEMS_ARCH"] == "sparc":
-        source += ['freebsd/sys/mips/mips/in_cksum.c',
-                   'freebsd/sys/sparc/sparc/in_cksum.c']
+        source += ['freebsd/sys/mips/mips/in_cksum.c']
     if bld.get_env()["RTEMS_ARCH"] == "sparc64":
         source += ['freebsd/sys/sparc64/sparc64/in_cksum.c']
     if bld.get_env()["RTEMS_ARCH"] == "v850":
-        source += ['freebsd/sys/v850/v850/in_cksum.c']
+        source += ['freebsd/sys/mips/mips/in_cksum.c']
     bld.stlib(target = "bsd",
               features = "c cxx",
               cflags = cflags,



More information about the vc mailing list