Boost C++ Libraries: Ticket #1967: bjam bug? iostreams + zlib won't build for VC8 or MinGW with small hack to Jamfile.v2 https://svn.boost.org/trac10/ticket/1967 <p> In boost_1_35_0\libs\iostreams\build\Jamfile.v2 I find I have to change </p> <table class="wiki"> <tr>if $(NO_COMPRESSION) <td> $(NO_$(LIB)) </td></tr></table> <p> to </p> <table class="wiki"> <tr>if $(NO_COMPRESSION) = 1 <td> $(NO_$(LIB)) = 1 </td></tr></table> <p> to get VC8 or MinGW building with zlib. This is with bjam -v Boost.Jam Version 3.1.16. OS=NT. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/1967 Trac 1.4.3 brian.pratt@… Thu, 29 May 2008 15:48:43 GMT attachment set https://svn.boost.org/trac10/ticket/1967 https://svn.boost.org/trac10/ticket/1967 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">Jamfile.v2</span> </li> </ul> <p> hacked iostreams Jamfile.v2 that allows zlib use in VC8 and MinGW </p> Ticket Marshall Clow Tue, 03 Jun 2008 14:06:44 GMT component changed; owner set https://svn.boost.org/trac10/ticket/1967#comment:1 https://svn.boost.org/trac10/ticket/1967#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">Vladimir Prus</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">Building Boost</span> </li> </ul> Ticket Vladimir Prus Tue, 03 Jun 2008 14:52:04 GMT <link>https://svn.boost.org/trac10/ticket/1967#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1967#comment:2</guid> <description> <p> Can you provide a little bit more explanations? On NT, we already set NO_$(LIB) to 1 a few lines earlier, unless you provide the path to the zlib source. So, what exactly are you doing, how it works, and how you want it to work. </p> <p> Also, please provide changes as unified diff against SVN HEAD, if possible. </p> </description> <category>Ticket</category> </item> <item> <author>brian.pratt@…</author> <pubDate>Tue, 03 Jun 2008 18:56:35 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/1967#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1967#comment:3</guid> <description> <p> I notice a typo in the bug description, I meant to say "without small hack", of course. Oops. </p> <p> Near as I can tell the problem is that when NO_ZLIB is defined to 0 it still triggers the logic, as if it's an ifdef instead of an if, if you see what I mean. </p> <p> Here's my change as a unified diff against trunk as requested: </p> <p> --- Jamfile.orig Tue Jun 3 11:52:46 2008 +++ Jamfile.v2 Thu May 29 07:58:30 2008 @@ -55,7 +55,8 @@ </p> <blockquote> <p> modules.poke : NO_$(LIB) : 1 ; </p> </blockquote> <blockquote> <p> } </p> </blockquote> <ul><li></li></ul><table class="wiki"> <tr> if $(NO_COMPRESSION) <td> $(NO_$(LIB)) </td></tr></table> <p> + # bpratt added the = 1 tests here to get zlib working in MinGW and VC8 </p> <table class="wiki"> <tr>+ if $(NO_COMPRESSION) = 1 <td> $(NO_$(LIB)) = 1 </td></tr></table> <blockquote> <p> { </p> <blockquote> <p> if $(debug) { </p> </blockquote> </blockquote> <p> @@ -141,7 +142,6 @@ </p> </description> <category>Ticket</category> </item> <item> <dc:creator>René Rivera</dc:creator> <pubDate>Tue, 03 Jun 2008 19:07:21 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/1967#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1967#comment:4</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/1967#comment:3" title="Comment 3">brian.pratt@insilicos.com</a>: </p> <blockquote class="citation"> <p> Near as I can tell the problem is that when NO_ZLIB is defined to 0 it still triggers the logic, as if it's an ifdef instead of an if, if you see what I mean. </p> </blockquote> <p> AFAICT, this is intentional in the iostreams Jamfile. And it doesn't set them to "0" anywhere I can see. How are you seeing it being set to "0"? </p> </description> <category>Ticket</category> </item> <item> <author>brian.pratt@…</author> <pubDate>Tue, 03 Jun 2008 19:57:14 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/1967#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1967#comment:5</guid> <description> <p> Since NO_ZLIB defaults to 1 for VC8 and MinGW, it's necessary to set it to 0 at the bjam commandline (-sNO_ZLIB=0). My experience, though, was that this didn't work, and that the test as written seemed to act more as an "ifdef NO_ZLIB". If the test is rewritten to check explicitly for value "1" it acts as required and the zlib build is enabled. It's as if bjam has forgotten the difference between a boolean (zero vs everything else) and an ifdef (undefined vs everything else). </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Vladimir Prus</dc:creator> <pubDate>Wed, 04 Jun 2008 04:48:58 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/1967#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1967#comment:6</guid> <description> <p> By my reading of the code, NO_ZLIB will be set to 1, if you're on Windows, and have not set both ZLIB_SOURCE and ZLIB_INCLUDE. If you set NO_ZLIB=0 on command line and do not set ZLIB_SOURCE and ZLIB_INCLUDE, zlib won't be used anyway. And if you do set ZLIB_SOURCE and ZLIB_INCLUDE, zlib should be used without any other option. So, back to original question -- what exactly are you doing (exact command line), and what effect you see? </p> </description> <category>Ticket</category> </item> <item> <author>brian.pratt@…</author> <pubDate>Wed, 04 Jun 2008 14:34:30 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/1967#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1967#comment:7</guid> <description> <p> bjam -toolset=msvc "-sNO_ZLIB=0" -sZLIB_SOURCE="/zlib123-dll" --build-type=complete --without-python --without-mpi stage </p> <p> I tried various permutations of ZLIB_SOURCE, ZLIB_INCLUDE etc (docs are exceedingly murky on this), this commandline together with the patch is the one that results in zlib being enabled. Everything else gave the default no zlib behavior. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>alessandro_vergani</dc:creator> <pubDate>Wed, 10 Sep 2008 08:05:04 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/1967#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1967#comment:8</guid> <description> <p> The problem happens also with VC9. I think it is a problem with bjam because if I place in the jamfile.v2 a simple test like: </p> <p> if 0 { </p> <blockquote> <p> ECHO "Error" ; </p> </blockquote> <p> } </p> <p> the test always succeeds and the error string is diplayed. </p> <p> Explicitly comparing for equality with 1 solves the problem. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Vladimir Prus</dc:creator> <pubDate>Sat, 04 Apr 2009 12:45:00 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/1967#comment:9 https://svn.boost.org/trac10/ticket/1967#comment:9 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/52168" title="Check if value of NO_COMPRESSION/NO_ZLIB is 0 or 1. Originally, only ...">[52168]</a>) Check if value of NO_COMPRESSION/NO_ZLIB is 0 or 1. </p> <p> Originally, only presence of these variables was checked. Unfortunately, iostreams documentation said, incorrectly, that NO_ZLIB and NO_BZIP2 default to 1 on Windows, which caused some users to pass NO_ZLIB=0 explicitly, together with other variables,thereby still disabling zlib. </p> <p> This match makes Jamfile forgiving of this error. </p> <p> Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/1967" title="#1967: Bugs: bjam bug? iostreams + zlib won't build for VC8 or MinGW with small ... (closed: fixed)">#1967</a>. </p> Ticket