[libvirt] [PATCH WIP] build: add a warning when configure is executed with -Werror

Marcelo Cerri mhcerri at linux.vnet.ibm.com
Wed Sep 19 22:28:02 UTC 2012


Some tests performed by configure to check what is supported can be
broken if -Werror is defined in CFLAGS variable when configure is
executed.

This patch checks if CFLAGS contains -Werror and shows a warning for
user recommending to use --enable-compile-warnings=error instead.
---

Please, note that this is a work in progress patch and suggestions are
welcome.

 configure.ac | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/configure.ac b/configure.ac
index 3e90672..38d6263 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3232,3 +3232,10 @@ AC_MSG_NOTICE([Privileges])
 AC_MSG_NOTICE([])
 AC_MSG_NOTICE([      QEMU: $QEMU_USER:$QEMU_GROUP])
 AC_MSG_NOTICE([])
+
+# -Werror can break some configure tests
+if echo "$CFLAGS" | sed -e 's/\s\+/\n/g' | grep -E '^-Werror$' >/dev/null 2>&1; then
+    AC_MSG_WARN([CFLAGS contains -Werror flag. This might break some tests performed by])
+    AC_MSG_WARN([configure and cause some compilation errors.])
+    AC_MSG_WARN([Please use --enable-compile-warnings=error instead.])
+fi
-- 
1.7.12




More information about the libvir-list mailing list