build_fix_install_rpath.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:scm-workbench 作者: barry-scott 项目源码 文件源码
def getDylibs( self, filename ):
        all_dylibs = []
        res = subprocess.run( ['otool', '-l', filename], stdout=subprocess.PIPE, universal_newlines=True )
        state = self.ST_IDLE
        for line in res.stdout.split('\n'):
            words = line.strip().split()
            if state == self.ST_IDLE:
                if words == ['cmd','LC_LOAD_DYLIB']:
                    state = self.ST_DYNLIB

            elif state == self.ST_DYNLIB:
                if words[0:1] == ['name']:
                    path = words[1]
                    all_dylibs.append( path )
                    state = self.ST_IDLE

        return all_dylibs
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号