如何列出可以在 ./configure 脚本中启用和禁用的功能?
许多开源软件都是通过自动工具构建系统以源代码形式分发的。为了构建这样的软件,我发出 ./configure &&制作
。但对于某些软件,我只需要构建它的子集 - 例如,在 SRP 中,我只对库感兴趣,而不对终端或 ftp 客户端感兴趣。要指定要构建的内容,./configure
脚本接受 --disable-
、--enable-
、--with-、
--without-
等命令行键,在 ./configure --help
“功能和包”部分列出。
给定带有 ./configure
脚本的第三方开源存档,我是否可以轻松获取可用于启用-禁用的所有功能的列表?当然,这些信息可以在源代码中找到,例如在 makefile.am
和 makefile.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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
./configure --help
就可以了。这显示使用宏
AC_ARG_ENABLE
或AC_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 macrosAC_ARG_ENABLE
orAC_ARG_WITH
, as well as a list of environment variables that the configure script will pay attention to, such asCC
.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.AFAIK,如果
configure.ac
使用AC_ARG_ENABLE
和AC_ARG_WITH
宏,这些选项应该显示在帮助输出中。我不知道为什么一个包会试图绕过这个,除非它是一个旧的脚本。在configure.ac
或configure.in
脚本中搜索这些宏可能会有所帮助。AFAIK, if
configure.ac
uses theAC_ARG_ENABLE
andAC_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 theconfigure.ac
orconfigure.in
script for these macros might help.