I have a library where the include files are distributed in a 'generic'
form, and are then processed at configuration / build time to localise
them. For instance, one of them defines C types based on what the local
machine has available (whether int is 32 bit, long or long long is 64
bit, etc.). At present I do this with a custom makefile.in and
autoconf, but this is getting unwieldy.
The structure I have is (where . is the root of the directory tree):
./util where utilities such as the pre-processing live
./src where the library sources live
./inc where the 'generic' include files live
tmpinc where the preprocessed include files live
The subdirectories ./util, ./src and ./inc (and files in .) are required
to be distributed. At configure time, or at the start of the build,
files in ./util must be built (and some of them run automatically), then
one of the utilities is run on each of the files in ./inc to create the
processed file in tmpinc. At build time (after doing that) the
library is built from sources in ./src, using include files from
tmpinc. At install time, the library is installed and the
preprocessed includefiles in ./tmpinc are installed.
Note that tmpinc should be relative to the build directory, not to the
source directory, since it depends on build options (like which compiler
is being used).
This sort of thing must surely have been solved before, but I can't find
any references to it using Google etc. Or is it something that automake
just can't do so people "roll their own"?
Chris C