Opened 5 years ago

Closed 5 years ago

#55926 closed enhancement (fixed)

boost: Add C++11 variant

Reported by: michaelld (Michael Dickens) Owned by: michaelld (Michael Dickens)
Priority: Normal Milestone:
Component: ports Version:
Keywords: c++11, haspatch Cc: ken-cunningham-webuse
Port: boost


This ticket is a proposal to add +cxx11 variant to Boost to build Boost using -std=gnu++11 with a c++11 compliant compiler (via the cxx11 1.1 PortGroup and appending to configure.cxxflags), and make it a default for Mac OS X <= 10.8.

I've tested this change (+cxx11) on 10.12 and 10.8, and this small change works nicely. A benefit especially for <= 10.8 is that any port using the cxx11 1.1 PortGroup with boost as a dependency will work out of the box, instead of having to manually select a valid compiler (for Boost and/or the port).

In my testing, compiling Boost using c++11 does not mean that any port using this Boost must also be compiled using c++11. Further, Boost +cxx11 seems to be a drop-in replacement for Boost -cxx11.

I'd even go so far as to say that Boost should -always- be compiled using c++11, since doing so will be more robust for building ports on both older and newer OSs.

Attachments (1)

Boost_add_cxx11.diff (931 bytes) - added by michaelld (Michael Dickens) 5 years ago.

Download all attachments as: .zip

Change History (5)

Changed 5 years ago by michaelld (Michael Dickens)

Attachment: Boost_add_cxx11.diff added

comment:1 Changed 5 years ago by michaelld (Michael Dickens)

I'm looking for discussion of pros & cons to this change as is, as well as making +cxx11 a default variant for all installs (not just <= 10.8).

comment:2 Changed 5 years ago by ryandesign (Ryan Schmidt)

Keywords: boost removed
Summary: Add C++11 variant to Boostboost: Add C++11 variant

Then I'd say include the cxx11 1.1 portgroup, add to the cxxflags, and forget about the variant.

comment:3 Changed 5 years ago by michaelld (Michael Dickens)

Since nobody seems to either care or be against moving Boost to requiring C++11, I'm going to "just do it".

comment:4 Changed 5 years ago by michaelld (Michael Dickens)

Owner: set to michaelld
Resolution: fixed
Status: newclosed

In 9aef396e4c29007abf037434284b5e3858bfafe3/macports-ports:

boost: use c++11 for building

Closes: #55926

Note: See TracTickets for help on using tickets.