Skip to content

Commit

Permalink
Update compile.sh to make use of CC environment variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
necrophcodr committed Oct 22, 2014
1 parent 5804aea commit cb1534b
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions compile.sh
Expand Up @@ -4,23 +4,12 @@

# current version does not build reasoner: added later

# Support for clang compilator
PARAM=${1:-"gcc"}
COMPILER="cc"

if [ $(which gcc&>/dev/null;echo $?) -eq 0 ] && [ "$PARAM" = "gcc" ]; then
COMPILER="gcc"
echo "Info: Compilation with GCC"
fi

if [ $(which clang&>/dev/null;echo $?) -eq 0 ] && [ "$PARAM" = "clang" ]; then
COMPILER="clang"
echo "Info: Compilation with CLANG"
fi

[[ -z "$CC" ]] && COMPILER="$CC"

if [ -z "$COMPILER" ]; then
echo "Error: No compiler $PARAM found"
if [[ -z "$COMPILER" && -z "$(which $COMPILER 2>/dev/null)" ]]; then
echo "Error: No compiler found"
exit 1
fi

Expand Down

0 comments on commit cb1534b

Please sign in to comment.