示例#1
0
def build_runtime(host_phase,target_phase):
    path = Path ('src/flx_async')
    buildsystem.copy_hpps_to_rtl(target_phase.ctx,
        path / 'flx_async.hpp',
    )

    dst = 'host/lib/rtl/flx_async'
    suffix = '.so'
    srcs = [copy(ctx=target_phase.ctx, src=f, dst=target_phase.ctx.buildroot / f) for f in ['src/flx_async/flx_async.cpp']]
    includes = [
        target_phase.ctx.buildroot / 'host/lib/rtl',
        target_phase.ctx.buildroot / 'share/lib/rtl'
    ]
    macros = ['BUILD_ASYNC']
    libs = [
        call('buildsystem.flx_pthread.build_runtime', target_phase),
        call('buildsystem.flx_gc.build_runtime', host_phase,target_phase),
    ]

    return Record(
        static=buildsystem.build_cxx_static_lib(target_phase, dst, srcs,
            includes=includes,
            macros=macros,
            libs=[lib.static for lib in libs]),
        shared=buildsystem.build_cxx_shared_lib(target_phase, dst, srcs,
            includes=includes,
            macros=macros,
            libs=[lib.shared for lib in libs]))
示例#2
0
文件: flx_glob.py 项目: arowM/felix
def build_runtime(host_phase, target_phase):
    path = Path('src/unixem')

    buildsystem.copy_hpps_to_rtl(target_phase.ctx,
        path / 'flx_glob.hpp',
    )

    dst = target_phase.ctx.buildroot / 'lib/rtl/flx_glob'
    srcs = []
    includes = [target_phase.ctx.buildroot / 'config/target']
    macros = ['BUILD_GLOB']
    libs = [call('buildsystem.flx_gc.build_runtime', host_phase, target_phase)]

    if 'win32' in target_phase.platform:
        srcs.extend((path / 'flx_glob.cpp', path / 'unixem_util.cpp'))

        return Record(
          static=buildsystem.build_cxx_static_lib(target_phase, dst, srcs,
              includes=includes,
              macros=macros,
              libs=[lib.static for lib in libs]),
          shared=buildsystem.build_cxx_shared_lib(target_phase, dst, srcs,
              includes=includes,
              macros=macros,
              libs=[lib.shared for lib in libs]))
    else:
        return Record()
示例#3
0
def build_runtime(phase):
    dst = 'lib/rtl/flx_async'
    suffix = '.so'
    srcs = ['src/flx_async/flx_async.cpp']
    includes = [
        phase.ctx.buildroot / 'config/target',
        'src/exceptions',
        'src/demux',
        'src/faio',
        'src/gc',
        'src/pthread',
        'src/rtl',
    ]
    macros = ['BUILD_ASYNC']
    libs = [
        call('buildsystem.flx_pthread.build_runtime', phase),
        call('buildsystem.faio.build_runtime', phase),
        call('buildsystem.demux.build_runtime', phase),
    ]

    return Record(
        static=buildsystem.build_cxx_static_lib(phase, dst, srcs,
            includes=includes,
            macros=macros,
            libs=[lib.static for lib in libs]),
        shared=buildsystem.build_cxx_shared_lib(phase, dst, srcs,
            includes=includes,
            macros=macros,
            libs=[lib.shared for lib in libs]))
示例#4
0
def build_runtime(phase):
    path = Path('src/exceptions')

    buildsystem.copy_hpps_to_rtl(
        phase.ctx,
        path / 'flx_exceptions.hpp',
        path / 'flx_eh.hpp',
    )

    srcs = [
        copy(ctx=phase.ctx, src=f, dst=phase.ctx.buildroot / f) for f in [
            path / 'flx_exceptions.cpp',
            path / 'flx_eh.cpp',
        ]
    ]
    includes = [
        'src/rtl', phase.ctx.buildroot / 'host/lib/rtl',
        phase.ctx.buildroot / 'share/lib/rtl'
    ]
    macros = ['BUILD_FLX_EXCEPTIONS']

    dst = 'host/lib/rtl/flx_exceptions'
    return Record(static=buildsystem.build_cxx_static_lib(phase,
                                                          dst,
                                                          srcs,
                                                          includes=includes,
                                                          macros=macros),
                  shared=buildsystem.build_cxx_shared_lib(phase,
                                                          dst,
                                                          srcs,
                                                          includes=includes,
                                                          macros=macros))
示例#5
0
def build_runtime(host_phase, target_phase):
    path = Path('src', 'rtl')

    buildsystem.copy_hpps_to_rtl(target_phase.ctx,
        path / 'flx_rtl.hpp',
        path / 'flx_rtl_shapes.hpp',
        path / 'flx_compiler_support_headers.hpp',
        path / 'flx_compiler_support_bodies.hpp',
        path / 'flx_dynlink.hpp',
        path / 'flx_i18n.hpp',
        path / 'flx_ioutil.hpp',
        path / 'flx_strutil.hpp',
        path / 'flx_executil.hpp',
        path / 'flx_sync.hpp',
        path / 'flx_world.hpp',
        path / 'flx_async_world.hpp',
        path / 'flx_world_config.hpp',
        path / 'plat_linux.hpp',
    )

    for f in Path.glob(path/"*.hpp"):
      print("Copying " + f + " --> " +target_phase.ctx.buildroot/f )
      copy(ctx=target_phase.ctx, src=f,dst=target_phase.ctx.buildroot/f)

    srcs = [copy(ctx=target_phase.ctx, src=f, dst=target_phase.ctx.buildroot / f) for f in Path.glob(path / '*.cpp')]
    includes = [
        target_phase.ctx.buildroot / 'host/lib/rtl',
        target_phase.ctx.buildroot / 'share/lib/rtl'
    ]
    macros = ['BUILD_RTL']
    libs = [
        call('buildsystem.flx_async.build_runtime', host_phase,target_phase),
        call('buildsystem.flx_exceptions.build_runtime', target_phase),
        call('buildsystem.flx_gc.build_runtime', host_phase, target_phase),
    ]

    dlfcn_h = config_call('fbuild.config.c.posix.dlfcn_h',
        target_phase.platform,
        target_phase.cxx.static,
        target_phase.cxx.shared)

    if dlfcn_h.dlopen:
        external_libs = dlfcn_h.external_libs
    else:
        external_libs = []

    dst = 'host/lib/rtl/flx'
    return Record(
        static=buildsystem.build_cxx_static_lib(target_phase, dst, srcs,
            includes=includes,
            macros=macros,
            libs=[lib.static for lib in libs],
            external_libs=external_libs),
        shared=buildsystem.build_cxx_shared_lib(target_phase, dst, srcs,
            includes=includes,
            macros=macros,
            libs=[lib.shared for lib in libs],
            external_libs=external_libs))
示例#6
0
def build_runtime(host_phase, target_phase):
    path = Path('src/faio')

    buildsystem.copy_hpps_to_rtl(
        target_phase.ctx,
        path / 'faio_job.hpp',
        path / 'faio_timer.hpp',
        path / 'faio_posixio.hpp',
        path / 'faio_winio.hpp',
    )

    dst = 'host/lib/rtl/faio'
    srcs = [
        path / 'faio_job.cpp',
        path / 'faio_timer.cpp',
    ]
    includes = [
        target_phase.ctx.buildroot / 'host/lib/rtl',
        Path('src', 'flx_async'),
        Path('src', 'pthread'),
        Path('src', 'demux'),
        Path('src', 'rtl'),
        Path('src', 'exceptions'),
        Path('src', 'gc'),
        path,
    ]
    macros = ['BUILD_FAIO']
    libs = [
        call('buildsystem.flx_pthread.build_runtime', target_phase),
        call('buildsystem.flx_async.build_runtime', host_phase, target_phase),
        call('buildsystem.demux.build_runtime', target_phase),
    ]

    if 'win32' in target_phase.platform:
        srcs.append(path / 'faio_winio.cpp')
        includes.append(Path('src', 'demux', 'win'))

    if 'posix' in target_phase.platform:
        srcs.append(path / 'faio_posixio.cpp')
        includes.append(Path('src', 'demux', 'posix'))

    return Record(static=buildsystem.build_cxx_static_lib(
        target_phase,
        dst,
        srcs,
        includes=includes,
        macros=macros,
        libs=[lib.static for lib in libs]),
                  shared=buildsystem.build_cxx_shared_lib(
                      target_phase,
                      dst,
                      srcs,
                      includes=includes,
                      macros=macros,
                      libs=[lib.shared for lib in libs]))
示例#7
0
def build_runtime(host_phase, target_phase):
    path = Path('src', 'rtl')

    buildsystem.copy_hpps_to_rtl(target_phase.ctx,
        target_phase.ctx.buildroot / 'config/target/flx_rtl_config.hpp',
        target_phase.ctx.buildroot / 'config/target/flx_meta.hpp',
        path / 'flx_rtl.hpp',
        path / 'flx_compiler_support_headers.hpp',
        path / 'flx_compiler_support_bodies.hpp',
        path / 'flx_dynlink.hpp',
        path / 'flx_i18n.hpp',
        path / 'flx_ioutil.hpp',
        path / 'flx_strutil.hpp',
        path / 'flx_executil.hpp',
    )

    dst = 'lib/rtl/flx'
    srcs = Path.glob(path / '*.cpp')
    includes = [
        target_phase.ctx.buildroot / 'config/target',
        'src/exceptions',
        'src/demux',
        'src/faio',
        'src/judy/src',
        'src/gc',
        'src/pthread',
    ]
    macros = ['BUILD_RTL']
    libs = [
        call('buildsystem.flx_async.build_runtime', target_phase),
        call('buildsystem.flx_exceptions.build_runtime', target_phase),
        call('buildsystem.flx_gc.build_runtime', host_phase, target_phase),
    ]

    dlfcn_h = config_call('fbuild.config.c.posix.dlfcn_h',
        target_phase.platform,
        target_phase.cxx.static,
        target_phase.cxx.shared)

    if dlfcn_h.dlopen:
        external_libs = dlfcn_h.external_libs
    else:
        external_libs = []

    return Record(
        static=buildsystem.build_cxx_static_lib(target_phase, dst, srcs,
            includes=includes,
            macros=macros,
            libs=[lib.static for lib in libs],
            external_libs=external_libs),
        shared=buildsystem.build_cxx_shared_lib(target_phase, dst, srcs,
            includes=includes,
            macros=macros,
            libs=[lib.shared for lib in libs],
            external_libs=external_libs))
示例#8
0
def build_runtime(phase):
    path = Path('src/faio')

    buildsystem.copy_hpps_to_rtl(phase.ctx,
        phase.ctx.buildroot / 'config/target/flx_faio_config.hpp',
        path / 'faio_asyncio.hpp',
        path / 'faio_job.hpp',
        path / 'faio_timer.hpp',
        path / 'faio_posixio.hpp',
        path / 'faio_winio.hpp',
    )

    dst = 'lib/rtl/faio'
    srcs = [
        path / 'faio_asyncio.cpp',
        path / 'faio_job.cpp',
        path / 'faio_timer.cpp',
    ]
    includes = [
        phase.ctx.buildroot / 'config/target',
        Path('src', 'pthread'),
        Path('src', 'demux'),
        Path('src', 'rtl'),
        Path('src', 'exceptions'),
        Path('src', 'gc'),
        path,
    ]
    macros = ['BUILD_FAIO']
    libs=[
        call('buildsystem.flx_pthread.build_runtime', phase),
        call('buildsystem.demux.build_runtime', phase),
    ]

    if 'win32' in phase.platform:
        srcs.append(path / 'faio_winio.cpp')
        includes.append(Path('src', 'demux', 'win'))

    if 'posix' in phase.platform:
        srcs.append(path / 'faio_posixio.cpp')
        includes.append(Path('src', 'demux', 'posix'))

    return Record(
        static=buildsystem.build_cxx_static_lib(phase, dst, srcs,
            includes=includes,
            macros=macros,
            libs=[lib.static for lib in libs]),
        shared=buildsystem.build_cxx_shared_lib(phase, dst, srcs,
            includes=includes,
            macros=macros,
            libs=[lib.shared for lib in libs]))
示例#9
0
文件: faio.py 项目: eccstartup/felix
def build_runtime(host_phase, target_phase):
    path = Path("src/faio")

    buildsystem.copy_hpps_to_rtl(
        target_phase.ctx,
        # target_phase.ctx.buildroot / 'config/target/flx_faio_config.hpp',
        path / "faio_job.hpp",
        path / "faio_timer.hpp",
        path / "faio_posixio.hpp",
        path / "faio_winio.hpp",
    )

    dst = "lib/rtl/faio"
    srcs = [path / "faio_job.cpp", path / "faio_timer.cpp"]
    includes = [
        target_phase.ctx.buildroot / "config/target",
        Path("src", "flx_async"),
        Path("src", "pthread"),
        Path("src", "demux"),
        Path("src", "rtl"),
        Path("src", "exceptions"),
        Path("src", "gc"),
        path,
    ]
    macros = ["BUILD_FAIO"]
    libs = [
        call("buildsystem.flx_pthread.build_runtime", target_phase),
        call("buildsystem.flx_async.build_runtime", host_phase, target_phase),
        call("buildsystem.demux.build_runtime", target_phase),
    ]

    if "win32" in target_phase.platform:
        srcs.append(path / "faio_winio.cpp")
        includes.append(Path("src", "demux", "win"))

    if "posix" in target_phase.platform:
        srcs.append(path / "faio_posixio.cpp")
        includes.append(Path("src", "demux", "posix"))

    return Record(
        static=buildsystem.build_cxx_static_lib(
            target_phase, dst, srcs, includes=includes, macros=macros, libs=[lib.static for lib in libs]
        ),
        shared=buildsystem.build_cxx_shared_lib(
            target_phase, dst, srcs, includes=includes, macros=macros, libs=[lib.shared for lib in libs]
        ),
    )
示例#10
0
def build_runtime(phase):
    path = Path('src/exceptions')

    buildsystem.copy_hpps_to_rtl(phase.ctx,
        phase.ctx.buildroot / 'config/target/flx_exceptions_config.hpp',
        path / 'flx_exceptions.hpp',
    )

    dst = 'lib/rtl/flx_exceptions'
    srcs = [path / 'flx_exceptions.cpp']
    includes = [phase.ctx.buildroot / 'config/target']
    macros = ['BUILD_FLX_EXCEPTIONS']

    return Record(
        static=buildsystem.build_cxx_static_lib(phase, dst, srcs,
            includes=includes,
            macros=macros),
        shared=buildsystem.build_cxx_shared_lib(phase, dst, srcs,
            includes=includes,
            macros=macros))
示例#11
0
def build_runtime(host_phase, target_phase):
    path = Path('src/gc')

    buildsystem.copy_hpps_to_rtl(target_phase.ctx,
        path / 'flx_gc.hpp',
        path / 'flx_judy_scanner.hpp',
        path / 'flx_serialisers.hpp',
        path / 'flx_collector.hpp',
        path / 'flx_gc_private.hpp',
        path / 'flx_ts_collector.hpp',
        path / 'pthread_bound_queue.hpp',
        path / 'pthread_work_fifo.hpp',
    )

    dst = 'lib/rtl/flx_gc'
    srcs = [copy(ctx=target_phase.ctx, src=f, dst=target_phase.ctx.buildroot / f) for f in Path.glob(path / '*.cpp')]
    includes = [
        target_phase.ctx.buildroot / 'config/target',
        target_phase.ctx.buildroot / 'lib/rtl',
        'src/rtl',
        'src/pthread',
        'src/exceptions',
        'src/judy/src',
    ]
    macros = ['BUILD_FLX_GC']
    libs = [
        call('buildsystem.judy.build_runtime', host_phase, target_phase),
        call('buildsystem.flx_exceptions.build_runtime', target_phase),
        call('buildsystem.flx_pthread.build_runtime', target_phase),
    ]

    return Record(
        static=buildsystem.build_cxx_static_lib(target_phase, dst, srcs,
            includes=includes,
            macros=macros,
            libs=[lib.static for lib in libs]),
        shared=buildsystem.build_cxx_shared_lib(target_phase, dst, srcs,
            includes=includes,
            macros=macros,
            libs=[lib.shared for lib in libs]))
示例#12
0
def build_runtime(host_phase, target_phase):
    path = Path('src/gc')

    buildsystem.copy_hpps_to_rtl(target_phase.ctx,
        path / 'flx_gc.hpp',
        path / 'flx_judy_scanner.hpp',
        path / 'flx_serialisers.hpp',
        path / 'flx_collector.hpp',
        path / 'flx_gc_private.hpp',
        path / 'flx_ts_collector.hpp',
        path / 'pthread_bound_queue.hpp',
        path / 'pthread_work_fifo.hpp',
    )

    dst = 'host/lib/rtl/flx_gc'
    srcs = [copy(ctx=target_phase.ctx, src=f, dst=target_phase.ctx.buildroot / f) for f in Path.glob(path / '*.cpp')]
    includes = [
        target_phase.ctx.buildroot / 'host/lib/rtl',
        target_phase.ctx.buildroot / 'share/lib/rtl',
        'src/rtl',
        'src/pthread',
        'src/exceptions',
        'src/judy/src',
    ]
    macros = ['BUILD_FLX_GC']
    libs = [
        call('buildsystem.judy.build_runtime', host_phase, target_phase),
        call('buildsystem.flx_exceptions.build_runtime', target_phase),
        call('buildsystem.flx_pthread.build_runtime', target_phase),
    ]

    return Record(
        static=buildsystem.build_cxx_static_lib(target_phase, dst, srcs,
            includes=includes,
            macros=macros,
            libs=[lib.static for lib in libs]),
        shared=buildsystem.build_cxx_shared_lib(target_phase, dst, srcs,
            includes=includes,
            macros=macros,
            libs=[lib.shared for lib in libs]))
示例#13
0
def build_runtime(phase):
    path = Path("src/sundown")
    buildsystem.copy_hpps_to_rtl(phase.ctx, path / "flx_sundown.hpp")

    dst = "lib/rtl/flx_sundown"
    suffix = ".so"
    srcs = [
        "src/sundown/autolink.cpp",
        "src/sundown/buffer.cpp",
        "src/sundown/markdown.cpp",
        "src/sundown/stack.cpp",
        "src/sundown/html.cpp",
        "src/sundown/houdini_href_e.cpp",
        "src/sundown/houdini_html_e.cpp",
        "src/sundown/flx_sundown.cpp",
    ]
    includes = [path, phase.ctx.buildroot / "config/target"]
    macros = ["BUILD_SUNDOWN"]

    return Record(
        static=buildsystem.build_cxx_static_lib(phase, dst, srcs, includes=includes, macros=macros, libs=[]),
        shared=buildsystem.build_cxx_shared_lib(phase, dst, srcs, includes=includes, macros=macros, libs=[]),
    )
示例#14
0
def build_runtime(phase):
    path = Path('src/exceptions')

    buildsystem.copy_hpps_to_rtl(phase.ctx,
        path / 'flx_exceptions.hpp',
        path / 'flx_eh.hpp',
    )

    srcs = [copy(ctx=phase.ctx, src=f, dst=phase.ctx.buildroot / f) for f in[
     path / 'flx_exceptions.cpp',
     path / 'flx_eh.cpp',
     ]]
    includes = ['src/rtl', phase.ctx.buildroot / 'host/lib/rtl', phase.ctx.buildroot / 'share/lib/rtl']
    macros = ['BUILD_FLX_EXCEPTIONS']

    dst = 'host/lib/rtl/flx_exceptions'
    return Record(
        static=buildsystem.build_cxx_static_lib(phase, dst, srcs,
            includes=includes,
            macros=macros),
        shared=buildsystem.build_cxx_shared_lib(phase, dst, srcs,
            includes=includes,
            macros=macros))
示例#15
0
文件: flx_gc.py 项目: mmaul/felix
def build_runtime(host_phase, target_phase):
    path = Path("src/gc")

    buildsystem.copy_hpps_to_rtl(
        target_phase.ctx,
        target_phase.ctx.buildroot / "config/target/flx_gc_config.hpp",
        path / "flx_gc.hpp",
        path / "flx_judy_scanner.hpp",
        path / "flx_collector.hpp",
        path / "flx_gc_private.hpp",
        path / "flx_ts_collector.hpp",
    )

    dst = "lib/rtl/flx_gc"
    srcs = Path.glob(path / "*.cpp")
    includes = [
        target_phase.ctx.buildroot / "config/target",
        "src/rtl",
        "src/pthread",
        "src/exceptions",
        "src/judy/src",
    ]
    macros = ["BUILD_FLX_GC"]
    libs = [
        call("buildsystem.judy.build_runtime", host_phase, target_phase),
        call("buildsystem.flx_exceptions.build_runtime", target_phase),
        call("buildsystem.flx_pthread.build_runtime", target_phase),
    ]

    return Record(
        static=buildsystem.build_cxx_static_lib(
            target_phase, dst, srcs, includes=includes, macros=macros, libs=[lib.static for lib in libs]
        ),
        shared=buildsystem.build_cxx_shared_lib(
            target_phase, dst, srcs, includes=includes, macros=macros, libs=[lib.shared for lib in libs]
        ),
    )
示例#16
0
文件: flx_async.py 项目: refi64/felix
def build_runtime(host_phase, target_phase):
    path = Path('src/flx_async')
    buildsystem.copy_hpps_to_rtl(
        target_phase.ctx,
        path / 'flx_async.hpp',
    )

    dst = 'host/lib/rtl/flx_async'
    suffix = '.so'
    srcs = [
        copy(ctx=target_phase.ctx, src=f, dst=target_phase.ctx.buildroot / f)
        for f in ['src/flx_async/flx_async.cpp']
    ]
    includes = [
        target_phase.ctx.buildroot / 'host/lib/rtl',
        target_phase.ctx.buildroot / 'share/lib/rtl'
    ]
    macros = ['BUILD_ASYNC']
    libs = [
        call('buildsystem.flx_pthread.build_runtime', target_phase),
        call('buildsystem.flx_gc.build_runtime', host_phase, target_phase),
    ]

    return Record(static=buildsystem.build_cxx_static_lib(
        target_phase,
        dst,
        srcs,
        includes=includes,
        macros=macros,
        libs=[lib.static for lib in libs]),
                  shared=buildsystem.build_cxx_shared_lib(
                      target_phase,
                      dst,
                      srcs,
                      includes=includes,
                      macros=macros,
                      libs=[lib.shared for lib in libs]))
示例#17
0
文件: demux.py 项目: refi64/felix
def build_runtime(phase):
    path = Path('src/demux')

    buildsystem.copy_hpps_to_rtl(phase.ctx,
        #phase.ctx.buildroot / 'lib/rtl/flx_demux_config.hpp', # portable

        # portable
        path / 'flx_demux.hpp',
        path / 'demux_demuxer.hpp',
        path / 'demux_timer_queue.hpp',
        path / 'demux_quitter.hpp',

        # windows (monolithic)
        path / 'win/demux_iocp_demuxer.hpp',
        path / 'win/demux_overlapped.hpp',
        path / 'win/demux_win_timer_queue.hpp',
        path / 'win/demux_wself_piper.hpp',

        # posix
        path / 'posix/demux_posix_demuxer.hpp',
        path / 'posix/demux_posix_timer_queue.hpp',
        path / 'posix/demux_pfileio.hpp',
        path / 'posix/demux_select_demuxer.hpp',
        path / 'posix/demux_sockety.hpp',
        path / 'posix/demux_self_piper.hpp',
        path / 'posix/demux_ts_select_demuxer.hpp',

        # linux, osx 10.3 (select impl), 10.4 real.
        path / 'poll/demux_poll_demuxer.hpp',
        path / 'poll/demux_ts_poll_demuxer.hpp',

        # linux (>= 2.6)
        path / 'epoll/demux_epoll_demuxer.hpp',

        # osx (10.3 onwards)/bsd
        path / 'kqueue/demux_kqueue_demuxer.hpp',

        # solaris (9 onwards?)
        path / 'evtport/demux_evtport_demuxer.hpp',
    )

    dst = 'host/lib/rtl/demux'
    srcs = [path / '*.cpp']
    includes = [
        phase.ctx.buildroot / 'host/lib/rtl',
        Path('src', 'pthread'),
        Path('src', 'gc'),
        path,
    ]
    macros = ['BUILD_DEMUX']
    libs = [call('buildsystem.flx_pthread.build_runtime', phase)]
    extra_libs = []

    if 'win32' in phase.platform:
        print("DEMUX: providing WIN32 IO COMPLETION PORTS");
        srcs.extend((
            path / 'win/demux_iocp_demuxer.cpp',       # windows
            path / 'win/demux_overlapped.cpp',         # windows
            path / 'win/demux_wself_piper.cpp',        # windows
            path / 'win/demux_win_timer_queue.cpp',    # windows
        ))
        includes.append(path / 'win')
        extra_libs.extend(('ws2_32', 'mswsock'))

    if 'posix' in phase.platform:
        print("DEMUX: providing POSIX SELECT");
        srcs.extend((
            path / 'posix/demux_posix_demuxer.cpp',      # posix
            path / 'posix/demux_select_demuxer.cpp',     # posix
            path / 'posix/demux_posix_timer_queue.cpp',  # posix
            path / 'posix/demux_sockety.cpp',            # posix
            path / 'posix/demux_self_piper.cpp',         # posix
            path / 'posix/demux_pfileio.cpp',            # posix
            path / 'posix/demux_ts_select_demuxer.cpp',  # posix
        ))
        includes.append(path / 'posix')

    poll_h = config_call('fbuild.config.c.posix.poll_h', phase.platform, phase.cxx.shared)
    sys_epoll_h = config_call('fbuild.config.c.linux.sys_epoll_h', phase.platform, phase.cxx.shared)
    sys_event_h = config_call('fbuild.config.c.bsd.sys_event_h', phase.platform, phase.cxx.shared)
    port_h = config_call('fbuild.config.c.solaris.port_h', phase.platform, phase.cxx.shared)

    if poll_h.header:
        print("DEMUX: providing UNIX POLL");
        srcs.extend((
            # I've seen poll on linux and osx10.4 systems.
            # conditionally compiled and used.
            path / 'poll/demux_poll_demuxer.cpp',       # I've seen this on linux and osx10.4
            path / 'poll/demux_ts_poll_demuxer.cpp',    # ditto
        ))
        includes.append(path / 'poll')

    if sys_epoll_h.header:
        print("DEMUX: providing LINUX EPOLL");
        srcs.append(path / 'epoll/demux_epoll_demuxer.cpp')
        includes.append(path / 'epoll')

    if sys_event_h.header:
        print("DEMUX: providing OSX KQUEUE");
        srcs.append(path / 'kqueue/demux_kqueue_demuxer.cpp')
        includes.append(path / 'kqueue')

    if port_h.header:
        print("DEMUX: providingd SOLARIS EVENT PORTS");
        srcs.append(path / 'evtport/demux_evtport_demuxer.cpp')
        includes.append(path / 'evtport')

    srcs = Path.globall(srcs)

    lp = len (path)
    #print("demux: srcs = ", [str (src)[lp+1:] for src in srcs])
    #print("demux: include paths = ", [str(inc) for inc in includes])
    return Record(
        static=buildsystem.build_cxx_static_lib(phase, dst, srcs,
            includes=includes,
            macros=macros,
            libs=[lib.static for lib in libs],
            external_libs=extra_libs),
        shared=buildsystem.build_cxx_shared_lib(phase, dst, srcs,
            includes=includes,
            macros=macros,
            libs=[lib.shared for lib in libs],
            external_libs=extra_libs))
示例#18
0
def build_runtime(phase):
    path = Path('src/pthread')

    copy(ctx=phase.ctx,
         src="src/config/target/flx_pthread_config.hpp",
         dst=phase.ctx.buildroot / 'host/lib/rtl/flx_pthread_config.hpp')

    buildsystem.copy_hpps_to_rtl(
        phase.ctx,

        # portable
        path / 'pthread_thread.hpp',
        path / 'pthread_mutex.hpp',
        path / 'pthread_counter.hpp',
        path / 'pthread_waitable_bool.hpp',
        path / 'pthread_condv.hpp',
        path / 'pthread_semaphore.hpp',
        path / 'pthread_monitor.hpp',

        # win32 and posix
        path / 'pthread_win_posix_condv_emul.hpp',
    )

    srcs = [
        copy(ctx=phase.ctx, src=f, dst=phase.ctx.buildroot / f) for f in [
            path / 'pthread_win_posix_condv_emul.cpp',  # portability hackery
            path / 'pthread_mutex.cpp',
            path / 'pthread_condv.cpp',
            path / 'pthread_counter.cpp',
            path / 'pthread_waitable_bool.cpp',
            path / 'pthread_semaphore.cpp',
            path / 'pthread_monitor.cpp',
            path / 'pthread_thread_control.cpp',
            path / 'pthread_win_thread.cpp',
            path / 'pthread_posix_thread.cpp',
        ]
    ]
    includes = [
        phase.ctx.buildroot / 'host/lib/rtl',
        phase.ctx.buildroot / 'share/lib/rtl',
        'src/rtl',
    ]
    macros = ['BUILD_PTHREAD']
    flags = []
    libs = []
    external_libs = []

    pthread_h = config_call('fbuild.config.c.posix.pthread_h', phase.platform,
                            phase.cxx.shared)

    dst = 'host/lib/rtl/flx_pthread'
    if pthread_h.pthread_create:
        flags.extend(pthread_h.flags)
        libs.extend(pthread_h.libs)
        external_libs.extend(pthread_h.external_libs)

    return Record(
        static=buildsystem.build_cxx_static_lib(phase,
                                                dst,
                                                srcs,
                                                includes=includes,
                                                macros=macros,
                                                cflags=flags,
                                                libs=libs,
                                                external_libs=external_libs,
                                                lflags=flags),
        shared=buildsystem.build_cxx_shared_lib(phase,
                                                dst,
                                                srcs,
                                                includes=includes,
                                                macros=macros,
                                                cflags=flags,
                                                libs=libs,
                                                external_libs=external_libs,
                                                lflags=flags))
示例#19
0
def build_runtime(phase):
    path = Path("src/pthread")

    buildsystem.copy_hpps_to_rtl(
        phase.ctx,
        phase.ctx.buildroot / "config/target/flx_pthread_config.hpp",
        # portable
        path / "pthread_thread.hpp",
        path / "pthread_mutex.hpp",
        path / "pthread_counter.hpp",
        path / "pthread_waitable_bool.hpp",
        path / "pthread_condv.hpp",
        path / "pthread_semaphore.hpp",
        path / "pthread_monitor.hpp",
        path / "pthread_sleep_queue.hpp",
        path / "pthread_work_fifo.hpp",
        # win32 and posix
        path / "pthread_win_posix_condv_emul.hpp",
    )

    dst = "lib/rtl/flx_pthread"
    srcs = [
        path / "pthread_win_posix_condv_emul.cpp",  # portability hackery
        path / "pthread_mutex.cpp",
        path / "pthread_condv.cpp",
        path / "pthread_counter.cpp",
        path / "pthread_waitable_bool.cpp",
        path / "pthread_semaphore.cpp",
        path / "pthread_monitor.cpp",
        path / "pthread_sleep_queue.cpp",
        path / "pthread_work_fifo.cpp",
        path / "pthread_thread_control.cpp",
    ]
    includes = [phase.ctx.buildroot / "config/target", "src/rtl"]
    macros = ["BUILD_PTHREAD"]
    flags = []
    libs = []
    external_libs = []

    if "win32" in phase.platform:
        srcs.append(path / "pthread_win_thread.cpp")

    if "posix" in phase.platform:
        srcs.append(path / "pthread_posix_thread.cpp")

    pthread_h = config_call("fbuild.config.c.posix.pthread_h", phase.platform, phase.cxx.shared)

    if pthread_h.pthread_create:
        flags.extend(pthread_h.flags)
        libs.extend(pthread_h.libs)
        external_libs.extend(pthread_h.external_libs)

    return Record(
        static=buildsystem.build_cxx_static_lib(
            phase,
            dst,
            srcs,
            includes=includes,
            macros=macros,
            cflags=flags,
            libs=libs,
            external_libs=external_libs,
            lflags=flags,
        ),
        shared=buildsystem.build_cxx_shared_lib(
            phase,
            dst,
            srcs,
            includes=includes,
            macros=macros,
            cflags=flags,
            libs=libs,
            external_libs=external_libs,
            lflags=flags,
        ),
    )
示例#20
0
文件: re2.py 项目: arowM/felix
def build_runtime(phase):
    path = Path('src/re2/re2')

    buildsystem.copy_to(phase.ctx, phase.ctx.buildroot / "lib/rtl/re2", [
        path / 're2/re2.h',
        path / 're2/set.h',
        path / 're2/stringpiece.h',
        path / 're2/variadic_function.h',
        ]
     )

    dst = 'lib/rtl/flx_re2'
    srcs = [
        path / 're2/bitstate.cc',
        path / 're2/compile.cc',
        path / 're2/dfa.cc',
        path / 're2/filtered_re2.cc',
        path / 're2/mimics_pcre.cc',
        path / 're2/nfa.cc',
        path / 're2/onepass.cc',
        path / 're2/parse.cc',
        path / 're2/perl_groups.cc',
        path / 're2/prefilter.cc',
        path / 're2/prefilter_tree.cc',
        path / 're2/prog.cc',
        path / 're2/re2.cc',
        path / 're2/regexp.cc',
        path / 're2/set.cc',
        path / 're2/simplify.cc',
        path / 're2/tostring.cc',
        path / 're2/unicode_casefold.cc',
        path / 're2/unicode_groups.cc',
        path / 'util/arena.cc',
        #path / 'util/benchmark.cc',
        path / 'util/hash.cc',
        #path / 'util/pcre.cc',
        #path / 'util/random.cc',
        path / 'util/rune.cc',
        path / 'util/stringpiece.cc',
        path / 'util/stringprintf.cc',
        path / 'util/strutil.cc',
        #path / 'util/thread.cc',
        path / 'util/valgrind.cc',
     ]
    includes = [
      phase.ctx.buildroot / 'config/target',
      path ]
    macros = ['BUILD_RE2'] + (['WIN32', 'NOMINMAX'],[])[not 'win32' in phase.platform]
    cflags = ([], ['-Wno-sign-compare'])[not 'win32' in phase.platform]
    lflags = []
    libs = []
    external_libs = []

    return Record(
        static=buildsystem.build_cxx_static_lib(phase, dst, srcs,
            includes=includes,
            macros=macros,
            cflags=cflags,
            libs=libs,
            external_libs=external_libs,
            lflags=lflags),
        shared=buildsystem.build_cxx_shared_lib(phase, dst, srcs,
            includes=includes,
            macros=macros,
            cflags=cflags,
            libs=libs,
            external_libs=external_libs,
            lflags=lflags))
示例#21
0
文件: demux.py 项目: qyqx/felix
def build_runtime(phase):
    path = Path("src/demux")

    buildsystem.copy_hpps_to_rtl(
        phase.ctx,
        # phase.ctx.buildroot / 'lib/rtl/flx_demux_config.hpp', # portable
        # portable
        path / "flx_demux.hpp",
        path / "demux_demuxer.hpp",
        path / "demux_timer_queue.hpp",
        path / "demux_quitter.hpp",
        # windows (monolithic)
        path / "win/demux_iocp_demuxer.hpp",
        path / "win/demux_overlapped.hpp",
        path / "win/demux_win_timer_queue.hpp",
        path / "win/demux_wself_piper.hpp",
        # posix
        path / "posix/demux_posix_demuxer.hpp",
        path / "posix/demux_posix_timer_queue.hpp",
        path / "posix/demux_pfileio.hpp",
        path / "posix/demux_select_demuxer.hpp",
        path / "posix/demux_sockety.hpp",
        path / "posix/demux_self_piper.hpp",
        path / "posix/demux_ts_select_demuxer.hpp",
        # linux, osx 10.3 (select impl), 10.4 real.
        path / "poll/demux_poll_demuxer.hpp",
        path / "poll/demux_ts_poll_demuxer.hpp",
        # linux (>= 2.6)
        path / "epoll/demux_epoll_demuxer.hpp",
        # osx (10.3 onwards)/bsd
        path / "kqueue/demux_kqueue_demuxer.hpp",
        # solaris (9 onwards?)
        path / "evtport/demux_evtport_demuxer.hpp",
    )

    dst = "host/lib/rtl/demux"
    srcs = [path / "*.cpp"]
    includes = [phase.ctx.buildroot / "host/lib/rtl", Path("src", "pthread"), Path("src", "gc"), path]
    macros = ["BUILD_DEMUX"]
    libs = [call("buildsystem.flx_pthread.build_runtime", phase)]
    extra_libs = []

    if "win32" in phase.platform:
        print("DEMUX: providing WIN32 IO COMPLETION PORTS")
        srcs.extend(
            (
                path / "win/demux_iocp_demuxer.cpp",  # windows
                path / "win/demux_overlapped.cpp",  # windows
                path / "win/demux_wself_piper.cpp",  # windows
                path / "win/demux_win_timer_queue.cpp",  # windows
            )
        )
        includes.append(path / "win")
        extra_libs.extend(("ws2_32", "mswsock"))

    if "posix" in phase.platform:
        print("DEMUX: providing POSIX SELECT")
        srcs.extend(
            (
                path / "posix/demux_posix_demuxer.cpp",  # posix
                path / "posix/demux_select_demuxer.cpp",  # posix
                path / "posix/demux_posix_timer_queue.cpp",  # posix
                path / "posix/demux_sockety.cpp",  # posix
                path / "posix/demux_self_piper.cpp",  # posix
                path / "posix/demux_pfileio.cpp",  # posix
                path / "posix/demux_ts_select_demuxer.cpp",  # posix
            )
        )
        includes.append(path / "posix")

    poll_h = config_call("fbuild.config.c.posix.poll_h", phase.platform, phase.cxx.shared)
    sys_epoll_h = config_call("fbuild.config.c.linux.sys_epoll_h", phase.platform, phase.cxx.shared)
    sys_event_h = config_call("fbuild.config.c.bsd.sys_event_h", phase.platform, phase.cxx.shared)
    port_h = config_call("fbuild.config.c.solaris.port_h", phase.platform, phase.cxx.shared)

    if poll_h.header:
        print("DEMUX: providing UNIX POLL")
        srcs.extend(
            (
                # I've seen poll on linux and osx10.4 systems.
                # conditionally compiled and used.
                path / "poll/demux_poll_demuxer.cpp",  # I've seen this on linux and osx10.4
                path / "poll/demux_ts_poll_demuxer.cpp",  # ditto
            )
        )
        includes.append(path / "poll")

    if sys_epoll_h.header:
        print("DEMUX: providing LINUX EPOLL")
        srcs.append(path / "epoll/demux_epoll_demuxer.cpp")
        includes.append(path / "epoll")

    if sys_event_h.header:
        print("DEMUX: providing OSX KQUEUE")
        srcs.append(path / "kqueue/demux_kqueue_demuxer.cpp")
        includes.append(path / "kqueue")

    if port_h.header:
        print("DEMUX: providingd SOLARIS EVENT PORTS")
        srcs.append(path / "evtport/demux_evtport_demuxer.cpp")
        includes.append(path / "evtport")

    srcs = Path.globall(srcs)

    lp = len(path)
    # print("demux: srcs = ", [str (src)[lp+1:] for src in srcs])
    # print("demux: include paths = ", [str(inc) for inc in includes])
    return Record(
        static=buildsystem.build_cxx_static_lib(
            phase,
            dst,
            srcs,
            includes=includes,
            macros=macros,
            libs=[lib.static for lib in libs],
            external_libs=extra_libs,
        ),
        shared=buildsystem.build_cxx_shared_lib(
            phase,
            dst,
            srcs,
            includes=includes,
            macros=macros,
            libs=[lib.shared for lib in libs],
            external_libs=extra_libs,
        ),
    )
示例#22
0
def build_runtime(host_phase, target_phase):
    path = Path('src', 'rtl')

    buildsystem.copy_hpps_to_rtl(
        target_phase.ctx,
        path / 'flx_rtl.hpp',
        path / 'flx_rtl_shapes.hpp',
        path / 'flx_compiler_support_headers.hpp',
        path / 'flx_compiler_support_bodies.hpp',
        path / 'flx_dynlink.hpp',
        path / 'flx_i18n.hpp',
        path / 'flx_ioutil.hpp',
        path / 'flx_strutil.hpp',
        path / 'flx_executil.hpp',
        path / 'flx_sync.hpp',
        path / 'flx_world.hpp',
        path / 'flx_async_world.hpp',
        path / 'flx_world_config.hpp',
        path / 'plat_linux.hpp',
    )

    for f in Path.glob(path / "*.hpp"):
        print("Copying " + f + " --> " + target_phase.ctx.buildroot / f)
        copy(ctx=target_phase.ctx, src=f, dst=target_phase.ctx.buildroot / f)

    srcs = [
        copy(ctx=target_phase.ctx, src=f, dst=target_phase.ctx.buildroot / f)
        for f in Path.glob(path / '*.cpp')
    ]
    includes = [
        target_phase.ctx.buildroot / 'host/lib/rtl',
        target_phase.ctx.buildroot / 'share/lib/rtl'
    ]
    macros = ['BUILD_RTL']
    libs = [
        call('buildsystem.flx_async.build_runtime', host_phase, target_phase),
        call('buildsystem.flx_exceptions.build_runtime', target_phase),
        call('buildsystem.flx_gc.build_runtime', host_phase, target_phase),
    ]

    dlfcn_h = config_call('fbuild.config.c.posix.dlfcn_h',
                          target_phase.platform, target_phase.cxx.static,
                          target_phase.cxx.shared)

    if dlfcn_h.dlopen:
        external_libs = dlfcn_h.external_libs
    else:
        external_libs = []

    dst = 'host/lib/rtl/flx'
    return Record(static=buildsystem.build_cxx_static_lib(
        target_phase,
        dst,
        srcs,
        includes=includes,
        macros=macros,
        libs=[lib.static for lib in libs],
        external_libs=external_libs),
                  shared=buildsystem.build_cxx_shared_lib(
                      target_phase,
                      dst,
                      srcs,
                      includes=includes,
                      macros=macros,
                      libs=[lib.shared for lib in libs],
                      external_libs=external_libs))
示例#23
0
def build_runtime(phase):
    path = Path('src/re2/re2')

    buildsystem.copy_to(phase.ctx, phase.ctx.buildroot / "share/lib/rtl/re2", [
        path / 're2/re2.h',
        path / 're2/set.h',
        path / 're2/stringpiece.h',
        path / 're2/variadic_function.h',
    ])

    dst = 'host/lib/rtl/flx_re2'
    srcs = [
        path / 're2/bitstate.cc',
        path / 're2/compile.cc',
        path / 're2/dfa.cc',
        path / 're2/filtered_re2.cc',
        path / 're2/mimics_pcre.cc',
        path / 're2/nfa.cc',
        path / 're2/onepass.cc',
        path / 're2/parse.cc',
        path / 're2/perl_groups.cc',
        path / 're2/prefilter.cc',
        path / 're2/prefilter_tree.cc',
        path / 're2/prog.cc',
        path / 're2/re2.cc',
        path / 're2/regexp.cc',
        path / 're2/set.cc',
        path / 're2/simplify.cc',
        path / 're2/tostring.cc',
        path / 're2/unicode_casefold.cc',
        path / 're2/unicode_groups.cc',
        path / 'util/arena.cc',
        #path / 'util/benchmark.cc',
        path / 'util/hash.cc',
        #path / 'util/pcre.cc',
        #path / 'util/random.cc',
        path / 'util/rune.cc',
        path / 'util/stringpiece.cc',
        path / 'util/stringprintf.cc',
        path / 'util/strutil.cc',
        #path / 'util/thread.cc',
        path / 'util/valgrind.cc',
    ]
    includes = [phase.ctx.buildroot / 'host/lib/rtl', path]
    macros = ['BUILD_RE2'] + (['WIN32', 'NOMINMAX'
                               ], [])[not 'win32' in phase.platform]
    cflags = ([], ['-Wno-sign-compare'])[not 'win32' in phase.platform]
    lflags = []
    libs = []
    external_libs = []

    return Record(
        static=buildsystem.build_cxx_static_lib(phase,
                                                dst,
                                                srcs,
                                                includes=includes,
                                                macros=macros,
                                                cflags=cflags,
                                                libs=libs,
                                                external_libs=external_libs,
                                                lflags=lflags),
        shared=buildsystem.build_cxx_shared_lib(phase,
                                                dst,
                                                srcs,
                                                includes=includes,
                                                macros=macros,
                                                cflags=cflags,
                                                libs=libs,
                                                external_libs=external_libs,
                                                lflags=lflags))
示例#24
0
def build_runtime(phase):
    path = Path('src/pthread')

    copy(ctx=phase.ctx, 
      src="src/config/target/flx_pthread_config.hpp",
      dst=phase.ctx.buildroot / 'host/lib/rtl/flx_pthread_config.hpp')

    buildsystem.copy_hpps_to_rtl(phase.ctx,

        # portable
        path / 'pthread_thread.hpp',
        path / 'pthread_mutex.hpp',
        path / 'pthread_counter.hpp',
        path / 'pthread_waitable_bool.hpp',
        path / 'pthread_condv.hpp',
        path / 'pthread_semaphore.hpp',
        path / 'pthread_monitor.hpp',

        # win32 and posix
        path / 'pthread_win_posix_condv_emul.hpp',
    )

    srcs = [copy(ctx=phase.ctx, src=f, dst=phase.ctx.buildroot / f) for f in [
        path / 'pthread_win_posix_condv_emul.cpp', # portability hackery
        path / 'pthread_mutex.cpp',
        path / 'pthread_condv.cpp',
        path / 'pthread_counter.cpp',
        path / 'pthread_waitable_bool.cpp',
        path / 'pthread_semaphore.cpp',
        path / 'pthread_monitor.cpp',
        path / 'pthread_thread_control.cpp',
        path / 'pthread_win_thread.cpp',
        path / 'pthread_posix_thread.cpp',
    ]]
    includes = [phase.ctx.buildroot / 'host/lib/rtl', phase.ctx.buildroot / 'share/lib/rtl', 'src/rtl',]
    macros = ['BUILD_PTHREAD']
    flags = []
    libs = []
    external_libs = []

    pthread_h = config_call('fbuild.config.c.posix.pthread_h',
        phase.platform,
        phase.cxx.shared)

    dst = 'host/lib/rtl/flx_pthread'
    if pthread_h.pthread_create:
        flags.extend(pthread_h.flags)
        libs.extend(pthread_h.libs)
        external_libs.extend(pthread_h.external_libs)

    return Record(
        static=buildsystem.build_cxx_static_lib(phase, dst, srcs,
            includes=includes,
            macros=macros,
            cflags=flags,
            libs=libs,
            external_libs=external_libs,
            lflags=flags),
        shared=buildsystem.build_cxx_shared_lib(phase, dst, srcs,
            includes=includes,
            macros=macros,
            cflags=flags,
            libs=libs,
            external_libs=external_libs,
            lflags=flags))
示例#25
0
文件: demux.py 项目: eccstartup/felix
def build_runtime(phase):
    path = Path('src/demux')

    buildsystem.copy_hpps_to_rtl(phase.ctx,
        #phase.ctx.buildroot / 'config/target/flx_demux_config.hpp', # portable

        # portable
        path / 'flx_demux.hpp',
        path / 'demux_demuxer.hpp',
        path / 'demux_timer_queue.hpp',
        path / 'demux_quitter.hpp',

        # windows (monolithic)
        path / 'win/demux_iocp_demuxer.hpp',
        path / 'win/demux_overlapped.hpp',
        path / 'win/demux_win_timer_queue.hpp',
        path / 'win/demux_wself_piper.hpp',

        # posix
        path / 'posix/demux_posix_demuxer.hpp',
        path / 'posix/demux_posix_timer_queue.hpp',
        path / 'posix/demux_pfileio.hpp',
        path / 'posix/demux_select_demuxer.hpp',
        path / 'posix/demux_sockety.hpp',
        path / 'posix/demux_self_piper.hpp',
        path / 'posix/demux_ts_select_demuxer.hpp',

        # linux, osx 10.3 (select impl), 10.4 real.
        path / 'poll/demux_poll_demuxer.hpp',
        path / 'poll/demux_ts_poll_demuxer.hpp',

        # linux (>= 2.6)
        path / 'epoll/demux_epoll_demuxer.hpp',

        # osx (10.3 onwards)/bsd
        path / 'kqueue/demux_kqueue_demuxer.hpp',

        # solaris (9 onwards?)
        path / 'evtport/demux_evtport_demuxer.hpp',
    )

    dst = 'lib/rtl/demux'
    srcs = [path / '*.cpp']
    includes = [
        phase.ctx.buildroot / 'config/target',
        Path('src', 'pthread'),
        Path('src', 'gc'),
        path,
    ]
    macros = ['BUILD_DEMUX']
    libs = [call('buildsystem.flx_pthread.build_runtime', phase)]
    extra_libs = []

    if 'win32' in phase.platform:
        print("DEMUX: providing WIN32 IO COMPLETION PORTS");
        srcs.extend((
            path / 'win/demux_iocp_demuxer.cpp',       # windows
            path / 'win/demux_overlapped.cpp',         # windows
            path / 'win/demux_wself_piper.cpp',        # windows
            path / 'win/demux_win_timer_queue.cpp',    # windows
        ))
        includes.append(path / 'win')
        extra_libs.extend(('ws2_32', 'mswsock'))

    if 'posix' in phase.platform:
        print("DEMUX: providing POSIX SELECT");
        srcs.extend((
            path / 'posix/demux_posix_demuxer.cpp',      # posix
            path / 'posix/demux_select_demuxer.cpp',     # posix
            path / 'posix/demux_posix_timer_queue.cpp',  # posix
            path / 'posix/demux_sockety.cpp',            # posix
            path / 'posix/demux_self_piper.cpp',         # posix
            path / 'posix/demux_pfileio.cpp',            # posix
            path / 'posix/demux_ts_select_demuxer.cpp',  # posix
        ))
        includes.append(path / 'posix')

    poll_h = config_call('fbuild.config.c.posix.poll_h', phase.platform, phase.cxx.shared)
    sys_epoll_h = config_call('fbuild.config.c.linux.sys_epoll_h', phase.platform, phase.cxx.shared)
    sys_event_h = config_call('fbuild.config.c.bsd.sys_event_h', phase.platform, phase.cxx.shared)
    port_h = config_call('fbuild.config.c.solaris.port_h', phase.platform, phase.cxx.shared)

    if poll_h.header:
        print("DEMUX: providing UNIX POLL");
        srcs.extend((
            # I've seen poll on linux and osx10.4 systems.
            # conditionally compiled and used.
            path / 'poll/demux_poll_demuxer.cpp',       # I've seen this on linux and osx10.4
            path / 'poll/demux_ts_poll_demuxer.cpp',    # ditto
        ))
        includes.append(path / 'poll')

    if sys_epoll_h.header:
        print("DEMUX: providing LINUX EPOLL");
        srcs.append(path / 'epoll/demux_epoll_demuxer.cpp')
        includes.append(path / 'epoll')

    if sys_event_h.header:
        print("DEMUX: providing OSX KQUEUE");
        srcs.append(path / 'kqueue/demux_kqueue_demuxer.cpp')
        includes.append(path / 'kqueue')

    if port_h.header:
        print("DEMUX: providingd SOLARIS EVENT PORTS");
        srcs.append(path / 'evtport/demux_evtport_demuxer.cpp')
        includes.append(path / 'evtport')

    srcs = Path.globall(srcs)

    lp = len (path)
    #print("demux: srcs = ", [str (src)[lp+1:] for src in srcs])
    #print("demux: include paths = ", [str(inc) for inc in includes])
    return Record(
        static=buildsystem.build_cxx_static_lib(phase, dst, srcs,
            includes=includes,
            macros=macros,
            libs=[lib.static for lib in libs],
            external_libs=extra_libs),
        shared=buildsystem.build_cxx_shared_lib(phase, dst, srcs,
            includes=includes,
            macros=macros,
            libs=[lib.shared for lib in libs],
            external_libs=extra_libs))