Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Hope is not the conviction that something will turn out well, but the certainty that something makes sense, regardless of how it turns out.
— Václav Havel Disturbing the Peace
In Chapter 3, we discussed the essentials of Autoconf—how to bootstrap a new or existing project and how to understand some of the basic aspects of configure.ac files. In this chapter, we'll cover some of the more complex Autoconf macros. We'll begin by learning how to substitute our own variables into template files (e.g., Makefile.in) and how to define our own preprocessor definitions from within the configuration script. Throughout this chapter, we'll continue to develop functionality in the Jupiter project by adding important checks and tests. We'll cover the all-important AC_OUTPUT macro, and we'll conclude by discussing the application of user-defined project configuration options as specified in the configure.ac file.
In addition to all this, I'll present an analysis technique that you can use to decipher the inner workings of macros. Using the somewhat complex AC_CHECK_PROG macro as an example, I'll show you some ways to find out what's going on under the hood. After all, when software is distributed in source format, its secrets can't stay hidden forever.