开发者

Using pkg-config with autotools

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 & 开发者_StackOverflow中文版then add the include & link lines.

Any help would be appreciated. Thanks.

Steve


pkg-config comes with its own set of Autoconf macros such as PKG_CHECK_EXIST and PKG_CHECK_MODULES. They are documented in the pkg-config man page.

cppunit also comes with its own Autoconf macro AM_PATH_CPPUNIT in the cppunit.m4 file. So that's probably the best place to start.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜