Skip to content

Commit

Permalink
Emit a nice error message if the compiler isn't functional.
Browse files Browse the repository at this point in the history
  • Loading branch information
areitz committed Oct 8, 2015
1 parent 6f56880 commit 8511efb
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions build-support/common.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
#!/usr/bin/env bash

# Prevent bootstrapping failure due to unrecognized flag:
# https://github.com/pantsbuild/pants/issues/78
function set_archflags() {
GCC_VERSION=`gcc -v 2>&1`
if [[ "$GCC_VERSION" == *503.0.38* ]]; then
# Required for clang version 503.0.38
export set ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future
fi
}
set_archflags


function log() {
Expand Down Expand Up @@ -41,3 +31,19 @@ function banner() {
function fingerprint_data() {
openssl md5 | cut -d' ' -f2
}

# Prevent bootstrapping failure due to unrecognized flag:
# https://github.com/pantsbuild/pants/issues/78
function set_archflags() {
GCC_VERSION=`gcc -v 2>&1`
if [ $? -ne 0 ]; then
die "ERROR: unable to execute 'gcc'. Please verify that your compiler is installed, in your\n" \
" \$PATH and functional.\n\n" \
" Hint: on Mac OS X, you may need to accept the XCode EULA: 'sudo xcodebuild -license accept'."
fi
if [[ "$GCC_VERSION" == *503.0.38* ]]; then
# Required for clang version 503.0.38
export set ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future
fi
}
set_archflags

0 comments on commit 8511efb

Please sign in to comment.