Hello,

here is an updated patch which additionally adds a --with-developer-dir
option. With this the user can specify which developer dir should be
used if multiple Xcode versions are installed.

Rainer

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
--- src/configure.in.orig       2010-03-08 14:54:51.000000000 +0100
+++ src/configure.in    2010-03-08 14:59:40.000000000 +0100
@@ -116,6 +116,22 @@
        MACARCH="$withval"; AC_MSG_RESULT($MACARCH),
        MACARCH="current"; AC_MSG_RESULT(defaulting to $MACARCH))
 
+  AC_MSG_CHECKING(--with-developer-dir argument)
+  AC_ARG_WITH(developer-dir, [  --with-developer-dir=PATH    use PATH as 
location for Xcode developer tools],
+       DEVELOPER_DIR="$withval"; AC_MSG_RESULT($DEVELOPER_DIR),
+        DEVELOPER_DIR=""; AC_MSG_RESULT(not present))
+  
+  if test "x$DEVELOPER_DIR" = "x"; then
+    AC_PATH_PROG(XCODE_SELECT, xcode-select)
+    if test "x$XCODE_SELECT" != "x"; then
+      AC_MSG_CHECKING(for developer dir using xcode-select)
+      DEVELOPER_DIR=`$XCODE_SELECT -print-path`
+      AC_MSG_RESULT([$DEVELOPER_DIR])
+    else
+      DEVELOPER_DIR=/Developer
+    fi
+  fi
+
   if test "x$MACARCH" = "xboth"; then
     AC_MSG_CHECKING(for 10.4 universal SDK)
     dnl There is a terrible inconsistency (but we appear to get away with it):
@@ -127,7 +143,7 @@
     save_cppflags="$CPPFLAGS"
     save_cflags="$CFLAGS"
     save_ldflags="$LDFLAGS"
-    CFLAGS="$CFLAGS -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch 
ppc"
+    CFLAGS="$CFLAGS -isysroot $DEVELOPER_DIR/SDKs/MacOSX10.4u.sdk -arch i386 
-arch ppc"
     AC_TRY_LINK([ ], [ ],
        AC_MSG_RESULT(found, will make universal binary),
 
@@ -157,9 +173,9 @@
     dnl TODO: use -arch i386 on Intel machines
     CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX -no-cpp-precomp"
     if test "x$MACARCH" = "xboth"; then
-      CPPFLAGS="$CPPFLAGS 
-I/Developer/SDKs/MacOSX10.4u.sdk/Developer/Headers/FlatCarbon"
+      CPPFLAGS="$CPPFLAGS 
-I$DEVELOPER_DIR/SDKs/MacOSX10.4u.sdk/Developer/Headers/FlatCarbon"
     else
-      CPPFLAGS="$CPPFLAGS -I/Developer/Headers/FlatCarbon"
+      CPPFLAGS="$CPPFLAGS -I$DEVELOPER_DIR/Headers/FlatCarbon"
     fi
 
     dnl If Carbon is found, assume we don't want X11
@@ -3221,7 +3237,7 @@
   fi
 fi
 if test "x$MACARCH" = "xboth"; then
-  LDFLAGS="$LDFLAGS -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch 
ppc"
+  LDFLAGS="$LDFLAGS -isysroot $DEVELOPER_DIR/SDKs/MacOSX10.4u.sdk -arch i386 
-arch ppc"
 fi
 
 dnl gcc 3.1 changed the meaning of -MM.  The only solution appears to be to

Raspunde prin e-mail lui