Next: , Previous: func, Up: Particular Modules

12.16 configmake

The configmake module builds a C include file named configmake.h containing the usual installation directory values; for example, those specified by --prefix or --libdir to configure. Each variable is given a #define with an all-uppercase macro name, such as PREFIX and LIBDIR. (Automake cannot create this file directly because the user might override directory values at make time.)

Specifically, the module retrieves values of the variables through configure followed by make, not directly through configure, so that a user who sets some of these variables consistently on the make command line gets correct results.

One advantage of this approach, compared to the classical approach of adding -DLIBDIR=\"$(libdir)\" etc. to AM_CPPFLAGS, is that it protects against the use of undefined variables. That is, if, say, $(libdir) is not set in the Makefile, LIBDIR is not defined by this module, and code using LIBDIR gives a compilation error.

Another advantage is that make output is shorter.

For the complete list of variables which are #defined this way, see the file gnulib/modules/configmake, or inspect your resulting gnulib Makefile.