Support new location of Xcode 4.3 and later; just warn if can't find SDKs directory.
authorChris Hanson <org/chris-hanson/cph>
Mon, 12 Nov 2012 05:54:19 +0000 (21:54 -0800)
committerChris Hanson <org/chris-hanson/cph>
Mon, 12 Nov 2012 05:54:19 +0000 (21:54 -0800)
src/microcode/achost.ac

index f8b0d04dcfc1f495767529aa75d79b44fdfe0c83..10038b7cc0b321fac8c58ca714eaefb3d9051147 100644 (file)
@@ -143,9 +143,22 @@ darwin*)
     else
        SDK=MacOSX${MACOSX}
     fi
-    MACOSX_SYSROOT=/Developer/SDKs/${SDK}.sdk
-    if test ! -d "${MACOSX_SYSROOT}"; then
-       AC_MSG_ERROR([No MacOSX SDK for version: ${MACOSX}])
+    MACOSX_SYSROOT=
+    for dir in /Developer/SDKs \
+       /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
+    do
+       if test -d "${dir}"; then
+           MACOSX_SYSROOT=${dir}
+           break
+       fi
+    done
+    if test -z "${MACOSX_SYSROOT}"; then
+       AC_MSG_WARN([Can't find SDKs directory, not checking for SDK])
+    else       
+       MACOSX_SYSROOT=${MACOSX_SYSROOT}/${SDK}.sdk
+       if test ! -d "${MACOSX_SYSROOT}"; then
+           AC_MSG_ERROR([No MacOSX SDK for version: ${MACOSX}])
+       fi
     fi
     MACOSX_CFLAGS="${MACOSX_CFLAGS} -isysroot ${MACOSX_SYSROOT}"
     MACOSX_CFLAGS="${MACOSX_CFLAGS} -fconstant-cfstrings"