我目前正在使用 autotools 开发一个 Linux 项目。代码在 SCM (Perforce) 中提交,我们有配置脚本、Makefile.am、Makefile.in——通常的 autotools 样板文件。最近有人改了Makefile.am,却忘了重新生成Makefile.in;当我尝试构建时,出现了这个错误:
WARNING: `automake-1.11' is missing on your system. You should only need it if
you modified `Makefile.am', `acinclude.m4' or `configure.ac'.
You might want to install the `Automake' and `Perl' packages.
Grab them from any GNU archive site.
cd . && /bin/bash ./config.status Makefile depfiles
我看到 automake 版本在配置脚本中被硬编码(并且似乎来自 aclocal.m4):
am__api_version='1.11'
所以我想我需要 automake-1.11(不是 1.10,不是任何更新的)来重新生成 Makefile.in 文件。
这是为什么呢?为什么我们应该绑定(bind)到特定的 automake 版本?我们主要在 Ubuntu 14.04 上构建,其中 1.14 是默认安装的版本。有没有办法告诉构建系统简单地使用安装的任何版本的 automake?或者从 aclocal.m4 中删除 am__api_version 定义是否安全?
最佳答案
问题是您正在尝试使用其他版本的 autotools 重新创建 Makefile.in
。这会导致版本不匹配,因为 aclocal.m4
是用不同的版本构建的,它用于生成剩余的文件。
与其仅重新创建 Makefile.in
,还尝试重新创建 aclocal.m4
和所有剩余的 autotools 生成的文件:
autoreconf --force --install
关于linux - 在配置脚本中硬编码的 automake 版本 (am__api_version),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29746960/