[82168] trunk/dports/graphics

Blair Zajac blair at orcaware.com
Tue Aug 9 18:58:54 PDT 2011


On Aug 9, 2011, at 6:25 PM, Ryan Schmidt wrote:

> On Aug 9, 2011, at 19:57, Blair Zajac wrote:
> 
>> On Aug 9, 2011, at 2:59 PM, Ryan Schmidt wrote:
>> 
>>> On Aug 9, 2011, at 12:16, blair at macports.org wrote:
>>>> +post-patch {
>>>> +    reinplace "s#@PREFIX@#$prefix#g" ${worksrcpath}/BuildSupport.py
>>>> +    reinplace "s#@CC@#${configure.cc}#" ${worksrcpath}/SConstruct
>>>> +    reinplace "s#@CXX@#${configure.cxx}#" ${worksrcpath}/SConstruct
>>>> +}
>>> 
>>> These reinplaces are good for ensuring we're UsingTheRightCompiler... but what about the right build_arch? May need to do something with ${configure.cc_archflags} too (or [get_canonical_archflags], if universal works).
>> 
>> Can you provide a link to universal so I know what this is all about?
>> 
>> I could also tweak the CFLAGS and CXXFLAGS to get additional flags in there.
> 
> Well, I mean a universal binary. Building for multiple architectures.
> 
> http://en.wikipedia.org/wiki/Universal_binary
> 
> We've been doing it for years, since Intel Macs came out.
> 
> https://trac.macports.org/wiki/FAQ#universal

I just assumed that the compiler made universals by default, but what you're saying is that you need to provide multiple -arch to get a universal?

> 
> In MacPorts this happens via a variant called "universal" which MacPorts adds to most ports for you, and for most ports it works without further maintainer intervention. But your port says "use_configure no" which means MacPorts won't add the standard universal variant. But if a universal build would work, you should add a universal variant. Perhaps along the lines of:
> 
> 
> variant universal {}
> post-patch {
>    reinplace "s#@PREFIX@#${prefix}#g" ${worksrcpath}/BuildSupport.py
>    reinplace "s#@CC@#${configure.cc} [get_canonical_archflags]#" ${worksrcpath}/SConstruct
>    reinplace "s#@CXX@#${configure.cxx} [get_canonical_archflags]#" ${worksrcpath}/SConstruct
> }
> 
> 
> I haven't tested this for this port, but this general strategy is often sufficient. Putting the archflags into the CFLAGS and CXXFLAGS and LDFLAGS generally works too, if you prefer.
> 
> Just make sure you write "variant universal {}" *before* calling [get_canonical_archflags] otherwise you won't get the right arches.

This seems to work.

Thanks!

Blair



More information about the macports-dev mailing list