Boost C++ Libraries: Ticket #6887: Hardcoded path to g++ in gcc.mak and gcc-shared.mak for regex https://svn.boost.org/trac10/ticket/6887 <p> The makefiles gcc.mak and gcc-shared.mak in boost/libs/regex/build both contain the lines </p> <p> CXX=g++ LINKER=g++ -shared </p> <p> which means that the compiler will pick the g++ defined by the PATH variable. </p> <p> This is unfortunate if you have multiple gcc version on the machine and intend to link boost regex with modules compiled with another g++ version than the one defined by PATH. </p> <p> To fix this, I suggest that these lines are changed to </p> <p> CXX?=g++ LINKER=$(CXX) -shared </p> <p> so that a CXX value passed to the makefile will prevail, and "g++" is still if no value is passed. </p> <p> In other words: this suggestion adds the option of passing an alternative CXX value to the makefile - the suggestion will be backward compatible by working as before if no value is passed. </p> <p> The changes in diff format: </p> <p> diff gcc.mak.orig gcc.mak 24,25c24,25 &lt; CXX=g++ &lt; LINKER=g++ -shared --- </p> <blockquote class="citation"> <p> CXX?=g++ LINKER=$(CXX) -shared </p> </blockquote> <p> diff gcc-shared.mak.orig gcc-shared.mak 24,25c24,25 &lt; CXX=g++ &lt; LINKER=g++ -shared --- </p> <blockquote class="citation"> <p> CXX?=g++ LINKER=$(CXX) -shared </p> </blockquote> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6887 Trac 1.4.3 Morten Rasmussen <mortenrasmussen@…> Thu, 10 May 2012 13:26:19 GMT <link>https://svn.boost.org/trac10/ticket/6887#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6887#comment:1</guid> <description> <p> (Sorry for lousy formatting - read below instead) </p> <p> The makefiles gcc.mak and gcc-shared.mak in boost/libs/regex/build both contain the lines </p> <pre class="wiki">CXX=g++ LINKER=g++ -shared </pre><p> which means that the compiler will pick the g++ defined by the PATH variable. </p> <p> This is unfortunate if you have multiple gcc version on the machine and intend to link boost regex with modules compiled with another g++ version than the one defined by PATH. </p> <p> To fix this, I suggest that these lines are changed to </p> <pre class="wiki">CXX?=g++ LINKER=$(CXX) -shared </pre><p> so that a CXX value passed to the makefile will prevail, and "g++" is still if no value is passed. </p> <p> In other words: this suggestion adds the option of passing an alternative CXX value to the makefile - the suggestion will be backward compatible by working as before if no value is passed. </p> <p> The changes in diff format: </p> <pre class="wiki">diff gcc.mak.orig gcc.mak 24,25c24,25 &lt; CXX=g++ &lt; LINKER=g++ -shared --- &gt; CXX?=g++ &gt; LINKER=$(CXX) -shared diff gcc-shared.mak.orig gcc-shared.mak 24,25c24,25 &lt; CXX=g++ &lt; LINKER=g++ -shared --- &gt; CXX?=g++ &gt; LINKER=$(CXX) -shared </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Fri, 11 May 2012 18:42:51 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/6887#comment:2 https://svn.boost.org/trac10/ticket/6887#comment:2 <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/78424" title="Change gcc makefile variable usage. Regenerate makesfiles. Fixes #6887">[78424]</a>) Change gcc makefile variable usage. Regenerate makesfiles. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6887" title="#6887: Bugs: Hardcoded path to g++ in gcc.mak and gcc-shared.mak for regex (closed: fixed)">#6887</a> </p> Ticket