Ignore:
Timestamp:
Nov 13, 2015, 12:59:52 AM (3 years ago)
Author:
dstrubbe@…
Message:

compilers portgroup: Add proc to give actual Fortran compiler name from variant name, to more clearly identify gfortran=gcc5. Use this to simplify logic for compilers.enforce_fortran.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/_resources/port1.0/group/compilers-1.0.tcl

    r142490 r142492  
    6161# fortran_active_variant_name {depspec}: which Fortran variant a dependency has set
    6262# fortran_variant_name {}: which Fortran variant is set
     63# fortran_compiler_name {arg}:  converts gfortran into the actual Fortran compiler name; otherwise returns arg
    6364# clang_variant_isset {}: is a clang variant set
    6465# clang_variant_name {}: which clang variant is set
     
    373374}
    374375
     376proc fortran_compiler_name {variant} {
     377    global compilers.gcc_default
     378
     379    if {$variant eq "gfortran"} {
     380        return ${compilers.gcc_default}
     381    } else {
     382        return $variant
     383    }
     384}
     385
    375386proc fortran_variant_name {} {
    376387    global compilers.fortran_variants variations
     
    538549
    539550proc compilers.action_enforce_f {args} {
    540     global compilers.gcc_default
    541 
    542551    ui_debug "compilers.enforce_fortran list: ${args}"
    543552    foreach portname $args {
     
    546555            set myf  [fortran_variant_name]
    547556
    548             # gfortran is nothing more than the fortran compiler from a default version of gcc
    549             set equiv 0
    550             if {($otf eq ${compilers.gcc_default} || $otf eq "gfortran") &&
    551                 ($myf eq ${compilers.gcc_default} || $myf eq "gfortran")} {
    552                 set equiv 1
    553             }
    554 
    555557            if {$otf ne "" && $myf eq ""} {
    556558                default_variants +$otf
    557             } elseif {$otf ne $myf && !$equiv} {
     559            } elseif {[fortran_compiler_name $otf] ne [fortran_compiler_name $myf]} {
     560                # what if $portname does not have that variant? e.g. maybe it has only gcc5 and we are asking for gfortran.
    558561                ui_error "Install $portname +$myf"
    559562                return -code error "$portname +$myf not installed"
Note: See TracChangeset for help on using the changeset viewer.