Wilson Talaugon
|
Re: RE: How to cross-compile python24 for qnx-ppc using pkgsrc
|
Wilson Talaugon
07/28/2008 2:24 PM
post11162
|
Re: RE: How to cross-compile python24 for qnx-ppc using pkgsrc
Hi Robert,
I make modifications every time I encounter a build problem. Cross-compiling python is a bit tricky. It has 2-stage
build process - it first builds the python interpreter and then invokes the built python binary executable to run the
setup.py python script to build the extension modules. The problem here is that the python executable is the cross-
compiled for ppc which will not run on the self-hosted machine. You have to change the Makefile to use the python for
qnx-x86. I haven't done the proper changes to be able to do a fresh build since my initial goal so to be able build
something that I can run. Here's what I did as far as I can remember:
1. You have to build & install python first natively on qnx-x86 self-hosted. This will be installed in /usr/pkg/bin & /
usr/pkg/lib. Make sure you set your default compiler to qcc. Add the following line in /usr/pkg/etc/mk.conf
configuration file.
PKGSRC_COMPILER= qcc
2. Delete the previously configured & built python using "bmake clean".
3. Reconfigure python source using "bmake configure".
4. Make some changes in the Makefile to cross-compile to ppc. You can use the attached Makefile as a reference.
Summary of the changes:
a. Changed the compiler to cross-compiler. From "qcc" to "qcc -V3.3.5,gcc_ntoppcbe".
b. Changed the default installation directory from "/usr/pkg/src/" to "/staging/usr/pkg/src".
c. Changed the default python call from "./python" to "python". This will run the native python instead of the
cross-compiled python.
5. Modify python24/work/Python-2.4.4/.gcc/bin/qcc with the ff:
exec /usr/qnx630/host/qnx6/x86/usr/bin/qcc -V3.3.5,gcc_ntoppcbe "$@"
6. Build & install python using "bmake install".
If anybody wants the pre-compiled binaries I can provide them in a tarball as well.
|
|
|