[x264-devel] Re: [PATCH] crosscompilation support

Bernhard Rosenkraenzer bero at arklinux.org
Thu Oct 27 19:46:43 CEST 2005


On Thursday, 27. October 2005 18:11, Christophe Mutricy wrote:
> > +         UNAMES="`echo $CROSS | cut -d- -f3`"
>
> On the Debian Sid i have, the executables from mingw are called :
> i586-mingw32msvc-gcc, i586-mingw32msvc-ar, ...
> So we need CROSS=i586-mingw32msvc
>
> So i believe it should be cut -d- -f2.
> Or we're unlucky and other distro have another naming convention.

We need another check then...

It's not so much a distribution thing as a target thing, e.g. I typically use 
armv5tel-ark-linux-gnu-ar and friends to crosscompile from Linux x86 to Linux 
ARM.

While it isn't 100% foolproof, this should work for most common cases:

UNAMES="`echo $CROSS |cut -d- -f3`"
[ -z "$UNAMES" ] && UNAMES="`echo $CROSS |cut -d- -f2`"

This will do the right thing for e.g. i586-mingw32msvc, armv5tel-ark-linux-gnu 
and i686-ark-linux. It'll fail for stuff like armv5tel-linux-uclibc though 
(not very common, the far more common variant is 
armv5tel-SOME_DISTRO-linux-uclibc)

The only fix for that I can think of is being aware of libc identifier tags:

UNAMES="`echo $CROSS |cut -d- -f3`"
[ -z "$UNAMES" -o "$UNAMES" = "uclibc" -o "$UNAMES" = "gnu" ] && UNAMES="`echo 
$CROSS |cut -d- -f2`"

That should work for pretty much anything out there, new patch doing that is 
attached.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: x264-342-crosscompile.patch
Type: text/x-diff
Size: 7893 bytes
Desc: not available
Url : http://mailman.videolan.org/pipermail/x264-devel/attachments/20051027/d6360b59/attachment.patch 


More information about the x264-devel mailing list