configure: add --extra-cflags
authorJens Axboe <axboe@kernel.dk>
Tue, 29 Jan 2013 08:26:07 +0000 (09:26 +0100)
committerJens Axboe <axboe@kernel.dk>
Tue, 29 Jan 2013 08:26:07 +0000 (09:26 +0100)
And ensure that -D_GNU_SOURCE is being set for configure test
programs too.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
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
 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
 
 # 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"
   ;;
   case "$opt" in
   --cc=*) CC="$optarg"
   ;;
+  --extra-cflags=*) CFLAGS="$CFLAGS $optarg"
+  ;;
   *)
   echo "Bad option $opt"
   exit 1
   *)
   echo "Bad option $opt"
   exit 1
@@ -934,4 +937,4 @@ fi
 
 echo "LIBS+=$LIBS" >> $config_host_mak
 echo "CC=$cc" >> $config_host_mak
 
 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