from bento.commands import hooks

@hooks.pre_build
def pre_build(context):
    features="c fc pyext bento cshlib"
    f2py_features = "c fc pyext bento cshlib f2py"
    use = "minpack rootfind LAPACK CLIB"

    context.tweak_extension("_lbfgsb", features=f2py_features, use=use)
    context.tweak_extension("_cobyla", features=f2py_features, use=use)
    context.tweak_extension("minpack2", features=f2py_features, use=use)
    context.tweak_extension("_nnls", features=f2py_features, use=use)
    context.tweak_extension("_slsqp", features=f2py_features, use=use)

    context.tweak_extension("_zeros", features=features, use=use)
    context.tweak_extension("_minpack", features=features, use=use)
    context.tweak_extension("moduleTNC", features=features, use=use)
