On Sun, 24 Jul 2005 07:27:41 -0500, aaron-XW8b5UTxoeLYtjvyW6yDsg wrote:
I'm making a new package right now. In the last email I sent you I was trying something like this, but I noticed it didn't make the package size any larger. Could that be because I didn't append version numbers to the library names in that line? How do I know when I need to do that?
OK, here's a useful bit of shell script I use:
function needed() { objdump -x $1 | grep NEEDED; }
Whack that in your ~/.bashrc or something, then you can find out what libraries a binary needs by running "needed `which .proxy.inkscape`", for instance. On my system this gives the following result:
[mike@...628... main]$ needed /usr/bin/.proxy.inkscape NEEDED libpthread.so.0 NEEDED libgtkmm-2.4.so.1 NEEDED libgdkmm-2.4.so.1 NEEDED libatkmm-1.6.so.1 NEEDED libpangomm-1.4.so.1 NEEDED libglibmm-2.4.so.1 NEEDED libgtk-x11-2.0.so.0 NEEDED libgdk-x11-2.0.so.0 NEEDED libgdk_pixbuf-2.0.so.0 NEEDED libxml2.so.2 NEEDED libsigc-2.0.so.0 NEEDED libgthread-2.0.so.0 NEEDED libpng12.so.0 NEEDED libX11.so.6 NEEDED libfontconfig.so.1 NEEDED libpangoft2-1.0.so.0 NEEDED libpango-1.0.so.0 NEEDED libgobject-2.0.so.0 NEEDED libglib-2.0.so.0 NEEDED libfreetype.so.6 NEEDED libz.so.1 NEEDED libstdc++.so.5 NEEDED libm.so.6 NEEDED libgcc_s.so.1 NEEDED libc.so.6
Incidentally, it's curious that a proxy file is generated. Normally that's only done when there's a program with that name already in the PATH. But for me there wasn't. Hmm.
Anyway. You can see here that the *mm libraries are dynamically linked. To statically link them, we firstly chop off the leading lib prefix, then drop the .so suffix and anything after that:
libgtkmm-2.4.so.1 -> gtkmm-2.4
We also need to make sure there's a .a file for everything we statically link:
[mike@...628... main]$ file /usr/lib/libgtkmm-2.4.a /usr/lib/libgtkmm-2.4.a: current ar archive
So we can statically link this by putting in gtkmm-2.4
thanks -mike