Markus Armbruster <arm...@redhat.com> writes: [...] > The problem is including generated bits, namely results of configure, > into source files. > > The Autoconf way is to substitute placeholders in FOO.in producing FOO. > > When you want to limit .in contents as much as possible, you factor out > the stuff that needs substitutions into some SUB.in, which you then > include into FOO. Requires a suitable include mechanism. In shell, > builtin source. > > But then you need to find SUB from FOO. I've seen two ways used: > > 1. Assume SUB is in the current directory. Link FOO into the build tree > to make it so. > > 2. Require FOO to be run in a way that lets it find its source > directory. If whatever runs FOO puts the full path into argv[0], you > can use that. Else, require a suitable argument or environment > variable.
Uh, I left out some "obvious" details here. Revert the role of FOO and SUB. Generate FOO from FOO.in into the build tree, include the real meat from SUB.