the commands-to-set-it part of it. Give them a warning.
+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.
# 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])])
# 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])])