configure: add --extra-cflags
[fio.git] / configure
index 3ea10b2ae62ba615d38c74171ada10bf37e0e1e8..4402f3a41d4fb3ec2b0064cf13db2a2c3b4b16dc 100755 (executable)
--- a/configure
+++ b/configure
@@ -30,7 +30,8 @@ rm -rf $config_host_mak
 rm -rf $config_host_h
 
 # Default CFLAGS
-EXTFLAGS="-include config-host.h -D_GNU_SOURCE"
+CFLAGS="-D_GNU_SOURCE"
+EXTFLAGS="-include config-host.h"
 
 # Print a helpful header at the top of config.log
 echo "# FIO configure log $(date)" >> config.log
@@ -127,6 +128,8 @@ for opt do
   case "$opt" in
   --cc=*) CC="$optarg"
   ;;
+  --extra-cflags=*) CFLAGS="$CFLAGS $optarg"
+  ;;
   *)
   echo "Bad option $opt"
   exit 1
@@ -934,4 +937,4 @@ fi
 
 echo "LIBS+=$LIBS" >> $config_host_mak
 echo "CC=$cc" >> $config_host_mak
-echo "EXTFLAGS=$EXTFLAGS" >> $config_host_mak
+echo "EXTFLAGS=$EXTFLAGS $CFLAGS" >> $config_host_mak