summaryrefslogtreecommitdiffstats
path: root/m4
diff options
context:
space:
mode:
authorFrancois Gouget <fgouget@codeweavers.com>2015-11-03 13:05:28 +0100
committerChristophe Fergeau <cfergeau@redhat.com>2015-11-04 10:34:19 +0100
commit899a7c75e31c4ac9d64ab6ec7b61b2b6c6de3e3a (patch)
tree8e686f0bfa6fc79db8b92d915ca04e19162fea63 /m4
parent304a16fdadbf2628556ba6e5fcb5b1634960f7c2 (diff)
downloadspice-common-899a7c75e31c4ac9d64ab6ec7b61b2b6c6de3e3a.tar.gz
spice-common-899a7c75e31c4ac9d64ab6ec7b61b2b6c6de3e3a.tar.xz
spice-common-899a7c75e31c4ac9d64ab6ec7b61b2b6c6de3e3a.zip
build-sys: Add the SPICE_WARNING() and SPICE_PRINT_MESSAGES m4 macros
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@codeweavers.com>
Diffstat (limited to 'm4')
-rw-r--r--m4/spice-deps.m421
1 files changed, 21 insertions, 0 deletions
diff --git a/m4/spice-deps.m4 b/m4/spice-deps.m4
index 0f90cec..57d5b78 100644
--- a/m4/spice-deps.m4
+++ b/m4/spice-deps.m4
@@ -1,3 +1,24 @@
+# For autoconf < 2.63
+m4_ifndef([AS_VAR_APPEND],
+ AC_DEFUN([AS_VAR_APPEND], $1=$$1$2))
+
+# 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],[],,[AC_MSG_WARN([$msg]); echo >&2])
+ done
+ IFS="$ac_save_IFS"
+])
+
+
# SPICE_CHECK_SYSDEPS()
# ---------------------
# Checks for header files and library functions needed by spice-common.