当前位置: 首页>>代码示例>>Python>>正文


Python UnixCCompiler.link方法代码示例

本文整理汇总了Python中distutils.unixccompiler.UnixCCompiler.link方法的典型用法代码示例。如果您正苦于以下问题:Python UnixCCompiler.link方法的具体用法?Python UnixCCompiler.link怎么用?Python UnixCCompiler.link使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在distutils.unixccompiler.UnixCCompiler的用法示例。


在下文中一共展示了UnixCCompiler.link方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_versions

# 需要导入模块: from distutils.unixccompiler import UnixCCompiler [as 别名]
# 或者: from distutils.unixccompiler.UnixCCompiler import link [as 别名]
def get_versions():
    """ Try to find out the versions of gcc and ld.
        If not possible it returns None for it.
    """
    from distutils.version import StrictVersion
    from distutils.spawn import find_executable
    import re

    gcc_exe = find_executable('gcc')
    if gcc_exe:
        out = os.popen(gcc_exe + ' -dumpversion','r')
        out_string = out.read()
        out.close()
        result = re.search('(\d+\.\d+\.\d+)',out_string)
        if result:
            gcc_version = StrictVersion(result.group(1))
        else:
            gcc_version = None
    else:
        gcc_version = None
    # EMX ld has no way of reporting version number, and we use GCC
    # anyway - so we can link OMF DLLs
    ld_version = None
    return (gcc_version, ld_version) 
开发者ID:ofermend,项目名称:medicare-demo,代码行数:26,代码来源:emxccompiler.py

示例2: link

# 需要导入模块: from distutils.unixccompiler import UnixCCompiler [as 别名]
# 或者: from distutils.unixccompiler.UnixCCompiler import link [as 别名]
def link(self,
             target_desc,
             objects,
             output_filename,
             output_dir,
             libraries,
             library_dirs,
             runtime_library_dirs,
             export_symbols = None,
             debug=0,
             extra_preargs=None,
             extra_postargs=None,
             build_temp=None,
             target_lang=None):
        # Include the appropriate MSVC runtime library if Python was built
        # with MSVC >= 7.0 (MinGW standard is msvcrt)
        runtime_library = msvc_runtime_library()
        if runtime_library:
            if not libraries:
                libraries = []
            libraries.append(runtime_library)
        args = (self,
                target_desc,
                objects,
                output_filename,
                output_dir,
                libraries,
                library_dirs,
                runtime_library_dirs,
                None, #export_symbols, we do this in our def-file
                debug,
                extra_preargs,
                extra_postargs,
                build_temp,
                target_lang)
        if self.gcc_version < "3.0.0":
            func = distutils.cygwinccompiler.CygwinCCompiler.link
        else:
            func = UnixCCompiler.link
        func(*args[:func.__code__.co_argcount])
        return 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:43,代码来源:mingw32ccompiler.py

示例3: get_versions

# 需要导入模块: from distutils.unixccompiler import UnixCCompiler [as 别名]
# 或者: from distutils.unixccompiler.UnixCCompiler import link [as 别名]
def get_versions():
    """ Try to find out the versions of gcc and ld.
        If not possible it returns None for it.
    """
    from distutils.version import StrictVersion
    from distutils.spawn import find_executable
    import re

    gcc_exe = find_executable('gcc')
    if gcc_exe:
        out = os.popen(gcc_exe + ' -dumpversion','r')
        try:
            out_string = out.read()
        finally:
            out.close()
        result = re.search('(\d+\.\d+\.\d+)',out_string)
        if result:
            gcc_version = StrictVersion(result.group(1))
        else:
            gcc_version = None
    else:
        gcc_version = None
    # EMX ld has no way of reporting version number, and we use GCC
    # anyway - so we can link OMF DLLs
    ld_version = None
    return (gcc_version, ld_version) 
开发者ID:glmcdona,项目名称:meddle,代码行数:28,代码来源:emxccompiler.py

示例4: link

# 需要导入模块: from distutils.unixccompiler import UnixCCompiler [as 别名]
# 或者: from distutils.unixccompiler.UnixCCompiler import link [as 别名]
def link(self,
             target_desc,
             objects,
             output_filename,
             output_dir,
             libraries,
             library_dirs,
             runtime_library_dirs,
             export_symbols = None,
             debug=0,
             extra_preargs=None,
             extra_postargs=None,
             build_temp=None,
             target_lang=None):
        # Include the appropiate MSVC runtime library if Python was built
        # with MSVC >= 7.0 (MinGW standard is msvcrt)
        runtime_library = msvc_runtime_library()
        if runtime_library:
            if not libraries:
                libraries = []
            libraries.append(runtime_library)
        args = (self,
                target_desc,
                objects,
                output_filename,
                output_dir,
                libraries,
                library_dirs,
                runtime_library_dirs,
                None, #export_symbols, we do this in our def-file
                debug,
                extra_preargs,
                extra_postargs,
                build_temp,
                target_lang)
        if self.gcc_version < "3.0.0":
            func = distutils.cygwinccompiler.CygwinCCompiler.link
        else:
            func = UnixCCompiler.link
        func(*args[:func.__code__.co_argcount])
        return 
开发者ID:abhisuri97,项目名称:auto-alt-text-lambda-api,代码行数:43,代码来源:mingw32ccompiler.py

示例5: get_msvcr

# 需要导入模块: from distutils.unixccompiler import UnixCCompiler [as 别名]
# 或者: from distutils.unixccompiler.UnixCCompiler import link [as 别名]
def get_msvcr():
    """Include the appropriate MSVC runtime library if Python was built
    with MSVC 7.0 or later.
    """
    # FIXME: next code is from issue870382
    # MS C-runtime libraries never support backward compatibility.
    # Linking to a different library without to specify correct runtime
    # version for the headers will link renamed functions to msvcrt.
    # See issue3308: this piece of code is python problem even
    # with correct w32api headers.
    # Issue: for MSVC compiler we can get the version and from version
    # to determine mcvcrt as code below. But what about if python is
    # build with GCC compiler?
    # Output of sys.version is information for python build on first
    # line, on the next line is information for the compiler and the
    # output lack information for the C-runtime.
    msc_pos = sys.version.find('MSC v.')
    if msc_pos != -1:
        msc_ver = sys.version[msc_pos+6:msc_pos+10]
        if msc_ver == '1300':
            # MSVC 7.0
            return ['msvcr70']
        elif msc_ver == '1310':
            # MSVC 7.1
            return ['msvcr71']
        elif msc_ver == '1400':
            # VS2005 / MSVC 8.0
            return ['msvcr80']
        elif msc_ver == '1500':
            # VS2008 / MSVC 9.0
            return ['msvcr90']
        else:
            raise ValueError("Unknown MS Compiler version %s " % msc_ver)
    else:
        return [] 
开发者ID:dxwu,项目名称:BinderFilter,代码行数:37,代码来源:cygwinccompiler.py

示例6: _init_posix

# 需要导入模块: from distutils.unixccompiler import UnixCCompiler [as 别名]
# 或者: from distutils.unixccompiler.UnixCCompiler import link [as 别名]
def _init_posix():
    old_init_posix()
    ld = distutils.sysconfig._config_vars['LDSHARED']
    # distutils.sysconfig._config_vars['LDSHARED'] = ld.replace('gcc','g++')
    # FreeBSD names gcc as cc, so the above find and replace doesn't work.
    # So, assume first entry in ld is the name of the linker -- gcc or cc or
    # whatever.  This is a sane assumption, correct?
    # If the linker is gcc, set it to g++
    link_cmds = ld.split()
    if gcc_exists(link_cmds[0]):
        link_cmds[0] = 'g++'
        ld = ' '.join(link_cmds)

    if (sys.platform == 'darwin'):
        # The Jaguar distributed python 2.2 has -arch i386 in the link line
        # which doesn't seem right.  It omits all kinds of warnings, so
        # remove it.
        ld = ld.replace('-arch i386','')

        # The following line is a HACK to fix a problem with building the
        # freetype shared library under Mac OS X:
        ld += ' -framework AppKit'

        # 2.3a1 on OS X emits a ton of warnings about long double.  OPT
        # appears to not have all the needed flags set while CFLAGS does.
        cfg_vars = distutils.sysconfig._config_vars
        cfg_vars['OPT'] = cfg_vars['CFLAGS']
    distutils.sysconfig._config_vars['LDSHARED'] = ld 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:30,代码来源:build_tools.py


注:本文中的distutils.unixccompiler.UnixCCompiler.link方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。