检查配置脚本中的 automake/autoconf 版本
我正在尝试编辑一个配置脚本,如果它高于 Automake 版本 x.xx,它将执行这段代码,如果不是,它将执行另一段代码。
因此,我需要版本为 1.10 或更高版本,然后在这种情况下我想这样做:
m4_rename_force([glibcxx_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
并且,否则:
m4_rename([glibcxx_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
所以我假设它看起来像这样(在 configure.in
):
if test GET_AUTOMAKE_VERSION >= 1.10; then
m4_rename_force([glibcxx_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
else
m4_rename([glibcxx_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
fi
另外,我应该检查 autoconf 或 automake 版本吗?可能两者皆有?
I'm trying to edit a configure script that will execute this piece of code if it is above Automake version x.xx, and if it isn't, it executes a different piece of code.
So, I need the version to be 1.10 or above, then when it is the case I want to do this:
m4_rename_force([glibcxx_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
And, otherwise:
m4_rename([glibcxx_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
So I would assume it would look something like this (in configure.in
):
if test GET_AUTOMAKE_VERSION >= 1.10; then
m4_rename_force([glibcxx_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
else
m4_rename([glibcxx_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
fi
Also, should I check for the autoconf or automake version? Possibly both?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在配置时检查 automake 版本没有任何意义。配置脚本在 automake 之后很长时间运行,并且可能在根本没有安装 automake 的机器上运行。编写configure.ac(而不是configure.in)以使用现代automake。运行 autoconf 来生成配置脚本的开发人员需要安装现代 automake。调用配置脚本的用户根本不需要安装任何自动工具。
It doesn't make any sense to check for the automake version at configure time. The configure script is run long after automake, and may be running on a box on which automake is not installed at all. Write your configure.ac (not configure.in) to use modern automake. The developer who runs autoconf to generate the configure script will need to have modern automake installed. The user who invokes the configure script will not need to have any of the autotools installed at all.
为了测试 autoconf 版本,我认为这样的东西会起作用。
我不知道如何为 automake 做同样的事情。
For testing the autoconf version I think something like this will work.
I don't know how to do the same for automake.