Hello,
since Xcode 3.0 it is possible to install it to another location than
the default /Developer. At the moment, the configure script for vim
always uses the /Developer directory. When Xcode is in a custom
location, the build fails due to headers not being found.
...
/usr/bin/gcc-4.2 ... -I/Developer/Headers/FlatCarbon ...
os_mac.h:26:64: error: Quickdraw.h: No such file or directory
os_mac.h:27:24: error: ToolUtils.h: No such file or directory
os_mac.h:28:21: error: LowMem.h: No such file or directory
os_mac.h:29:20: error: Scrap.h: No such file or directory
...
The solution is to either always expect users to install to the default
directory or at least to place a symlink there. But there is also the
possibility to find the Xcode location using `xcode-select -print-path`.
Here is a patch for configure to find the location using the included
xcode-select tool and use the path everywhere /Developer has been used
before. I would appreciate if someone could verify this patch.
Rainer
--
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
--- work/vim72/src/configure.in.origdev 2010-02-24 12:18:17.000000000 +0100
+++ work/vim72/src/configure.in 2010-02-24 12:18:19.000000000 +0100
@@ -116,6 +116,15 @@
MACARCH="$withval"; AC_MSG_RESULT($MACARCH),
MACARCH="current"; AC_MSG_RESULT(defaulting to $MACARCH))
+ AC_PATH_PROG(XCODE_SELECT, xcode-select)
+ 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 "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 +136,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 +166,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 +3230,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