Chris Lambacher <ch...@kateandchris.net> added the comment:

Antoine said:
> I don't understand how you can cross-compile using the host Python
> Makefile. Could you explain?

The get_config_vars() function parses the host Makefile to get the values that 
we are discussing overriding.

> EXTRA_CFLAGS is not defined in the Makefile so it would probably be
> taken from the environment anyway (if my understand of Makefiles is
> right). That seems to explain the name "EXTRA_CFLAGS", but I'm no
> specialist of the jungle that have building systems become under Unix.

You are correct, EXTRA_CFLAGS is not in the Makefile, but does provide us with 
an expected order of evaluation. i.e. Distutils is generating the equivalent 
command lines from the pieces and we should be respecting the Makefile order 
for consistency. Also, I don't know if there is a way to insert EXTRA_CFLAGS as 
an option to the ./configure script when Python is built such that it shows up 
in the resulting Makefile. If there is no way to get EXTRA_CFLAGS into the 
Makefile, then we should take it entirely out of the equation in the 
construction of the cflags var. 

Stephan Said:
> Just out of curiosity: You are cross-compiling a C-extension? How can
> you be sure that all values in pyconfig.h are correct?
That is the whole point of this discussion, if you can sub out the build 
parameters, you can insert the path to the .h files for the embedded target 
before any host specific .h files.

In order to build a C extension, you pretty much have to do it through 
Distutils and therefore the host python interpreter or else do a lot of extra 
work to get the right settings for each individual extension.
See the following for some basic how-to info: 
http://whatschrisdoing.com/blog/2006/10/06/howto-cross-compile-python-25/
http://whatschrisdoing.com/blog/2009/10/16/cross-compiling-python-extensions/

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue969718>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to