Redhat .so python shared library.

Tom bondpaper at
Sun Oct 20 11:30:58 CEST 2002

In article <3daffc2e$1 at>,
 ´ÐÜøÐÝ ³. <ßÕÝÓãØÝØáâÐ@ÜÐØÛ.ÝÕâ.ÜÚ> wrote:

> >> I didn't know that this is possible. 
> >> Is it? [ Compiling python as a shared library, I mean. ]
> > What do you mean, not possible? On any system that supports shared
> > libraries, you can replace any static library with a shared library,
> > if you adjust the build process.
> I think when I tried that some years ago, it didn't work. Programs
> would not work when linked with shared python. But this was long time
> ago.

I feel silly admitting this, but a method is explained in the Python FAQ 
for converting the standard .a file into a shared library. It's not all 
that complicated, and doesn't require fiddling with the makefile. I 
discovered this after I posted my question, and it works quite nicely. 

  make distclean 
  make OPT="-fpic -O2" 
  mkdir .extract 
  (cd .extract; ar xv ../libpython1.5.a) 
  gcc -shared -o .extract/*.o 
  rm -rf .extract

It also says that a shared library will be a supported option in v2.3.


More information about the Python-list mailing list