def AcCheckProgs(context, programs, selection=None, value_if_not_found=None,
               path=None, pathext=None, reject=[]):
    """Corresponds to AC_CHECK_PROGS_ autoconf macro.

    Check for each program in **programs** list existing in **path**. If one is
    found, return the name of that program. Otherwise, continue checking the
    next program in the list. If none of the programs in the list are found,
    return the **value_if_not_found** (which defaults to ``None``).

    :Parameters:
        context
            SCons configuration context.
        programs
            Program names of the programs to be checked.
        selection
            If ``None`` (default), the program will be found automatically,
            otherwise the method will return the value of **selection**.
        value_if_not_found
            Value to be returned, when the program is not found.
        path
            Search path.
        pathext
            Extensions used for executable files.
        reject
            List of file names to be rejected if found.

    .. _AC_CHECK_PROGS: http://www.gnu.org/software/autoconf/manual/autoconf.html#index-AC_005fCHECK_005fPROGS-307
    """

    result = None
    if not selection:
        context.did_show_result = 1
        sconf = context.sconf
        for program in programs:
            result = sconf.AcCheckProg(program, None, None, None, path, pathext, reject)
            if result:
                return result
        return value_if_not_found
    else:
        context.Display('Checking for %s... ' % selection)
        context.Result(str(selection))
        return selection