Build ONLY python interpreter
Hi,
I am using ubuntu hardy and python 2.6.5 (built from sources). For a custom python packager I need to rebuild python interpreter (python executable). I am new to linux and don't have much knowledge of gcc and other stuff. Here is the process: 1. Copy python.c as myapp.c. myapp.c is in the same directory (python2.6.5) in which I have all the required files. 2. Using the syntax from makefile of python sources, here is my first command to produce myapp.o Code:
gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -IInclude -I/home/zeno/installed/Python-2.6.5/Include -fPIC -DPy_BUILD_CORE -c myapp.c -o myapp.o Code:
myapp.c:24:2: warning: no newline at end of file Code:
gcc -pthread -Xlinker -export-dynamic -o $@ myapp.o -L. -lpython2.6 -lpthread -ldl -lutil -lm -o myapp Code:
/usr/lib/gcc/i486-linux-gnu/4.2.4/../../../../lib/crt1.o: In function `_start': BTW, here is myapp.c. It's a copy of python.c Code:
/* Minimal main program -- everything is loaded from the library */ Prashant |
Make sure you have build-essential installed. You may also need various -dev packages.
Generally, I'd recommend against using gcc directly on someone else's project. Usually "./configure.sh" and "make test" suffice. It sounds like you might be using a tutorial somewhere. If so, it might help if you shared it. Virtualenv is another tool that you might find interesting. It can be used to distribute the python interpreter, along with system and site packages. This eliminates many (but not all) system dependencies. It does eliminate any dependencies on the local python installation. (I haven't used it directly, but have relied on it as part of the go-pylons.py script.) |
All times are GMT -5. The time now is 03:33 PM. |