Project Home
Project Home
Source Code
Source Code
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - How to cross-compile python24 for qnx-ppc using pkgsrc: (6 Items)
   
How to cross-compile python24 for qnx-ppc using pkgsrc  
Hi,

I was able to build python24 successfully on self-hosted QNX-x86.  Now I need to cross-compile it for QNX-ppc.  The self
-hosted QNX-x86 is preinstalled with QNX toolchain to cross-compile to QNX-ppc.  I would appreciate any info/tips for 
cross-compiling using pkgsrc.
Re: How to cross-compile python24 for qnx-ppc using pkgsrc  
By understanding the pkgsrc build process I was able to figure out what to modify to be able to cross-compile to a 
different target architecture.  Now, I'm able to cross-compile Python-2.4.4 to QNX powerpc.
RE: How to cross-compile python24 for qnx-ppc using pkgsrc  
It would be great if you could let us know what changes you made to get the cross-compiling working for you.

   Thanks!
      Robert.

-----Original Message-----
From: Wilson Talaugon [mailto:community-noreply@qnx.com]
Sent: Sun 7/27/2008 6:05 PM
To: general-pkgsrc
Subject: Re: How to cross-compile python24 for qnx-ppc using pkgsrc
 
By understanding the pkgsrc build process I was able to figure out what to modify to be able to cross-compile to a 
different target architecture.  Now, I'm able to cross-compile Python-2.4.4 to QNX powerpc.

_______________________________________________
General
http://community.qnx.com/sf/go/post11123


Attachment: Text winmail.dat 2.75 KB
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.
Attachment: Text Makefile 37.59 KB
RE: RE: How to cross-compile python24 for qnx-ppc using pkgsrc  
Hi Wilson:
	Thanks very much for the description!  Cross-compilation is one
of the things that we are intending to support at some point in the
future but we just don't have the people to dig into it with right now.
It's great to know that it can be done and having this information
available for others to work with is invaluable.

	Robert.

-----Original Message-----
From: Wilson Talaugon [mailto:community-noreply@qnx.com] 
Sent: Monday, July 28, 2008 2:25 PM
To: general-pkgsrc
Subject: 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.


_______________________________________________
General
http://community.qnx.com/sf/go/post11162
Re: RE: How to cross-compile python24 for qnx-ppc using pkgsrc  
I know this is a very old post, could I have a binary of the python for PPC?

> 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.