示例#1
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()
示例#2
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()
示例#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()