diff options
author | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2013-05-15 13:51:46 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-05-20 15:20:26 +0200 |
commit | 0feb1aadfdd0654f17b523035e57ddf35efd11cf (patch) | |
tree | 214c38b808a1748e8dd51a30748fa7f85509f498 /configure | |
parent | 2bf76918ab399d7cfc9ecf15a4b67fe412ee6815 (diff) |
configure/Mac: Handle errors by xcrun.
xcrun occasionally prompts for a license or outputs errors which
results in:
configure: line 2488: [: : integer expression expected
Check the output and bail out on error.
Change-Id: Ic1ae62b5f19cf87365c38901e98d6b385cdb39a4
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -2483,7 +2483,10 @@ if [ -z "$PLATFORM" ]; then # about the OS version, since we're not using the clang version that comes # with the system. We use 'xcrun' to check the clang version that's part of # the Xcode installation. - if [ "$(/usr/bin/xcrun -sdk macosx clang -v 2>&1 | sed -n 's/.*version \([0-9]\).*/\1/p')" -ge 3 ]; then + XCRUN=`/usr/bin/xcrun -sdk macosx clang -v 2>&1` + CLANGVERSION=`echo "$XCRUN" | sed -n 's/.*version \([0-9]\).*/\1/p'` + expr "$CLANGVERSION" : '[0-9]' > /dev/null || { echo "Unable to determine CLANG version from output of xcrun: $XCRUN" ; exit 2 ; } + if [ "$CLANGVERSION" -ge 3 ]; then PLATFORM=macx-clang # Advertise g++ as an alternative on Lion and below |