コード例 #1
0
ファイル: plugins.py プロジェクト: martindemello/felix
def build(phase, felix):
    print ("BUILDING PLUGINS")
    for f in Path.glob('src/lib/plugins/*'):
      copy(ctx=phase.ctx, src=f, dst=phase.ctx.buildroot / 'share'/f[4:]) 
    plugins = [
      #"ocaml2html",
      #"py2html",
      #"fdoc2html",
      #"flx2html",
      #"cpp2html",
      #"fpc2html",
      #"fdoc_slideshow",
      #"fdoc_paragraph",
      #"fdoc_heading",
      #"fdoc_fileseq",
      #"fdoc_scanner",
      #"fdoc_button",
      "toolchain_clang_osx",
      "toolchain_clang_linux",
      "toolchain_gcc_osx",
      "toolchain_gcc_linux",
      "toolchain_gcc48_linux",
      ]
    for base in plugins:
      shlib = felix.compile(phase.ctx.buildroot/('share/lib/plugins/'+base+'.flx'),flags=['-od',phase.ctx.buildroot/'host/lib/rtl'])
コード例 #2
0
def build(phase, felix):
    print("BUILDING PLUGINS")
    for f in Path.glob('src/lib/plugins/*'):
        copy(ctx=phase.ctx, src=f, dst=phase.ctx.buildroot / 'share' / f[4:])
    plugins = [
        #"ocaml2html",
        #"py2html",
        #"fdoc2html",
        #"flx2html",
        #"cpp2html",
        #"fpc2html",
        #"fdoc_slideshow",
        #"fdoc_paragraph",
        #"fdoc_heading",
        #"fdoc_fileseq",
        #"fdoc_scanner",
        #"fdoc_button",
        "toolchain_clang_osx",
        "toolchain_clang_linux",
        "toolchain_gcc_osx",
        "toolchain_gcc_linux",
    ]
    for base in plugins:
        shlib = felix.compile(
            phase.ctx.buildroot / ('share/lib/plugins/' + base + '.flx'),
            flags=['-od', phase.ctx.buildroot / 'host/lib/rtl'])
コード例 #3
0
ファイル: flx_rtl.py プロジェクト: FelixKiprono/felix
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))
コード例 #4
0
ファイル: judy.py プロジェクト: arowM/felix
def build_runtime(host_phase, target_phase):
    """
    Builds the judy runtime library, and returns the static and shared
    library versions.
    """

    path = Path('src/judy/src')

    # Copy the header into the runtime library.
    buildsystem.copy_to(target_phase.ctx,
        target_phase.ctx.buildroot / 'lib/rtl',
        [path / 'Judy.h',
         path / 'Judy1/Judy1.h',
         path / 'JudyL/JudyL.h'])

    types = config_call('fbuild.config.c.c99.types',
        target_phase.platform, target_phase.c.static)

    if types.voidp.size == 8:
        macros = ['JU_64BIT']
    else:
        macros = ['JU_32BIT']

    if 'windows' in target_phase.platform:
        macros.append('BUILD_JUDY') #Apply this to all source files.

    srcs = [copy(target_phase.ctx, p, target_phase.ctx.buildroot / p) for p in [
        path / 'JudyCommon/JudyMalloc.c',
        path / 'JudySL/JudySL.c',
        path / 'JudyHS/JudyHS.c'] +
        (path / 'Judy1' / '*.c').glob() +
        (path / 'JudyL' / '*.c').glob()]
    
    # Copy all the common judy sources we need so people can rebuild the RTL without a source distro
    for p in ((path / 'JudyCommon' / '*.c').glob() + 
              (path / 'Judy*' / '*.h').glob()): 
        if p not in ('JudyMalloc.c', 'JudyPrintJP.c'):
            copy(target_phase.ctx, p, target_phase.ctx.buildroot / p)

    includes = [path, 
                path / 'JudyCommon', 
                path / 'JudyL', 
                path / 'Judy1']
    
    static = buildsystem.build_c_static_lib(target_phase, 'lib/rtl/judy',
        srcs=srcs,
        macros=macros,
        includes=includes)

    shared = buildsystem.build_c_shared_lib(target_phase, 'lib/rtl/judy',
        srcs=srcs,
        macros=macros,
        includes=includes)

    return Record(static=static, shared=shared)
コード例 #5
0
ファイル: fbuildroot.py プロジェクト: zvikadror/midifi
def build(ctx):
    rec = configure(ctx, ctx.options.release)
    get_soundfont(ctx)
    get_font(ctx)
    if isinstance(rec.static, MsvcBuilder):
        exports = save_exports(ctx, rec.fluidsynth)
        make_lib(ctx, exports, rec.static.lib_linker, rec.fluidsynth)
        copy_dll(ctx, rec.fluidsynth)
    else:
        copy(ctx, rec.fluidsynth, ctx.buildroot / rec.fluidsynth.basename())
    midifile = build_midifile(ctx, rec)
    build_midifi(ctx, rec, midifile)
コード例 #6
0
def build_runtime(host_phase, target_phase):
    """
    Builds the judy runtime library, and returns the static and shared
    library versions.
    """

    path = Path('src/judy/src')

    # Copy the header into the runtime library.
    buildsystem.copy_to(target_phase.ctx,
                        target_phase.ctx.buildroot / 'share/lib/rtl',
                        [path / 'Judy.h'])

    types = config_call('fbuild.config.c.c99.types', target_phase.platform,
                        target_phase.c.static)

    if types.voidp.size == 8:
        macros = ['JU_64BIT']
    else:
        macros = ['JU_32BIT']

    if 'windows' in target_phase.platform:
        macros.append('BUILD_JUDY')  #Apply this to all source files.

    srcs = [
        copy(target_phase.ctx, p, target_phase.ctx.buildroot / 'share' / p)
        for p in [
            path / 'JudyCommon/JudyMalloc.c', path / 'JudySL/JudySL.c', path /
            'JudyHS/JudyHS.c'
        ] + (path / 'Judy1' / '*.c').glob() + (path / 'JudyL' / '*.c').glob()
    ]

    # Copy all the common judy sources we need so people can rebuild the RTL without a source distro
    for p in ((path / 'JudyCommon' / '*.c').glob() +
              (path / 'Judy*' / '*.h').glob()):
        if p not in ('JudyMalloc.c', 'JudyPrintJP.c'):
            copy(target_phase.ctx, p, target_phase.ctx.buildroot / 'share' / p)

    includes = [path, path / 'JudyCommon', path / 'JudyL', path / 'Judy1']

    static = buildsystem.build_c_static_lib(target_phase,
                                            'host/lib/rtl/judy',
                                            srcs=srcs,
                                            macros=macros,
                                            includes=includes)

    shared = buildsystem.build_c_shared_lib(target_phase,
                                            'host/lib/rtl/judy',
                                            srcs=srcs,
                                            macros=macros,
                                            includes=includes)

    return Record(static=static, shared=shared)
コード例 #7
0
ファイル: flx_async.py プロジェクト: FelixKiprono/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]))
コード例 #8
0
ファイル: flx_exceptions.py プロジェクト: refi64/felix
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))
コード例 #9
0
ファイル: main.py プロジェクト: rjeschmi/fbuild
def install_files(ctx):
    for file, subdir, rename, perms in ctx.to_install:
        # Generate the full subdirectory.
        target_root = fbuild.path.Path(subdir).addroot(ctx.install_prefix)
        target_root.makedirs(exist_ok=True)

        # Generate the target path.
        target = target_root / (rename or file.basename())
        file = file.relpath(file.getcwd())

        # Copy the file.
        ctx.logger.check(' * install',
                         '%s -> %s' % (file, target),
                         color='yellow')
        file.copy(target)

        # Set permissions.
        if perms is not None:
            file.chmod(perms)
コード例 #10
0
ファイル: flx_gc.py プロジェクト: eccstartup/felix
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]))
コード例 #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 = '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]))
コード例 #12
0
ファイル: flx_exceptions.py プロジェクト: FelixKiprono/felix
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))
コード例 #13
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]))
コード例 #14
0
ファイル: judy.py プロジェクト: mmaul/felix
def _build_objs(host_phase, target_phase, builder, dstname):
    """
    Build the object files for Judy1 or JudyL. Unfortunately the judy build
    process is a little complicated because the same underlying code is used for
    bit arrays and word arrays. The only distinguishing feature is if the macro
    JUDY1 or JUDYL is defined. This function abstracts the handling of this
    distinction.
    """

    path = Path("src/judy/src")
    includes = [path, path / "JudyCommon", path / dstname]

    types = config_call("fbuild.config.c.c99.types", target_phase.platform, builder)

    macros = [dstname.upper()]
    if types.voidp.size == 8:
        macros.append("JU_64BIT")
    else:
        macros.append("JU_32BIT")

    kwargs = {}
    if "iphone" in target_phase.platform:
        kwargs["machine_flags"] = ["32"]

    # First, copy all the common files into the Judy* directory.
    srcs = []
    srcs.extend(
        copy_regex(
            target_phase.ctx,
            srcdir=path / "JudyCommon",
            dstdir=path / dstname,
            src_pattern=r"^Judy(.*\.c)",
            dst_pattern=r"%s\1" % dstname,
            exclude_pattern=r"("
            r"JudyMalloc.c|"
            r"JudyByCount.c|"
            r"JudyPrevNext.c|"
            r"JudyPrevNextEmpty.c|"
            r"JudyTables.c|"
            r"JudyPrintJP.c)",
        )
    )

    # Create the tablegen.
    tablegen = host_phase.c.static.build_exe(
        path / dstname / dstname + "TableGen",
        [copy(target_phase.ctx, src=path / "JudyCommon/JudyTables.c", dst=path / dstname / dstname + "TablesGen.c")],
        includes=includes,
        macros=macros,
        ckwargs=kwargs,
        lkwargs=kwargs,
    )

    # Create the table source.
    srcs.append(
        build_judytables(target_phase.ctx, tablegen, target_phase.ctx.buildroot / path / dstname / dstname + "Tables.c")
    )
    # Compile the objects.

    objs = []
    objs.extend(builder.build_objects(srcs, includes=includes, macros=macros))

    objs.extend(
        (
            builder.compile(
                path / "JudyCommon/JudyGet.c",
                dst=path / dstname / "j__udyGet.c",
                includes=includes,
                macros=macros + ["JUDYGETINLINE"],
            ),
            builder.compile(
                path / "JudyCommon/JudyPrevNext.c",
                dst=path / dstname / dstname + "Next.c",
                includes=includes,
                macros=macros + ["JUDYNEXT"],
            ),
            builder.compile(
                path / "JudyCommon/JudyPrevNextEmpty.c",
                dst=path / dstname / dstname + "NextEmpty.c",
                includes=includes,
                macros=macros + ["JUDYNEXT"],
            ),
            builder.compile(
                path / "JudyCommon/JudyPrevNext.c",
                dst=path / dstname / dstname + "Prev.c",
                includes=includes,
                macros=macros + ["JUDYPREV"],
            ),
            builder.compile(
                path / "JudyCommon/JudyPrevNextEmpty.c",
                dst=path / dstname / dstname + "PrevEmpty.c",
                includes=includes,
                macros=macros + ["JUDYPREV"],
            ),
            builder.compile(
                path / "JudyCommon/JudyByCount.c",
                path / dstname / dstname + "ByCount.c",
                includes=includes,
                macros=macros + ["NOSMARTJBB", "NOSMARTJBU", "NOSMARTJLB"],
            ),
        )
    )

    return objs
コード例 #15
0
ファイル: fbuildroot.py プロジェクト: zvikadror/midifi
def copy_dll2(ctx, fluid: fbuild.db.SRC) -> fbuild.db.DST:
    dst = ctx.buildroot / fluid.basename()
    copy(ctx, fluid, dst)
    return dst
コード例 #16
0
ファイル: fbuildroot.py プロジェクト: zvikadror/midifi
def save_font(ctx, font: fbuild.db.SRC) -> fbuild.db.DST:
    dst = ctx.buildroot / 'data' / 'Arial.ttf'
    return copy(ctx, font, dst)
コード例 #17
0
ファイル: tools.py プロジェクト: eccstartup/felix
def build(phase, felix):

    
    # The wiki is killing the compiler, inlining procedure
    # cannot cope. Possible inline explosion.
    # Need to investigate this. Maybe its too big,
    # and maybe the small change I just introduced was enough
    # to kill it.

    #try:
    #    exe = felix.compile(phase.ctx.buildroot/'wiki/wiki.flx', static=True)
    #    fbuild.builders.file.copy(phase.ctx, exe, 'bin')
    #except:
    #    print("Warning : wiki not built. Continuing..." )

    for f in Path.glob('src/lib/plugins/*'):
      copy(ctx=phase.ctx, src=f, dst=phase.ctx.buildroot / f[4:]) 

    exes = [
      "flx_grep",
      "flx_replace",
      "flx_ls",
      "flx_cp",
      "webserver",
      "flx_gramdoc",
      "flx_libcontents",
      "flx_libindex",
      "flx_renumber",
      "flx_mktutindex",
      "flx_perror",
      "flx_tangle",
      "flx_gengraph",
      "flx_testpack",
      ]

    optional_exes = [
      "norK",
      ]

    for base in exes:
      exe = felix.compile(phase.ctx.buildroot/('tools/'+base+'.flx'), 
        static=True,
        includes=[phase.ctx.buildroot/'lib'/'plugins'])
      fbuild.builders.file.copy(phase.ctx, exe, 'bin')

    for base in optional_exes:
      try:
          exe = felix.compile(phase.ctx.buildroot/('tools/'+base+'.flx'), 
            static=True,
            includes=[phase.ctx.buildroot/'lib'/'plugins'])
          fbuild.builders.file.copy(phase.ctx, exe, 'bin')
      except:
          print("Warning : "+base+" not built. Continuing..." )


    try:
      os.mkdir(phase.ctx.buildroot/'shlib')
    except:
      pass

    plugins = [
      "ocaml2html",
      "py2html",
      "fdoc2html",
      "flx2html",
      "cpp2html",
      "fpc2html",
      "fdoc_slideshow",
      "fdoc_paragraph",
      "fdoc_heading",
      "fdoc_fileseq",
      "fdoc_scanner",
      "fdoc_button",
      "toolchain_clang_osx",
      "toolchain_clang_linux",
      "toolchain_gcc_osx",
      "toolchain_gcc_linux",
      ]
    for base in plugins:
      shlib = felix.compile(phase.ctx.buildroot/('lib/plugins/'+base+'.flx'))
      fbuild.builders.file.copy(phase.ctx, shlib, 'shlib')
コード例 #18
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))
コード例 #19
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))
コード例 #20
0
ファイル: flx_pthread.py プロジェクト: FelixKiprono/felix
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))