[PHPC-2647] Out-of-source build: Don't necessarily generate flies in the source tree#1893
[PHPC-2647] Out-of-source build: Don't necessarily generate flies in the source tree#1893vector-of-bool wants to merge 2 commits intomongodb:v2.xfrom
Conversation
When doing an out-of-source build, certain generated headers are written into the build tree. The directories containing these headers need to be added as #include search paths for the build to succeed.
5b36382 to
d5197f7
Compare
There was a problem hiding this comment.
Pull request overview
This PR modifies the autoconf configuration to support out-of-source builds by changing how generated files are created. Instead of using absolute paths that write files into the source tree, it uses relative paths that write to the build directory.
Changes:
- Changed AC_CONFIG_FILES to use relative paths instead of absolute paths based on
${ac_config_dir} - Added build directories as include paths using
$PWDto ensure generated headers can be found
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Note: rebased to resolve conflicts. I tested this by running This leads me to believe that we'd need to add additional directories (e.g. |
This changeset modifies an AC_CONFIG_FILES directive to configure some of mongoc's files using relative paths. IIUC, using relative paths (instead of absolute ones) will make it read the file relative to the
configurescript, but write the file with the same name relative to the$PWDof theconfigureexecution. This allows theconfigurescript to leave the source tree more pristine.To support this, the directories that are (possibly) generated by AC_CONFIG_FILES needs to be added as
#includesearch paths. (The search directories are added based on$PWD, which feels somewhat brittle (is there a better autotools/autoconf variable to be used here? I couldn't seem to make it work otherwise.).)(I'm not sure if there is an existing relevant Jira ticket for out-of-source build support tasks, so I created PHPC-2647 for this.)