A problem linking phonon kded module

Alexander Neundorf neundorf at kde.org
Thu Jan 29 19:00:58 CET 2009


On Thursday 29 January 2009, Max Brazhnikov wrote:
> On Thu, 29 Jan 2009 12:07:51 +0100, David Faure wrote:
> > On Thursday 29 January 2009, Hasso Tepper wrote:
> > > Linking CXX shared module ../../../lib/kded_phononserver.so
> > > cd /home/kde-devel/kde/build/KDE/kdebase/runtime/phonon/kded-module
> > > && /usr/pkg/bin/cmake -E cmake_link_script
> > > CMakeFiles/kded_phononserver.dir/link.txt --verbose=1
> > > /usr/bin/c++  -fPIC  -Woverloaded-virtual -fvisibility=hidden -O2 -g
> > > -shared -Wl,-soname,kded_phononserver.so -o
> > > ../../../lib/kded_phononserver.so
> > > CMakeFiles/kded_phononserver.dir/kded_phononserver_automoc.o
> > > CMakeFiles/kded_phononserver.dir/phononserver.o
> > > CMakeFiles/kded_phononserver.dir/audiodevice.o
> > > CMakeFiles/kded_phononserver.dir/audiodeviceaccess.o
> > > CMakeFiles/kded_phononserver.dir/hardwaredatabase.o
> > > -L/home/kde-devel/kde/lib -L/usr/pkg/qt4/lib
> > > /home/kde-devel/kde/lib/libkdeui.so.5.2.0
> > > /home/kde-devel/kde/lib/libphonon.so
> > > /home/kde-devel/kde/lib/libsolid.so.4.2.0 -lpulse -lpthread
> > > /home/kde-devel/kde/lib/libkdecore.so.5.2.0
> > > /usr/pkg/qt4/lib/libQtDBus.so /usr/pkg/qt4/lib/libQtCore.so -lpthread
> > > /usr/pkg/qt4/lib/libQtSvg.so /usr/pkg/qt4/lib/libQtGui.so
> > >
> > 
> -Wl,-rpath,/home/kde-devel/kde/lib:/usr/pkg/qt4/lib::::::::::::::::::::::
> > >:: /usr/libexec/binutils217/elf/ld: cannot find -lpulse
> > >
> > > *** Error code 1
> > >
> > > $ cat CMakeCache.txt | grep ^PULSEAUDIO_
> > > PULSEAUDIO_INCLUDE_DIR:PATH=/usr/pkg/include
> > > PULSEAUDIO_LIBRARY:FILEPATH=pulse;pthread
> > > PULSEAUDIO_CFLAGS:INTERNAL=-D_REENTRANT;-I/usr/pkg/include
> > > PULSEAUDIO_CFLAGS_I:INTERNAL=
> > > PULSEAUDIO_CFLAGS_OTHER:INTERNAL=-D_REENTRANT
> > > PULSEAUDIO_FOUND:INTERNAL=1
> > > PULSEAUDIO_INCLUDEDIR:INTERNAL=/usr/pkg/include
> > > PULSEAUDIO_INCLUDE_DIRS:INTERNAL=/usr/pkg/include
> > > PULSEAUDIO_LDFLAGS:INTERNAL=-Wl,-R/usr/pkg/lib;-L/usr/pkg/lib;-lpulse;-
> > >lp thread PULSEAUDIO_LDFLAGS_OTHER:INTERNAL=-Wl,-R/usr/pkg/lib
> > > PULSEAUDIO_LIBDIR:INTERNAL=/usr/pkg/lib
> > > PULSEAUDIO_LIBRARIES:INTERNAL=pulse;pthread
> > > PULSEAUDIO_LIBRARY_DIRS:INTERNAL=/usr/pkg/lib
> >
> > Why is PULSEAUDIO_LIBRARY not set? I see that
> > kdelibs/cmake/modules/FindPulseAudio.cmake sets it. Is your kdelibs
> > uptodate?
>
> FindPulseAudio.cmake checks for pulse library via pkgconfig and sets it to
> pure 'pulse' instead of full path to library. Since FreeBSD installs 3rd
> party to /usr/local/ (or /usr/pkg/ for DragonFly), you have
> add /usr/local/lib/ to LDFLAGS. Or fix FindPulseAudio.cmake.

I haven't looked at the file yet, but it seems pkgconfig is used and the 
results are directly put into the variables.
As you see, this is bad.
Instead pkgconfig should be used only optionally, and the results should be 
used only as hints for FIND_LIBRARY/PATH/FILE/PROGRAM(). 
The variable used for pkgconfig should also have a "PC_" prefix, so they don't 
get messed up with the actual "public" variables.
See kdelibs/cmake/modules/FindLibXml2.cmake for an example.

Alex



More information about the Kde-buildsystem mailing list