develooper Front page | perl.perl5.porters | Postings from January 2013

Re: Cross-building and Makefile.SH

Thread Previous | Thread Next
From:
Jess Robinson
Date:
January 6, 2013 00:01
Subject:
Re: Cross-building and Makefile.SH
Message ID:
op.wqgqcjkj1zpo48@insel
On Sat, 05 Jan 2013 23:01:43 -0000, Neil Williams <codehelp@debian.org>  
wrote:

> On Fri, 04 Jan 2013 11:36:07 -0000
> "Jess Robinson" <castaway@desert-island.me.uk> wrote:
>
>> Hi Neil,
>>
>> My branch now has a Configure which builds a miniperl (and
>> generate_uudmap) when cross compiling, and stores the path to them as
>> "hostperl" and "hostgenerate" in the config.sh. The Makefile.SH then  
>> uses
>> them if set, instead of building, by symlinking.
>>
>> I changed how you had it a bit, as the if/else logic is now outside of  
>> the
>> makefile itself, rather than going into it.
>>
>> See attached, how does this look for you?
>
> I was very confused initially about why the Configure continually
> assumed a sysroot was in use, then I realised that your patch introduces
> a reliance on /bin/sh being /bin/bash - typically called a bashism.
>
> -    if $test "X$hostperl" == X; then
> +    if $test "X$hostperl" = X; then
>
> There is also one further up:
>
> - 	    if test "X$sysroot" == X; then
> + 	    if test "X$sysroot" = X; then
>
> The effect is that the code always assumes a sysroot and I'm not using
> one (nor am I using emulation). :-)
>
> patch attached for Configure.

Oops! Thanks! I really must get a smoke-me branch up to shake out such  
things.

> I do get an amd64 host/miniperl with these options:
>
> LINE="-Dusecrosscompile -Dcrosscompileprefix=arm-linux-gnueabi"
> LINE=" ${LINE} -Dcc=arm-linux-gnueabi-gcc "
> LINE=" ${LINE} -Dtargetarch=armel -Dusedevel -Des -d"
> ./Configure ${LINE}

For the record my current options are: ./Configure -des -Dusedevel  
-Dusecrosscompile -Dtargethost="emulator-5554" -Dtargetdir=/data/data/test  
-Dsysroot=/usr/src/android/android-ndk-r8/platforms/android-8/arch-arm/  
-Dcc=arm-linux-androideabi-gcc linux

targetarch/osname are derived from the gcc name as "linux-androideabi"  
with these settings.

I dropped crosscompileprefix again, I'm now using the branch  
https://github.com/castaway/perl/tree/jrobinson/configure-for-cross which  
doesn't have it.

> However, I don't actually get any cross-compilation in the branch - cc
> is still used instead of arm-linux-gnueabi-gcc and host/miniperl is not
> symlinked as ./miniperl (which is still an amd64 file).

Hmm, Do you have the resulting Makefile and config.sh available? It should  
set "hostperl" to be host/miniperl, which ends up in the Makefile as  
HOST_PERL, and when that's set, the MINIPERL_EXE rule should end up with  
rm $MINIPERL_EXE; ln -s $HOST_PERL $MINIPERL_EXE much like yours did.  
Maybe I have some bashisms in there too?

> In case it turns out to be helpful, build logs from my existing
> cross-builds are uploaded to:
> http://linux.codehelp.co.uk/emdebian/perl-cross-debian/
>
> perl-cross-debian has been updated but the only changes relate to how
> the Debian build handles the clean operation.

The resulting Makefile/config.sh files would be more useful.

Thanks for the testing!

Jess

Thread Previous | 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