Repository navigation
Pedantic fixes to build system (configure, Makefile)
#8933
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
whitslack
wants to merge
16
commits into
ElementsProject:master
Choose a base branch
from
whitslack:build-system-pedantry
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
2df7f0e
configure: don't use 'echo -n' under /bin/sh
whitslack 6790ec0
configure: be consistent in writing status output to stderr
whitslack 68527ee
configure: fix quoting mistake in setting DEFAULT_CWARNFLAGS in usage()
whitslack 96f75ce
Makefile: don't show config.vars on the LD line in show-flags
whitslack d353bd5
build: allow overriding CFLAGS, CPPFLAGS, and LDFLAGS
whitslack 60249d3
Makefile: use standard variables for compiling and linking C programs
whitslack 9947218
build: move -std=gnu11 to CPPFLAGS
whitslack 26e1a61
configure: fix have_function_sections test
whitslack 069ecc6
fix two libwally-core #includes
whitslack b4e1e63
build: manage installation targets with Make individually
whitslack 98851d4
configure: allow overriding library flags via environment vars
whitslack 2e2aaee
configure: keep -std=gnu11 when CPPFLAGS is set
Andezion 9a327be
Makefile: add CFLAGS, CPPFLAGS and LDFLAGS from make's environment an…
Andezion 8af90da
configure: pass LDFLAGS to have_function_sections, avoid [ -a ]
Andezion 869c4be
Makefile: simplify installation and uninstallation
Andezion 1bd3630
configure: don't add -ffunction-sections again on --reconfigure
Andezion File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add
$CFLAGSto all of these invocations, or keep-std=gnu11centralized in one flags variable that all of them already reference??There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some build systems put the
-std=option directly inCC(andCXXif applicable). I don't really like that, as some code assumes thatCCand friends contain simple path names with no arguments. However, there isn't a great place to specify the-std=option. It needs to be passed to the preprocessor, as feature test macros are affected by the C/C++ standard in use, but naïvely adding the-std=option toCPPFLAGSis suboptimal because C++ code will need a different standard than C code. Some build systems work around this by introducing aCXXCPPFLAGSvariable that is specific to the C++ preprocessor, but that's very non-standard. I usually make the compromise of locally overriding the value ofCPPFLAGSjust for C++ source files. This won't be an issue for CLN for the time being since it currently has no C++ source files.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, so that means we need to add
$CPPFLAGStohave_function_sectionsprobe$CONFIGURATORbinary$CONFIGURATOR --extra-tests ..., which generatesccan/config.h??There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed. I have done all that in f0d3497, although there's a bigger problem here, which I'm working on now: this doesn't support cross-compiling. Configurator needs to be built with
$CC_FOR_BUILD(and its associated$CFLAGS_FOR_BUILD,$CPPFLAGS_FOR_BUILD, and$LDFLAGS_FOR_BUILD).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'll open a new PR for cross-compilation support since I think it's going to involve quite a lot of changes, and it's logically independent of this PR.