AC_MSG_ERROR([The xcodebuild tool was not found, the Xcode command line tools are required to build on Mac OS X])
fi
# Fail-fast: verify we're building on Xcode 4, we cannot build with Xcode 5 or later
XCODE_VERSION=`$XCODEBUILD -version | grep '^Xcode ' | sed 's/Xcode //'`
XC_VERSION_PARTS=( ${XCODE_VERSION//./ } )
if test ! "${XC_VERSION_PARTS[[0]]}" = "4"; then
AC_MSG_ERROR([Xcode 4 is required to build JDK 8, the version found was $XCODE_VERSION. Use --with-xcode-path to specify the location of Xcode 4 or make Xcode 4 active by using xcode-select.])
fi
# Some versions of Xcode 5 command line tools install gcc and g++ as symlinks to
# clang and clang++, which will break the build. So handle that here if we need to.
if test -L "/usr/bin/gcc" -o -L "/usr/bin/g++"; then
# use xcrun to find the real gcc and add it's directory to PATH
# then autoconf magic will find it
AC_MSG_NOTICE([Found gcc symlinks to clang in /usr/bin, adding path to real gcc to PATH])
XCODE_BIN_PATH=$(dirname `xcrun -find gcc`)
PATH="$XCODE_BIN_PATH":$PATH
fi
# Determine appropriate SDKPATH, don't use SDKROOT as it interferes with the stub tools
AC_MSG_CHECKING([Determining Xcode SDK path])
# allow SDKNAME to be set to override the default SDK selection