Hello,
I noticed this weird macro: AC_MSG_RESULT_UNQUOTED
It was never documented. It has a misleading comment that it
does perform ` $ and \ substitutions. Actually (current version of)
AC_MSG_RESULT does $ and \ substitutions, so the only difference is
that it performs backtick substs, and that you can break it if you
pass a double quote in a parameter.
The macro AC_CACHE_CHECK was the only one in autoconf tree which
used AC_MSG_RESULT_UNQUOTED. And I think it would be better if it
didn't execute the backticks twice, the following would be better:
ac_res=AS_VAR_GET([$2])
AC_MSG_RESULT([$ac_res])
Actually, everyone should use this pattern instead of
AC_MSG_RESULT_UNQUOTED. That's why I propose to make it obsolete.
The patch attached to this mail implements this.
Paul, OK to commit?
Stepan
2005-05-23 Stepan Kasal <[EMAIL PROTECTED]>
* lib/autoconf/general.m4 (AC_MSG_RESULT_UNQUOTED): Make
obsolete; it was never documented.
(AC_CACHE_CHECK): Use AC_MSG_RESULT instead.
Index: lib/autoconf/general.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/general.m4,v
retrieving revision 1.857
diff -u -r1.857 general.m4
--- lib/autoconf/general.m4 20 May 2005 07:58:43 -0000 1.857
+++ lib/autoconf/general.m4 23 May 2005 16:01:20 -0000
@@ -1905,7 +1905,11 @@
m4_defun([AC_CACHE_CHECK],
[AC_MSG_CHECKING([$1])
AC_CACHE_VAL([$2], [$3])dnl
-AC_MSG_RESULT_UNQUOTED([AS_VAR_GET([$2])])])
+AS_LITERAL_IF([$2],
+ [AC_MSG_RESULT([$$2])],
+ [ac_res=AS_VAR_GET([$2])
+ AC_MSG_RESULT([$ac_res])])dnl
+])
@@ -2033,15 +2037,6 @@
])
-# AC_MSG_RESULT_UNQUOTED(RESULT)
-# ------------------------------
-# Likewise, but perform $ ` \ shell substitutions.
-m4_define([AC_MSG_RESULT_UNQUOTED],
-[_AS_ECHO_UNQUOTED([$as_me:$LINENO: result: $1], AS_MESSAGE_LOG_FD)
-_AS_ECHO_UNQUOTED([${ECHO_T}$1])[]dnl
-])
-
-
# AC_MSG_WARN(PROBLEM)
# AC_MSG_NOTICE(STRING)
# AC_MSG_ERROR(ERROR, [EXIT-STATUS = 1])
@@ -2069,6 +2064,15 @@
[AS_MESSAGE([checking $1...])])
+# AU::AC_MSG_RESULT_UNQUOTED(RESULT)
+# ----------------------------------
+# No escaping, so it performed also backtick substitution.
+AU_DEFUN([AC_MSG_RESULT_UNQUOTED],
+[_AS_ECHO_UNQUOTED([$as_me:$LINENO: result: $1], AS_MESSAGE_LOG_FD)
+_AS_ECHO_UNQUOTED([${ECHO_T}$1])[]dnl
+])
+
+
# AU::AC_VERBOSE(STRING)
# ----------------------
AU_ALIAS([AC_VERBOSE], [AC_MSG_RESULT])