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

[XEN PATCH for-4.17 v5 04/17] tools: Add -Werror by default to all tools/


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Date: Thu, 13 Oct 2022 14:05:00 +0100
  • Authentication-results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Anthony PERARD <anthony.perard@xxxxxxxxxx>, Luca Fancellu <luca.fancellu@xxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Thu, 13 Oct 2022 13:05:30 +0000
  • Ironport-data: A9a23:LkY9Va7I9QmVYQHL/35oAAxR2vbMJQZQLiYv29bIXmNSXhzvzPLM5wBkF31ARqiwpsLxTDuk2K5y4Fltw4rHtUhMcdOLQjwCbf3UD1utrioGJcIt4OZ/tjYNCi4ujkJMXCU9cPX3Q4OgGBMQFJQAlSrNy4hwQvVPWB7Uzo4IImWWayClEksCRdi/DUdPCvCpCfAc403pIYIdttpLONV2N3mmN8/cWy26ntknqBcy/B1vtszfsWR/SfRGHYyHBNlXrldqDpDzSPa/1cgcP4PnefU7Ee3D4eyjPzdc/eGRDowRIxyVcl+Vn0nY+PzCBs/JEBnOLiJgfa2bjfEJfNaqRSj3eoX6ehEQntN1XeRD6YFsMOie1hj0KmOCh2YdEVM/5jcg+YMARNIzC5LTR0sv2AdYFYZuf7EdjfMoV7KJQPaXVGmO+ddxBIweSIl3KD2BvzSDa9g69ij9bHEvgRUWMR2F9jYXKOEhKVgj/rBDSIL5QicT5J5q9RUWm7THJHov8CUlxSVEzC5uKaLok41jrHS5gaye/MmG/I/pitUNOG55Lc03ZalB1xLEicoFCzjUhJSzc8GUIVAfDyyDQjpnggMXgk6BJSWc+DPA8vKsekCJZRy8Ib9Zx/WnY/MXWNycMFpeUNS2ToLWHW1rJwCOojs8VVZ2uY/odHDqtQgwheS/gRl0Vcs0uw+OJ6rhaCGae0mpnrXzuy/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3N3xqUwgFkkyJqC0Ie1Q/oo/UA07Riu5vkbiVBMXhoApP1/lCJkHEsENUVcF/9y50Jv3BrZzAI4mwwUVzoJX8ug4ysNZrL+mg7cKY/z/CbT33556+7uUKySmpbTWD8P8qM381v/vJtolUGp0iFs0SiKqiVUneSY+xfRKNFt8+t5cr9W0Yg5kkpne92cAdSo9lbkDBwOfgTDoeQo1nPFn2f0RuDxs556c9xBzmxTX2fKo61+Fzbd9UcEa8zJcYGDT61bbokThd+iYUtiIWd8i8stASwrY5zR6xYTbaRtl2GfN1Ml3C/Nr+0PYUPkntFf99Sv40X5/nlyEseIPpTJEtqBjPVcGPfr/KhCIXiwoffGbEXvfYb0YwvJTHxO++dguS+5ZyXKdRzv2ys30O5ernjLgpowYARSm7QGNgGtRIMVR7DjPHGjpLy+P18BJlT3DeJ7Ftjehd7bkHJREX/2bJz4PTYl1jj7ZiyvUOT1YorRBAKufACs5KHl2Z0iHuvFsAh0OvDQBc0vysTksHAzQDAxzZXKnOlzQIuZWVoNADkx/ZLiSKfTDcs1cYoFHB+qDJc/suMDJd5WRGqf2s9SM7DhiJFeCijT23Hj1xmwTFEhrM6qufmkqxOg+Chi377o4AkZhLWNVPyQ30RP69y8rp7+iBU3o+pW0vS0wxz65ikgWcCEV/AdqHu2dKlh//RCon8ctUwwQdAyWwD9QqluGFfhXQVNEzpcfnZYbd3rKqt9YCDPlt9kvfUJF1n3Y4/AOQox56pMw/oztc7s5PH6JYHEOMP2JdtdbHdDI3dAyYDWp0P/2AC6ITACnr4jyL0jGrEVGd1/R4afWietbBXED/VPUbRTrPDoRntDQ4lsTRL6BrWYD/Z+CnD0bZFoH5IBilnPMY+Q2mB9JKGznGY3
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

And provide an option to ./configure to disable it.

A follow-up patch will remove -Werror from every other Makefile in
tools/. ("tools: Remove -Werror everywhere else")

Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
Reviewed-by: Luca Fancellu <luca.fancellu@xxxxxxx>
---
 tools/configure.ac |  1 +
 tools/Rules.mk     |  4 ++++
 config/Tools.mk.in |  1 +
 tools/configure    | 26 ++++++++++++++++++++++++++
 4 files changed, 32 insertions(+)

diff --git a/tools/configure.ac b/tools/configure.ac
index 32cbe6bd3c..09059bc569 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -81,6 +81,7 @@ m4_include([../m4/header.m4])
 AX_XEN_EXPAND_CONFIG()
 
 # Enable/disable options
+AX_ARG_DEFAULT_ENABLE([werror], [Build tools without -Werror])
 AX_ARG_DEFAULT_DISABLE([rpath], [Build tools with -Wl,-rpath,LIBDIR])
 AX_ARG_DEFAULT_DISABLE([githttp], [Download GIT repositories via HTTP])
 AX_ARG_DEFAULT_ENABLE([monitors], [Disable xenstat and xentop monitoring 
tools])
diff --git a/tools/Rules.mk b/tools/Rules.mk
index 26958b2948..a165dc4bda 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -133,6 +133,10 @@ endif
 
 CFLAGS_libxenlight += $(CFLAGS_libxenctrl)
 
+ifeq ($(CONFIG_WERROR),y)
+CFLAGS += -Werror
+endif
+
 ifeq ($(debug),y)
 # Use -Og if available, -O0 otherwise
 dbg_opt_level := $(call cc-option,$(CC),-Og,-O0)
diff --git a/config/Tools.mk.in b/config/Tools.mk.in
index 6c1a0a676f..d0d460f922 100644
--- a/config/Tools.mk.in
+++ b/config/Tools.mk.in
@@ -1,5 +1,6 @@
 -include $(XEN_ROOT)/config/Paths.mk
 
+CONFIG_WERROR       := @werror@
 CONFIG_RUMP         := @CONFIG_RUMP@
 ifeq ($(CONFIG_RUMP),y)
 XEN_OS              := NetBSDRump
diff --git a/tools/configure b/tools/configure
index 41deb7fb96..acd9a04c3b 100755
--- a/tools/configure
+++ b/tools/configure
@@ -716,6 +716,7 @@ ocamltools
 monitors
 githttp
 rpath
+werror
 DEBUG_DIR
 XEN_DUMP_DIR
 XEN_PAGING_DIR
@@ -805,6 +806,7 @@ with_xen_scriptdir
 with_xen_dumpdir
 with_rundir
 with_debugdir
+enable_werror
 enable_rpath
 enable_githttp
 enable_monitors
@@ -1490,6 +1492,7 @@ Optional Features:
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
   --disable-largefile     omit support for large files
+  --disable-werror        Build tools without -Werror (default is ENABLED)
   --enable-rpath          Build tools with -Wl,-rpath,LIBDIR (default is
                           DISABLED)
   --enable-githttp        Download GIT repositories via HTTP (default is
@@ -4111,6 +4114,29 @@ DEBUG_DIR=$debugdir_path
 
 # Enable/disable options
 
+# Check whether --enable-werror was given.
+if test "${enable_werror+set}" = set; then :
+  enableval=$enable_werror;
+fi
+
+
+if test "x$enable_werror" = "xno"; then :
+
+    ax_cv_werror="n"
+
+elif test "x$enable_werror" = "xyes"; then :
+
+    ax_cv_werror="y"
+
+elif test -z $ax_cv_werror; then :
+
+    ax_cv_werror="y"
+
+fi
+werror=$ax_cv_werror
+
+
+
 # Check whether --enable-rpath was given.
 if test "${enable_rpath+set}" = set; then :
   enableval=$enable_rpath;
-- 
Anthony PERARD




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.