configure: add --extra-cflags
And ensure that -D_GNU_SOURCE is being set for configure test
programs too.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
diff --git a/configure b/configure
index 3ea10b2..4402f3a 100755
--- a/configure
+++ b/configure
@@ -30,7 +30,8 @@
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 @@
case "$opt" in
--cc=*) CC="$optarg"
;;
+ --extra-cflags=*) CFLAGS="$CFLAGS $optarg"
+ ;;
*)
echo "Bad option $opt"
exit 1
@@ -934,4 +937,4 @@
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