+2008-03-26 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ Warn, not fail on whitespace-only precious variable differences.
+ * lib/autoconf/general.m4 (_AC_ARG_VAR_VALIDATE): Output
+ precious variable differences less ambiguous with `ugly-quotes'.
+ If their settings differ only in whitespace, do not fail, but
+ reuse the old value.
+ * tests/torture.at (AT_CHECK_AC_ARG_VAR): Extend macro to allow
+ an optional status and expected-warning argument. Fix m4
+ quotation for initial value.
+ (AC_ARG_VAR): Also test for whitespace-only differences, and
+ that the old value is retained in this case.
+ * doc/autoconf.texi (Setting Output Variables): Document this.
+ * NEWS: Update.
+ Report and initial patch by Paolo Bonzini.
+
2008-03-26 Eric Blake <ebb9@byu.net>
Document busybox sed bug.
** `configure --help=recursive' now works in read-only trees and from
unconfigured build trees.
+** If precious variables differ only in whitespace, then the cache consistency
+ check warns instead of fails, and reuses the old value.
+
** AT_BANNER is now documented.
** AT_SETUP now handles macro expansions properly when calculating line
@noindent
and similarly if the variable is unset, or if its content is changed.
-
+If the content has white space changes only, then the error is degraded
+to a warning only, but the old value is reused.
@item
@var{variable} is kept during automatic reconfiguration
,);;
*)
if test "x$ac_old_val" != "x$ac_new_val"; then
- AS_MESSAGE([error: `$ac_var' has changed since the previous run:], 2)
- AS_MESSAGE([ former value: $ac_old_val], 2)
- AS_MESSAGE([ current value: $ac_new_val], 2)
- ac_cache_corrupted=:
+ # differences in whitespace do not lead to failure.
+ ac_old_val_w=`echo x $ac_old_val`
+ ac_new_val_w=`echo x $ac_new_val`
+ if test "$ac_old_val_w" != "$ac_new_val_w"; then
+ AS_MESSAGE([error: `$ac_var' has changed since the previous run:], 2)
+ ac_cache_corrupted=:
+ else
+ AS_MESSAGE([warning: ignoring whitespace changes in `$ac_var' since the previous run:], 2)
+ eval $ac_var=\$ac_old_val
+ fi
+ AS_MESSAGE([ former value: `$ac_old_val'], 2)
+ AS_MESSAGE([ current value: `$ac_new_val'], 2)
fi;;
esac
# Pass precious variables to config.status.
## AC_ARG_VAR. ##
## ------------ ##
-# AT_CHECK_AC_ARG_VAR(FIRST-VALUE, SECOND-VALUE)
-# ----------------------------------------------
+# AT_CHECK_AC_ARG_VAR(FIRST-VALUE, SECOND-VALUE, [STATUS = 1])
+# ------------------------------------------------------------
# Check that AC_ARG_VAR caches the latest values, diagnoses
-# inconsistencies, and arms config.status.
+# inconsistencies, and arms config.status. Check that recheck
+# returns STATUS, save configure output in files 'stdout' and 'stderr'
+# for further inspection.
m4_define([AT_CHECK_AC_ARG_VAR],
[rm -f config.cache
# Initial value.
m4_ifval([$1],
- [precious='m4_bpatsubst($1, [[']], ['\\''])'; export precious],
+ [precious='m4_bpatsubst([$1], [[']], ['\\''])'; export precious],
[unset precious])
AT_CHECK_CONFIGURE([--config-cache -q])
AT_CHECK([cat file], [], [`$1'
m4_ifval([$2],
[precious='$2'; export precious],
[unset precious])
-AT_CHECK_CONFIGURE([--config-cache], [1], [], [ignore])
+AT_CHECK_CONFIGURE([--config-cache], [m4_default([$3], [1])], [stdout], [stderr])
])# AT_CHECK_AC_ARG_VAR
AT_CHECK_AC_ARG_VAR(['p r ec"iou$], [orange of my eye])
dnl restore font-lock: "
+# Warn (but do not fail) about a whitespace-only change
+AT_CHECK_AC_ARG_VAR([ apple of my eye ], [apple of my eye],
+ [0], ["has whitespace changes"])
+mv stdout configure-output
+AT_CHECK([grep "ignoring whitespace changes" stderr], [], [ignore])
+AT_CHECK([grep "precious: apple" configure-output], [], [ignore])
+
AT_CLEANUP