From f73a7ca46cb15d77608a4995921b4d501c21bdee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 8 Apr 2013 16:41:27 +0200 Subject: Verify Xcode installation more thoroughly before relying on it We depend on Xcode for building Qt itself and user application on Mac OS. The user may have an Xcode install that is not set up properly, in which case we would fail compilation in mysterious ways. Instead we try to detect misconfigured or missing Xcode installs as early as possible. We try to detect if an Xcode install has not been chosen yet, and if the user has not accepted the Xcode license agreement. We need to do these checks both in configure, as early as possible, and in mkspecs on Mac OS, as we need to error out if the user tries to build an app with the Qt SDK, but with a broken Xcode install. Change-Id: I4e3a11077a61dc5d4ee2c686d01044a9bb2c1c79 Reviewed-by: Oswald Buddenhagen --- configure | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'configure') diff --git a/configure b/configure index 0f178c0259..f55e2f622b 100755 --- a/configure +++ b/configure @@ -445,6 +445,28 @@ if [ "$OSTYPE" = "msys" ]; then BUILD_ON_MSYS=yes fi +#------------------------------------------------------------------------------- +# Verify Xcode installation on Mac OS +#------------------------------------------------------------------------------- + +if [ "$BUILD_ON_MAC" = "yes" ]; then + if ! /usr/bin/xcode-select --print-path >/dev/null 2>&1; then + echo >&2 + echo " No Xcode is selected. Use xcode-select -switch to choose an Xcode" >&2 + echo " version. See the xcode-select man page for more information." >&2 + echo >&2 + exit 2 + fi + + if ! /usr/bin/xcrun -find xcrun >/dev/null 2>&1; then + echo >&2 + echo " Xcode not set up properly. You may need to confirm the license" >&2 + echo " agreement by running /usr/bin/xcodebuild without arguments." >&2 + echo >&2 + exit 2 + fi +fi + #----------------------------------------------------------------------------- # Qt version detection #----------------------------------------------------------------------------- -- cgit v1.2.3