[Distutils] freebsd .a files

M.-A. Lemburg mal@lemburg.com
Thu Jan 25 12:21:00 2001

Robin Becker wrote:
> In article <3A70387D.9E87B195@lemburg.com>, M.-A. Lemburg
> <mal@lemburg.com> writes
> >Robin Becker wrote:
> >>
> >> How do I specify a static library. I have libraries=['gd'], but I don't
> >> seem to load symbols from libgd.a instead I have to use
> >> libraries=['libgd.a'] is that right?
> >
> >No, you should use the first variant. The compiler will then either
> >take the correspopnding .so file or .a file with a preference for the
> >shared object file (at least that's what gcc does).
> >
> >See distutils/ccompiler.py for details.
> >
> >In general it is a better idea to link to shared libs since these
> >provide more flexibility on the user side.
> >
> Well when I'm using the first form I don't seem to get the relevant
> things included in my final shared object. I use nm -a and the thinsg
> that would come from libgd.a are marked U (ie undefined). 

That's because the linker put a reference to the shared
lib libgd.so into the final shared object.

ldd ./module.so

will show where the dynamic linker looks for the libgd.so file.

> Our ISP
> changed up to 4.1.1 FreeBSD and now I'm having lot's of problems.

Ah, so you do want to link using the static lib ? This should
be possible by placing the 'libgd.a' into the objects option:

	objects = ['libgd.a']

Marc-Andre Lemburg
Company:                                        http://www.egenix.com/
Consulting:                                    http://www.lemburg.com/
Python Pages:                           http://www.lemburg.com/python/