The command line of external executables will not always parse correctly arguments containing spaces even if quoted. A simple example is when compiling gcc and a EXTRA_ECONF="--enable-cxx-flags='-O2 -g'" is passed, the configure will currently mistakenly parse this as "--enable-cxx-flags='-O2" and "-g'", resulting in a unexpected EOF error. The solution is simply to prepend an 'eval' statement before calling external executables. A sample of this is attached for the toolchain.eclass.
Created attachment 159127 [details] Sample toolchain.eclass eval fix
Since you provide only one example, and this example pertains to toolchain.eclass, let's devote this bug to that example. :)
EXTRA_ECONF is treated everywhere as a string. introducing eval can easily have unintended side effects. why is setting CXXFLAGS not good enough for you ? unless there's a real need for such flags in EXTRA_ECONF, it'll stay "broken".
EXTRA_ECONF, anything passed via "$@", quoted multi argument parameters, or (god forbid) a path name with spaces when executed will not parse correctly. The example for gcc compilation was simply one where I first ran into this issue (thus enable-cxx-flags vs. CXXFLAGS is not the point, just a case). I am attaching two test scripts to validate this approach (as I had reservations as well). This is not so much broken, but merely a method which I am using to configure and compile ebuilds (hence it's classification as an enhancement). Contributed in purely in the spirit of the open source community.
Created attachment 159161 [details] Test program Try executing while passing command line parameters as well as setting EXTRA_ECONF
Created attachment 159163 [details] Bogus configure for test to call
(In reply to Paul Davis from comment #4) we're completely aware of the limitations of EXTRA_ECONF being treated as a string and not an array. at this time though, we don't have plans on fixing it because it rarely comes up. although, it'd be easy to do while being backwards compatible. just change EXTRA_ECONF in ebuilds to "${EXTRA_ECONF[@]}". this has nothing to do with `eval` and any suggestions of using `eval` to expand it are doomed to fail.