Changeset 23d6e50 in rtems-libbsd


Ignore:
Timestamp:
Apr 3, 2017, 1:18:09 PM (2 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
5283630d2c9d40deb0183696d278e02644fe4326, bc2ba9a9cdc7381c2a4f2ae6ee303be636f31368
Children:
238e275
Parents:
fa4ec51
git-author:
Sebastian Huber <sebastian.huber@…> (04/03/17 13:18:09)
git-committer:
Sebastian Huber <sebastian.huber@…> (10/20/17 12:59:55)
Message:

scripts: Support Linux import

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • builder.py

    rfa4ec51 r23d6e50  
    5151LIBBSD_DIR = "."
    5252FreeBSD_DIR = "freebsd-org"
     53Linux_DIR = "linux-org"
    5354verboseLevel = 0
    5455isDryRun = False
     
    545546        return os.path.join(prefix, 'rtemsbsd', path)
    546547
     548class LinuxPathComposer(PathComposer):
     549    def composeOriginPath(self, path):
     550        return os.path.join(Linux_DIR, path)
     551
     552    def composeLibBSDPath(self, path, prefix):
     553        return os.path.join(prefix, 'linux', path)
     554
    547555class CPUDependentFreeBSDPathComposer(FreeBSDPathComposer):
    548556    def composeLibBSDPath(self, path, prefix):
    549557        path = super(CPUDependentFreeBSDPathComposer, self).composeLibBSDPath(path, prefix)
     558        path = mapCPUDependentPath(path)
     559        return path
     560
     561class CPUDependentLinuxPathComposer(LinuxPathComposer):
     562    def composeLibBSDPath(self, path, prefix):
     563        path = super(CPUDependentLinuxPathComposer, self).composeLibBSDPath(path, prefix)
    550564        path = mapCPUDependentPath(path)
    551565        return path
     
    662676                                    NoConverter(), NoConverter(), assertHeaderFile)
    663677
     678    def addLinuxHeaderFiles(self, files):
     679        self.files += self.addFiles(files,
     680                                    LinuxPathComposer(), FromFreeBSDToRTEMSHeaderConverter(),
     681                                    FromRTEMSToFreeBSDHeaderConverter(), assertHeaderFile)
     682
    664683    def addCPUDependentFreeBSDHeaderFiles(self, files):
    665684        self.files += self.addFiles(files,
    666685                                    CPUDependentFreeBSDPathComposer(), FromFreeBSDToRTEMSHeaderConverter(),
     686                                    FromRTEMSToFreeBSDHeaderConverter(), assertHeaderFile)
     687
     688    def addCPUDependentLinuxHeaderFiles(self, files):
     689        self.files += self.addFiles(files,
     690                                    CPUDependentLinuxPathComposer(), FromFreeBSDToRTEMSHeaderConverter(),
    667691                                    FromRTEMSToFreeBSDHeaderConverter(), assertHeaderFile)
    668692
     
    696720                                    RTEMSPathComposer(), NoConverter(), NoConverter(),
    697721                                    assertSourceFile, sourceFileFragmentComposer)
     722
     723    def addLinuxSourceFiles(self, files, sourceFileFragmentComposer):
     724        self.files += self.addFiles(files,
     725                                    LinuxPathComposer(), FromFreeBSDToRTEMSSourceConverter(),
     726                                    FromRTEMSToFreeBSDSourceConverter(), assertSourceFile,
     727                                    sourceFileFragmentComposer)
    698728
    699729    def addCPUDependentFreeBSDSourceFiles(self, cpus, files, sourceFileFragmentComposer):
     
    706736                              sourceFileFragmentComposer)
    707737
     738    def addCPUDependentLinuxSourceFiles(self, cpus, files, sourceFileFragmentComposer):
     739        for cpu in cpus:
     740            self.initCPUDependencies(cpu)
     741            self.cpuDependentSourceFiles[cpu] += \
     742                self.addFiles(files,
     743                              CPUDependentLinuxPathComposer(), FromFreeBSDToRTEMSSourceConverter(),
     744                              FromRTEMSToFreeBSDSourceConverter(), assertSourceFile,
     745                              sourceFileFragmentComposer)
     746
    708747    def addTest(self, testFragementComposer):
    709748        self.files += [File(testFragementComposer.testName,
  • freebsd-to-rtems.py

    rfa4ec51 r23d6e50  
    123123print("LibBSD Directory:            %s" % (builder.LIBBSD_DIR))
    124124print("FreeBSD Directory:           %s" % (builder.FreeBSD_DIR))
     125print("Linux Directory:             %s" % (builder.Linux_DIR))
    125126print("Direction:                   %s" % (("reverse", "forward")[isForward]))
    126127
     
    138139wasDirectorySet( "LibBSD", builder.LIBBSD_DIR )
    139140wasDirectorySet( "FreeBSD", builder.FreeBSD_DIR )
     141wasDirectorySet( "Linux", builder.Linux_DIR )
    140142
    141143# Are we generating or reverting?
    142144if isForward == True:
    143     print("Forward from", builder.FreeBSD_DIR, "into", builder.LIBBSD_DIR)
     145    print("Forward from", builder.FreeBSD_DIR, "and", builder.Linux_DIR, "into", builder.LIBBSD_DIR)
    144146else:
    145147    print("Reverting from", builder.LIBBSD_DIR)
Note: See TracChangeset for help on using the changeset viewer.