# HG changeset patch # User diego # Date 1092496659 0 # Node ID adb93ef6b07fe75280fe54fff4732635d29f9860 # Parent 5b9c594dc6e97f7ca3f2ce674d03854ea49b4e98 Improved SPARC CPU detection and SPARC compilation fixes. patch by jb13@gomerbud.com diff -r 5b9c594dc6e9 -r adb93ef6b07f configure --- a/configure Sat Aug 14 10:03:26 2004 +0000 +++ b/configure Sat Aug 14 15:17:39 2004 +0000 @@ -449,7 +449,8 @@ x86_64|amd64) host_arch=x86_64 ;; macppc|ppc) host_arch=ppc ;; alpha) host_arch=alpha ;; - sparc*) host_arch=sparc ;; + sparc) host_arch=sparc ;; + sparc64) host_arch=sparc64 ;; parisc*|hppa*|9000*) host_arch=hppa ;; arm*) host_arch=arm ;; s390) host_arch=s390 ;; @@ -885,7 +886,33 @@ _def_arch='#define ARCH_SPARC 1' _target_arch='TARGET_ARCH_SPARC = yes' iproc='sparc' - proc='v8' + if sunos ; then + echocheck "CPU type" + karch=`uname -m` + case "`echo $karch`" in + sun4) proc=v7 ;; + sun4c) proc=v7 ;; + sun4d) proc=v8 ;; + sun4m) proc=v8 ;; + sun4u) proc=v9 _vis='yes' _def_vis='#define HAVE_VIS = yes' ;; + *) ;; + esac + echores "$proc" + else + proc=v8 + fi + _march='' + _mcpu="-mcpu=$proc" + _optimizing="$proc" + ;; + + sparc64) + _def_arch='#define ARCH_SPARC 1' + _target_arch='TARGET_ARCH_SPARC = yes' + _vis='yes' + _def_vis='#define HAVE_VIS = yes' + iproc='sparc' + proc='v9' _march='' _mcpu="-mcpu=$proc" _optimizing="$proc" @@ -6265,6 +6292,7 @@ TARGET_3DNOWEX = $_3dnowex TARGET_SSE = $_sse TARGET_ALTIVEC = $_altivec +TARGET_VIS = $_vis # --- GUI stuff --- GTKLIB = $_ld_static $_ld_gtk @@ -6820,6 +6848,7 @@ $_def_mlib // Sun mediaLib, available only on solaris +$_def_vis // only define if you have VIS ( ultrasparc ) /* libmpeg2 uses a different feature test macro for mediaLib */ #ifdef HAVE_MLIB diff -r 5b9c594dc6e9 -r adb93ef6b07f libmpeg2/Makefile --- a/libmpeg2/Makefile Sat Aug 14 10:03:26 2004 +0000 +++ b/libmpeg2/Makefile Sat Aug 14 15:17:39 2004 +0000 @@ -13,6 +13,10 @@ SRCS += motion_comp_altivec.c idct_altivec.c endif +ifeq ($(TARGET_VIS),yes) +SRCS += motion_comp_vis.c +endif + .SUFFIXES: .c .o # .PHONY: all clean diff -r 5b9c594dc6e9 -r adb93ef6b07f libmpeg2/cpu_accel.c --- a/libmpeg2/cpu_accel.c Sat Aug 14 10:03:26 2004 +0000 +++ b/libmpeg2/cpu_accel.c Sat Aug 14 15:17:39 2004 +0000 @@ -108,7 +108,7 @@ } #endif /* ARCH_X86 */ -#if defined(ARCH_PPC) || defined(ARCH_SPARC) +#if defined(ARCH_PPC) || (defined(ARCH_SPARC) && defined(HAVE_VIS)) #include #include diff -r 5b9c594dc6e9 -r adb93ef6b07f libmpeg2/motion_comp.c --- a/libmpeg2/motion_comp.c Sat Aug 14 10:03:26 2004 +0000 +++ b/libmpeg2/motion_comp.c Sat Aug 14 15:17:39 2004 +0000 @@ -55,10 +55,12 @@ else #endif #ifdef ARCH_SPARC +#ifdef HAVE_VIS if (accel & MPEG2_ACCEL_SPARC_VIS) mpeg2_mc = mpeg2_mc_vis; else #endif +#endif mpeg2_mc = mpeg2_mc_c; }