There are two problems I've found:
- test_config.h is being built using configure.ac and that puts it in the _build subtree, but because it's built by configure, it's already in the true source tree. When distcheck builds the bes-<ver> source tree, it gets put there as well (because the copy in the 'bes' source tree got added to the source tarball and then extracted to the bes-<ver> source tree). The compiler finds the copy in the bes-<ver> source tree and not the copy in the _build tree. So... the paths in the file that use @top_builddir@ are not compiled into the code.
- The source dirs are not writeable, so on a host with automake 1.14.1++ we need to be writing to the build dirs (so we really do need those paths). The tests work on 1.14.0-- because the _test_config.h file used is the one that names the true ('bes' tree, not the 'bes-<ver>' tree) and as a result the temp files, etc. are written in the completely wrong place.
What we need to do:
- Figure out how to not include those generated headers in the tarball (idea: mark then as generated sources - there is an option for this).
- Build the needed temp dirs in the _build code (now we include those in the (pure) source tree by adding them to git. (idea: use simple code to build them. But how to run those targets and how to clean them up?)
A simple generator target for a directory:
Once working correctly we need to stamp and repeat the fix. There are two other places at least where we need this:
Search for test_config.h.in files that use @top_buiddir@