[FFmpeg-devel] [PATCH] Fix big/little endian check in configure (broken on Mac OS X)

Ivan Kalvachev ikalvachev
Fri Mar 14 02:23:36 CET 2008


On Fri, Mar 14, 2008 at 1:32 AM, M?ns Rullg?rd <mans at mansr.com> wrote:
>
> Patrice Bensoussan <patrice.bensoussan at free.fr> writes:
>
>  > On 13 Mar 2008, at 23:11, M?ns Rullg?rd wrote:
>  >
>  >> Patrice Bensoussan <patrice.bensoussan at free.fr> writes:
>  >>
>  >>> On 13 Mar 2008, at 22:59, M?ns Rullg?rd wrote:
>  >>>
>  >>>> Patrice Bensoussan <patrice.bensoussan at free.fr> writes:
>  >>>>
>  >>>>> On 13 Mar 2008, at 22:35, M?ns Rullg?rd wrote:
>  >>>>>
>  >>>>>> Patrice Bensoussan <patrice.bensoussan at free.fr> writes:
>  >>>>>>
>  >>>>>>> Hello,
>  >>>>>>>
>  >>>>>>> It seems the endian check in configure has been broken on Mac
>  >>>>>>> OS X
>  >>>>>>> (tr
>  >>>>>>> doesn't seem to like binary files). Here is a fix which should
>  >>>>>>> hopefully work everywhere...
>  >>>>>>>
>  >>>>>>> Patrice
>  >>>>>>>
>  >>>>>>> Index: configure
>  >>>>>>> =
>  >>>>>>> =
>  >>>>>>> =================================================================
>  >>>>>>> --- configure   (revision 12435)
>  >>>>>>> +++ configure   (working copy)
>  >>>>>>> @@ -1563,9 +1563,9 @@
>  >>>>>>> # ---
>  >>>>>>> # big/little-endian test
>  >>>>>>> check_cc <<EOF || die "endian test failed"
>  >>>>>>> -unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
>  >>>>>>> +unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8;
>  >>>>>>> EOF
>  >>>>>>> -tr -c -d BIGE < $TMPO | grep -q BIGE && enable bigendian
>  >>>>>>> +strings -n 3 $TMPO | grep -q BIG && enable bigendian
>  >>>>>>
>  >>>>>> It used to be like that, and broke horribly on some systems.
>  >>>>>
>  >>>>> Do you remember what was the issue? (btw sorry, I missed the
>  >>>>> related
>  >>>>> thread on solaris, altough grep seems to be the issue and not tr as
>  >>>>> on
>  >>>>> Mac OS X).
>  >>>>
>  >>>> It was something about strings only printing things that looked like
>  >>>> actual null-terminated strings.
>  >>>>
>  >>>> Anyhow, I've committed an alternate fix.  Please report any
>  >>>> malfunction.
>  >>>
>  >>> Your fix is still broken on Mac OS X.
>  >>
>  >> Details, please.
>  >>
>  >
>  > It seems od outputs 2 spaces between each hex number on Mac OS X.
>
>  Should be fixed.

How about have 2 test, one for big and one for little endian.
If both test fail, then it is almost sure the check is wrong :)




More information about the ffmpeg-devel mailing list