예제 #1
0
def configure(conf):
    from yaku.tools.gcc import detect

    conf.use_tools(["ctasks"])

    log_filename = os.path.join("build", "config.log")
    ensure_dir(log_filename)

    detect(conf)

    conf.log = open(log_filename, "w")
    try:
        # TODO
        #  - support for env update
        #  - config header support
        #  - confdefs header support
        check_compiler(conf)
        check_header(conf, "stdio.h")
        check_header(conf, "stdio")
        check_type(conf, "char")
        #check_type(conf, "complex")
        check_type(conf, "complex", headers=["complex.h"])
        check_lib(conf, lib="m")
        #check_lib(conf, lib="mm")
        check_func(conf, "floor", libs=["m"])
        check_func(conf, "floor")

        generate_config_h(conf.conf_results, "build/conf/config.h")
    finally:
        conf.log.close()
예제 #2
0
def configure(conf):
    conf.use_tools(["ctasks"])

    log_filename = os.path.join("build", "config.log")
    ensure_dir(log_filename)

    conf.log = open(log_filename, "w")
    try:
        # TODO
        #  - support for env update
        #  - config header support
        #  - confdefs header support
        check_compiler(conf)
        check_header(conf, "stdio.h")
        check_header(conf, "stdio")
        check_type(conf, "char")
        #check_type(conf, "complex")
        check_type(conf, "complex", headers=["complex.h"])
        if check_func(conf, "exp"):
            mlib = []
        else:
            if not check_lib(conf, "m", "exp"):
                raise ValueError("What is mlib ?")
            else:
                mlib = ["m"]
        check_lib(conf, mlib, "exp")
        #check_lib(conf, lib="mm")
        check_func(conf, "floor", libs=mlib)
        check_func(conf, "floor")

        generate_config_h(conf.conf_results, "build/conf/config.h")
    finally:
        conf.log.close()
예제 #3
0
def configure(conf):
    conf.use_tools(["ctasks"])

    log_filename = os.path.join("build", "config.log")
    ensure_dir(log_filename)

    conf.log = open(log_filename, "w")
    try:
        # TODO
        #  - support for env update
        #  - config header support
        #  - confdefs header support
        check_compiler(conf)
        check_header(conf, "stdio.h")
        check_header(conf, "stdio")
        check_type(conf, "char")
        #check_type(conf, "complex")
        check_type(conf, "complex", headers=["complex.h"])
        if check_func(conf, "exp"):
            mlib = []
        else:
            if not check_lib(conf, "m", "exp"):
                raise ValueError("What is mlib ?")
            else:
                mlib = ["m"]
        check_lib(conf, mlib, "exp")
        #check_lib(conf, lib="mm")
        check_func(conf, "floor", libs=mlib)
        check_func(conf, "floor")

        generate_config_h(conf.conf_results, "build/conf/config.h")
    finally:
        conf.log.close()
예제 #4
0
def configure(conf):
    conf.use_tools(["ctasks"])

    log_filename = os.path.join("build", "config.log")
    ensure_dir(log_filename)

    conf.log = open(log_filename, "w")
    try:
        check_compiler(conf)
        conf.env["CPPPATH"].append(distutils.sysconfig.get_python_inc())
        if not check_header(conf, "Python.h"):
            raise RuntimeError("Python header not found !")
        check_header(conf, "math.h")
        for mlibs in [[], ["m"]]:
            if check_func(conf, "floor", libs=mlibs):
                break
        for tp in ("short", "int", "long"):
            check_type_size(conf, tp)
        for tp in ("float", "double", "long double"):
            check_type_size(conf, tp)
        check_type(conf, "Py_intptr_t", headers=["Python.h"])
        define(conf, "NPY_NO_SMP")

        mfuncs = ('expl', 'expf', 'log1p', 'expm1', 'asinh', 'atanhf',
                  'atanhl', 'rint', 'trunc')
        check_funcs_at_once(conf, mfuncs)
        generate_config_h(conf.conf_results, "build/conf/config.h")
    finally:
        conf.log.close()
예제 #5
0
def configure(conf):
    conf.use_tools(["ctasks"])

    log_filename = os.path.join("build", "config.log")
    ensure_dir(log_filename)

    conf.log = open(log_filename, "w")
    try:
        check_compiler(conf)
        conf.env["CPPPATH"].append(distutils.sysconfig.get_python_inc())
        if not check_header(conf, "Python.h"):
            raise RuntimeError("Python header not found !")
        check_header(conf, "math.h")
        for mlibs in [[], ["m"]]:
            if check_func(conf, "floor", libs=mlibs):
                break
        for tp in ("short", "int", "long"):
            check_type_size(conf, tp)
        for tp in ("float", "double", "long double"):
            check_type_size(conf, tp)
        check_type(conf, "Py_intptr_t", headers=["Python.h"])
        define(conf, "NPY_NO_SMP")

        mfuncs = ('expl', 'expf', 'log1p', 'expm1', 'asinh', 'atanhf',
                'atanhl', 'rint', 'trunc')
        check_funcs_at_once(conf, mfuncs)
        generate_config_h(conf.conf_results, "build/conf/config.h")
    finally:
        conf.log.close()
예제 #6
0
def configure(ctx):
    ctx.use_tools(["pyext", "ctasks"], ["tools"])

    check_compiler(ctx)
    check_header(ctx, "stdio.h")
    check_module(ctx, "sys")
    check_module(ctx, "ssys")
예제 #7
0
def configure(ctx):
    ctx.use_tools(["pyext", "ctasks"], ["tools"])

    check_compiler(ctx)
    check_header(ctx, "stdio.h")
    check_module(ctx, "sys")
    check_module(ctx, "ssys")
예제 #8
0
def configure(ctx):
    ctx.use_tools(["ctasks", "cxxtasks"])
    ctx.env.append("DEFINES", "_FOO")

    cc = ctx.builders["ctasks"]
    assert cc.try_compile("foo", "int main() {}")
    assert not cc.try_compile("foo", "intt main() {}")

    assert cc.try_program("foo", "int main() {}")
    assert not cc.try_program("foo", "intt main() {}")

    assert cc.try_static_library("foo", "int foo() {}")
    assert not cc.try_static_library("foo", "intt foo() {}")

    assert check_func(ctx, "malloc")
    assert not check_func(ctx, "mmalloc")

    assert check_header(ctx, "stdio.h")
    assert not check_header(ctx, "stdioo.h")

    assert check_compiler(ctx)
    assert check_cpp_symbol(ctx, "NULL", ["stdio.h"])
    assert not check_cpp_symbol(ctx, "VERY_UNLIKELY_SYMOBOL_@aqwhn")
예제 #9
0
파일: example1.py 프로젝트: bluemoon/yaku
def configure(ctx):
    ctx.use_tools(["pyext"], ["tools"])

    gcc_detect(ctx)
    check_compiler(ctx)
    check_header(ctx, "stdio.h")