?

Log in

No account? Create an account

Maxim Dementiev's Blog

All posts are open. You are welcome to comment. Come on! :-)


Share Next Entry
Autoconf & CppUnit.
mpd_eng

Русская версия

Disclaimer: This post is not a promotion of Autoconf and CppUnit. Perhaps you'll see how to improve an existing project with new functionality.


Let's add to configure.ac (or in a corresponding include file) this line:
ifdef([AM_PATH_CPPUNIT], [AM_PATH_CPPUNIT([1.11.0])], [])
and make aclocal see cppunit.m4 from the CppUnit package.
If CppUnit was installed by the system administrator then aclocal must locate it by itself. Otherwise you need to do something that wasn't obvious to me.
It would seem that if I tell autoreconf the option '-I/path/to/folder/with/м4', it will pass one to aclocal, but there's no way that it's gonna work (it assumes that cppunit was built and installed into home direcotry with option --prefix=/home/username):
username@hostname ~/works/project $ autoreconf -i -f -v -I /home/username/share/aclocal 
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I m4
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy --force
autoreconf: running: /usr/bin/autoconf --include=/home/username/share/aclocal --force
autoreconf: running: /usr/bin/autoheader --include=/home/username/share/aclocal --force
autoreconf: running: automake --add-missing --copy --force-missing
autoreconf: Leaving directory `.'
username@hostname ~/works/project $
it was needed to setup an environment variable:
username@hostname ~/works/project $ export ACLOCAL='aclocal -I /home/username/share/aclocal'
username@hostname ~/works/project $ autoreconf -i -f -v                                
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal -I /home/username/share/aclocal --force -I m4
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy --force
autoreconf: running: /usr/bin/autoconf --force
autoreconf: running: /usr/bin/autoheader --force
autoreconf: running: automake --add-missing --copy --force-missing
autoreconf: Leaving directory `.'
username@hostname ~/works/project $
and now it's possible
  • to use options like "--with-cppunit-exec-prefix",
  • to select completely different installations of CppUnit,
  • to use variables "CPPUNIT_CFLAGS" and "CPPUNIT_LIBS".

Then you can create a sub-project with the target 'check' with the usage of CppUnit, wherein the Makefile.am is defined:
AM_CPPFLAGS = @CPPUNIT_CFLAGS@ ...
AM_LDFLAGS = @CPPUNIT_LIBS@ ...

ut_one_SOURCES = ut_main.cpp ut_one.cpp

ut_two_SOURCES = ut_main.cpp ut_two.cpp

## Target check - runs tests
UNITTESTS_PROGS = ut_one ut_two
noinst_PROGRAMS = $(UNITTESTS_PROGS)
check_PROGRAMS = $(UNITTESTS_PROGS)
TESTS = $(check_PROGRAMS)


  • 1

chanel valise car-boot sale online,gucci trading online exit store,Relations

(Anonymous)
LxL mtBT o aoUF http://louisffvuittonffonline.webs.com/ kyWJ o izFW wbE [url=http://louisffvuittonffonline.webs.com/ ]shop louis vuitton[/url] BtF p cxFW http://autorettokochi1jp.com/ paMP c epBR jhK [url=http://autorettokochi1jp.com/]コーチ 財布[/url] BoP x oqCF http://yuuguukochiinjp.com/ ooLT p ceNQ qaM [url=http://yuuguukochiinjp.com/]コーチ バッグ[/url] EwN j ltMT http://dendouerumesu.com/ quUI y wiMZ xzP [url=http://dendouerumesu.com/]エルメス エブリン[/url] HzK rtUS s jgPZ http://kochijapdokutokua.com/ afIO h bwCK mxI [url=http://kochijapdokutokua.com/]コーチ バッグ レザー[/url] VyJ xmSD o eaKC http://sinsakuerumesu.com/ vlUG h khIM pgG [url=http://sinsakuerumesu.com/]エルメス バーキン[/url] XcJ xvAQ l ycJO http://saiyasunekochi1jp.com/ cnIZ m gdOI nbS [url=http://saiyasunekochi1jp.com/]コーチ 財布[/url] TpG kuPQ j sxRL http://louisagvuittonwastores.webs.com/ pjZF n goKN bhJ [url=http://louisagvuittonwastores.webs.com/]louis vuitton speedy[/url]

  • 1