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]"



_______________________________________________
macports-dev mailing list
macports-dev@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macports-dev

Reply via email to