예제 #1
0
def try_tools():
    try:
        yield ExternalCompilationInfo.from_config_tool("ncursesw6-config")
    except Exception:
        pass
    try:
        yield ExternalCompilationInfo.from_config_tool("ncurses5-config")
    except Exception:
        pass
    try:
        yield ExternalCompilationInfo.from_pkg_config("ncursesw")
    except Exception:
        pass
    try:
        yield ExternalCompilationInfo.from_pkg_config("ncursesw")
    except Exception:
        pass
예제 #2
0
파일: fficurses.py 프로젝트: charred/pypy
def try_tools():
    try:
        yield ExternalCompilationInfo.from_pkg_config("ncurses")
    except Exception:
        pass
    try:
        yield ExternalCompilationInfo.from_config_tool("ncurses5-config")
    except Exception:
        pass
예제 #3
0
 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
예제 #4
0
 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
예제 #5
0
def configure_boehm(platform=None):
    if platform is None:
        from rpython.translator.platform import platform
    if sys.platform == 'win32':
        import platform as host_platform  # just to ask for the arch. Confusion-alert!
        if host_platform.architecture()[0] == '32bit':
            library_dir = 'Release'
            libraries = ['gc']
            includes = ['gc.h']
        else:
            library_dir = ''
            libraries = ['gc64_dll']
            includes = ['gc.h']
        # since config_external_library does not use a platform kwarg,
        # somehow using a platform kw arg make the merge fail in
        # config_external_library
        platform = None
    else:
        library_dir = ''
        libraries = ['gc']
        includes = ['gc/gc.h']
    try:
        eci = ExternalCompilationInfo.from_pkg_config('bdw-gc')
        eci.includes += tuple(includes)
        return eci
    except ImportError:
        eci = ExternalCompilationInfo(
            platform=platform,
            includes=includes,
            libraries=libraries,
        )
    return configure_external_library(
        'gc',
        eci,
        [dict(prefix='gc-', include_dir='include', library_dir=library_dir)],
        symbol='GC_init')
예제 #6
0
파일: uv.py 프로젝트: andrewchambers/pixie
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))