Question: I'm looking for a way to colorize the output from `./configure` so that all instances of `yes` at the end of a check show in one color and `no` in another. I think there may be a way of creating the echo message using `AS_IF` to test the check result and then set the output using the usual bash color commands. I'd obviously prefer to not have to spend time doing this if it's already been done.

Answer: 
Lucky for you, Autoconf is basically one giant C-preprocessor-abuse, so its internals are all exposed and it's easy to do something hacky that, fair warning, might not carry over from one Autoconf version to the next.

The definition of `AC_MSG_RESULT` (which prints most of those yes/no messages) is found in `/usr/share/autoconf/autoconf/general.m4`, and is quite simply defined as printing a given message to the log file as well as to the terminal:

```
m4_define([AC_MSG_RESULT],
[{ _AS_ECHO_LOG([result: $1])
_AS_ECHO([$1]); }dnl
])

```

Since the Autoconf internals called in that macro are exposed to your configure.ac, you can just override `AC_MSG_RESULT` with your own macro that calls them. Here's one that worked for me, printing "yes" in green, "no" in red, and all other results in blue. Include it before any other macro calls in your configure.ac:

```
m4_pushdef([AC_MSG_RESULT], [
    { result="$1"
    _AS_ECHO_LOG([result: $result])
    AS_CASE(["x$result"],
        [xnone\ needed], _AS_ECHO([$(tput setaf 4)$result$(tput sgr0)]),
        [xyes*], _AS_ECHO([$(tput setaf 2)$result$(tput sgr0)]),
        [xno*], _AS_ECHO([$(tput setaf 1)$result$(tput sgr0)]),
        _AS_ECHO([$(tput setaf 4)$result$(tput sgr0)])); }dnl
])

```

But seriously, don't do this.
This is probably a dumb ask. I wrote one for the package check:

```
AC_DEFUN([COLOR_PKG_CHECK],[

  red=$(tput setaf 1)
  grn=$(tput setaf 2)
  clr=$(tput sgr0)

  PKG_CHECK_EXISTS([$1],[$2],[found=yes],[found=no])

  AS_IF([test "x$found" = "xyes"],[
    msg="checking for $1... ${grn}yes${clr}"
    AC_MSG_RESULT($msg)
    $3
  ],[
    msg="checking for $1... ${red}no${clr}"
    AC_MSG_RESULT($msg)
    $4
  ])
])

```

This works but it kind of pointed out that the only way to do this would be to wrap any calls of interest the same way. I don't want to do that.