Building python extensions

J

Jrod

Lets say I compile python 2.6.1 without readline support due to not
having the readline headers installed prior. Is there a standard way to
recompile the extension without having to rebuild the entire source.
Looking at the makefile, I found the gcc line (modified to dump the
relocatable in the source root ):

$ gcc -pthread -fPIC -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall
-Wstrict-prototypes -I. -I/py/site/Python-2.6.1/./Include -I. -IInclude
-I./Include -I/usr/local/include -I/py/site/Python-2.6.1/Include
-I/py/site/Python-2.6.1 -c /py/site/Python-2.6.1/Modules/readline.c -o
build/temp.linux-x86_64-2.6/py/site/Python-2.6.1/Modules/readline.o -o
readline.so

This works (cp -av readline.so /py/2.6.1/lib/python2.6/lib-dynload/),
but is less than ideal. Maybe I am missing something in the docs? In php
there is phpize, is there something like this for python?

'python setup.py build' builds all the extensions in Modules/

This is my first time posting here and I am pretty new to python, so
pardon me if my my logic is a bit off. I love reading, so feel free to
link to the relevant documentation :)

Jrod
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top