Boost C++ Libraries: Ticket #3424: cflags don't affect C++ compiler https://svn.boost.org/trac10/ticket/3424 <p> According to <a href="http://www.boost.org/boost-build2/doc/html/bbv2/overview/builtins/features.html">this</a> page, the cflags should affect both C and C++ compilers. However, that isn't true, cflags are not passed to the C++ compiler, only cxxflags are. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3424 Trac 1.4.3 Steven Watanabe Tue, 08 Sep 2009 19:44:15 GMT component changed; owner set https://svn.boost.org/trac10/ticket/3424#comment:1 https://svn.boost.org/trac10/ticket/3424#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">Building Boost</span> → <span class="trac-field-new">build</span> </li> </ul> <p> Note that there are two things called cflags. The parameter passed to the toolset initialization is different from the feature and only affects the C compiler, not the C++ compiler. It appears to me that the values of the feature cflags are passed to the C++ compiler. What toolset are you using? Do you have a minimal example? </p> Ticket Andrey Semashev Mon, 14 Sep 2009 06:36:17 GMT <link>https://svn.boost.org/trac10/ticket/3424#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3424#comment:2</guid> <description> <p> I'm using MSVC 7.1 with STLPort. I don't have a minimal example, I was just trying to build Boost 1.40 with the following script (I used Cygwin to run it): </p> <pre class="wiki">export HAVE_ICU=1 export ICU_PATH="$ROOT_DIR/ThirdParty/icu" export ICU_LINK="/LIBPATH:$ROOT_DIR/ThirdParty/icu/win32/lib icuuc.lib icuin.lib icudt.lib" export ZLIB_BINARY=zlib export ZLIB_INCLUDE=$ROOT_DIR/ThirdParty/ZLib/inc export ZLIB_LIBPATH=$ROOT_DIR/ThirdParty/ZLib/lib/win32 tools/jam/src/bin.ntx86/bjam.exe -d+2 -j 2 --stagedir=stage.vc7 toolset=msvc stdlib=stlport variant=release link=shared runtime-link=shared threading=multi optimization=speed inlining=full rtti=on exception-handling=on debug-symbols=on "cflags=-G7 -arch:SSE2 -Oi -GL" "linkflags=/LTCG /OPT:REF,ICF $ICU_LINK" --without-python --without-wave --without-mpi stage </pre><p> The user-config.jam is in the tools/build/v2 directory (excessive commented lines stripped): </p> <pre class="wiki"># ------------------- # MSVC configuration. # ------------------- # Configure msvc (default version, searched for in standard locations and PATH). using msvc ; # ---------------------- # STLPort configuration. # ---------------------- # Configure specifying location of STLPort headers. Libraries must be either # not needed or available to the compiler by default. # using stlport : : /usr/include/stlport ; # Configure specifying location of both headers and libraries explicitly. using stlport : : "&lt;absolute_path_to_ThirdParty&gt;/ThirdParty/STLport/stlport" : "&lt;absolute_path_to_ThirdParty&gt;/ThirdParty/STLport/lib/win32" ; </pre><p> The resulting build log contains compiler flags, and "-G7 -arch:SSE2 -Oi -GL" are missing. When cflags are changed to cxxflags it works as expected. </p> <p> BTW, it's not mentioned in the initial posting, but I had another problem with user-config.jam. You see these "&lt;absolute_path_to_ThirdParty&gt;" parts? I had to write a perl script to fill these in, based on my current path configuration in the ROOT_DIR environment variable. When I tried to specify "$(ROOT_DIR)<a class="missing wiki">/ThirdParty</a>/STLport/stlport" I got build errors that basically said that there were too many arguments for stlport rule. Apparently, it took the colon after the drive letter as a delimiter between rule parameters. I failed to work it around except to write a perl script that would substitute the &lt;absolute_path_to_ThirdParty&gt; placeholder with the expanded value of ROOT_DIR, then it worked (even though the colon is still there). </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Vladimir Prus</dc:creator> <pubDate>Mon, 14 Sep 2009 06:57:55 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3424#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3424#comment:3</guid> <description> <p> This appears to be msvc-specific bug, I'll fix that. As for your second problem, not that </p> <ul><li>"$(ROOT_DIR)" is not automatically expanded, see FAQ for explanation how to get environment variables </li><li>Many users are passing full windows paths without issues. If the path contain spaces -- did you quote it? </li></ul><p> If the above suggestions do no work, can you file a separate bug report so as not to confuse different things. </p> <p> Thanks, Volodya </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Andrey Semashev</dc:creator> <pubDate>Tue, 15 Sep 2009 06:40:13 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3424#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3424#comment:4</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/3424#comment:3" title="Comment 3">vladimir_prus</a>: </p> <blockquote class="citation"> <p> As for your second problem, not that </p> <ul><li>"$(ROOT_DIR)" is not automatically expanded, see FAQ for explanation how to get environment variables </li></ul></blockquote> <p> That helped, thanks a lot. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Vladimir Prus</dc:creator> <pubDate>Thu, 05 Nov 2009 09:39:31 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3424#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3424#comment:5</guid> <description> <p> Fixed in <a class="changeset" href="https://svn.boost.org/trac10/changeset/57405" title="Make cflags affect both C and C++ compilers, per docs. ">r57405</a>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Vladimir Prus</dc:creator> <pubDate>Thu, 05 Nov 2009 09:41:31 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/3424#comment:6 https://svn.boost.org/trac10/ticket/3424#comment:6 <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> Merged to release branch in <a class="changeset" href="https://svn.boost.org/trac10/changeset/57406" title="Merge: Make cflags affect both C and C++ compilers, per docs. ">r57406</a>. </p> Ticket