[116307] trunk/dports/_resources/port1.0/group/compilers-1.0.tcl

sean at macports.org sean at macports.org
Thu Jan 23 12:09:07 PST 2014


Revision: 116307
          https://trac.macports.org/changeset/116307
Author:   sean at macports.org
Date:     2014-01-23 12:09:07 -0800 (Thu, 23 Jan 2014)
Log Message:
-----------
compilers-1.0: add enforce_fortran proc

Modified Paths:
--------------
    trunk/dports/_resources/port1.0/group/compilers-1.0.tcl

Modified: trunk/dports/_resources/port1.0/group/compilers-1.0.tcl
===================================================================
--- trunk/dports/_resources/port1.0/group/compilers-1.0.tcl	2014-01-23 20:09:01 UTC (rev 116306)
+++ trunk/dports/_resources/port1.0/group/compilers-1.0.tcl	2014-01-23 20:09:07 UTC (rev 116307)
@@ -440,6 +440,28 @@
     }
 }
 
+proc compilers.enforce_fortran {args} {
+    foreach portname $args {
+        if {![catch {set result [active_variants $portname "" ""]}]} {
+            set otf  [fortran_active_variant_name $portname]
+            set myf  [fortran_variant_name]
+
+            # gfortran is nothing more than the fortran compiler from gcc48
+            set equiv 0
+            if {($otf eq "gcc48" || $otf eq "gfortran") && ($myf eq "gcc48" || $myf eq "gfortran")} {
+                set equiv 1
+            }
+
+            if {$otf ne "" && $myf eq ""} {
+                default_variants +$otf
+            } elseif {$otf ne $myf && !$equiv} {
+                ui_error "Install $portname +$myf"
+                return -code error "$portname +$myf not installed"
+            }
+        }
+    }
+}
+
 proc compilers.setup {args} {
     global cdb compilers.variants compilers.clang_variants compilers.gcc_variants
     global compilers.dragonegg_variants compilers.fortran_variants
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140123/c305c7ff/attachment.html>


More information about the macports-changes mailing list