检查配置脚本中的 automake/autoconf 版本

发布于 2024-08-18 16:31:34 字数 593 浏览 4 评论 0原文

我正在尝试编辑一个配置脚本,如果它高于 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

遇见了你 2024-08-25 16:31:34

在配置时检查 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 版本,我认为这样的东西会起作用。

m4_version_prereq ( 1.10, 
     m4_rename_force([glibcxx_PRECIOUS],[_AC_ARG_VAR_PRECIOUS]), 
     m4_rename([glibcxx_PRECIOUS],[_AC_ARG_VAR_PRECIOUS]) 
)

我不知道如何为 automake 做同样的事情。

For testing the autoconf version I think something like this will work.

m4_version_prereq ( 1.10, 
     m4_rename_force([glibcxx_PRECIOUS],[_AC_ARG_VAR_PRECIOUS]), 
     m4_rename([glibcxx_PRECIOUS],[_AC_ARG_VAR_PRECIOUS]) 
)

I don't know how to do the same for automake.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文