statically linking the entire runtime (HPUX Python2.1)

cmkl cmkleffner at
Thu Jun 14 17:36:09 CEST 2001

hi, is your friend! It lives in the source-code distribution
directory: ./Tools/freeze

1) You need the python sources, you need a C compiler

2) You have to build, test and install python from source

3) Somewhere in your install directory is the static
   python runtime library  libpythonxxx.a

4) copy the freeze directory somewhere
   python -h gives some help on necessary options

5) python /whateverdir/ -o mydir -e /somedir/informixdb
   will copy a lot of files in mydir/   - type 'make' there and you 
   will get your pythenabled binary

   /somedir/informixdb in this example is a directory with 
   additional objectfiles for C-modules (informixdb int his case)

6) If you are not happy with the Makefile, change

Unfortunately python2.1 comes with '', which will install
alot of C-modules as shared library. 


GADGIL PRASAD     /INFRA/INFOTECH <GADGILP at> wrote in message news:<mailman.992502501.26945.python-list at>...
> hello,
> forgive me for ignorance, but I didnt know of creating a standalone exe from
> a 
> python prog on unix, I went all the way to rewrite a python code to C prog
> cause, 
> I needed to have a binary only. I guess, FAQ doesn't mention this. Utils I
> guess
> do something similar for win platforms like py2exe which I use.
> Can a easy to follow procedure be posted by the knowledgable for those not
> very 
> proficient in handling C source compilations inolving make and whatnot.
> /prasad
> -----Original Message-----
> From: Andrew MacIntyre [mailto:andymac at]
> Sent: Wednesday, June 13, 2001 5:30 PM
> To: python-list at
> Subject: Re: statically linking the entire runtime (HPUX Python2.1)
> On 12 Jun 2001, cmkl wrote:
> > On HP-UX I'm trying to build python2.1 without building the C-modules
>  found
> > in Modules/ as shared libraries. With the Version 2.0 this was the
>  default.
> > I played around with configure, and Modules/Setup but I always
> > end up with a binary depending on various shared libraries.
> > I need this, bacause I want to freeze my pythons scripts as a single
>  binary.
> > Distribution is much easier this way.
> > What is the trick to do that?
> I don't know specifically about HP-UX, but in general:
> 1: uncomment the modules you want in Modules/Setup
> 2: comment any "*shared*" terms in Modules/Setup
> 3: don't bother with, as its only for dynload modules
> --
> Andrew I MacIntyre                     "These thoughts are mine alone..."
> E-mail: andrew.macintyre at    (work) | Snail: PO Box 370
>         andymac at  (play) |        Belconnen  ACT  2616
>         andymac at           (play2) |        Australia

More information about the Python-list mailing list