【发布时间】:2018-06-14 02:20:08
【问题描述】:
我正在尝试从 GutHub 源构建 libpsl。它需要autoreconf。 Autotools is failing with:
# Try to reconfigure. Autotools is so broken...
libtoolize --force && aclocal && autoheader && autoreconf --force --install
...
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
configure.ac:62: error: possibly undefined macro: AC_MSG_ERROR
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
configure.ac:68: error: possibly undefined macro: AC_MSG_CHECKING
configure.ac:70: error: possibly undefined macro: AC_MSG_RESULT
configure.ac:87: error: possibly undefined macro: AC_LINK_IFELSE
configure.ac:88: error: possibly undefined macro: AC_LANG_PROGRAM
configure.ac:222: error: possibly undefined macro: AC_SEARCH_LIBS
...
我找到了Possibly undefined macro: AC_MSG_ERROR 和AS_IF and AC_MSG_ERROR: error: possibly undefined macro,但猜测并没有解决我的问题。在过去的 4 个小时里,我一直在尝试猜测。
我想停止猜测并解决问题。我遇到的问题是,我找不到有关排除 Autotools 问题的信息或程序。授予,"troubleshoot" autoconf site:gnu.org。
我想出的最好的方法是使用-v 运行命令,但我没有看到复制general.m4 的尝试。如果我没记错的话,general.m4 提供了AC_MSG_ERROR,所以我应该看到它被访问了。所以我的程序有明显的差距或缺陷。并且文件存在:
$ find /usr/local -name general.m4
/usr/local/share/autoconf/autoconf/general.m4
/usr/local/share/autoconf/autotest/general.m4
如何解决 Autotools 的 Possibly undefined macro: AC_MSG_ERROR 问题?
【问题讨论】:
-
我觉得奇怪的是您手动调用
libtoolize、autoheader和aclocal。如果该项目还不是一个 libtool 项目,那么将其转换为一个(使用libtoolize)可能比您想要或需要的工作更多。对于他们来说,autoheader和aclocal无论如何都应该由autoreconf运行,因此单独运行它们是多余的。 -
我发现这个错误信息通常表明 previous 行上有一个未扩展的宏。
-
这个 github 问题非常有帮助:github.com/openucx/ucx/issues/3540#issuecomment-495794266(短篇小说错误消息非常具有误导性)