Checking for Compilers

The AC_PROG_CC macro ensures that the user's system has a working C-language compiler. Here's the prototype for this macro:

AC_PROG_CC([compiler-search-list])

If your code requires a particular flavor or brand of C compiler, you can pass a whitespace-separated list of program names in this argument. For example, if you use AC_PROG_CC([cc cl gcc]), the macro expands into shell code that searches for cc, cl, and gcc, in that order. Usually, the argument is omitted, allowing the macro to find the best compiler option available on the user's system.

You'll recall from An Even Quicker Start with autoscan in An Even Quicker Start with autoscan that when autoscan noticed C source files in the directory tree, it inserted a no-argument ...

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.