-
Notifications
You must be signed in to change notification settings - Fork 989
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
[bug] autotools.configure() uses --host and --build when cross-compiling #12705
Comments
related to #12546 |
Yeah, good point! I opened a PR some time ago that added those parameters at |
Looks ok to me, I'm still new to the conan codebase, Seems logical to me ... :) Might be nice to have a "remove_starting_with()" method to make that simple. |
Yes, I think it could be reasonable to have a little helper to prune those arguments. Indeed, your comment is related to @SpaceIm's one #12645 (comment) Let me propose something in that PR. |
Only to clarify the issue's title, it says always, but it's only happening when |
I have proposed something like this in my previously mentioned PR: at = AutotoolsToolchain(self)
# Pruning values if None is passed as a flag value
at.update_configure_args({"--build": None, "--host": None}) EDITED: It was a dictionary in the end. |
I like it :) but the first one ... if you only want to prune host, then if you don't specify 'build' then it would call with build=None due to default arguments? |
Not at all. You pass only the arguments that you want to change, the rest of them are unaffected. at = AutotoolsToolchain(self)
# at.configure_args -> ['--host=wasm32-local-emscripten', '--build=x86_64-linux-gnu', '--target=aarch64-linux-android']
at.update_configure_args({"--host": None, "--target": "my_triplet"})
# configure_args -> ['--build=x86_64-linux-gnu', '--target=my_triplet'] EDITED: It was a dictionary in the end. |
Closed by #12884 Finally, it'll be something like this: at = AutotoolsToolchain(self)
at.update_configure_args({"--build": None, # remove --build flag
"--host": "whatever" # update existing --host one
}) |
conan/conan/tools/gnu/autotoolstoolchain.py
Line 188 in d23c1b4
The old conans autotools_environment.py had parameters to set
build=False
host=False`, to prevent the configure script from being called with --host and --build.That seems like a useful thing for one problematic recipe: libvpx
It has a custom configure script that does not handle --host and --build.
One way to workaround this is to patch the script so it accepts and ignores these parameters.
This sounds fragile.
The other way is to generate my own call to the configure script.
This seems appropriate and simpler than adding more cruft to the conan core.
conan-io/conan-center-index#13799
So, I thought I should raise this to see what you guys thought.
The text was updated successfully, but these errors were encountered: