--- configure.orig	2012-09-19 07:58:20.000000000 -0500
+++ configure	2015-09-07 21:12:47.000000000 -0500
@@ -177,22 +177,21 @@
  exit
 fi
 
-# 11. CHECK TO SEE WHETHER THIS SYSTEM HAS GCC INSTALLED
+# 11. CHECK TO SEE WHETHER THIS SYSTEM HAS A COMPILER INSTALLED
 
-echo $ECHO_N "Checking for gcc               ............. $ECHO_C"
-whichout=`which gcc 2> conf.stderr`
-rm -f conf.*
-if test "`echo $whichout | sed 's/\([a-z]*\).*/\1/'`" = "no" ; then whichout="" ; fi
-if test "$whichout" != "" ; then
+CC="${CC:-gcc}"
+echo $ECHO_N "Checking for $CC               ............. $ECHO_C"
+if $CC -v 2> conf.stderr
+then
  echo "YES"
 else
- echo "NO" ; echo "ERROR: Required program gcc could not be found." >&2 ; exit
+ echo "NO" ; echo "ERROR: Required program $CC could not be found or does not work." >&2 ; exit
 fi
 
 # 12. CHECK TO SEE WHETHER THIS SYSTEM HAS GNU READLINE HEADERS
 
 echo $ECHO_N "Checking for libreadline-dev   ............. $ECHO_C"
-if printf '#include <stdio.h>\n#include <readline/readline.h>\nint main() { return 0; }\n' | gcc -x c - -o conf.out > conf.stdout 2> conf.stderr
+if printf '#include <stdio.h>\n#include <readline/readline.h>\nint main() { return 0; }\n' | $CC -x c - -o conf.out > conf.stdout 2> conf.stderr
 then
  rm -f conf.*
  echo "YES"
@@ -208,7 +207,7 @@
 # 13. CHECK TO SEE WHETHER THIS SYSTEM HAS CFITSIO HEADERS
 
 echo $ECHO_N "Checking for libcfitsio-dev    ............. $ECHO_C"
-if printf '#include <fitsio.h>\nint main() { return 0; }\n' | gcc -x c - -o conf.out > conf.stdout 2> conf.stderr
+if printf '#include <fitsio.h>\nint main() { return 0; }\n' | $CC -x c - -o conf.out > conf.stdout 2> conf.stderr
 then
  rm -f conf.*
  echo "YES"
@@ -224,7 +223,7 @@
 # 14. CHECK TO SEE WHETHER THIS SYSTEM HAS GSL HEADERS
 
 echo $ECHO_N "Checking for libgsl0-dev       ............. $ECHO_C"
-if printf '#include <gsl/gsl_version.h>\nint main() { return 0; }\n' | gcc `gsl-config --cflags` -x c - -o conf.out > conf.stdout 2> conf.stderr
+if printf '#include <gsl/gsl_version.h>\nint main() { return 0; }\n' | $CC `gsl-config --cflags` -x c - -o conf.out > conf.stdout 2> conf.stderr
 then
  rm -f conf.*
  echo "YES"
@@ -250,7 +249,7 @@
 # 15. CHECK TO SEE WHETHER THIS SYSTEM HAS FFTW HEADERS
 
 echo $ECHO_N "Checking for libfftw3-dev      ............. $ECHO_C"
-if printf '#include <fftw3.h>\nint main() { return 0; }\n' | gcc -x c - -o conf.out > conf.stdout 2> conf.stderr
+if printf '#include <fftw3.h>\nint main() { return 0; }\n' | $CC -x c - -o conf.out > conf.stdout 2> conf.stderr
 then
  rm -f conf.*
  echo "YES"
@@ -260,7 +259,7 @@
  rm -f conf.*
  echo "NO"
  echo $ECHO_N "Checking for libfftw2-dev      ............. $ECHO_C"
- if printf '#include <fftw.h>\nint main() { return 0; }\n' | gcc -x c - -o conf.out > conf.stdout 2> conf.stderr
+ if printf '#include <fftw.h>\nint main() { return 0; }\n' | $CC -x c - -o conf.out > conf.stdout 2> conf.stderr
  then
   rm -f conf.*
   echo "YES"
@@ -290,7 +289,7 @@
 # 17. CHECK TO SEE WHETHER THIS SYSTEM HAS LIBPNG HEADERS
 
 echo $ECHO_N "Checking for libpng-dev        ............. $ECHO_C"
-if printf '#include <stdlib.h>\n#include <stdio.h>\n#include <png.h>\nint main() { return 0; }\n' | gcc -x c - -o conf.out > conf.stdout 2> conf.stderr
+if printf '#include <stdlib.h>\n#include <stdio.h>\n#include <png.h>\nint main() { return 0; }\n' | $CC -x c - -o conf.out > conf.stdout 2> conf.stderr
 then
  rm -f conf.*
  echo "YES"
@@ -304,7 +303,7 @@
 # 18. CHECK TO SEE WHETHER THIS SYSTEM HAS KPATHSEA HEADERS
 
 echo $ECHO_N "Checking for libkpathsea-dev   ............. $ECHO_C"
-if printf '#include <stdlib.h>\n#include <stdio.h>\n#include <kpathsea/kpathsea.h>\nint main() { return 0; }\n' | gcc -x c - -o conf.out > conf.stdout 2> conf.stderr
+if printf '#include <stdlib.h>\n#include <stdio.h>\n#include <kpathsea/kpathsea.h>\nint main() { return 0; }\n' | $CC -x c - -o conf.out > conf.stdout 2> conf.stderr
 then
  rm -f conf.*
  echo "YES"