Esempio n. 1
0
def find_lcg(ctx, **kwargs):
    
    ctx.load('hwaf-base', tooldir=_heptooldir)

    if not ctx.env.HWAF_FOUND_C_COMPILER:
        ctx.fatal('load a C compiler first')
        pass

    if not ctx.env.HWAF_FOUND_CXX_COMPILER:
        ctx.fatal('load a C++ compiler first')
        pass

    lcg_root = ctx.options.with_lcg
    if not osp.exists(lcg_root):
        msg.fatal("LCG: no such path [%s]" % lcg_root)
        return

    ctx.start_msg("LCG-hep-tools")
    ctx.end_msg(lcg_root)

    lcg_ext_root = ctx.options.with_lcg_ext_root
    ctx.start_msg("LCG-hep-tools externals")
    ctx.end_msg(lcg_ext_root)

    
    ctx.env.HWAF_FOUND_LCG = 1
    return
Esempio n. 2
0
def find_python_module(ctx, module_name, condition='', **kwargs):
    
    ctx.load('hwaf-base', tooldir=_heptooldir)

    if not ctx.env.CXX and not ctx.env.CC:
        msg.fatal('load a C or C++ compiler first')
        pass

    if not ctx.env.HWAF_FOUND_PYTHON:
        ctx.find_python()
        pass

    found = False
    os_env = dict(os.environ)
    try:
        ctx.env.stash()
        env = ctx._get_env_for_subproc()
        for k,v in env.items():
            os.environ[k] = v
            pass
        ctx.check_python_module(module_name, condition)
        found = True
    except ctx.errors.ConfigurationError:
        os.environ = os_env
        ctx.env.revert()
        found = False
        pass
    finally:
        os.environ = os_env
        pass

    if not found and kwargs.get('mandatory', True):
        ctx.fatal("python module %s not found" % module_name)
    return
Esempio n. 3
0
def get_android_build_environment(conf):
    env = _get_android_setting(conf, 'BUILD_ENVIRONMENT')
    if env == 'Development' or env == 'Distribution':
        return env
    else:
        Logs.fatal(
            '[ERROR] Invalid android build environment, valid environments are: Development and Distribution'
        )