From 573314cce458b5689aa768a4667927b5affdf0f8 Mon Sep 17 00:00:00 2001 From: Loren Merritt Date: Sun, 27 Jan 2008 09:11:01 +0000 Subject: [PATCH] configure test for endianness git-svn-id: svn://svn.videolan.org/x264/trunk@722 df754926-b1dd-0310-bc7b-ec298dee348c --- configure | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/configure b/configure index aff77e9a..6f82da2f 100755 --- a/configure +++ b/configure @@ -25,27 +25,23 @@ exit 1 fi cc_check() { - rm -f conftest* cat > conftest.c << EOF #include <$1> int main () { $3 return 0; } EOF $CC conftest.c $CFLAGS $LDFLAGS $2 -o conftest 2>$DEVNULL TMP="$?" - rm -f conftest* return $TMP } as_check() { - rm -f conftest* echo "$1" > conftest.asm $AS conftest.asm $ASFLAGS $2 -o conftest.o 2>$DEVNULL TMP="$?" - rm -f conftest* return $TMP } -rm -f config.h config.mak x264.pc +rm -f config.h config.mak x264.pc conftest* prefix='/usr/local' exec_prefix='${prefix}' @@ -335,6 +331,10 @@ fi CFLAGS="$CFLAGS -DARCH_$ARCH -DSYS_$SYS" +echo "unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';" > conftest.c +$CC $CFLAGS conftest.c -c -o conftest.o 2>$DEVNULL || die "endian test failed" +grep -q BIGE conftest.o && CFLAGS="$CFLAGS -DWORDS_BIGENDIAN" + # autodetect options that weren't forced nor disabled libpthread="" @@ -418,6 +418,8 @@ elif cc_check "stdio.h" "" "fseeko64(stdin,0,0);" ; then echo "#define ftell ftello64" >> config.h fi +rm -f conftest* + # generate config files cat > config.mak << EOF -- 2.47.3