From ee75acd55e1a89eb9a8c2f7d14c923b57e08ceb3 Mon Sep 17 00:00:00 2001 From: Sean McGovern Date: Sun, 10 Oct 2010 19:34:18 -0400 Subject: [PATCH] Fix build on SPARC Solaris 10 --- common/pixel.c | 6 +++--- configure | 29 +++++++++++++++++------------ 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/common/pixel.c b/common/pixel.c index 1e215500..7fa497c7 100644 --- a/common/pixel.c +++ b/common/pixel.c @@ -36,7 +36,7 @@ #if ARCH_ARM # include "arm/pixel.h" #endif -#if ARCH_UltraSparc +#if ARCH_UltraSPARC # include "sparc/pixel.h" #endif @@ -443,7 +443,7 @@ SAD_X( 4x8 ) SAD_X( 4x4 ) #if !HIGH_BIT_DEPTH -#if ARCH_UltraSparc +#if ARCH_UltraSPARC SAD_X( 16x16_vis ) SAD_X( 16x8_vis ) SAD_X( 8x16_vis ) @@ -1063,7 +1063,7 @@ void x264_pixel_init( int cpu, x264_pixel_function_t *pixf ) } #endif #if !HIGH_BIT_DEPTH -#if ARCH_UltraSparc +#if ARCH_UltraSPARC INIT4( sad, _vis ); INIT4( sad_x3, _vis ); INIT4( sad_x4, _vis ); diff --git a/configure b/configure index 2f381546..fd623375 100755 --- a/configure +++ b/configure @@ -392,15 +392,20 @@ case $host_cpu in fi ;; sparc) - if [ $asm = auto ] && test "$(uname -m)" = "sun4u"; then - ARCH="UltraSparc" - CFLAGS="$CFLAGS -mcpu=ultrasparc" - LDFLAGS="$LDFLAGS -mcpu=ultrasparc" - AS="${AS-${cross_prefix}as}" - ASFLAGS="$ASFLAGS -xarch=v8plusa" - else - ARCH="Sparc" - fi + ARCH="SPARC" + case $(uname -m) in + sun4u|sun4v) + if [ $asm = auto ]; then + ARCH="UltraSPARC" + if ! echo $CFLAGS | grep -Eq '\-mcpu' ; then + CFLAGS="$CFLAGS -mcpu=ultrasparc" + LDFLAGS="$LDFLAGS -mcpu=ultrasparc" + fi + AS="${AS-${cross_prefix}as}" + ASFLAGS="$ASFLAGS -xarch=v8plusa" + fi + ;; + esac ;; mips|mipsel|mips64|mips64el) ARCH="MIPS" @@ -497,11 +502,11 @@ fi define ARCH_$ARCH define SYS_$SYS -echo "int i = 0x42494745; double f = 0x1.0656e6469616ep+102;" > conftest.c +echo "int i[2] = {0x42494745,0}; double f[2] = {0x1.0656e6469616ep+102,0};" > 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 -- 2.47.3