[common 3/5] build-sys: Add the SPICE_WARNING() and SPICE_PRINT_MESSAGES m4 macros

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

 



A call to SPICE_WARNING() anywhere in the configure file results in the
warning being printed at the end of the configure run where it will be
be visible. This makes it possible to keep the SPICE_WARNING() calls
together with the related feature checks instead of having to put a
separate AC_MSG_WARN() call near the end.

Signed-off-by: Francois Gouget <fgouget@xxxxxxxxxxxxxxx>
---
 m4/spice-deps.m4 | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

If it is accepted I also plan to use it for the updated Spice GStreamer 
patches.

diff --git a/m4/spice-deps.m4 b/m4/spice-deps.m4
index 59744d2..1c753bf 100644
--- a/m4/spice-deps.m4
+++ b/m4/spice-deps.m4
@@ -1,3 +1,18 @@
+# SPICE_WARNING(warning)
+# SPICE_PRINT_MESSAGES
+# ----------------------
+# Collect warnings and print them at the end so they are clearly visible.
+# ---------------------
+AC_DEFUN([SPICE_WARNING],[AS_VAR_APPEND([spice_warnings],["|$1"])])
+AC_DEFUN([SPICE_PRINT_MESSAGES],[ac_save_IFS="$IFS"
+IFS="|"
+for msg in $spice_warnings; do
+    IFS="$ac_save_IFS"
+    AS_VAR_IF([msg],[],,[echo >&2
+        AC_MSG_WARN([$msg])])
+done
+IFS="$ac_save_IFS"])# SPICE_WARNING
+
 # SPICE_CHECK_SYSDEPS()
 # ---------------------
 # Checks for header files and library functions needed by spice-common.
-- 
2.6.1
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]