def _detect(env):
    """
    Detect all the command line tools that we might need for creating
    the requested output formats.
    """
    global prefer_xsltproc
    
    if env.get('DOCBOOK_PREFER_XSLTPROC',''):
        prefer_xsltproc = True
        
    if ((not has_libxml2 and not has_lxml) or (prefer_xsltproc)):
        # Try to find the XSLT processors
        __detect_cl_tool(env, 'DOCBOOK_XSLTPROC', xsltproc_com, xsltproc_com_priority)
        __detect_cl_tool(env, 'DOCBOOK_XMLLINT', xmllint_com)

    __detect_cl_tool(env, 'DOCBOOK_FOP', fop_com, ['fop','xep','jw'])
Detect all the command line tools that we might need for creating
    the requested output formats.