Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

forcing python to build a static libpython2.1.a

1 view
Skip to first unread message

Roman Milner

unread,
Jun 17, 2001, 12:05:53 AM6/17/01
to
Is there an easy way to have the build process disable dynamic
loading? I just want a plain old static libpython2.1.a.

I've been able to build a static lib, but only by manually creating
one after the python build process. I'm looking for a configure
switch (that I haven't been able to find) or something similar, that
will do this for me.

Thanks,
^Roman

Michael Hudson

unread,
Jun 17, 2001, 5:05:34 AM6/17/01
to
Roman Milner <ro...@speeder.org> writes:

I think the most efficuient way to do what you want is to uncomment
the modules you want to build statically in Modules/Setup. Read the
comments in the top of Modules/Setup.dist in the source distribution
for more info.

Cheers,
M.

--
My hat is lined with tinfoil for protection in the unlikely event
that the droid gets his PowerPoint presentation working.
-- Alan W. Frame, alt.sysadmin.recovery

Roman Milner

unread,
Jun 17, 2001, 11:16:41 PM6/17/01
to
>>>>> "MH" == Michael Hudson <m...@python.net> writes:

MH> Roman Milner <ro...@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.

^Roman

Michael Hudson

unread,
Jun 18, 2001, 11:22:19 AM6/18/01
to
Roman Milner <ro...@speeder.org> writes:

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

0 new messages