如何使配置脚本检查依赖项 [英] How to make configure script check the dependencies
问题描述
它工作正常,除非我没有安装一些需要的库。缺少某些文件时返回错误,但实际上应该由配置脚本检查?
所以我的问题是:如何修改autoconf生成的脚本来寻找对于依赖关系,告诉用户哪些库缺少?
取决于依赖,没有通用的解决方案。 >
有 <$如果库和标题安装在标准位置,则可能适用于您的c $ c> AC_CHECK_LIB 和 许多包现在支持 使用不兼容的软件包AC宏并且不支持 I generated a configure script with autoconf to build my project. It works fine unless I don't have some needed library installed. Make returns error when lacking some files, but it should be actually checked by the configure script i think? So my question is: How to modify an autoconf generated script to seek for dependencies and tell the user which libraries it lacks? Depends on the dependency, there is no generic solution. There are Many packages nowadays support With packages that do not work with AC macros and do not support 这篇关于如何使配置脚本检查依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! AC_SEARCH_LIBS
宏* p>
pkg-config
或类似的东西可以让你检查是否存在库,还可以为您提供所需的编译器和链接器标志。
pkg-config
或类似的内容,您可能必须自己编写大量脚本,以确定依赖关系是否可用以及编译器和链接器它需要的选项。即使这样,很难使其便携。AC_CHECK_LIB
and AC_SEARCH_LIBS
macros that may work for you if the libraries and headers are installed in standard locations.pkg-config
or something similar which allows you to check for existence of libraries, and also can supply you the compiler and linker flags required.pkg-config
or similar, you'll probably have to write a ton of scripts yourself to find out whether the dependency is available and what compiler and linker options it requires. And even then it is hard to make it portable.