如何列出可以在 ./configure 脚本中启用和禁用的功能?

发布于 2024-12-20 02:05:21 字数 558 浏览 1 评论 0原文

许多开源软件都是通过自动工具构建系统以源代码形式分发的。为了构建这样的软件,我发出 ./configure &&制作。但对于某些软件,我只需要构建它的子集 - 例如,在 SRP 中,我只对库感兴趣,而不对终端或 ftp 客户端感兴趣。要指定要构建的内容,./configure 脚本接受 --disable---enable---with-、--without- 等命令行键,在 ./configure --help“功能和包”部分列出。

给定带有 ./configure 脚本的第三方开源存档,我是否可以轻松获取可用于启用-禁用的所有功能的列表?当然,这些信息可以在源代码中找到,例如在 makefile.ammakefile.in 中 - 但它们很大且难以阅读。也许存在更简单的方法,例如 ./configure --list-features

Lots of open source software is distributed in source code with autotools build system. In order to build such software i issue ./configure && make. But for some software i need to build only subset of it - for example, in SRP i'm interested only in library and not in terminal or ftp client. To specify what to build ./configure script accepts --disable-, --enable-, --with-, --without- etc command-line keys that are listed in ./configure --help, "Features and packages" section.

Given third-party open source archive with ./configure script is it any way i can easily get list of all features available to enable-disable? Of course such information is available in source code, for example in makefile.am and makefile.in - but they are huge and hard to read. Maybe easier way exist, something like ./configure --list-features?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

脸赞 2024-12-27 02:05:21

./configure --help 就可以了。

这显示使用宏 AC_ARG_ENABLEAC_ARG_WITH 定义的任何 --enable-X--with-X 参数code>,以及配置脚本将关注的环境变量列表,例如 CC

在一些组织为一系列子项目的大型项目中,每个子项目都有自己的配置脚本,您可能需要执行 ./configure --help=recursive 来查看所有功能/包子项目。

./configure --help will do the trick.

This shows any --enable-X or --with-X arguments that are defined using the macros AC_ARG_ENABLE or AC_ARG_WITH, as well as a list of environment variables that the configure script will pay attention to, such as CC.

In some large projects that are organized as a series of sub-projects each with their own configure script, you may need to do ./configure --help=recursive to see all the features/packages for all the sub-projects.

水波映月 2024-12-27 02:05:21

AFAIK,如果 configure.ac 使用 AC_ARG_ENABLEAC_ARG_WITH 宏,这些选项应该显示在帮助输出中。我不知道为什么一个包会试图绕过这个,除非它是一个旧的脚本。在 configure.acconfigure.in 脚本中搜索这些宏可能会有所帮助。

AFAIK, if configure.ac uses the AC_ARG_ENABLE and AC_ARG_WITH macros, the options should show up in the help output. I don't know why a package would try to circumvent this, unless it's an old script. A search of the configure.ac or configure.in script for these macros might help.

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