From: Akim Demaille Date: Mon, 26 Jun 2000 09:08:13 +0000 (+0000) Subject: * acgeneral.m4 (AC_CACHE_VAL): Too many people put AC_DEFINE in X-Git-Tag: autoconf-2.50~800 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=99f2a140ad3087895cbb6fc9c5f1c961f71cf4db;p=thirdparty%2Fautoconf.git * acgeneral.m4 (AC_CACHE_VAL): Too many people put AC_DEFINE in the commands-to-set-it part of it. Give them a warning. --- diff --git a/ChangeLog b/ChangeLog index 84f367e7f..5535735a5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2000-06-26 Akim Demaille + + * 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 * doc/autoconf.texi (Prerequisite Macros): More about AC_REQUIRE. diff --git a/acgeneral.m4 b/acgeneral.m4 index 52a38e1c1..aae5e29d6 100644 --- a/acgeneral.m4 +++ b/acgeneral.m4 @@ -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])]) diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4 index 52a38e1c1..aae5e29d6 100644 --- a/lib/autoconf/general.m4 +++ b/lib/autoconf/general.m4 @@ -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])])