New features in 2.0.0

Ryan Schmidt ryandesign at macports.org
Fri Jul 29 18:24:24 PDT 2011


On Jul 29, 2011, at 20:01, Joshua Root wrote:

> 5. get_canonical_archflags
> 
> This:
> 
> variant universal {}
> if {[variant_isset universal]} {
>    set archflags ${configure.universal_cflags}
> } else {
>    set archflags ${configure.cc_archflags}
> }
> post-patch {
>    reinplace "s|__ARCHFLAGS__|${archflags}|" ${worksrcpath}/Makefile
> }
> 
> Can be replaced with:
> 
> variant universal {}
> post-patch {
>    reinplace "s|__ARCHFLAGS__|[get_canonical_archflags]|" \
>        ${worksrcpath}/Makefile
> }
> 
> Bear in mind that it won't return the universal flags if it's called
> before a universal variant has been declared. A good rule of thumb to
> avoid problems is to only call it inside a phase.

Most of the instances where I want to use this, I want to do it outside of a phase, as in:

variant universal {}
if {[variant_isset universal]} {
    set archflags ${configure.universal_cflags}
} else {
    set archflags ${configure.cc_archflags}
}
build.env CC="${configure.cc} ${archflags}"

But it should be fine to do this right?

variant universal {}
build.env CC="${configure.cc} [get_canonical_archflags]"





More information about the macports-dev mailing list