g++-4.2 and -stdlib on 10.6

Ryan Schmidt ryandesign at macports.org
Sun Jul 6 12:04:19 PDT 2014

On Jul 3, 2014, at 6:34 AM, Mojca Miklavec <mojca at macports.org> wrote:

> I naively added -stdlib=${configure.cxx_stdlib} to a port, but this
> broke the compilation on 10.6:
> cc1plus: error: unrecognized command line option "-stdlib=libstdc++"
> (See https://trac.macports.org/ticket/44145.)
> What's the best/proper way to handle this setup, so that the Portfile
> would support building the package on 10.6 both with libstdc++ as well
> as with libc++? (Blacklisting the default compiler is probably one
> option, but not necessarily the best one.)

Add this line only if configure.cxx matches clang. See for example the port gpsd.

More information about the macports-dev mailing list