from bento.commands import hooks

@hooks.pre_build
def pre_build(context):
    context.waf_context.env.INCLUDES.append(".")

    context.tweak_extension("orthogonal_eval", use="NPYMATH")
    context.tweak_extension("lambertw", use="NPYMATH")
    context.tweak_extension("_logit", use="NPYMATH")

    context.tweak_extension("specfun", features="c fc pyext cshlib bento f2py",
                             use="sc_specfun NPYMATH CLIB")

    context.tweak_extension("_cephes",
                          use="sc_amos sc_toms sc_c_misc sc_cephes sc_mach " \
                              "sc_cdf sc_specfun NPYMATH CLIB")

    context.tweak_extension("_ufuncs_cxx", features="cxx cxxshlib pyext bento",
                            use="NPYMATH")

    context.waf_context.env.INCLUDES.append("c_misc")
    context.tweak_extension("_ufuncs",
                            use="sc_amos sc_c_misc sc_cephes sc_mach sc_cdf "\
                                "sc_specfun NPYMATH CLIB")
