本文整理汇总了Python中rpython.translator.tool.cbuild.ExternalCompilationInfo.from_pkg_config方法的典型用法代码示例。如果您正苦于以下问题:Python ExternalCompilationInfo.from_pkg_config方法的具体用法?Python ExternalCompilationInfo.from_pkg_config怎么用?Python ExternalCompilationInfo.from_pkg_config使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rpython.translator.tool.cbuild.ExternalCompilationInfo
的用法示例。
在下文中一共展示了ExternalCompilationInfo.from_pkg_config方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: try_tools
# 需要导入模块: from rpython.translator.tool.cbuild import ExternalCompilationInfo [as 别名]
# 或者: from rpython.translator.tool.cbuild.ExternalCompilationInfo import from_pkg_config [as 别名]
def try_tools():
try:
yield ExternalCompilationInfo.from_pkg_config("ncurses")
except Exception:
pass
try:
yield ExternalCompilationInfo.from_config_tool("ncurses5-config")
except Exception:
pass
示例2: test_from_pkg_config
# 需要导入模块: from rpython.translator.tool.cbuild import ExternalCompilationInfo [as 别名]
# 或者: from rpython.translator.tool.cbuild.ExternalCompilationInfo import from_pkg_config [as 别名]
def test_from_pkg_config(self):
try:
cmd = ['pkg-config', 'ncurses', '--exists']
popen = Popen(cmd)
result = popen.wait()
except OSError:
result = -1
if result != 0:
py.test.skip("failed: %r" % (' '.join(cmd),))
eci = ExternalCompilationInfo.from_pkg_config('ncurses')
assert 'ncurses' in eci.libraries
示例3: str
# 需要导入模块: from rpython.translator.tool.cbuild import ExternalCompilationInfo [as 别名]
# 或者: from rpython.translator.tool.cbuild.ExternalCompilationInfo import from_pkg_config [as 别名]
import pixie.vm.libs.ffi as ffi
import rpython.rlib.rgc as rgc
pkgpath = py.path.local(__file__).dirpath()
srcpath = pkgpath.join("c")
shutil.copyfile(str(srcpath / "uv_ffi.c"), str(udir.udir / "uv_ffi.c"))
shutil.copyfile(str(srcpath / "uv_ffi.h"), str(udir.udir / "uv_ffi.h"))
compilation_info = ExternalCompilationInfo(
includes=['uv.h', "ffi.h", "uv_ffi.h"],
include_dirs=[srcpath],
libraries=["uv", "ffi"],
separate_module_files=[udir.udir / "uv_ffi.c"]).merge(ExternalCompilationInfo.from_pkg_config("libffi"))
def llexternal(*args, **kwargs):
return rffi.llexternal(*args, compilation_info=compilation_info, **kwargs)
uv_work = rffi_platform.Struct("uv_work_t",
[("data", rffi.VOIDP)])
uv_timer_t = rffi.COpaque("uv_timer_t", compilation_info=compilation_info)
uv_baton_t = rffi.COpaque("work_baton_t", compilation_info=compilation_info)
uv_timer = lltype.Ptr(uv_timer_t)
uv_timer_cb = lltype.Ptr(lltype.FuncType([uv_timer, rffi.INT], lltype.Void))