Changeset faa3583 in rtems-source-builder for source-builder/sb/pkgconfig.py


Ignore:
Timestamp:
Feb 12, 2014, 2:13:28 AM (6 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
4.10, 4.11, 4.9, master
Children:
587aa5f
Parents:
d5c7c1f
Message:

sb: Fixed from Fedora testing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source-builder/sb/pkgconfig.py

    rd5c7c1f rfaa3583  
    4343
    4444def default_prefix():
    45     paths = ['/usr', '/usr/local']
     45    paths = []
     46    defaults = ['/usr', '/usr/share', '/lib', '/lib64', '/usr/lib', '/usr/lib64', '/usr/local']
     47    for d in defaults:
     48        if os.path.exists(d):
     49            paths += [d]
    4650    if 'PKG_CONFIG_PATH' in os.environ:
    4751        paths += os.environ['PKG_CONFIG_PATH'].split(':')
     
    184188                        self.paths += [prefix]
    185189            self._log('paths: %s' % (', '.join(self.paths)))
    186         if 'PKG_CONFIG_SYSROOT_DIR' in os.environ:
    187             self.defines['sysroot'] = os.environ['PKG_CONFIG_SYSROOT_DIR']
     190        if 'sysroot' in self.defines:
    188191            self._log('sysroot: %s' % (self.defines['sysroot']))
    189         if 'PKG_CONFIG_BUILD_TOP_DIR' in os.environ:
    190             self.defines['top_builddir'] = os.environ['PKG_CONFIG_BUILD_TOP_DIR']
     192        if 'top_builddir' in self.defines:
    191193            self._log('top_builddir: %s' % (self.defines['top_builddir']))
    192194        if self.name_:
     
    238240            self.nodes[nt] = {}
    239241        self.libraries = []
     242        if 'PKG_CONFIG_SYSROOT_DIR' in os.environ:
     243            self.defines['sysroot'] = os.environ['PKG_CONFIG_SYSROOT_DIR']
     244        if 'PKG_CONFIG_BUILD_TOP_DIR' in os.environ:
     245            self.defines['top_builddir'] = os.environ['PKG_CONFIG_BUILD_TOP_DIR']
    240246
    241247    def _log(self, s):
     
    279285        if 'top_builddir' in self.defines:
    280286            top_builddir = self.defines['top_builddir']
    281             if self.file.startswith(top_builddir) and not s.startswith(top_builddir):
     287            if self.file_.startswith(top_builddir):
    282288                offset = 0
    283289                while True:
     
    286292                        break
    287293                    if offset + dash + 2 < len(s) and s[offset + dash + 1] in 'LI':
    288                         s = s[:offset + dash + 2] + top_builddir + s[offset + dash + 2:]
     294                        path = s[offset + dash + 2:]
     295                        if not path.startswith(top_builddir):
     296                            s = s[:offset + dash + 2] + top_builddir + path
    289297                    offset += dash + 1
    290298        return s
     
    348356    def name_from_file(self, file = None):
    349357        if file is None:
    350             file = self.file
     358            file = self.file_
    351359        if file is None:
    352360            return None
     
    421429            self.file_ = file
    422430        else:
    423             self._log('load: %s (libraries)' % (name))
    424431            self.libraries = self._find_libraries(name)
    425432        for nt in package.node_types:
Note: See TracChangeset for help on using the changeset viewer.