--- ./configure.orig	2011-01-31 13:09:57.000000000 +0000
+++ ./configure	2014-02-27 22:09:07.000000000 +0000
@@ -2,11 +2,11 @@
 
 # Based on FFMPEG's configure (http://ffmpeg.sourceforge.net/)
 
-PREFIX=/usr/local
-CC=gcc
+PREFIX=${PREFIX:=/usr/local}
+CC=${CC:=gcc}
 COMPILER_PREFIX=
 FLAGS=""
-CFLAGS="-Wall"
+CFLAGS="${CFLAGS}"
 LDFLAGS=""
 LANGUAGE="english"
 CONFIG_USER_CHAN_LIST="-DUSER_LIST_CHAN"
@@ -151,7 +151,7 @@
   case "$option" in
   --help) show_help
   ;;
-  --cflags=*) CFLAGS="${CFLAGS} $optval"
+  --cflags=*) CFLAGS="$optval"
   ;;
   --compiler-prefix=*) COMPILER_PREFIX="$optval"
   ;;
@@ -218,12 +218,9 @@
 
 done
 
-if test_compiler "gcc"
+if ! test_compiler $CC
 then
   CC="gcc"
-elif test_compiler "cc"
-then
-  CC="cc"
 fi
 
 if test_lib "-lpthread"; then LDFLAGS="${LDFLAGS} -lpthread"; fi
