Subject: [Boost-bugs] [Boost C++ Libraries] #6887: Hardcoded path to g++ in gcc.mak and gcc-shared.mak for regex
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-05-10 13:21:18
#6887: Hardcoded path to g++ in gcc.mak and gcc-shared.mak for regex
-----------------------------------------------------------+----------------
Reporter: Morten Rasmussen <mortenrasmussen@â¦> | Owner: johnmaddock
Type: Bugs | Status: new
Milestone: To Be Determined | Component: regex
Version: Boost 1.49.0 | Severity: Problem
Keywords: gcc makefile g++ path |
-----------------------------------------------------------+----------------
The makefiles gcc.mak and gcc-shared.mak in boost/libs/regex/build both
contain the lines
CXX=g++
LINKER=g++ -shared
which means that the compiler will pick the g++ defined by the PATH
variable.
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.
To fix this, I suggest that these lines are changed to
CXX?=g++
LINKER=$(CXX) -shared
so that a CXX value passed to the makefile will prevail, and "g++" is
still if no value is passed.
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.
The changes in diff format:
diff gcc.mak.orig gcc.mak
24,25c24,25
< CXX=g++
< LINKER=g++ -shared
---
> CXX?=g++
> LINKER=$(CXX) -shared
diff gcc-shared.mak.orig gcc-shared.mak
24,25c24,25
< CXX=g++
< LINKER=g++ -shared
---
> CXX?=g++
> LINKER=$(CXX) -shared
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/6887> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:09 UTC