autotools:autoreconf 找不到宏,但 aclocal 可以
作为一名开发人员,我是第一次尝试使用自动工具,所以请原谅任何新手。
我正在使用 Check 单元测试库,它在 < 中定义了宏 AM_PATH_CHECK
code>check.m4,安装在 /usr/local/share/aclocal
中。我设法通过编辑 /usr/share/aclocal/dirlist
以包含 /usr/local/share 来让
。aclocal
识别 AM_PATH_CHECK
/aclocal
因此,aclocal
运行并干净地返回(无需任何附加参数)。
但是,当我运行 autoreconf --install
时,我收到错误
configure.ac:36: error: possibly undefined macro: AM_PATH_CHECK
If this token and others are legitimate, please use m4_pattern_allow
See the Autoconf documentation
autoreconf: /usr/local/bin/autoconf failed with exit status: 1
我做错了什么?我应该如何让 autoreconf
知道 AM_PATH_LOCAL
的存在?
I'm trying to use autotools for the first time as a developer, so excuse any noobishness.
I'm using the Check unit testing library which defines the macro AM_PATH_CHECK
in check.m4
, which was installed in /usr/local/share/aclocal
. I managed to get aclocal
to recognize AM_PATH_CHECK
by editing /usr/share/aclocal/dirlist
to include /usr/local/share/aclocal
.
So aclocal
runs and returns cleanly (without any additional arguments).
However, when I run autoreconf --install
, I get the error
configure.ac:36: error: possibly undefined macro: AM_PATH_CHECK
If this token and others are legitimate, please use m4_pattern_allow
See the Autoconf documentation
autoreconf: /usr/local/bin/autoconf failed with exit status: 1
What am I doing wrong? How should I let autoreconf
know of the existence of AM_PATH_LOCAL
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
听起来 Check 本身安装不正确。你应该在那里提交一个错误。要解决此问题,您可以采取的方法是将
AC_CONFIG_MACRO_DIR([m4])
添加到
configure.ac
,并添加ACLOCAL_AMFLAGS += -I m4
code>到
Makefile.am
,然后将check.m4
复制到将在项目根目录中创建的m4
目录。Sounds like Check is installing itself incorrectly. You should file a bug there. What you can do to work around this problem is to add
AC_CONFIG_MACRO_DIR([m4])
to
configure.ac
, and addACLOCAL_AMFLAGS += -I m4
to
Makefile.am
, and then copycheck.m4
to them4
directory that will be created in your project's root directory.我让一位同事帮我解决了这个问题,我们发现问题是
pkg-config
没有安装。 (显然,不是 OSX 的 XCode 工具的一部分)。我不确定该向谁提交有关此问题的错误 -
Check
应该在安装时检查pkg-confg
吗?应该autoconf
吗?或者它是否太标准了以至于我应该向 XCode 工具人员抱怨?I had one of my peers help me out, and we discovered that the problem was that
pkg-config
wasn't installed. (Evidently, not part of OSX's XCode tools).I'm not sure who to file a bug with about this - should
Check
be checking forpkg-confg
when it installs? Shouldautoconf
? Or is it so bog-standard that I should complain to the XCode tools people?