Revision
90107
Author
dports@macports.org
Date
2012-02-21 22:51:46 -0800 (Tue, 21 Feb 2012)

Log Message

On Xcode 4.3, give a warning if the command-line utilities package
doesn't appear to be installed.

Check the Xcode version and supported_archs even if the port we're
installing has no dependencies.

Modified Paths

Diff

Modified: trunk/base/src/macports1.0/macports.tcl (90106 => 90107)


--- trunk/base/src/macports1.0/macports.tcl	2012-02-22 01:04:31 UTC (rev 90106)
+++ trunk/base/src/macports1.0/macports.tcl	2012-02-22 06:51:46 UTC (rev 90107)
@@ -1889,6 +1889,20 @@
         macports::push_log $mport
     }
 
+    # Use _target_needs_deps as a proxy for whether we're going to
+    # build and will therefore need to check Xcode version and
+    # supported_archs.
+    if {[macports::_target_needs_deps $target]} {
+        # possibly warn or error out depending on how old xcode is
+        if {[$workername eval _check_xcode_version] != 0} {
+            return 1
+        }
+        # error out if selected arch(s) not supported by this port
+        if {[$workername eval check_supported_archs] != 0} {
+            return 1
+        }
+    }
+
     # Before we build the port, we must build its dependencies.
     set dlist {}
     if {[macports::_target_needs_deps $target] && [macports::_mport_has_deptypes $mport [macports::_deptypes_for_target $target $workername]]} {
@@ -1896,14 +1910,6 @@
         # see if we actually need to build this port
         if {($target != "activate" && $target != "install") ||
             ![$workername eval registry_exists \$subport \$version \$revision \$portvariants]} {
-            # possibly warn or error out depending on how old xcode is
-            if {[$workername eval _check_xcode_version] != 0} {
-                return 1
-            }
-            # error out if selected arch(s) not supported by this port
-            if {[$workername eval check_supported_archs] != 0} {
-                return 1
-            }
     
             # upgrade dependencies that are already installed
             if {![macports::global_option_isset ports_nodeps]} {

Modified: trunk/base/src/port1.0/portutil.tcl (90106 => 90107)


--- trunk/base/src/port1.0/portutil.tcl	2012-02-22 01:04:31 UTC (rev 90106)
+++ trunk/base/src/port1.0/portutil.tcl	2012-02-22 06:51:46 UTC (rev 90107)
@@ -2814,6 +2814,16 @@
         } elseif {[vercmp $xcodeversion $ok] < 0} {
             ui_warn "The installed version of Xcode (${xcodeversion}) is known to cause problems. Version $rec or later is recommended on Mac OS X ${macosx_version}."
         }
+
+        # Xcode 4.3 requires the command-line utilities package to be
+        # installed. 
+        if {[vercmp $xcodeversion 4.3] >= 0} {
+            if {![file exists "/usr/bin/make"]} {
+                ui_warn "The Command Line Tools for Xcode don't appear to be installed; most ports will likely fail to build."
+                ui_warn "See http://guide.macports.org/chunked/installing.xcode.html for more information."
+            }
+        }
+        
     }
     return 0
 }