Move headers from configure to compats.h#26
Open
paravoid wants to merge 10 commits intokristapsdz:masterfrom
Open
Move headers from configure to compats.h#26paravoid wants to merge 10 commits intokristapsdz:masterfrom
paravoid wants to merge 10 commits intokristapsdz:masterfrom
Conversation
Adjust the whitespace in the target definition, to avoid the need for spurious -/+ to realign when adding additional targets.
configure currently has a lot of ${HAVE_...} -eq 0 ] if blocks, printing
out header code for compats.c, to config.h. This is a lot of repetition,
does not allow for splitting the code up properly, and makes the
configure code a bit less maintainable.
Introduce instead a "compats.h" that should now be included by
downstreams, alongside compats.c. Also, add Makefile.regen code to
generate said file from the different compat_*.h parts, in the same way
compats.c is generated.
Use the new compats.h facility to include the sys_queue.h and sys_tree.h code. This removes the special-casing of that header code, and the configure.in/configure.1/configure.2 sed replacements, making the code cleaner and more aligned to the rest of the compatibility code.
Remove more "if HAVE_..." code from configure, relying on simple "#include" statements in compat_*.h code instead.
They use size_t but have not been including it (even pre-refactor)
Given this is now a header file, also convert it from using sh/uname to define it conditionally, to using preprocessor macros.
This lets compats.h define _GNU_SOURCE etc., rather than config.h, and moves these ifdefs outside of configure.
Contributor
Author
|
It's been a long while, I'm wondering if you've given this any thought. There are conflicts now of course, but it shouldn't be too hard to reconcile. First and foremost it'd be good to hear your opinion on the concept itself :) TIA! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
configure currently has a lot of
${HAVE_...} -eq 0 ]if blocks, printing out header code for compats.c, to config.h. This is a lot of repetition, does not allow for splitting the code up properly, and makes the configure code a bit less maintainable.Introduce instead a "compats.h" that should now be included by downstreams, alongside compats.c. Also, add Makefile.regen code to generate said file from the different compat_*.h parts, in the same way compats.c is generated.
The PR is doing this gradually, initially moving all the code that does:
Later on, the more tricky ones are being handled, one by one in a separate commit. This is a breaking change for downstreams, in the sense that they're going to need to add another file to their tree.
To review, it may be worth to look at
configure.inat the end of the PR, and then review the commits one by one.I understand this is a wider change, and I expect it to be somewhat controversial :) I didn't open an issue first because I wanted to see how the end result will look like, and now that I see it I think it is much cleaner. YMMV, and no hard feelings if you outright reject it!