I just spent the past couple of hours figuring out why I wasn't able to compile the Player server with plugin capabilities. It turns out that there were many intermediate steps that were axing the ability.
First obstacle: configure.ac
The autoconfigure script for the player project had a macro called AC_CHECK_LIB that checked to see if I had libltdl installed. Now, I have both libltdl for my system(system A) as well as libltdl for the target system(system B). If I want to cross-compile, then there's no way for this check to work because it tests for the existence of libraries by compiling, linking, and running a piece of test code with a particular function within the library. Since I'm compiling using B's libltdl, yet the check wants to run on architecture A, we have a problem!! To circumvent this, I simply removed the check and told the configure script to simply compile with the appropriate flags. (LIBS = -lltdl -dl $LIBS)
Second obstacle: misconfigured paths
After fixing the makefiles and ensuring the appropriate compile time flags were set, I went ahead and tried making the program only to find, Oh Noes! the program wasn't looking for libltdl in the right location. It was apparently looking for it in the standard /usr/lib/ directory. I figured this would be an easy fix as all I would have to do would be to change some path. As it turns out, I tried changing LD_LIBRARY_PATH, which on my distro of linux prepends that string to the path that ld searches. This didn't work either, and it kept insisting that libltdl was /usr/lib/libltdl.so. I was a little fed up at this point and didn't feel like reading about the intricacies of how ld caches library locations and deals with alternate scenarios like mine, so I simply made a soft link in /usr/lib to the real library that I wanted to link with.
Presto!! Out comes the beautiful binaries that I've been looking for this whole time!
Now I can finally get to testing the drivers I wrote for Player so that I can start reading range finder information over the network. Score!!!!
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment