dbe*_*eer 106 autoconf autotools
我在configure.ac中有以下内容:
AC_CHECK_PROGS(MAKE,$MAKE make gmake,error)
if test "x$MAKE" = "xerror" ;then
AC_MSG_ERROR([cannot find a make command])
fi
Run Code Online (Sandbox Code Playgroud)
这已经在我们的项目中很长一段时间了,但在一些设置中,我得到这个错误:
configure.ac:45: error: possibly undefined macro: AC_MSG_ERROR
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
Run Code Online (Sandbox Code Playgroud)
最近在上面添加的行:
AC_CONFIG_MACRO_DIR([m4])
LT_INIT
Run Code Online (Sandbox Code Playgroud)
任何人都可以解释导致此错误的原因以及如何追踪问题?
编辑:添加有关差异的详细信息.
有效的盒子:
uname -a Linux host1 2.6.38-13-generic #53-Ubuntu SMP Mon Nov 28 19:33:45 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
automake: 1.11.1
autoconf: 2.67
m4: 1.4.14
libtoolize: 2.2.6b
Run Code Online (Sandbox Code Playgroud)
不起作用的盒子:
Linux host2 2.6.32-35-generic-pae #78-Ubuntu SMP Tue Oct 11 17:01:12 UTC 2011 i686 GNU/Linux
automake: 1.11.1
autoconf: 2.65
m4: 1.4.13
libtoolize: 2.2.6b
Run Code Online (Sandbox Code Playgroud)
新编辑:只有32位机器遇到这个困难.
已更新我能够重现问题CentOS的机器上autoconf 2.67
,automake 1.11.1
,libtool 2.2.6b
,和m4 1.4.14
.这只是32位机器的错误吗?
小智 232
我有同样的问题,发现pkg-config
包丢失了.
安装包后,一切都正确生成.
jør*_*sen 31
建议使用autoreconf -fi
而不是手动调用aclocal;autoconf;automake; #and whatever else
以正确填充aclocal.m4等.
添加ACLOCAL_AMFLAGS = -I m4
(到顶层Makefile.am),AC_CONFIG_MACRO_DIR([m4])
如果你不使用任何自己的m4文件,目前仍然是可选的,但当然,这样做会使这个过程沉默:)
Mal*_*ous 26
我有自己的这个问题configure.ac
,但在这种情况下(并且为了Google的任何人的利益),这是因为我不小心引用了AC_MSG_ERROR
所以它被视为字符串:
AX_BOOST_BASE([1.42], [], [AC_MSG_ERROR([Could not find Boost])])
Run Code Online (Sandbox Code Playgroud)
一旦我删除AC_MSG_ERROR
宏周围的方括号,它工作:
AX_BOOST_BASE([1.42], [], AC_MSG_ERROR([Could not find Boost]))
Run Code Online (Sandbox Code Playgroud)
那些说你应该安装pkg-config
或者一些软件包的评论都没有提到.本AC_MSG_ERROR
应该是工作,像"你需要安装包XYZ"给你一个有用的信息,但由于一些问题,AC_MSG_ERROR
不能正常工作.安装包XYZ肯定会使错误消失,但只是因为一旦包在那里,就不再需要打印错误消息了!
因此,安装pkg-config
或特定包只是绕过了问题,它实际上并没有解决它.
Bea*_*tes 11
我也有类似的问题..我的解决方案是
apt-get install libcurl4-openssl-dev
Run Code Online (Sandbox Code Playgroud)
(我已经安装了libcurl)至少为我工作..
小智 7
该问题有两个可能的原因:
\n\n没有安装aclocal。
\n解决方案\xef\xbc\x9ainstall libtool
sudo apt-get install libtool
sudo yum install libtool
LIBTOOL.m4 的路径错误。
\n解决方案:
aclocal --print-ac-dir
检查 aclocal 的当前路径。(通常应该是“/usr/share/aclocal”或“/usr/share/aclocal”)cp /usr/share/aclocal/*.m4 /usr/local/share/aclocal/
或者cp /usr/local/share/aclocal/*.m4 /usr/share/aclocal/
)希望能帮助到你
\n小智 6
I had the same problem on RHEL7.5 with otto-de/libvmod-uuid
It was fixed by installing "autoconf-archive" packages
我刚刚在这件事上浪费了几个小时。我的结论: