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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]