A Common Problem with Autoconf

We should take this opportunity to address a particular problem that developers new to the Autotools consistently encounter. Here's the formal definition of AC_CHECK_PROG, as you will find it in the GNU Autoconf Manual:

AC_CHECK_PROG(variable, prog-to-check-for, value-if-found,
    [value-if-not-found], [path], [reject])

Check whether program prog-to-check-for exists in path. If it is found, set variable to value-if-found, otherwise to value-if-not-found, if given. Always pass over reject (an absolute filename) even if it is the first found in the search path; in that case, set variable using the absolute filename of the prog-to-check-for found that is not reject. If variable was already set, do nothing. Calls AC_SUBST ...

Get Autotools now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.