-
-
Notifications
You must be signed in to change notification settings - Fork 63
configure: fix broken cross-compilation detection #524
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
base: master
Are you sure you want to change the base?
Conversation
Assume the build as native if both $CXX and $CXX_FOR_BUILD have the same value. If the compiler for the host and the build machine are the same, it's a native build. There is a chance that the user may set both $CXX and $CXX_FOR_BUILD to the same compiler. For example, cbuild (Chimera Linux package builder) sets both variables regardless of native or cross build and because we use $CXX_FOR_BUILD for detecting cross build, we should unset that variable in this case. Also, GNU autotools detects this case and assumes the build as native.
|
I just realised that the whole commit message should be written imperatively, not just the commit title or first sentence of commit comment. |
No, background information may follow. Your message here really isn't too bad and it's an improvement on previous commit messages. However, it could be improved:
(This is nothing to do with commit messages per se - it's just better writing).
This is basically saying the same thing, a third time - I don't think it's necessary.
This is background info and in general the style used in commit messages is to start a new paragraph for the background information. You should read through the existing commit messages to get a sense for this. Here are some recent examples: And See the general structure?
This is explaining what the change does at the code level. It doesn't make sense at the abstract level of the commit message (why should we unset the variable? we could also just flag "not a cross-build" internally in some other way).
If the point is that the new behaviour is consistent with autotools, then it's better to say that directly rather than force the reader to make that connection themselves (even if it's fairly simple, there's no reason not to state your point explicitly). |
|
Sorry for delay, I got sick. I'm better now.
I added the first sentence after my comment. It wasn't there and I added it without thinking twice because I wanted to rewrite it after I set the PR to draft. Thanks for the suggestion. Yes, It's better.
Yes. I need to get better in breaking down text to sections to understand them better.
Yes. That's better to explicitly state that point. |
I think you're misinterpreting what I said. I'm not saying the solution is wrong.
That's ok as a solution, but, I think the comment doesn't explain that very well. It doesn't say where the change is, it doesn't really explain how the solution works; you have to look at the code to make sense of it. |
|
To explain more:
We don't need to unset the variable. That's the solution you have chosen. And, it didn't explain how that fixes the issue. What was written was:
it doesn't say how we "use" $CXX_FOR_BUILD for detecting a cross build, and it doesn't say how/why unsetting the variable alters the result of that detection. For example it doesn't explain the variable is unset just before the check for whether the $CXX_FOR_BUILD is set or not (which is used to detect a cross build). That's so easy to say and makes it so much clearer. |
Assume the build as native if both $CXX and $CXX_FOR_BUILD have the same value. If the compiler for the host and the build machine are the same, it's a native build. There is a chance that the user may set both $CXX and $CXX_FOR_BUILD to the same compiler. For example, cbuild (Chimera Linux package builder) sets both variables regardless of native or cross build and because we use $CXX_FOR_BUILD for detecting cross build, we should unset that variable in this case.
Also, GNU autotools detects this case and assumes the build as native.