def _setup_cxxcompiler(ctx, cxx_type):
    old_env = ctx.env
    ctx.env = Environment()
    sys.path.insert(0, os.path.dirname(yaku.tools.__file__))
    try:
        mod = __import__(cxx_type)
        mod.setup(ctx)
        cxx_env = ctx.env
    finally:
        sys.path.pop(0)
        ctx.env = old_env

    for k in ["CXX", "CXXFLAGS", "CXX_TGT_F", "CXX_SRC_F",
              "CXXSHLINK"]:
        ctx.env["PYEXT_%s" % k] = cxx_env[k]

# FIXME: find a way to reuse this kind of code between tools
dataset/ETHPy150Open cournape/Bento/bento/private/_yaku/yaku/tools/pyext.py/_setup_cxxcompiler/original