Hiya,
Appended is my submission for a new pair of macros:
AX_CONFIG_PREFIXED_HEADER(OUTPUT, PREFIX, INPUT)
AX_PREFIXED_DEFINE(PREFIX, SYMBOL)
for release under the "GPLv2 with Autoconf exception" license.
These were inspired by the AX_PREFIX_CONFIG_H macro to solve the
same basic problem: create an installable version of the generated
"config.h" header by prefixing the defined symbols with a PREFIX.
However, instead of copying/prefixing the *entire* input header file,
this new pair of macros allows the developer to select exactly which
symbols she needs in the installable header file. AX_PREFIXED_DEFINE
is used to schedule a SYMBOL (which should already have a corresponding
AC_DEFINE) for prefixing with PREFIX. AX_CONFIG_PREFIXED_HEADER
specifies that the OUTPUT header is generated from the INPUT header
using all the symbols scheduled under PREFIX.
It's nice because it creates an installable config header with only
the symbols one absolutely needs (and none of the extraneous cruft
which may be broken anyhow).
The macros currently have no defaults for the parameters; each parameter
is required. I'm happy to take suggestions for how to improve this,
or pointers to examples of the right way to do this, or anything else
in the macros. (This is my first autoconf macro, and I must admit I'd
like to take a break from pouring over m4 source code for a while.)