[90480] trunk/base

jmr at macports.org jmr at macports.org
Tue Mar 6 14:33:51 PST 2012


Revision: 90480
          http://trac.macports.org/changeset/90480
Author:   jmr at macports.org
Date:     2012-03-06 14:33:48 -0800 (Tue, 06 Mar 2012)
Log Message:
-----------
fix xcode checks in configure

Modified Paths:
--------------
    trunk/base/configure
    trunk/base/configure.ac

Modified: trunk/base/configure
===================================================================
--- trunk/base/configure	2012-03-06 22:05:17 UTC (rev 90479)
+++ trunk/base/configure	2012-03-06 22:33:48 UTC (rev 90480)
@@ -2952,19 +2952,32 @@
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking Xcode location" >&5
 $as_echo_n "checking Xcode location... " >&6; }
   DEVELOPER_DIR=`$XCODE_SELECT -print-path`
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DEVELOPER_DIR" >&5
+fi
+if test -z "$DEVELOPER_DIR" -o ! -d "$DEVELOPER_DIR" ; then
+    if test -d /Applications/Xcode.app/Contents/Developer ; then
+        DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer
+    else
+        DEVELOPER_DIR=/Developer
+    fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $DEVELOPER_DIR" >&5
 $as_echo "$DEVELOPER_DIR" >&6; }
-else
-  DEVELOPER_DIR=/Developer
-fi
 
 
-XCODEPLIST=$DEVELOPER_DIR/Applications/Xcode.app/Contents/version.plist
+case "$DEVELOPER_DIR" in
+  *Xcode.app/Contents/Developer)
+    XCODEPLIST_BASE=`dirname $DEVELOPER_DIR`/version
+    ;;
+  *)
+    XCODEPLIST_BASE=$DEVELOPER_DIR/Applications/Xcode.app/Contents/version
+    ;;
+esac
+XCODEPLIST=${XCODEPLIST_BASE}.plist
 if test -r "$XCODEPLIST"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking Xcode version" >&5
 $as_echo_n "checking Xcode version... " >&6; }
   if test "x$DEFAULTS" != "x"; then
-    XCODE_VERSION=`$DEFAULTS read $DEVELOPER_DIR/Applications/Xcode.app/Contents/version CFBundleShortVersionString`
+    XCODE_VERSION=`$DEFAULTS read $XCODEPLIST_BASE CFBundleShortVersionString`
   else
     XCODE_VERSION=`tr -d '\r\n' < $XCODEPLIST | sed -e 's/.*<key>CFBundleShortVersionString<\/key>.<string>\([0-9.]*\)<\/string>.*/\1/'`
   fi

Modified: trunk/base/configure.ac
===================================================================
--- trunk/base/configure.ac	2012-03-06 22:05:17 UTC (rev 90479)
+++ trunk/base/configure.ac	2012-03-06 22:33:48 UTC (rev 90480)
@@ -47,17 +47,30 @@
 if test "x$XCODE_SELECT" != "x"; then
   AC_MSG_CHECKING(Xcode location)
   DEVELOPER_DIR=`$XCODE_SELECT -print-path`
-  AC_MSG_RESULT([$DEVELOPER_DIR])
-else
-  DEVELOPER_DIR=/Developer
 fi
+if test -z "$DEVELOPER_DIR" -o ! -d "$DEVELOPER_DIR" ; then
+    if test -d /Applications/Xcode.app/Contents/Developer ; then
+        DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer
+    else
+        DEVELOPER_DIR=/Developer
+    fi
+fi
+AC_MSG_RESULT([$DEVELOPER_DIR])
 AC_SUBST(DEVELOPER_DIR)
 
-XCODEPLIST=$DEVELOPER_DIR/Applications/Xcode.app/Contents/version.plist
+case "$DEVELOPER_DIR" in
+  *Xcode.app/Contents/Developer)
+    XCODEPLIST_BASE=`dirname $DEVELOPER_DIR`/version
+    ;;
+  *)
+    XCODEPLIST_BASE=$DEVELOPER_DIR/Applications/Xcode.app/Contents/version
+    ;;
+esac
+XCODEPLIST=${XCODEPLIST_BASE}.plist
 if test -r "$XCODEPLIST"; then
   AC_MSG_CHECKING(Xcode version)
   if test "x$DEFAULTS" != "x"; then
-    XCODE_VERSION=`$DEFAULTS read $DEVELOPER_DIR/Applications/Xcode.app/Contents/version CFBundleShortVersionString`
+    XCODE_VERSION=`$DEFAULTS read $XCODEPLIST_BASE CFBundleShortVersionString`
   else
     XCODE_VERSION=`tr -d '\r\n' < $XCODEPLIST | sed -e 's/.*<key>CFBundleShortVersionString<\/key>.<string>\([[0-9.]]*\)<\/string>.*/\1/'`
   fi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120306/05d73dfb/attachment-0001.html>


More information about the macports-changes mailing list