xref: /haiku/src/add-ons/media/plugins/ffmpeg/Jamfile (revision b46615c55ad2c8fe6de54412055a0713da3d610a)
1SubDir HAIKU_TOP src add-ons media plugins ffmpeg ;
2
3SetSubDirSupportedPlatformsBeOSCompatible ;
4
5UsePrivateHeaders media shared ;
6
7SubDirHdrs [ FDirName $(SUBDIR) libavcodec ] ;
8SubDirHdrs [ FDirName $(SUBDIR) libavformat ] ;
9SubDirHdrs [ FDirName $(SUBDIR) libavutil ] ;
10SubDirHdrs [ FDirName $(SUBDIR) libswscale ] ;
11
12SubDirC++Flags -D__STDC_CONSTANT_MACROS ;
13
14Addon ffmpeg :
15 	AVCodecDecoder.cpp
16 	AVCodecEncoder.cpp
17 	AVFormatReader.cpp
18 	AVFormatWriter.cpp
19 	CodecTable.cpp
20	DemuxerTable.cpp
21	EncoderTable.cpp
22	FFmpegPlugin.cpp
23	MuxerTable.cpp
24	CpuCapabilities.cpp
25
26	gfx_conv_c.cpp
27	gfx_conv_c_lookup.cpp
28	gfx_conv_mmx.cpp
29 	gfx_util.cpp
30 	yuvrgb_sse.nasm
31 	yuvrgb_sse2.nasm
32 	yuvrgb_ssse3.nasm
33	:
34	libavformat.a
35	libavcodec.a
36	libavcodec_$(TARGET_ARCH).a
37	libavutil.a
38	libswscale.a
39
40	libvorbis_ffmpeg.a
41	libspeex_ffmpeg.a
42	libtheora_ffmpeg.a
43	libogg_ffmpeg.a
44	libbz2_ffmpeg.a
45
46	be
47	libmedia.so
48	libz.a
49	$(TARGET_LIBSUPC++)
50;
51
52# FFmpeg libs configuration is in the config.h header. Architecture specific
53# defines have been commented out there and are being defined here instead.
54# NOTE: These are intentionally global variables, so we can re-use them in
55# sub-folders.
56HAIKU_FFMPEG_DEFINES = HAVE_AV_CONFIG_H _FILE_OFFSET_BITS=64
57	_LARGEFILE_SOURCE ;
58HAIKU_FFMPEG_USE_MMX = 1 ;
59HAIKU_FFMPEG_USE_MMX2 = 1 ;
60HAIKU_FFMPEG_USE_SSE = 1 ;
61HAIKU_FFMPEG_USE_SSSE3 = 1 ;
62HAIKU_FFMPEG_USE_AMD3DNOW = 1 ;
63HAIKU_FFMPEG_USE_AMD3DNOWEXT = 1 ;
64HAIKU_FFMPEG_GCC_EXTRA_FLAGS = ;
65if $(HAIKU_GCC_VERSION[1]) >= 3 {
66	HAIKU_FFMPEG_GCC_EXTRA_FLAGS = -fomit-frame-pointer -fno-pic
67		-fno-math-errno -fno-signed-zeros -fno-tree-vectorize  ;
68} else {
69	HAIKU_FFMPEG_GCC_EXTRA_FLAGS = -fomit-frame-pointer -fPIC ;
70	HAIKU_FFMPEG_USE_SSE = 0 ;
71}
72
73if $(TARGET_ARCH) = x86 {
74	HAIKU_FFMPEG_DEFINES += ARCH_X86=1 ARCH_X86_32=1 ;
75	HAIKU_FFMPEG_DEFINES += ARCH_PPC=0 ;
76	HAIKU_FFMPEG_DEFINES += ARCH_SPARC=0 ;
77	HAIKU_FFMPEG_DEFINES += HAVE_AMD3DNOW=$(HAIKU_FFMPEG_USE_AMD3DNOW) ;
78	HAIKU_FFMPEG_DEFINES += HAVE_AMD3DNOWEXT=$(HAIKU_FFMPEG_USE_AMD3DNOWEXT) ;
79	HAIKU_FFMPEG_DEFINES += HAVE_BIGENDIAN=0 ;
80	HAIKU_FFMPEG_DEFINES += HAVE_MMX=$(HAIKU_FFMPEG_USE_MMX) ;
81	HAIKU_FFMPEG_DEFINES += HAVE_MMX2=$(HAIKU_FFMPEG_USE_MMX2) ;
82	HAIKU_FFMPEG_DEFINES += HAVE_SSE=$(HAIKU_FFMPEG_USE_SSE) ;
83	HAIKU_FFMPEG_DEFINES += HAVE_SSSE3=$(HAIKU_FFMPEG_USE_SSSE3) ;
84	HAIKU_FFMPEG_DEFINES += HAVE_ALTIVEC=0 ;
85	HAIKU_FFMPEG_DEFINES += HAVE_VIS=0 ;
86} else if $(TARGET_ARCH) = ppc {
87	HAIKU_FFMPEG_DEFINES += ARCH_X86=0 ARCH_X86_32=0 ;
88	HAIKU_FFMPEG_DEFINES += ARCH_PPC=1 ;
89	HAIKU_FFMPEG_DEFINES += ARCH_SPARC=0 ;
90	HAIKU_FFMPEG_DEFINES += HAVE_AMD3DNOW=0 HAVE_AMD3DNOWEXT=0 ;
91	HAIKU_FFMPEG_DEFINES += HAVE_MMX=0 HAVE_MMX2=0 HAVE_SSE=0 HAVE_SSSE3=0 ;
92	HAIKU_FFMPEG_DEFINES += HAVE_ALTIVEC=1 ;
93	HAIKU_FFMPEG_DEFINES += HAVE_BIGENDIAN=1 ;
94	HAIKU_FFMPEG_DEFINES += HAVE_VIS=0 ;
95} else if $(TARGET_ARCH) = sparc {
96	HAIKU_FFMPEG_DEFINES += ARCH_X86=0 ARCH_X86_32=0 ;
97	HAIKU_FFMPEG_DEFINES += ARCH_PPC=0 ;
98	HAIKU_FFMPEG_DEFINES += ARCH_SPARC=1 ;
99	HAIKU_FFMPEG_DEFINES += HAVE_AMD3DNOW=0 HAVE_AMD3DNOWEXT=0 ;
100	HAIKU_FFMPEG_DEFINES += HAVE_MMX=0 HAVE_MMX2=0 HAVE_SSE=0 HAVE_SSSE3=0 ;
101	HAIKU_FFMPEG_DEFINES += HAVE_ALTIVEC=0 ;
102	HAIKU_FFMPEG_DEFINES += HAVE_BIGENDIAN=1 ;
103	HAIKU_FFMPEG_DEFINES += HAVE_VIS=1 ;
104}
105
106if $(HAIKU_INCLUDE_GPL_ADDONS) = 1 {
107	HAIKU_FFMPEG_DEFINES += CONFIG_GPL=1 ;
108} else {
109	HAIKU_FFMPEG_DEFINES += CONFIG_GPL=0 ;
110}
111
112
113HAIKU_FFMPEG_DEFINES = [ FDefines $(HAIKU_FFMPEG_DEFINES) ] ;
114
115SubInclude HAIKU_TOP src add-ons media plugins ffmpeg libavcodec ;
116SubInclude HAIKU_TOP src add-ons media plugins ffmpeg libavformat ;
117SubInclude HAIKU_TOP src add-ons media plugins ffmpeg libavutil ;
118SubInclude HAIKU_TOP src add-ons media plugins ffmpeg libbz2 ;
119SubInclude HAIKU_TOP src add-ons media plugins ffmpeg libogg ;
120SubInclude HAIKU_TOP src add-ons media plugins ffmpeg libswscale ;
121SubInclude HAIKU_TOP src add-ons media plugins ffmpeg libspeex ;
122SubInclude HAIKU_TOP src add-ons media plugins ffmpeg libtheora ;
123SubInclude HAIKU_TOP src add-ons media plugins ffmpeg libvorbis ;
124