CC, CXX et al in build, test and destroot phases
Ryan Schmidt
ryandesign at macports.org
Sun Mar 22 16:19:30 PDT 2009
On Mar 22, 2009, at 18:00, Toby Peterson wrote:
> On Sun, Mar 22, 2009 at 15:48, Ryan Schmidt wrote:
>
>> MacPorts sets the environment variables CC, CXX and so forth in the
>> configure phase only.
>>
>> Can anyone think of a reason why it should not also set these
>> variables in
>> the build, test and destroot phases? It would save a lot of this
>> kind of
>> thing for ports that have an unusual configure script, or none at
>> all:
>>
>>
>> build.args-append CC=${configure.cc}
>> destroot.args-append CC=${configure.cc}
>
> Properly designed configure-based projects will pay attention to the
> environment and set things according... configuring it so that the
> build phase to consist of nothing more than "make".
I am aware of that. But we have a lot of ports for software which is
not properly-designed.
Of my 81 ports, 11 need fiddling with ${configure.cc} at this time.
Most of this could be removed if MacPorts base set CC et al during
the build and destroot phases as I proposed.
> Ports that need
> environment variables during build are more of a special case. Current
> behavior is fine, and most correct.
Current behavior is annoying because it causes port authors to need
to repeat certain common bits in their portfiles which could be moved
into MacPorts base so that port maintainers don't need to worry about
it. We should always be on the lookout for ways of simplifying
portfiles by moving common functionality into base.
I feel this particular issue is especially important because most
port maintainers probably don't know they should make sure the port
uses ${configure.cc} (e.g. /usr/bin/gcc-4.0) instead of just "cc",
not to mention that we have thousands of ports that have no
maintainer which are not being looked after. Even for those that are,
the port will probably not produce an error message for the
maintainer if they do not take care to set CC. But the port may
produce an error for some other user who has gcc_select'ed some other
compiler. The whole reason the setting of CC=${configure.cc} etc. was
added to the configure phase in base was to avoid problems for users
who have gcc_select'ed something else, but this only works for
software that have well-behaved configure scripts. If we can make
this work automatically for additional ports, I feel we should do so.
So I ask again: can you think of any reason why we should not set
these variables in the build, test and destroot phases? Can you think
of any problems it would cause?
More information about the macports-dev
mailing list