> In binutils/configure.ac there is:
> [case $srcdir in
> *" "*)
> m4_pushdef([AS_MESSAGE_LOG_FD], )dnl
> AC_MSG_ERROR([path to source, $srcdir, contains spaces])
> ac_subdirs_all=`cd $srcdir && echo */configure | sed 's,/configure,,g'`
> I can't find where it's used, and was wondering how one would use this
That is, the result of invoking AC_MSG_ERROR is a shell-script call to
the function as_fun_error, with either 2 arguments (the error code and
message) or 4 arguments (the error code, message, current line number,
and log fd), based on whether the current macro definition of
AS_MESSAGE_LOG_FD is blank. Looking at that shell function, it behaves
differently according to whether the third and fourth arguments are
present, by additionally logging to the log fd.
So what binutils is doing is writing a low-level macro where they DON'T
want the message logged to config.log, so they temporarily redefine
AS_MESSAGE_LOG_FD to the empty string around the duration of the
expansion of AC_MSG_ERROR, in order to change how that macro is expanded.
> Doesn't the pushdef/popdef pair make it useless?
No, the pushdef/popdef pair is what makes it so that the temporary
non-logging nature of AC_MSG_ERROR() lasts only for the duration of the
expansion of this snippet, rather than the rest of configure.ac.
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org