Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

macro `AM_PATH_CPPUNIT' not found in library

I am trying to build libtorrent on shared hosting. So built CPPUnit(1.12.1) with --prefix=$HOME. After that my $HOME/lib and $HOME/include contains CPPUnit libraries and headers.

The I exported LD_ paths

export LD_LIBRARY_PATH=$HOME/lib:$LD_LIBRARY_PATH
export LD_INCLUDE_PATH=$HOME/include:$LD_INCLUDE_PATH

Then I run libtorrent/autogen.sh --prefix=$HOME and getting the following warning, which prevents me to run configure:

aclocal...
aclocal:configure.ac:20: warning: macro `AM_PATH_CPPUNIT' not found in library

cppunit.m4 file is located in $HOME/share/aclocal. I guess libtorrent can't find that dir for some reason.

like image 781
Pablo Avatar asked Dec 16 '11 12:12

Pablo


1 Answers

I stumbled across this page trying to follow the default cppunit Money tutorial. As @Carlo Wood specified

This no longer works. cppunit.m4 was removed from libcppunit-dev.

Which is true, I followed the next answer to no avail, there is no cppunit.m4, the error is that you don't even need AM_PATH_CPPUNIT, just use

ProgramName_LDADD = -lcppunit

instead of ProgramName_LDFLAGS = $(CPPUNIT_LIBS)

Furthermore, I don't know if the rest of the Makefile.am is actually necessary, this is the Makefile I ended up using

Makefile.am

TESTS = MoneyApp
bin_PROGRAMS = $(TESTS)
MoneyApp_SOURCES = ...
MoneyApp_CXXFLAGS = $(CPPUNIT_CFLAGS)
MoneyApp_LDADD = -lcppunit

And config.ac

AC_INIT([MoneyApp], 1.0)
AM_INIT_AUTOMAKE
AC_PROG_CC
AC_PROG_CXX
AC_CONFIG_FILES(Makefile)
AC_OUTPUT

Hopefully this helps somebody in the future.

like image 156
iggy12345 Avatar answered Oct 25 '22 22:10

iggy12345