need help with variant_isset and default_variants

Takeshi Enomoto takeshi at macports.org
Fri Nov 6 01:08:56 PST 2009


Hello,

I am modifying Portfile for g95 to enable build on Snow Leopard.
It turned out that I need to link against gcc-4.2.x on Snow Leopard.
Although the fix also work fine on Intel Macs running Tiger and Leopard
as well as Snow Leopard, unfortunately this fix does not work on Power Macs.

So I decided to add a gcc42 variant.
I would like to make this variant automatically chosen for Snow Leopard
and user-option for Tiger and Leopard.

Currently gcc42 is not chosen automatically.
I am not clear if this is a port bug or a bug in port command.
It would be nice if someone let me know the behaviour of variant_isset
and default_variants
and how I should write.

Portfile and patches are found at attachment at #22359.

Thanks

Takeshi
----

if {[variant_isset gcc42]} {
    set version_gcc 4.2.4
    dist_subdir     gcc42
    array set barch {ppc powerpc ppc64 powerpc64 i386 i386 x86_64 x86_64}
    set triple      $barch(${build_arch})-apple-darwin${os.major}
} else {
    set version_gcc 4.0.4
    dist_subdir     gcc40
    set triple      ${os.arch}-apple-darwin${os.major}
}

# zap

platform darwin 10 {}

if {[variant_isset darwin_10]} {
    default_variants +gcc42
}


More information about the macports-dev mailing list