cross-compilation

Roumen Petrov bugtrack at roumenpetrov.info
Mon Aug 18 20:53:17 EDT 2008


Martin v. Löwis wrote:
>> What about to start to resolve issues step by step ?
> 
> The first step surely should be to get the autoconf issue resolved.
> 
> I don't think distutils cross-compilation is going to work, instead,
> people wishing to cross-compile should edit Modules/Setup.
> 
> Regards,
> Martin

Please find attached file "python-2.5.2.patch-CROSS".
Note that this is "proof of concept" unified diff only for configure.in
to show only some changes required for cross-compilation:

- added macro AC_CANONICAL_HOST: this require files config.guess and
      config.sub to be copied to top source directiory. The files can be
obtained from GNU automake distribution. In my test I use files from
automake 1.10.1.

- makefile conditional: the idea is to use in makefiles. It seems to me
that build for PGEN (Parser from Makefile.pre.in) has to be suppress in
case of cross-compilation as example (without related changes):
=========
# Parser
@CROSS_OFF at PGEN=		Parser/pgen$(EXE)
=========

- search for python in build system: usually in the cross environment
we cann't run just build python executable we may use existing
interpreter as example in Makefile.pre.in:
=========
@CROSS_ON at RUNPYTHON=	HOST_OS=@HOST_OS@ @SYSPYTHON@
@CROSS_OFF at RUNPYTHON=	$(RUNSHARED) ./$(BUILDPYTHON)
=========

- $ac_sys_system vs $host: the attached diff show how to detect host
system. The existing detection (variable $ac_sys_system) isn't suitable
for cross-environment.

- ar program : macro AC_CHECK_TOOLS replace AC_CHECK_PROGS. for more
details see autoconf texinfo page.

- detection of files: skip detection in cross-env. and by default assume
    that file don't exists. This is minimal change and I think that we
has to use macro AC_CHECK_FILE and in cross-env. to warn user but this
require more changes.

- creation of files from configure script (note this is not related
directly to cross compilation): the script is changed to use macros
AC_CONFIG_COMMANDS{_PRE}, i.e. more autoconf friendly.


I would like to know what is acceptable for above changes ?
(note that changes for mingw are only to show idea how to get host
system and i will exclude from final patch ).


Also how to proceed ?
Must I open new issue and to mark that as example 1597850 depend from
new one ?
What is preferred patch: against trunk, release2.5 or both ?


Roumen


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: python-2.5.2.patch-CROSS
URL: <http://mail.python.org/pipermail/python-list/attachments/20080819/b447d0b9/attachment-0001.ksh>


More information about the Python-list mailing list