On 02/20/2012 12:00 PM, Marc wrote:
I am not sure if the strip-eol option really does what the name
implies. Maybe it could be implemented such that all whitespace
characters (when isspace is true) are replaced with space, whitespace
following whitespace is removed and leading and trailing whitespace is
removed. That should be pretty portable, depending only on the isspace
FYI: I added that option and it was designed specifically to avoid breaking any existing Jamfiles that might want embedded newlines in the result.  'strip-eol' only removes the final trailing newline and this works fine for the case I was addressing, which is capturing build options from a script (such as 'wx-config') to be inserted into a command line.  (This output usually consists of only a single line with a single trailing newline.)

Prior to this option, if you placed the output of something like 'wx-config' into <cxx-options> or <link-options> the final trailing newline was preserved and ended up causing bjam to generate an invalid command line (to the shell interpreter it appeared to be two separate command lines).  The only work-around was to pipe the result of 'wx-config' to something like 'tr' and tell it convert the newlines into a space; a bit hacky and not very portable.

I would recommend not changing how 'strip-eol' works as some folks may now rely on that behavior.  I have thought about adding another option to do what you suggest but I haven't really had the need for it.  It would trivial to do so, however.