Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > static python build?

Reply
Thread Tools

static python build?

 
 
mudd@vex.net
Guest
Posts: n/a
 
      08-06-2004
How do I build Python so that I get static libraries instead of dynamic
libraries (e.g. build/lib.solaris-2.8-sun4u-2.3/math.so)?

John


 
Reply With Quote
 
 
 
 
Michael Hudson
Guest
Posts: n/a
 
      08-06-2004
http://www.velocityreviews.com/forums/(E-Mail Removed) writes:

> How do I build Python so that I get static libraries instead of dynamic
> libraries (e.g. build/lib.solaris-2.8-sun4u-2.3/math.so)?


Edit Modules/Setup. The comments in the file should get you started.

Cheers,
mwh

--
Monte Carlo sampling is no way to understand code.
-- Gordon McMillan, comp.lang.python
 
Reply With Quote
 
 
 
 
mudd@vex.net
Guest
Posts: n/a
 
      08-06-2004
Yes, thanks!, it was easy. I just edited Modules/Setup as follows:

(1) Changed the commented *shared* line to the *static* line (see below).

(2) Uncommented the modules (math, time, array) that I wanted incorporated
into the static libpython.a library.

(3) Added lines for a couple other modules (strop & _random) that
previously weren't listed in the Setup file.

(4) Reran configure, make & make install. It works!

Now I can run freeze.py and build a truly stand-alone executable including
the modules I mentioned.



Here's a section of Modules/Setup with my changes:
--------------------------------------------------------------------------
# Uncommenting the following line tells makesetup that all following #
modules are to be built as shared libraries (see above for more
# detail; also note that *static* reverses this effect):

*static*

# Modules that should always be present (non UNIX dependent):

array arraymodule.c # array objects
#cmath cmathmodule.c # -lm # complex math library functions
math mathmodule.c # -lm # math library functions, e.g. sin()
#struct structmodule.c # binary structure packing/unpacking
time timemodule.c # -lm # time operations and variables
#operator operator.c # operator.add() and similar goodies
#_weakref _weakref.c # basic weak reference support
#_testcapi _testcapimodule.c # Python C API test module
strop stropmodule.c
_random _randommodule.c
--------------------------------------------------------------------------





> (E-Mail Removed) writes:
>
>> How do I build Python so that I get static libraries instead of dynamic

libraries (e.g. build/lib.solaris-2.8-sun4u-2.3/math.so)?
>
> Edit Modules/Setup. The comments in the file should get you started.
>
> Cheers,
> mwh
>
> --
> Monte Carlo sampling is no way to understand code.
> -- Gordon McMillan, comp.lang.python
> --
> http://mail.python.org/mailman/listinfo/python-list
>




 
Reply With Quote
 
Michael Hudson
Guest
Posts: n/a
 
      08-07-2004
(E-Mail Removed) writes:

> Yes, thanks!, it was easy. I just edited Modules/Setup as follows:
>
> (1) Changed the commented *shared* line to the *static* line (see below).
>
> (2) Uncommented the modules (math, time, array) that I wanted incorporated
> into the static libpython.a library.
>
> (3) Added lines for a couple other modules (strop & _random) that
> previously weren't listed in the Setup file.


I'm a bit surprised strop wasn't in there. _random probably should
be, too. File a bug on SF?

Cheers,
mwh

--
<washort> glyph: you're evil, too
<glyph> washort: I try
<washort> not the good kind of evil
<washort> the other kind -- from Twisted.Quotes
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PIX public/24 ip static mapping means 256 times interfaces static maps? Nieuws Xs4all Cisco 2 05-26-2005 06:25 PM
PIX public/24 ip static mapping means 256 times interfaces static maps? Nieuws Xs4all Cisco 0 05-26-2005 11:07 AM
Static is REALLY Static! Paul W ASP .Net 2 05-03-2005 10:12 AM
Static classes with static members Ben ASP .Net 3 06-01-2004 07:43 PM
Static vs. non-static connection Natan ASP .Net 8 05-26-2004 08:21 AM



Advertisments