standard way to require c++11?

Michael Dickens michaelld at macports.org
Thu Mar 19 11:00:37 PDT 2015


So, here's what I have thus far:

{{{
if {${configure.cxx_stdlib} eq "libstdc++"} {
    # *clang* when using libstdc++ do not seem to support C++11;
    # C++11 support seems to need GCC 4.7+ when using libstdc++;
    # could use C++0x support on GCC4.[56], but just ignore it since
    # there are newer compilers already in place as defaults.
    # Blacklist GCC compilers not supporting C++11 and all CLANG.
    compiler.blacklist-append *clang* {*gcc-3*} {*gcc-4.[0-6]}
    compiler.fallback-append macports-gcc-4.9 macports-gcc-4.8
    macports-gcc-4.7
} else {
    # using libc++;
    # Blacklist Clang not supporting C++11 in some form and all GCC.
    compiler.blacklist-append *gcc* {clang < 500}
}
}}}

This seems to work for me, without using variants; at least on 10.8.
I'll test on 10.10 shortly. I don't see it as having C++ runtime library
issues, since it maintains correct usage of either libc++ or libstdc++.
- MLD


More information about the macports-dev mailing list