有没有一种方法可以计算出所有必需的依赖项,但无需执行“./configure”? -C
对于那些从源代码编译过的人来说,运行“./configure”却发现 X 库或丢失是多么痛苦,最糟糕的是它会吐出一条愚蠢的行,说缺少一个神秘的 lib 文件,然后您就可以使用它必须去网络浏览器中输入丢失的文件,祈祷谷歌可以为你找到答案...
我发现这非常重复,所以我的问题是:
有没有一种方法可以计算出所有必需的依赖项,但又不需要执行“./configure”
For those who have compiled from source knows how much of a pain it is to run "./configure" only to find that X library or missing, worst yet it spits out a silly line saying a cryptic lib file is missing, which you then have to go to a web browser type in the missing file cross you fingers that Google can find the answer for you...
I find that very repetitive, so my question is:
Is there a way to work out all the required dependencies but without doing "./configure"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
阅读源代码分发中的 README* 或 INSTALL* 文件(如果有),或者在下载该文件的网站上查找任何文档。如果包有详细的文档记录,依赖项通常会在某处列出。
Read the README* or INSTALL* files in the source distribution, if there are any, or look for any documentation on the website where you downloaded it from. If the package is well documented, dependencies will usually be listed somewhere.
鉴于没有提及特定的 pkg,我认为这是一个通用的“如何避免使用配置”问题。从源 tarball 来看,没有自动方法来解决依赖关系。这就是configure 的用途(您始终可以阅读Makefile 和autoconf 文件并手动了解依赖关系,但很快您就会错过configure)。为了避免这种情况,您需要使用直接 tarball 以外的东西,它已经解决了依赖关系。
例如,您可以切换到构建源 rpm(或 deb,具体取决于您的系统)。或者您可以使用 Gentoo 等系统,它非常擅长为您解决依赖关系。但所有这些都要求您感兴趣的 pkg 以其格式可用,因此它们不适用于您从源提供商下载的 tarball。
Given that there's no mention of a specific pkg has been mentioned, I assume this is a generic "how to avoid using configure" question. From a source tarball, no there is no automated way to work the dependencies out. That's what configure is for (you can always read the Makefiles and autoconf files and understand the dependencies manually, but then you'll miss configure very quickly). To avoid it, you need use something other the straight tarball, which has already worked out the dependencies.
For example you can switch to building source rpms (or debs, dependending on your system). Or you can use a system such as Gentoo which is really good at working out the dependencies for you. But all of these require the pkg you're interested in to be available in their format, so they won't work for tarballs that you download from the source provider.
读取
configure.ac
/configure.in
。查找对AC_CHECK_LIB
、AC_CHECK_LIBS
、AC_SEARCH_LIBS
、AM_PATH_*
的调用(一些旧软件包不使用< code>pkg-config 由于某种原因将其检查放入AM_*
命名空间),PKG_CHECK_MODULES
(对于pkg-config
) 、AX_*
(许多自动配置存档宏都是为了检查不常见的依赖关系而编写的)以及任何以奇怪名称开头的宏调用(即不是AC_*
、AM_*
或AX_*
。尝试grep '^[^A]'
?)。Read
configure.ac
/configure.in
. Look for calls toAC_CHECK_LIB
,AC_CHECK_LIBS
,AC_SEARCH_LIBS
,AM_PATH_*
(some old packages that don't usepkg-config
put their checks into theAM_*
namespace for some reason),PKG_CHECK_MODULES
(forpkg-config
),AX_*
(many autoconf-archive macros are written to check for uncommon dependencies) and any macro call that start with an odd name (i.e., notAC_*
,AM_*
orAX_*
. Trygrep '^[^A]'
?).您可以做的一件对社区有益的事情就是向软件包维护者提交错误报告/功能请求。有相当多的包的配置脚本不会在第一个缺少的依赖项上中止,而是运行到完成,然后打印所有缺少的依赖项的摘要。这大大减少了您所描述的单调乏味。不幸的是,“相当多”转化为低于 0.00001%(这是一个虚构的统计数据)。如果您可以说服软件包维护者重新编写他们的配置脚本来支持此行为,您将为让世界变得更美好做出贡献。
祝你好运!
One thing you can do that would be good for the community is to submit a bug report/feature request to the package maintainers. There are quite a few packages whose configure script does not abort on the first missing dependency, but runs to completion and then prints a summary of all the dependencies that are missing. That greatly reduces the tedium you describe. Unfortunately, "quite a few" translates to less than .00001 percent (this is a made up statistic). If you can convince the package maintainers to re-write their configure script to support this behavior, you will contribute to making the world a better place.
Good luck with that!