[90070] trunk/base

jberry at macports.org jberry at macports.org
Mon Feb 20 13:54:35 PST 2012


Revision: 90070
          http://trac.macports.org/changeset/90070
Author:   jberry at macports.org
Date:     2012-02-20 13:54:35 -0800 (Mon, 20 Feb 2012)
Log Message:
-----------
Get xcodebuild, mdfind, and mdls paths from autoconfig

Modified Paths:
--------------
    trunk/base/configure
    trunk/base/configure.ac
    trunk/base/src/macports1.0/macports.tcl
    trunk/base/src/macports1.0/macports_autoconf.tcl.in

Modified: trunk/base/configure
===================================================================
--- trunk/base/configure	2012-02-20 18:58:05 UTC (rev 90069)
+++ trunk/base/configure	2012-02-20 21:54:35 UTC (rev 90070)
@@ -679,6 +679,8 @@
 TAR_CMD
 TAR_Q
 SED_EXT
+MDLS
+MDFIND
 SWIG
 OPEN
 XAR
@@ -5869,7 +5871,87 @@
 fi
 
 
+# Extract the first word of "mdfind", so it can be a program name with args.
+set dummy mdfind; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_MDFIND+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $MDFIND in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_MDFIND="$MDFIND" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_MDFIND="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
+  ;;
+esac
+fi
+MDFIND=$ac_cv_path_MDFIND
+if test -n "$MDFIND"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MDFIND" >&5
+$as_echo "$MDFIND" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+# Extract the first word of "mdls", so it can be a program name with args.
+set dummy mdls; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_MDLS+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $MDLS in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_MDLS="$MDLS" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_MDLS="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+MDLS=$ac_cv_path_MDLS
+if test -n "$MDLS"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MDLS" >&5
+$as_echo "$MDLS" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
 # Define some precious variables allowing user to override PATH for some programs
 
 

Modified: trunk/base/configure.ac
===================================================================
--- trunk/base/configure.ac	2012-02-20 18:58:05 UTC (rev 90069)
+++ trunk/base/configure.ac	2012-02-20 21:54:35 UTC (rev 90070)
@@ -128,6 +128,8 @@
 AC_PATH_PROG(XAR, [xar], [])
 AC_PATH_PROG(OPEN, [open], [])
 AC_PATH_PROG(SWIG, [swig], [], [$PATH:/usr/local/bin])
+AC_PATH_PROG(MDFIND, [mdfind], [])
+AC_PATH_PROG(MDLS, [mdls], [])
 
 # Define some precious variables allowing user to override PATH for some programs
 AC_ARG_VAR(MTREE, [path to mtree command])

Modified: trunk/base/src/macports1.0/macports.tcl
===================================================================
--- trunk/base/src/macports1.0/macports.tcl	2012-02-20 18:58:05 UTC (rev 90069)
+++ trunk/base/src/macports1.0/macports.tcl	2012-02-20 21:54:35 UTC (rev 90070)
@@ -368,7 +368,7 @@
     trace remove variable macports::xcodeversion read macports::setxcodeinfo
     trace remove variable macports::xcodebuildcmd read macports::setxcodeinfo
 
-    if {![catch {findBinary xcodebuild /usr/bin/xcodebuild} xcodebuild]} {
+    if {![catch {findBinary xcodebuild $macports::autoconf::xcodebuild_path} xcodebuild]} {
         if {![info exists xcodeversion]} {
             # Determine xcode version
             set macports::xcodeversion "2.0orlower"
@@ -427,7 +427,7 @@
     trace remove variable macports::developer_dir read macports::set_developer_dir
 
     # Look for xcodeselect, and make sure it has a valid value
-    if {![catch {findBinary xcode-select /usr/bin/xcode-select} xcodeselect]} {
+    if {![catch {findBinary xcode-select $macports::autoconf::xcode_select_path} xcodeselect]} {
 
         # We have xcode-select: ask it where xcode is
         set devdir [exec $xcodeselect -print-path 2> /dev/null]
@@ -442,13 +442,13 @@
         # Ask mdfind where Xcode is and make some suggestions for the user,
         # searching by bundle identifier for various Xcode versions (3.x and 4.x)
         set installed_xcodes {}
-        if {![catch {findBinary mdfind /usr/bin/mdfind} mdfind]} {
+        if {![catch {findBinary mdfind $macports::autoconf::mdfind_path} mdfind]} {
             set installed_xcodes [concat \
                 [exec $mdfind "kMDItemCFBundleIdentifier == 'com.apple.Xcode'"] \
                 [exec $mdfind "kMDItemCFBundleIdentifier == 'com.apple.dt.Xcode'"] \
                 ]
         }
-        if {[llength $installed_xcodes] > 0 && ![catch {findBinary mdls /usr/bin/mdls} mdls]} {
+        if {[llength $installed_xcodes] > 0 && ![catch {findBinary mdls $macports::autoconf::mdls_path} mdls]} {
             # One, or more than one, Xcode installations found
             ui_error "No valid Xcode installation is properly selected."
             
@@ -462,7 +462,7 @@
                 } elseif {[_is_valid_developer_dir "${xcode}/../.."]} {
                     ui_error "    sudo xcode-select -switch [file normalize ${xcode}/../..] # version ${vers}"
                 } else {
-                    ui_error "    # malformed xcode at ${xcode}, version ${vers}"
+                    ui_error "    # malformed Xcode at ${xcode}, version ${vers}"
                 }
             }
             ui_error

Modified: trunk/base/src/macports1.0/macports_autoconf.tcl.in
===================================================================
--- trunk/base/src/macports1.0/macports_autoconf.tcl.in	2012-02-20 18:58:05 UTC (rev 90069)
+++ trunk/base/src/macports1.0/macports_autoconf.tcl.in	2012-02-20 21:54:35 UTC (rev 90070)
@@ -40,6 +40,8 @@
     variable macports_version "@MACPORTS_VERSION@"
     variable macports_user_dir "~/.macports"
     variable macportsuser "@RUNUSR@"
+    variable mdfind_path "@MDFIND@"
+    variable mdls_path "@MDLS@"
     variable open_path "@OPEN@"
     variable openssl_path "@OPENSSL@"
     variable pax_path "@PAX@"
@@ -49,4 +51,6 @@
     variable tar_q "@TAR_Q@"
     variable unzip_path "@UNZIP@"
     variable xar_path "@XAR@"
+    variable xcode_select_path "@XCODE_SELECT@"
+    variable xcodebuild_path "@XCODEBUILD@"
 }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120220/125be33a/attachment.html>


More information about the macports-changes mailing list