configure: add --cc= option to script
authorJens Axboe <axboe@kernel.dk>
Wed, 23 Jan 2013 20:47:54 +0000 (13:47 -0700)
committerJens Axboe <axboe@kernel.dk>
Wed, 23 Jan 2013 20:47:54 +0000 (13:47 -0700)
Get rid of uname -o usage for Windows, and specifically require
CC=bla ./configure or ./configure --cc=bla to set something else
than gcc.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
configure

index 08c8bd2e21611e9be979c26201fdbca32fea0380..cc453be4f119c63a3902a4ddcd1ae6882ef24625 100755 (executable)
--- a/configure
+++ b/configure
@@ -102,11 +102,22 @@ cpu=""
 
 cc="${CC-${cross_prefix}gcc}"
 
+# parse options
+for opt do
+  optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
+  case "$opt" in
+  --cc=*) CC="$optarg"
+  ;;
+  *)
+  echo "Bad option $opt"
+  exit 1
+  esac
+done
+
 if check_define __linux__ ; then
   targetos="Linux"
-elif test `uname -o` = Cygwin ; then
+elif check_define _WIN32 ; then
   echo "Forcing known good options on Windows"
-  echo "CC=x86_64-w64-mingw32-gcc" >> $config_host_mak
   echo "CONFIG_64BIT_LLP64=y"      >> $config_host_mak
   echo "CONFIG_CLOCK_GETTIME=y"    >> $config_host_mak
   echo "CONFIG_CLOCK_MONOTONIC=y"  >> $config_host_mak