diff options
author | Ralf Wildenhues <Ralf.Wildenhues@gmx.de> | 2007-09-27 22:14:06 -0600 |
---|---|---|
committer | Eric Blake <ebb9@byu.net> | 2007-09-27 22:18:28 -0600 |
commit | 220fef66a88d8b22ff401efd8212e0c6167f3f2d (patch) | |
tree | ccea6ce1cb25663264a69458ae1d5204f13c847c /tests/base.at | |
parent | 755596a7aeb47a7c34d67982ca566a8fd20c15b0 (diff) | |
download | autoconf-220fef66a88d8b22ff401efd8212e0c6167f3f2d.tar.gz |
Catch even more common AC_CACHE_VAL mistakes.
* lib/autoconf/general.m4 (AC_CACHE_VAL): Warn if cache variable
lacks '_cv_', or if AC_SUBST appears in body.
* tests/base.at (AC_CACHE_CHECK): Test this change.
Diffstat (limited to 'tests/base.at')
-rw-r--r-- | tests/base.at | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/base.at b/tests/base.at index 0acabe7d..f7e9ecf6 100644 --- a/tests/base.at +++ b/tests/base.at @@ -2,7 +2,8 @@ AT_BANNER([Autoconf base layer.]) -# Copyright (C) 2000, 2001, 2003, 2005, 2006 Free Software Foundation, Inc. +# Copyright (C) 2000, 2001, 2003, 2005, 2006, 2007 Free Software +# Foundation, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -202,16 +203,29 @@ AT_CLEANUP ## ---------------- ## # Make sure AC_CACHE_CHECK is silent with -q. +# Also make sure we warn about cache id's not named with `_cv_'. AT_SETUP([AC_CACHE_CHECK]) AT_DATA([configure.ac], [[AC_INIT +# m4_define([ac_nothing], [ac_cv_absolutely_nothing]) AC_CACHE_CHECK([for nothing], [ac_nothing], [ac_nothing=found]) ]]) +AT_CHECK_AUTOCONF([], [], [], [stderr]) +AT_CHECK([grep 'must contain _cv_ to be cached' stderr], [], [ignore]) + +# Do not warn about defines: +sed 's/^# //' configure.ac > t +mv -f t configure.ac +AT_CHECK_AUTOCONF +AT_CHECK_CONFIGURE([-q]) + +sed '/m4_define/d; s/ac_nothing/ac_cv_nothing/' configure.ac > t +mv -f t configure.ac AT_CHECK_AUTOCONF AT_CHECK_CONFIGURE([-q]) |