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

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


Revision: 116306
          https://trac.macports.org/changeset/116306
Author:   sean at macports.org
Date:     2014-01-23 12:09:01 -0800 (Thu, 23 Jan 2014)
Log Message:
-----------
compilers-1.0: add compilers.enforce_c 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:08:56 UTC (rev 116305)
+++ trunk/dports/_resources/port1.0/group/compilers-1.0.tcl	2014-01-23 20:09:01 UTC (rev 116306)
@@ -423,6 +423,23 @@
     return 1
 }
 
+# for the c compiler
+proc compilers.enforce_c {args} {
+    foreach portname $args {
+        if {![catch {set result [active_variants $portname "" ""]}]} {
+            set otcomp  [c_active_variant_name $portname]
+            set mycomp  [c_variant_name]
+
+            if {$otcomp ne "" && $mycomp eq ""} {
+                default_variants +$otcomp
+            } elseif {$otcomp ne $mycomp} {
+                ui_error "Install $portname +$mycomp"
+                return -code error "$portname +$mycomp 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/eb7eb740/attachment.html>


More information about the macports-changes mailing list