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

compilers portgroup: Add new proc compilers.enforce_some_fortran to enforce that a dependency has some Fortran variant set, without being concerned which one.

File:
1 edited

Legend:

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

    r142489 r142490  
    6969# compilers.enforce_c {args}: enforce that a dependency has the same C variant as is set here
    7070# compilers.enforce_fortran {args}: enforce that a dependency has the same Fortran variant as is set here
     71# compilers.enforce_some_fortran {args}: enforce that a dependency has some Fortran variant set
    7172#
    7273# The compilers.gcc_default variable may be useful for setting a default compiler variant
     
    8687default compilers.required_c {}
    8788default compilers.required_f {}
     89default compilers.required_some_f {}
    8890default compilers.variants_conflict {}
    8991default compilers.libfortran {}
     
    528530}
    529531
     532proc compilers.enforce_some_fortran {args} {
     533    global compilers.required_some_f
     534    foreach portname $args {
     535        lappend compilers.required_some_f $portname
     536    }
     537}
     538
    530539proc compilers.action_enforce_f {args} {
    531540    global compilers.gcc_default
     
    553562            ui_error "Internal error: compilers.enforce_fortran: '$portname' is not an installed port."
    554563            return -code error "Internal error: compilers.enforce_fortran: '$portname' is not an installed port."
     564        }
     565    }
     566}
     567
     568proc compilers.action_enforce_some_f {args} {
     569    ui_debug "compilers.enforce_some_fortran list: ${args}"   
     570    foreach portname $args {
     571        if {![catch {set result [active_variants $portname "" ""]}]} {
     572            if {[fortran_active_variant_name $portname] eq ""} {
     573                ui_error "Install $portname with a Fortran variant (e.g. +gfortran, +gccX, +g95)"
     574                return -code error "$portname not installed with a Fortran variant"
     575            }
     576        } else {
     577            ui_error "Internal error: compilers.enforce_some_fortran: '$portname' is not an installed port."
     578            return -code error "Internal error: compilers.enforce_some_fortran: '$portname' is not an installed port."
    555579        }
    556580    }
     
    685709    eval compilers.action_enforce_c ${compilers.required_c}
    686710    eval compilers.action_enforce_f ${compilers.required_f}
    687 }
     711    eval compilers.action_enforce_some_f ${compilers.required_some_f}
     712}
Note: See TracChangeset for help on using the changeset viewer.