Checking for Other Programs

Immediately following the call to AC_PROG_CC (see Example 4-1) is a call to AC_PROG_INSTALL. All of the AC_PROG_* macros set (and then substitute, using AC_SUBST) various environment variables that point to the located utilities. AC_PROG_INSTALL does the same thing for the install utility. To use this check, you need to use the associated Autoconf substitution variables in your Makefile.in templates, just as we did above with @CC@, @CFLAGS@, and @CPPFLAGS@. Example 4-3 illustrates these changes.

Example 4-3. src/Makefile.in: Substituting the install utility in your Makefile.in templates

...
# Tool-specific substitution variables
CC              = @CC@
CFLAGS          = @CFLAGS@
CPPFLAGS        = @CPPFLAGS@
INSTALL         = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@ ...

Get Autotools now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.