GNU Autoconf, Automake, and Libtool
by Gary V. Vaughan, Ben Elliston, Tom Tromey, Ian Lance Taylor
5.3. Ordering Tests
In addition to the problem of writing portable sh code, another problem confronts first-time 'configure.in' writers: determining the order in which to run the various tests. Autoconf indirectly (via the autoscan program covered in Chapter 23) suggests a standard ordering, as described here.
The standard ordering is as follows:
Boilerplate. This section should include standard boilerplate code, such as the call to AC_INIT (which must be first), AM_INIT_AUTOMAKE, AC_CONFIG_HEADER, and perhaps AC_REVISION.
Options. The next section should include macros that add command-line options to configure, such as AC_ARG_ENABLE. It is typical to put support code for the option in this section as well, if it is short enough, like this ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access