The developer specifies the desired behaviour of the configure script by writing a list of instructions in the GNU m4 language in a file called "configure.ac". A library of pre-defined m4 macros is available to describe common configure script instructions. Autoconf transforms the instructions in "configure.ac" into a portable configure script. The system that will be doing the building need not have autoconf installed: autoconf is needed only to build the configure script, that is usually shipped with the software.
Autoconf is similar to the Metaconfig package used by Perl. The imake system formerly used by the X Window System is closely related, but has a different philosophy. The Autoconf approach to portability is to test for features, not for versions. For example, the native C compiler on SunOS 4 did not support ISO C. However, it is possible for the user or administrator to have installed an ISO C-compliant compiler. A pure version-based approach would not detect the presence of the ISO C compiler, but a feature-testing approach would be able to discover the ISO C compiler the user had installed. The rationale of this approach is to gain the following advantages:
the configure script can get reasonable results on newer or unknown systems
it allows administrators to customize their machines and have the configure script take advantage of the customizations
there is no need to keep track of minute details of versions, patch numbers, etc., to figure out whether a particular feature is supported or not
Autoconf provides extensive documentation around the non-portability of many POSIX shell constructs to older shells and bugs therein. It also provides M4SH, a macro-based replacement for shell syntax.
Criticism
There is some criticism that states that Autoconf uses dated technologies, has a lot of legacy restrictions, and complicates simple scenarios unnecessarily for the author of configure.ac scripts. In particular, often cited weak points of Autoconf are:
General complexity of used architecture, most projects use multiple repetitions.
Generated 'configure' is written in Bourne shell and thus Makefile generation is slow.
Some people think that 'configure' scripts generated by autoconf provide only manual-driven command-line interface without any standardization. While it is true that some developers do not respect common conventions, such conventions do exist and are widely used.
M4 is unusual and unknown to many developers. Developers will need to learn it to extend autoconf with non-standard checks.