Library querying

Discuss Programming

Library querying

Postby worker201 » Wed Aug 25, 2004 1:37 pm

I have this open-source program called gaim (maybe you've heard of it?) and I want to do a resource port to OSX. For more information as to how this is done, check out gimp.app at gimp.org - the gimp port works dandy. I have all the dependencies for gaim installed (fontconfig was the worst). Now I want to bundle up all the libraries so I can use it natively on the Mac.

My question is this - even though I installed Pango and ATK and all that other stuff, I probably don't need every single library, right? So how can I find out which ones gaim uses, and which ones it ignores? Is there a way to find this out? Where exactly in the code might this information be available? I mean, I guess I could go through every single include line in every single file of the source, but there has got to be an easier way.
worker201
guru
guru
 
Posts: 668
Joined: Sun Jun 13, 2004 6:38 pm
Location: Hawaii

Postby Void Main » Wed Aug 25, 2004 2:29 pm

ldd `which gaim`

Better yet, if you statically link it there will be no shared libraries, everything needed will be right in the gaim binary. Not sure what this has to do with Linux though...
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby worker201 » Wed Aug 25, 2004 4:20 pm

Well, it's true that OSX is not totally open source. But it is based on OpenBSD, and I do a lot of work with tcsh, and I have compiled all of my libraries/tools from source. Most Mac forums/users out there ignore the beauty and usefulness of the BSD subsystem, and it is difficult to find help from them concerning things like this, which have more to do with *nix heritage than Apple. I've tried to keep my Apple questions to a minimum, but feel free to delete this thread if you need to.
worker201
guru
guru
 
Posts: 668
Joined: Sun Jun 13, 2004 6:38 pm
Location: Hawaii

Postby Void Main » Wed Aug 25, 2004 4:58 pm

I won't delete it, especially since this forum doesn's say "Linux programming". I do try and keep it related to Linux only though (and by Linux I mean free/Free Linux or Linux based distros and not "open source" or "BSD" or "UNIX"). Is the "ldd" command what you were looking for or did I misunderstand the question?
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby worker201 » Wed Aug 25, 2004 5:27 pm

ldd /usr/bin/gaim worked just fine, and gave me exactly what I was looking for. Maybe not good news...

So the command I tried first was the one you suggested, which I read as ldd 'which gaim' , which totally did not work. Can you please explain what this which thing is all about? I assume it works kinda like a built-in whereis, which is how I ended up getting the path.

Thanks for the command.
worker201
guru
guru
 
Posts: 668
Joined: Sun Jun 13, 2004 6:38 pm
Location: Hawaii

Postby Tux » Wed Aug 25, 2004 5:35 pm

They were backticks, that''s why it didn't work.
Watch out for that one :)

A command in backticks returns the value of this command.
eg. if I do echo "Time is `date`" now it will output:

Time is Thu Aug 26 00:33:57 BST 2004
Tux
guru
guru
 
Posts: 689
Joined: Wed Jan 08, 2003 10:40 am

Postby Void Main » Wed Aug 25, 2004 5:46 pm

Yeah, Tux is right, those were backticks (`) not ('). Also both "which" and "whereis" are external commands /usr/bin/which and /usr/bin/whereis. "which" has been around a lot longer and is more common, but they do actually behave differently. If I want to search outside my PATH I like to use the locate command.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby worker201 » Thu Aug 26, 2004 4:51 pm

Okay, one of the libraries gaim is currently using on FC2 is supposedly called linux-gate.so.1, and I cannot seem to find this anywhere on my system. Googling for information about this library turned up very, very little. Anybody familiar with this library, what it does, and where it can be found? What (if any) package would it come with?
worker201
guru
guru
 
Posts: 668
Joined: Sun Jun 13, 2004 6:38 pm
Location: Hawaii

Postby Void Main » Thu Aug 26, 2004 5:55 pm

That appears to be a special shared object within the kernel (not an actual library file):

http://kerneltrap.org/node/view/3405
http://lkml.org/lkml/2003/6/18/156
http://bugzilla.redhat.com/bugzilla/sho ... ?id=107528
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby worker201 » Thu Aug 26, 2004 8:44 pm

Hopefully, that means that gaim calls it only because it was compiled in and/or for Linux. Hopefully, compiling it on PPC Darwin will not create any serious difficulties. Nothing was mentioned in my previous compiles - it had so many dependencies to complain about, it didn't bother, I guess. Either that, or I am off the hook.

So what exactly is this kernel space, and why does gaim need to get at it? Sorry for all these questions, but I like good solid answers (unless they involve math that is way over my head). "The more you know..." and such.

Thanks again.
worker201
guru
guru
 
Posts: 668
Joined: Sun Jun 13, 2004 6:38 pm
Location: Hawaii

Postby Void Main » Thu Aug 26, 2004 9:00 pm

To be honest I don't really know what that linux-gate.so does. I am pretty sure it is something very recently added because I have never seen anything out of it before. You are right that there isn't much on Google about it so the best place to get good hard facts about it would be on the LKML. I would do much better with a math question. :)

Here's a thread on where the name came from:
http://www.uwsg.iu.edu/hypermail/linux/ ... /0674.html

You might have better luck researching Linux and "DSO". This isn't something that you write into your program, the linker adds it in automatically (I assume). Surely when you compile the app on another platform the linker would not add "linux-gate.so.1". It would be nice to find a nice definitive explanation of it though.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby worker201 » Thu Aug 26, 2004 9:43 pm

Someday, I hope there is some giant Linux library, that tells you everything about everything. Kinda like www.tldp.org, but with ten million terrabytes of info, just waiting to be perused. Kind of a big project, though, finding a maintainer might be tricky. :wink:
worker201
guru
guru
 
Posts: 668
Joined: Sun Jun 13, 2004 6:38 pm
Location: Hawaii


Return to Programming

Who is online

Users browsing this forum: No registered users and 2 guests