diff --git a/Patches/Mtoc/libstuff.xcconfig b/Patches/Mtoc/libstuff.xcconfig index 78871016de..ed98d5ba78 100644 --- a/Patches/Mtoc/libstuff.xcconfig +++ b/Patches/Mtoc/libstuff.xcconfig @@ -10,7 +10,7 @@ // HEADER_SEARCH_PATHS includes the local toolchain headers in order to find // "llvm-c/lto.h" -HEADER_SEARCH_PATHS = ${inherited} ${DT_TOOLCHAIN_DIR}/usr/local/include +HEADER_SEARCH_PATHS = ${inherited} ${TOOLCHAIN_DIR}/usr/local/include // libstuff currently requires the LTO_SUPPORT macro to be defined in order to // compile support for LTO. This is built non-conditionally, and can probably diff --git a/buildmtoc.sh b/buildmtoc.sh index 8fc427f380..6a9bb5a876 100755 --- a/buildmtoc.sh +++ b/buildmtoc.sh @@ -183,6 +183,14 @@ fnCompileMtoc () # Mtoc build local cmd logfile cd "$CCTOOLS_DIR" + +# Replace deprecated DT_TOOLCHAIN_DIR as a workaround for building in Xcode 15 + xcodeapp=$(defaults read /Applications/Xcode.app/Contents/version.plist CFBundleShortVersionString) + if [[ $xcodeapp == 15.* ]]; then + sed -i '' 's/DT_TOOLCHAIN_DIR/TOOLCHAIN_DIR/g' "$CCTOOLS_DIR"/xcode/cctools.xcconfig + sed -i '' 's/DT_TOOLCHAIN_DIR/TOOLCHAIN_DIR/g' "$CCTOOLS_DIR"/xcode/libstuff.xcconfig + sed -i '' 's/DT_TOOLCHAIN_DIR/TOOLCHAIN_DIR/g' "$CCTOOLS_DIR"/xcode/strip.xcconfig + fi # Removal of _structs.h needed as a workaround for a bug in cctools-900 or above /bin/rm -f ./include/mach/i386/_structs.h echo "- cctools-${CCTOOLS_VERSION} make mtoc..."