Fall back to cc as default compiler when gcc is not available

This commit is contained in:
Mislav Marohnić 2014-01-05 18:27:35 +01:00
parent a6e0785b84
commit 294cff3fd4

13
src/configure vendored
View file

@ -3,10 +3,17 @@ set -e
src_dir="${0%/*}"
CC="${CC:-gcc}"
if [ -z "$CC" ]; then
if type -p gcc >/dev/null; then
CC=gcc
else
echo "warning: gcc not found; using CC=cc" >&2
CC=cc
fi
fi
if ! which "$CC" &>/dev/null; then
echo "no compiler found: $CC" >&2
if ! type -p "$CC" >/dev/null; then
echo "aborted: compiler not found: $CC" >&2
exit 1
fi