【发布时间】:2015-06-27 02:58:24
【问题描述】:
我目前正在使用 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 文件。
这是为什么呢?为什么我们要绑定到特定的 automake 版本?我们主要在 Ubuntu 14.04 上构建,其中 1.14 是安装的默认版本。有没有办法告诉构建系统简单地使用安装的任何版本的 automake?或者从 aclocal.m4 中删除 am__api_version 定义是否安全?
【问题讨论】:
-
我将“通常的 autotools 样板”定义为
configure.ac和Makefile.am。这两个文件的目的是生成configure脚本、Makefile.in、Makefile以及支持构建的各种其他工件。生成的文件不需要(实际上不应该)添加到任何源代码管理中。
标签: linux makefile autotools automake