views:

232

answers:

1

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

+2  A: 

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.

Peter Eisentraut
Thanks for pointing me in the right direction!
Stephen Burke

related questions