[x264-devel] [PATCH] Fix build on Solaris 10 SPARC

Måns Rullgård mans at mansr.com
Sat Nov 20 12:13:15 CET 2010


Sean McGovern <gseanmcg at gmail.com> writes:

>  echo "int i = 0x42494745; double f = 0x1.0656e6469616ep+102;" > conftest.c
>  $CC $CFLAGS conftest.c -c -o conftest.o 2>$DEVNULL || die "endian test failed"
> -if grep -q BIGE conftest.o && grep -q FPendian conftest.o ; then
> +if (strings -a conftest.o | grep -q BIGE) && (strings -a conftest.o | grep -q FPendian) ; then
>      define WORDS_BIGENDIAN
> -elif !(grep -q EGIB conftest.o && grep -q naidnePF conftest.o) ; then
> +elif !(strings -a conftest.o | grep -q EGIB && strings -a conftest.o | grep -q naidnePF) ; then
>      die "endian test failed"
>  fi

I remember encountering some system where this didn't work.
Unfortunately, I don't remember which one.  It has to do with this
part of the 'strings' spec:

  A printable string is any sequence of four (by default) or more
  printable characters terminated by a <newline> or NUL character.

You can't be certain that the test word will be followed by a zero.

-- 
Måns Rullgård
mans at mansr.com


More information about the x264-devel mailing list