Repository navigation
Fix configure to mangle AM_LDFLAGS instead of LDFLAGS, which it has no business to mangle. - #1242
Merged
Merged
Conversation
Currently we just unconditionally add it to LDFLAGS, without checking whether it even exists. That creates confusing error messages down the line. Instead, use AC_CHECK_LIB to see whether the library is there, and provide a proper error message if not. This should fix OpenLightingProject#1201.
Automake defines LDFLAGS (and CFLAGS, and a number of other variables) as user variables (i.e., reserved for the user, not for the build system), and provides AM_* alternatives for the build system to mangle instead. The advantage of this is that the user can mangle those variables by running "make LDFLAGS=-lfoo" without having to fiddle with configure, and without losing whatever flags the configure run added. In addition, since doing "LDFLAGS=-lfoo ./configure" is also supported, LDFLAGS is captured at AC_OUTPUT time, and therefore should not be directly mangled by the configure script; otherwise a user might try to do something which will break the build. We do so anyway, which might cause things to break in some corner cases. Fix this misbehaviour by setting AM_LDFLAGS rather than LDLFLAGS, and AC_SUBST'ing it into the build system at the end of the configure run.
Member
|
Thanks @yoe ! Can we target the tcmalloc bit at the 0.10 branch please as it's a bugfix, but perhaps the LDFLAGS stuff should stay in master, in case it's got unintended consequences. |
Member
Member
|
@yoe do the other LDFLAGS references in the m4 scripts in config want fixing too then? https://github.com/OpenLightingProject/ola/search?utf8=%E2%9C%93&q=LDFLAGS&type= |
peternewman
reviewed
Apr 30, 2017
peternewman
left a comment
Member
There was a problem hiding this comment.
As per the question, do the other bits need fixing?
Contributor
Author
|
No, they don't. Those all use the pattern (mangle LDFLAGS, run various tests) etc, which means that while they touch |
peternewman
approved these changes
May 5, 2017
nomis52
approved these changes
May 6, 2017
Member
|
This will go green after #1248 goes in. |
Closed
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.
Fix #1201
While at it, fix configure to mangle AM_LDFLAGS instead of LDFLAGS, which it has no business to mangle.