From 294cff3fd4a2d6bfbabf91591383f99715144d11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Sun, 5 Jan 2014 18:27:35 +0100 Subject: [PATCH] Fall back to `cc` as default compiler when `gcc` is not available --- src/configure | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/configure b/src/configure index f54f09d..dc29eb7 100755 --- a/src/configure +++ b/src/configure @@ -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