configure: enable --extra-cflags for Windows
authorJens Axboe <axboe@kernel.dk>
Tue, 29 Jan 2013 09:06:30 +0000 (10:06 +0100)
committerJens Axboe <axboe@kernel.dk>
Tue, 29 Jan 2013 09:06:30 +0000 (10:06 +0100)
Add configure help as well.

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

index 4402f3a41d4fb3ec2b0064cf13db2a2c3b4b16dc..583e3ab286b0cc9088d221ff3fc49630699e5bd5 100755 (executable)
--- a/configure
+++ b/configure
@@ -122,6 +122,9 @@ cpu=""
 
 cc="${CC-${cross_prefix}gcc}"
 
+show_help="no"
+exit_val=0
+
 # parse options
 for opt do
   optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
@@ -130,12 +133,22 @@ for opt do
   ;;
   --extra-cflags=*) CFLAGS="$CFLAGS $optarg"
   ;;
+  --help)
+  show_help="yes"
+  ;;
   *)
   echo "Bad option $opt"
-  exit 1
+  show_help="yes"
+  exit_val=1
   esac
 done
 
+if test "$show_help" = "yes" ; then
+  echo "--cc=                  Specify compiler to use"
+  echo "--extra-cflags=        Specify extra CFLAGS to pass to compiler"
+  exit $exit_val
+fi
+
 if check_define __linux__ ; then
   targetos="Linux"
 elif check_define __OpenBSD__ ; then
@@ -188,7 +201,7 @@ CYGWIN*)
   output_sym "CONFIG_GETTIMEOFDAY"
   output_sym "CONFIG_CLOCK_GETTIME"
   echo "CC=$CC" >> $config_host_mak
-  echo "EXTFLAGS=-include config-host.h -D_GNU_SOURCE" >> $config_host_mak
+  echo "EXTFLAGS=$CFLAGS -include config-host.h -D_GNU_SOURCE" >> $config_host_mak
   exit 0
 esac