]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* acgeneral.m4 (AC_CACHE_VAL): Too many people put AC_DEFINE in
authorAkim Demaille <akim@epita.fr>
Mon, 26 Jun 2000 09:08:13 +0000 (09:08 +0000)
committerAkim Demaille <akim@epita.fr>
Mon, 26 Jun 2000 09:08:13 +0000 (09:08 +0000)
the commands-to-set-it part of it.  Give them a warning.

ChangeLog
acgeneral.m4
lib/autoconf/general.m4

index 84f367e7faace46e0520598da1536c414a56ba83..5535735a5354af8779057b5a7426ab1a27061fe2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2000-06-26  Akim Demaille  <akim@epita.fr>
+
+       * acgeneral.m4 (AC_CACHE_VAL): Too many people put AC_DEFINE in
+       the commands-to-set-it part of it.  Give them a warning.
+
 2000-06-26  Akim Demaille  <akim@epita.fr>
 
        * doc/autoconf.texi (Prerequisite Macros): More about AC_REQUIRE.
index 52a38e1c10d7d4cc2b009a019e87240dae05ef4a..aae5e29d6865aecce2126c0033fe91bfc1dd2a96 100644 (file)
@@ -2320,13 +2320,13 @@ rm -f confcache[]dnl
 
 # AC_CACHE_VAL(CACHE-ID, COMMANDS-TO-SET-IT)
 # ------------------------------------------
-#
 # The name of shell var CACHE-ID must contain `_cv_' in order to get saved.
-# Should be dnl'ed.
+# Should be dnl'ed.  Try to catch common mistakes.
 define([AC_CACHE_VAL],
-[dnl We used to use the below line, but it fails if the 1st arg is a
-dnl shell variable, so we need the eval.
-dnl if test "${$1+set}" = set; then
+[ifelse(regexp([AC_DEFINE], [$2]), [-1],
+               [AC_DIAGNOSE(syntax,
+[$0($1, ...): suspicious presence of an AC_DEFINE in the second argument, ]dnl
+[where no actions should be taken])])dnl
 AC_VAR_IF_SET([$1],
               [echo $ECHO_N "(cached) $ECHO_C" >&AC_FD_MSG],
               [$2])])
index 52a38e1c10d7d4cc2b009a019e87240dae05ef4a..aae5e29d6865aecce2126c0033fe91bfc1dd2a96 100644 (file)
@@ -2320,13 +2320,13 @@ rm -f confcache[]dnl
 
 # AC_CACHE_VAL(CACHE-ID, COMMANDS-TO-SET-IT)
 # ------------------------------------------
-#
 # The name of shell var CACHE-ID must contain `_cv_' in order to get saved.
-# Should be dnl'ed.
+# Should be dnl'ed.  Try to catch common mistakes.
 define([AC_CACHE_VAL],
-[dnl We used to use the below line, but it fails if the 1st arg is a
-dnl shell variable, so we need the eval.
-dnl if test "${$1+set}" = set; then
+[ifelse(regexp([AC_DEFINE], [$2]), [-1],
+               [AC_DIAGNOSE(syntax,
+[$0($1, ...): suspicious presence of an AC_DEFINE in the second argument, ]dnl
+[where no actions should be taken])])dnl
 AC_VAR_IF_SET([$1],
               [echo $ECHO_N "(cached) $ECHO_C" >&AC_FD_MSG],
               [$2])])