On 19/10/15 03:55, Greg Troxel wrote:
Thomas Klausner <wiz%NetBSD.org@localhost> writes:On Thu, Oct 15, 2015 at 09:08:17AM -0400, Greg Troxel wrote:2) how to deal with mixed compilers and libs. If there's a c++ library, and it doesn't need C++11, and then a C++ porgram does and links to the library, is that sound? What about the other way around?How does this sound: * we define, per operating system/version, a default c++ compiler, let's say gcc-4.9 (or whatever we think is the best version on that platform). this version is pulled in whenever c++ is defined in USE_LANGUAGES. It should support c++11. * the user can override this default globally, before compiling packagesThat's ok with me. Then, we shouldn't need GCC_REQD in C++ packages, and we can use the min/objectioable scheme in C, since we can mix?
I've thought about this approach a few times too. Probably allowing the user to override it addresses my minor concern that it might force some users to build a GCC on very purpose-specific systems where they may prefer not to.
GCC_REQD is sometimes used to avoid GCC bugs present in a range of versions, not just to ensure certain features are present. I think in principle that a package should be able to state an explicit GCC minimum, as well as relying on the default USE_LANGUAGES handling.
Assuming that we default to, say, GCC 4.9 for C++ - I think that means for most people PKGSRC_GCC_MIN should be 4.9 for C packages too. I.e. if we're expecting to build GCC 4.9 as soon as we hit a C++ package, maybe the default preference should be to use that version for C packages too, if and only if the native version isn't good enough for some package or other.
If there isn't a compelling reason to choose 4.9, I suggest 4.8 instead as a default. Grep says that nothing in Pkgsrc explicitly requires beyond 4.8 - though there are several that call for 4.8 as a minimum. GCC 4.8 is the current default native for Ubuntu and related long term support installations, so we will support at least those users a bit better if we don't force a 4.9 build on them.