【问题标题】:How to deal with multiple versions of Automake in configure.acconfigure.ac中如何处理多个版本的Automake
【发布时间】:2013-08-01 04:55:08
【问题描述】:

我想在我的configure.ac 调用AM_INIT_AUTOMAKE 时选择性地省略某些标志,具体取决于Automake 版本。有没有办法做到这一点?

我正在处理的具体问题是 Automake 1.12 引入了一些我想禁用的与可移植性相关的警告(-Wextra-portability-Wportability)(因为我使用 -Wall-Werror 所以我不能忽略不相关的警告):

AM_INIT_AUTOMAKE([-Wall -Werror -Wno-extra-portability -Wno-portability gnu foreign]) 

这适用于 Automake 1.12,但早期版本的 Automake 会出错,因为他们不知道这些标志。如果我们使用 Automake >= 1.12 运行,有没有办法只包含这些标志?

我尝试使用m4_version_compare,但这不起作用(另外我认为使用它甚至没有意义,因为它检查的是 Autoconf 版本,而不是 Automake 版本......)

Here 是一个类似问题的解决方案,涉及在autogen.sh 中修补configure.ac,我想避免这种情况...

【问题讨论】:

  • 您可以将最新的 automake 组件与软件包一起分发为一个独立的构建系统——这就是 autotools 的重点:automake [--foreign] --add-missing --force-missing --copy

标签: build configure autotools automake


【解决方案1】:

简短的回答是否定的,你不能在 automake 中干净地做到这一点。如果你想要类似的东西,你必须在引导脚本 (autogen.sh) 中修补 configure.ac

更简单,只需要 automake 1.12。

问题在于您要比较的 automake 版本号(写入 configuream__api_version)在 M4sugar 层中没有提供。那里没有这些信息,很难修复过去版本的 automake。

编辑:我想到了一种不同的方式来做同样的事情,而无需使用autogen.sh 修补configure.ac,但最终结果是相同的。 make dist tarball 仍将具有基于构建 tarball 的 automake 版本的 automake 选项的“烘焙”版本。但实际上这与仅使用选项设置 automake 版本没有什么不同。

【讨论】:

    猜你喜欢
    • 2013-01-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-01-24
    • 2013-04-11
    • 2019-08-26
    相关资源
    最近更新 更多