[90650] trunk/base/src/port1.0

cal at macports.org cal at macports.org
Sun Mar 11 13:48:53 PDT 2012


Revision: 90650
          http://trac.macports.org/changeset/90650
Author:   cal at macports.org
Date:     2012-03-11 13:48:51 -0700 (Sun, 11 Mar 2012)
Log Message:
-----------
Auto-add depends_build bin:bsdmake:bsdmake to port setting build.type bsd, closes #33355

Modified Paths:
--------------
    trunk/base/src/port1.0/portbuild.tcl
    trunk/base/src/port1.0/portdestroot.tcl

Modified: trunk/base/src/port1.0/portbuild.tcl
===================================================================
--- trunk/base/src/port1.0/portbuild.tcl	2012-03-11 20:18:13 UTC (rev 90649)
+++ trunk/base/src/port1.0/portbuild.tcl	2012-03-11 20:48:51 UTC (rev 90650)
@@ -43,9 +43,10 @@
 }
 
 # define options
+options build.asroot
+options build.jobs
 options build.target
-options build.jobs
-options build.asroot
+options build.type
 options use_parallel_build
 commands build
 # defaults
@@ -56,12 +57,38 @@
 default build.jobs {[portbuild::build_getjobs]}
 default build.pre_args {[portbuild::build_getargs]}
 default build.target "all"
+default build.type "default"
 default use_parallel_build yes
 
+# proc to add dependency on bsdmake, if necessary
+option_proc build.type portbuild::set_build_type
+
 set_ui_prefix
 
+proc portbuild::set_build_type {option action args} {
+    array set build_type_map {
+        bsd     {bin:bsdmake:bsdmake}
+    }
+
+    if {$action == "set"} {
+        switch $option {
+            build.type {
+                # using [exists foo] doesn't work with arrays!
+                if {[info exists build_type_map([option build.type])]} {
+                    # remove dependencies added before when setting build.type more than once
+                    eval depends_build-delete $build_type_map([option build.type])
+                }
+                if {[info exists build_type_map($args)]} {
+                    # add dependency if needed
+                    eval depends_build-append $build_type_map($args)
+                }
+            }
+        }
+    }
+}
+
 proc portbuild::build_getmaketype {args} {
-    if {![exists build.type]} {
+    if {[option build.type] == "default"} {
         return [findBinary make $portutil::autoconf::make_path]
     }
     switch -exact -- [option build.type] {
@@ -124,7 +151,8 @@
 }
 
 proc portbuild::build_getargs {args} {
-    if {((![exists build.type] && [option os.platform] != "freebsd") || ([exists build.type] && [option build.type] == "gnu")) \
+    if {(([option build.type] == "default" && [option os.platform] != "freebsd") || \
+         ([option build.type] == "gnu")) \
         && [regexp "^(/\\S+/|)(g|gnu|)make(\\s+.*|)$" [option build.cmd]]} {
         # Print "Entering directory" lines for better log debugging
         return "-w [option build.target]"

Modified: trunk/base/src/port1.0/portdestroot.tcl
===================================================================
--- trunk/base/src/port1.0/portdestroot.tcl	2012-03-11 20:18:13 UTC (rev 90649)
+++ trunk/base/src/port1.0/portdestroot.tcl	2012-03-11 20:48:51 UTC (rev 90650)
@@ -90,8 +90,9 @@
 set_ui_prefix
 
 proc portdestroot::destroot_getargs {args} {
-    if {((![exists build.type] && [option os.platform] != "freebsd") || ([exists build.type] && [option build.type] == "gnu")) \
-        && [regexp "^(/\\S+/|)(g|gnu|)make(\\s+.*|)$" [option destroot.cmd]]} {
+    if {(([option build.type] == "default" && [option os.platform] != "freebsd") || \
+         ([option build.type] == "gnu")) \
+        && [regexp "^(/\\S+/|)(g|gnu|)make(\\s+.*|)$" [option build.cmd]]} {
         # Print "Entering directory" lines for better log debugging
         return "-w [option destroot.target]"
     }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120311/59948fa2/attachment.html>


More information about the macports-changes mailing list