[Ffmpeg-devel] proposed configure patch for better detection of cross-platform compilers

Panayotis Katsaloulis panayotis
Mon Mar 6 23:37:47 CET 2006

On 3/4/06, Diego Biurrun <diego at biurrun.de> wrote:
> On Wed, Mar 01, 2006 at 02:42:25PM +0200, Panayotis Katsaloulis wrote:
> > 2006/3/1, Diego Biurrun <diego at biurrun.de>:
> > > You have the patch reversed.  Please create it with 'cvs diff -u' and
> > > resend it as attachment.
> >
> > Right, here it is.
> This won't work.
> +if test -z "$cross_prefix" ; then
> -if test -z "$cross_prefix" -a "$cpu" = "`uname -m`"; then
> $cpu is derived from `uname -m` on line 129ff, but in most cases the

Yes, I've seen this line

> value stored in $cpu and the output of `uname -m` are not identical.
> What exactly are you trying to accomplish?

The idea is this:

The script is trying originally to find out if the user wants to use a
cross platform enviromnet. If it doesn't then the script checks if the
current system is big endian or not.
If it does it performs a wild guess whether the target environment is
cross platform or not.

Up to this point everyting is OK.

The error is in the way the script tries to guess if a cross platform
development environment is used. The method is "optimized" only for
the mingw compiler (as much as I could understand). It only checks if
there is a cross prefix or not.

Unfortunately it ignores the more common argument "-arch" of GCC. So,
if someone wants to build a cross platform executable in a
endian-different environment, the build is succesfull but the produced
binary is wrong.

** What I am proposing **

Since this test only checks for the endianess of the target platform,
if the target platform is different than the "required" one, then just
go for the wild guess. Only if the cpu equals the current cpu perform
the actual test.
Since x86 is little endian and the default is little endian, I suspect
this approach is somewhat safe.

On the other hand I could have made a more sophisticated patch which
deals more properly with this issue (checking if really a cross
platform is used, with more variables dedicated for this issue or even
a new config parameter) but this I thought might be less acceptable.

What do you think about it?


More information about the ffmpeg-devel mailing list