Updated to support other $(TARGET_ARCH) specific optimization more

easily: moved out of config.h some definitions that we could do 
dynamically per target architecture.

NOTE: ppc, m68k and sparc optimizations are currently missing and should 
be imported from ffmpeg 0.5 before we can build avcodec plugin for these 
targets. Hence why it's still X86_ONLY qualified.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30185 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Philippe Houdoin 2009-04-15 23:11:01 +00:00
parent ed4f2d8805
commit 370ed3de61
3 changed files with 42 additions and 43 deletions

View File

@ -17,7 +17,7 @@ Addon avcodec :
gfx_util.cpp
:
libavcodec.a
libavcodec_x86.a
libavcodec_$(TARGET_ARCH).a
libavutil.a
libswscale.a
be

View File

@ -1,7 +1,7 @@
SubDir HAIKU_TOP src add-ons media plugins avcodec libavcodec ;
SubDirHdrs [ FDirName $(SUBDIR) .. ] ;
SubDirHdrs [ FDirName $(SUBDIR) x86 ] ;
SubDirHdrs [ FDirName $(SUBDIR) $(TARGET_ARCH) ] ;
SubDirHdrs [ FDirName $(SUBDIR) ../libavutil ] ;
SubDirHdrs [ FDirName $(SUBDIR) ../libswscale ] ;
@ -16,37 +16,33 @@ if $(HAIKU_GCC_VERSION[1]) >= 3 {
} else {
SubDirCcFlags -fomit-frame-pointer -DPIC ;
}
SubDirCcFlags -DHAVE_AV_CONFIG_H=1 ;
local libavcodecSourcesX86 =
cpuid.c
cavsdsp_mmx.c
idct_mmx.c
idct_mmx_xvid.c
idct_sse2_xvid.c
dsputil_mmx.c
fft_sse.c
h264_idct_sse2.nasm
h264_deblock_sse2.nasm
fft_mmx.nasm
dsputil_yasm.nasm
simple_idct_mmx.c
motion_est_mmx.c
mpegvideo_mmx.c
rv40dsp_mmx.c
vc1dsp_mmx.c
vp3dsp_mmx.c
vp3dsp_sse2.c
vp6dsp_mmx.c
vp6dsp_sse2.c
fdct_mmx.c
;
local defines ;
defines = HAVE_AV_CONFIG_H=1 ;
SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src add-ons media plugins avcodec libavcodec x86 ] ;
SEARCH on $(libavcodecSourcesX86) = $(SEARCH_SOURCE) ;
StaticLibrary libavcodec_x86.a :
$(libavcodecSourcesX86)
;
if $(TARGET_ARCH) = x86 {
defines += ARCH_X86=1 ARCH_X86_32=1 ARCH_PPC=0 ARCH_SPARC=0 ;
defines += HAVE_AMD3DNOW=0 HAVE_AMD3DNOWEXT=0 ;
defines += HAVE_MMX=1 HAVE_MMX2=1 HAVE_SSE=0 HAVE_SSE3=1 ;
defines += HAVE_ALTIVEC=0 ;
defines += HAVE_VIS=0 ;
} else if $(TARGET_ARCH) = ppc {
defines += ARCH_X86=0 ARCH_X86_32=0 ARCH_PPC=1 ARCH_SPARC=0 ;
defines += HAVE_AMD3DNOW=0 HAVE_AMD3DNOWEXT=0 ;
defines += HAVE_MMX=0 HAVE_MMX2=0 HAVE_SSE=0 HAVE_SSE3=0 ;
defines += HAVE_ALTIVEC=1 ;
defines += HAVE_VIS=0 ;
} else if $(TARGET_ARCH) = sparc {
defines += ARCH_X86=0 ARCH_X86_32=0 ARCH_PPC=0 ARCH_SPARC=1 ;
defines += HAVE_AMD3DNOW=0 HAVE_AMD3DNOWEXT=0 ;
defines += HAVE_MMX=0 HAVE_MMX2=0 HAVE_SSE=0 HAVE_SSE3=0 ;
defines += HAVE_ALTIVEC=0 ;
defines += HAVE_VIS=1 ;
}
defines = [ FDefines $(defines) ] ;
SubDirCcFlags $(defines) ;
SubDirC++Flags $(defines) ;
StaticLibrary libavcodec.a :
4xm.c
@ -313,3 +309,6 @@ StaticLibrary libavcodec.a :
xsubdec.c
zmbv.c
;
SubInclude HAIKU_TOP src add-ons media plugins avcodec libavcodec $(TARGET_ARCH) ;

View File

@ -10,30 +10,30 @@
#define ARCH_M68K 0
#define ARCH_MIPS 0
#define ARCH_PARISC 0
#define ARCH_PPC 0
// #define ARCH_PPC 0
#define ARCH_S390 0
#define ARCH_SH4 0
#define ARCH_SPARC 0
// #define ARCH_SPARC 0
#define ARCH_SPARC64 0
#define ARCH_X86 1
#define ARCH_X86_32 1
// #define ARCH_X86 1
// #define ARCH_X86_32 1
#define ARCH_X86_64 0
#define HAVE_ALTIVEC 0
#define HAVE_AMD3DNOW 0
#define HAVE_AMD3DNOWEXT 0
// #define HAVE_ALTIVEC 0
// #define HAVE_AMD3DNOW 0
// #define HAVE_AMD3DNOWEXT 0
#define HAVE_ARMV5TE 0
#define HAVE_ARMV6 0
#define HAVE_ARMV6T2 0
#define HAVE_ARMVFP 0
#define HAVE_IWMMXT 0
#define HAVE_MMI 0
#define HAVE_MMX 1
#define HAVE_MMX2 1
// #define HAVE_MMX 1
// #define HAVE_MMX2 1
#define HAVE_NEON 0
#define HAVE_PPC4XX 0
#define HAVE_SSE 0
#define HAVE_SSSE3 1
#define HAVE_VIS 0
// #define HAVE_SSE 0
// #define HAVE_SSSE3 1
// #define HAVE_VIS 0
#define HAVE_BEOSTHREADS 0
#define HAVE_OS2THREADS 0
#define HAVE_PTHREADS 0