forcing python to build a static libpython2.1.a

Michael Hudson mwh at python.net
Mon Jun 18 11:22:19 EDT 2001


Roman Milner <roman at speeder.org> writes:

> >>>>> "MH" == Michael Hudson <mwh at python.net> writes:
> 
>     MH> Roman Milner <roman at speeder.org> writes:
>     >> Is there an easy way to have the build process disable dynamic
>     >> loading? I just want a plain old static libpython2.1.a.
>     >> 
>     MH> I think the most efficuient way to do what you want is to
>     MH> uncomment the modules you want to build statically in
>     MH> Modules/Setup.  Read the comments in the top of
>     MH> Modules/Setup.dist in the source distribution for more info.
> 
> That doesn't seem to achieve what I want.  What you suggest will build
> the chosen modules statically into the python executable binary.  What
> I need is a static libpython2.1.a that I can link against other
> things.

But building python in this way produces a libpython2.1.a that
contains all the symbosl you need, doesn't it?  The final build
command is only

gcc  -Xlinker -export-dynamic -o python \
                Modules/python.o \
                libpython2.2.a -lpthread -ldl  -lutil   -lm 

after all.

Cheers,
M.

-- 
  This is not to say C++ = bad, Lisp = good.  It's to say
  C++ = bad irrespective of everything else.
                                       -- Alain Picard, comp.lang.lisp



More information about the Python-list mailing list