将 pkg-config 与 autotools 一起使用
我正在学习自动工具并通过一个 hello world 场景来实现它,现在想尝试将一些 cppunit 测试打包到一个包中并使用自动工具构建它。为了构建包,必须在系统上安装 cppunit。在构建的 ./configure 部分检查这一点的最佳方法是什么?
任何帮助将不胜感激。谢谢。
史蒂夫
I'm learning about the autotools and made it through a hello world scenario and now wanted to try wrapping up some cppunit tests into a package and build it using the autotools. In order to build the package, cppunit would have to be installed on the system. What's the best way to check for this during the ./configure portion of the build.
I looked into AC_CHECK_LIB
and then ran across some info about using pkg-config. How would I use pkg-config in the autotools realm to check for the existence of cppunit on the build system & then add the include & link lines.
Any help would be appreciated. Thanks.
Steve
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
pkg-config 附带了自己的一组 Autoconf 宏,例如 PKG_CHECK_EXIST 和 PKG_CHECK_MODULES 。它们记录在 pkg-config 手册页中。
cppunit 还在
cppunit.m4
文件中附带了自己的 Autoconf 宏AM_PATH_CPPUNIT
。所以这可能是最好的起点。pkg-config comes with its own set of Autoconf macros such as
PKG_CHECK_EXIST
andPKG_CHECK_MODULES
. They are documented in the pkg-config man page.cppunit also comes with its own Autoconf macro
AM_PATH_CPPUNIT
in thecppunit.m4
file. So that's probably the best place to start.