Author lambacck
Recipients Arfrever, brett.cannon, eric.araujo, georg.brandl, jwilk, jyasskin, lambacck, lemburg, loewis, lukasz.langa, marienz, mark.dickinson, nyogtha, pitrou, ronaldoussoren, rpetrov, skrah, tarek, vaxhacker
Date 2011-02-07.22:25:23
SpamBayes Score 1.58085e-12
Marked as misclassified No
Message-id <1297117529.15.0.087707557401.issue969718@psf.upfronthosting.co.za>
In-reply-to
Content
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/
History
Date User Action Args
2011-02-07 22:25:29lambaccksetrecipients: + lambacck, lemburg, loewis, brett.cannon, georg.brandl, ronaldoussoren, mark.dickinson, vaxhacker, nyogtha, marienz, pitrou, jyasskin, tarek, jwilk, eric.araujo, rpetrov, Arfrever, skrah, lukasz.langa
2011-02-07 22:25:29lambaccksetmessageid: <1297117529.15.0.087707557401.issue969718@psf.upfronthosting.co.za>
2011-02-07 22:25:23lambaccklinkissue969718 messages
2011-02-07 22:25:23lambacckcreate