Opened 7 years ago

Closed 7 years ago

#11285 closed Bug report (fixed)

libfilezilla doesn't build with cppunit 1.14

Reported by: yan12125 Owned by:
Priority: normal Component: libfilezilla
Keywords: Cc:
Component version: svn r8439 Operating system type: Linux
Operating system version: Arch Linux latest

Description

With cppunit 1.14, make check fails with:

make[2]: Entering directory '/home/yen/Projects/tmp/libfilezilla-svn/tests'
/bin/sh ../libtool  --tag=CXX   --mode=link g++  -g -O2 -Wall  -no-install  -o test test-test.o test-dispatch.o test-eventloop.o test-format.o test-iputils.o test-smart_pointer.o test-string.o test-time.o ../lib/libfilezilla.la  -lpthread 
libtool: link: g++ -g -O2 -Wall -o test test-test.o test-dispatch.o test-eventloop.o test-format.o test-iputils.o test-smart_pointer.o test-string.o test-time.o  ../lib/.libs/libfilezilla.so -lpthread -Wl,-rpath -Wl,/home/yen/Projects/tmp/libfilezilla-svn/lib/.libs
test-string.o: In function `string_test::test_conversion()':
/home/yen/Projects/tmp/libfilezilla-svn/tests/string.cpp:40: undefined reference to `CppUnit::SourceLine::SourceLine(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
(and much more "undefined reference" errors)
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:617: test] Error 1
make[2]: Leaving directory '/home/yen/Projects/tmp/libfilezilla-svn/tests'
make[1]: *** [Makefile:1019: check-am] Error 2
make[1]: Leaving directory '/home/yen/Projects/tmp/libfilezilla-svn/tests'
make: *** [Makefile:457: check-recursive] Error 1

The compilation command is missing -lcppunit. A deeper looking into libfilezilla reveals that the latest cppunit breaks it. In m4/cppunit.m4, cppunit-config binary is used to determine compiling and linking flags. However, cppunit-config is dropped upstream in favor of pkg-config. [1] As a result, cppunit detection fails silently and compilation of test programs doesn't work.

A workaround is specifying the necessary flag manually:

LDFLAGS="-lcppunit" ./configure

Note that cppunit 1.14 is libreoffice's fork. According to Wikipedia, [2] the version is used by Debian, Ubuntu, Gentoo and Arch. I believe the issue will affect other distros sooner or later.

[1] https://cgit.freedesktop.org/libreoffice/cppunit/commit/?id=c81afa737307ef525258cfae24eb3f2845ce7208
[2] https://en.wikipedia.org/wiki/CppUnit#cite_ref-6

Change History (1)

comment:1 by Tim Kosse, 7 years ago

Resolution: fixed
Status: newclosed

Thanks for reporting this.

I've committed fixes for both libfilezilla and FileZilla3.

Note: See TracTickets for help on using tickets.