Add -Qn to TARGET_CFLAGS if it's supported.
authorVladimir Serbinenko <phcoder@gmail.com>
Tue, 24 Dec 2013 14:00:46 +0000 (15:00 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Tue, 24 Dec 2013 14:00:46 +0000 (15:00 +0100)
Fixes compilation on cygwin.

Reported by: Andrey Borzenkov.
Suggested by: Andrey Borzenkov.

ChangeLog
configure.ac

index 65e8a1e..e12dbae 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2013-12-24  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       Add -Qn to TARGET_CFLAGS if it's supported.
+       Fixes compilation on cygwin.
+
+       Reported by: Andrey Borzenkov.
+       Suggested by: Andrey Borzenkov.
+
 2013-12-24  Vladimir Serbinenko  <phcoder@gmail.com>
 
        Save TARGET_CC version in modinfo.sh.
index 2aa2fb3..2836fc2 100644 (file)
@@ -913,6 +913,15 @@ if test "x$target_cpu" = xarm; then
   fi
 fi
 
+AC_CACHE_CHECK([whether option -Qn works], grub_cv_target_cc_qn, [
+  CFLAGS="$TARGET_CFLAGS -Qn -Werror"
+  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
+                   [grub_cv_target_cc_qn=yes],
+                   [grub_cv_target_cc_qn=no])])
+if test "x$grub_cv_target_cc_qn" = xyes; then
+  TARGET_CFLAGS="$TARGET_CFLAGS -Qn"
+fi
+
 #
 # Compiler features.
 #