develooper Front page | perl.perl5.porters | Postings from December 2012

Cross-building and Makefile.SH

Thread Next
From:
Neil Williams
Date:
December 13, 2012 13:32
Subject:
Cross-building and Makefile.SH
Message ID:
20121213133232.05e7776757089394ba8203dd@debian.org
There is outline cross-build support already in perl but this appears
outdated. In Debian, I've been working on updating the existing
cross-building support from old versions of perl to the current major
release. The principle need is to support porting perl to new
architectures where an initial cross-build is necessary to provide a
platform to prepare a native build environment, not just for perl but
for a full bootstrap environment.

https://github.com/codehelp/perl-cross-debian

The only upstream change is for Makefile.SH :

https://github.com/codehelp/perl-cross-debian/blob/master/patches/5.14.2/cross-Makefile.diff

This patch was developed for perl 5.12 and I've applied it to 5.14 and
5.16 with successful results.

The hard part is that full testing of a cross-build depends on the full
distro configuration, so doing a full test of the patch on 5.17 isn't
simple.

The history of these patches in Debian is recorded in #633884 and the
related #285559: 
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=633884
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=285559

The principle emphasis is to allow the use of the host perl interpreter
instead of miniperl and is activated simply by passing an environment
variable to $(MAKE) with the path to the native perl interpreter.

To actually make the cross-compile work, the config.h and config.sh
files need to be cached from a native build for the same architecture
or ported from a similar architecture and for each variant of the perl
build: static, debug and shared. This stage is highly
configuration-dependent and I've only done this stage for the Debian
configuration.

This part of the work is done by a separate package - perl-cross-debian
- which I will be maintaining for Debian. I'm hoping that the data
collected by the long term maintenance of cross-building support for
perl in Debian will help others use similar mechanisms for other
distributions.

I'm willing to provide documentation, if appropriate.

Would these changes be suitable for the next perl major release?

-- 


Neil Williams
=============
codehelp@debian.org
http://www.linux.codehelp.co.uk/


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About