Suggestion for improving an error message
Reuben Thomas via Bug reports for autoconf <[email protected]>
| Newsgroups | gmane.comp.sysutils.autoconf.bugs |
|---|---|
| Message-ID | <CAOnWdohvHyJHBguqVsTkzFppV6Z+aieiTRMk9vwtH68TT5ihqQ@mail.gmail.com> |
Last night I had the baffling error "possibly undefined macro: AC_MSG_WARN".
Surely "impossibly undefined macro"!
Anyway, I was led to the following excellent analysis of the problem:
https://ae1020.github.io/undefined-macro-pkg-config/
In my case, I was briefly baffled even further, as I *had* installed
pkg-config. But after a little thought I realised that my case was the
"opposite": I had failed to install a required autoconf-archive macro in my
project. Problem solved!
I wonder though if it might be possible to adopt the simplest suggestion of
the article I cite above, and improve the error message to something like
the following (lightly edited from the blog post to conform better to what
I take for autoconf house style):
configure.ac:34: error: unexpanded AC_XXX macro: AC_MSG_ERROR
A token that looks like an autoconf macro was left unexpanded in the output.
It may be undefined, or passed by `quote' to another macro that should
have invoked it but isn't installed to do so. If this token and others
are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.configure.ac:143: error: unexpanded
AC_XXX macro: AC_DEFINE
autoreconf: /usr/bin/autoconf failed with exit status: 1
Quite wordy, but might help more users get straight to the real problem!
--
https://rrt.sc3d.org