On Jul 22, 2013, at 14:51, Vincent Habchi wrote:
> Le 22 juil. 2013 à 21:41, Ryan Schmidt a écrit :
>
>> Hmm. I think we probably want all ports to respond correctly to
>> configure.compiler, since the default differs by Xcode version, but of
>> course we haven't audited all ports for compliance, and I'm sure several
>> don't. But that would be something that could be fixed on a port by port
>> basis as it's discovered.
>
> Well, I’m not sure it is feasible. Take, for example, py-scipy. It includes
> these lines (for the gcc45 variant):
>
> configure.compiler macports-gcc-4.5
> …
> destroot.env-append CC="${prefix}/bin/gcc-mp-4.5" \
> CXX="${prefix}/bin/g++-mp-4.5"
> build.env-append CC="${prefix}/bin/gcc-mp-4.5" \
> CXX="${prefix}/bin/g++-mp-4.5"
That seems to be ok. In that case, the maintainer wanted to have a variant to
change the compiler, and the variant accomplishes that. There is a bunch of
redundant code, of course, which it would be nice to consolidate.
> So in this case, a simple configure.compiler state variable does not seem to
> be enough. This is going to be real hard to fix.
To consolidate the redundant code, the gcc variants could be reduced to e.g.:
variant gcc45 {
configure.compiler macports-gcc-4.5
}
And then later, it would do:
pre-build {
build.env-append CC=${configure.cc} CXX=${configure.cxx}
}
pre-destroot {
destroot.env-append CC=${configure.cc} CXX=${configure.cxx}
}
_______________________________________________
macports-dev mailing list
[email protected]
https://lists.macosforge.org/mailman/listinfo/macports-dev