The cirros image was rebuilt against the 3.13.0-83 kernel, drivers e1000e, igbvf...
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / ffmpeg / ffmpeg.mk
1 ################################################################################
2 #
3 # ffmpeg
4 #
5 ################################################################################
6
7 FFMPEG_VERSION = 2.6.2
8 FFMPEG_SOURCE = ffmpeg-$(FFMPEG_VERSION).tar.bz2
9 FFMPEG_SITE = http://ffmpeg.org/releases
10 FFMPEG_INSTALL_STAGING = YES
11
12 FFMPEG_LICENSE = LGPLv2.1+, libjpeg license
13 FFMPEG_LICENSE_FILES = LICENSE.md COPYING.LGPLv2.1
14 ifeq ($(BR2_PACKAGE_FFMPEG_GPL),y)
15 FFMPEG_LICENSE += and GPLv2+
16 FFMPEG_LICENSE_FILES += COPYING.GPLv2
17 endif
18
19 FFMPEG_CONF_OPTS = \
20         --prefix=/usr \
21         --enable-avfilter \
22         --disable-version3 \
23         --enable-logging \
24         --enable-optimizations \
25         --disable-extra-warnings \
26         --enable-avdevice \
27         --enable-avcodec \
28         --enable-avformat \
29         --disable-x11grab \
30         --enable-network \
31         --disable-gray \
32         --enable-swscale-alpha \
33         --disable-small \
34         --enable-dct \
35         --enable-fft \
36         --enable-mdct \
37         --enable-rdft \
38         --disable-crystalhd \
39         --disable-vdpau \
40         --disable-dxva2 \
41         --enable-runtime-cpudetect \
42         --disable-hardcoded-tables \
43         --disable-memalign-hack \
44         --enable-hwaccels \
45         --disable-avisynth \
46         --disable-frei0r \
47         --disable-libopencore-amrnb \
48         --disable-libopencore-amrwb \
49         --disable-libopencv \
50         --disable-libdc1394 \
51         --disable-libfaac \
52         --disable-libgsm \
53         --disable-libmp3lame \
54         --disable-libnut \
55         --disable-libopenjpeg \
56         --disable-librtmp \
57         --disable-libschroedinger \
58         --disable-libspeex \
59         --disable-libtheora \
60         --disable-libvo-aacenc \
61         --disable-libvo-amrwbenc \
62         --disable-symver \
63         --disable-doc
64
65 FFMPEG_DEPENDENCIES += $(if $(BR2_PACKAGE_LIBICONV),libiconv) host-pkgconf
66
67 ifeq ($(BR2_PACKAGE_FFMPEG_GPL),y)
68 FFMPEG_CONF_OPTS += --enable-gpl
69 else
70 FFMPEG_CONF_OPTS += --disable-gpl
71 endif
72
73 ifeq ($(BR2_PACKAGE_FFMPEG_NONFREE),y)
74 FFMPEG_CONF_OPTS += --enable-nonfree
75 else
76 FFMPEG_CONF_OPTS += --disable-nonfree
77 endif
78
79 ifeq ($(BR2_PACKAGE_FFMPEG_FFMPEG),y)
80 FFMPEG_CONF_OPTS += --enable-ffmpeg
81 else
82 FFMPEG_CONF_OPTS += --disable-ffmpeg
83 endif
84
85 ifeq ($(BR2_PACKAGE_FFMPEG_FFPLAY),y)
86 FFMPEG_DEPENDENCIES += sdl
87 FFMPEG_CONF_OPTS += --enable-ffplay
88 FFMPEG_CONF_ENV += SDL_CONFIG=$(STAGING_DIR)/usr/bin/sdl-config
89 else
90 FFMPEG_CONF_OPTS += --disable-ffplay
91 endif
92
93 ifeq ($(BR2_PACKAGE_FFMPEG_FFSERVER),y)
94 FFMPEG_CONF_OPTS += --enable-ffserver
95 else
96 FFMPEG_CONF_OPTS += --disable-ffserver
97 endif
98
99 ifeq ($(BR2_PACKAGE_FFMPEG_AVRESAMPLE),y)
100 FFMPEG_CONF_OPTS += --enable-avresample
101 else
102 FFMPEG_CONF_OPTS += --disable-avresample
103 endif
104
105 ifeq ($(BR2_PACKAGE_FFMPEG_FFPROBE),y)
106 FFMPEG_CONF_OPTS += --enable-ffprobe
107 else
108 FFMPEG_CONF_OPTS += --disable-ffprobe
109 endif
110
111 ifeq ($(BR2_PACKAGE_FFMPEG_POSTPROC),y)
112 FFMPEG_CONF_OPTS += --enable-postproc
113 else
114 FFMPEG_CONF_OPTS += --disable-postproc
115 endif
116
117 ifeq ($(BR2_PACKAGE_FFMPEG_SWSCALE),y)
118 FFMPEG_CONF_OPTS += --enable-swscale
119 else
120 FFMPEG_CONF_OPTS += --disable-swscale
121 endif
122
123 ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_ENCODERS)),all)
124 FFMPEG_CONF_OPTS += --disable-encoders \
125         $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_ENCODERS)),--enable-encoder=$(x))
126 endif
127
128 ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_DECODERS)),all)
129 FFMPEG_CONF_OPTS += --disable-decoders \
130         $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_DECODERS)),--enable-decoder=$(x))
131 endif
132
133 ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_MUXERS)),all)
134 FFMPEG_CONF_OPTS += --disable-muxers \
135         $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_MUXERS)),--enable-muxer=$(x))
136 endif
137
138 ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_DEMUXERS)),all)
139 FFMPEG_CONF_OPTS += --disable-demuxers \
140         $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_DEMUXERS)),--enable-demuxer=$(x))
141 endif
142
143 ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_PARSERS)),all)
144 FFMPEG_CONF_OPTS += --disable-parsers \
145         $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_PARSERS)),--enable-parser=$(x))
146 endif
147
148 ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_BSFS)),all)
149 FFMPEG_CONF_OPTS += --disable-bsfs \
150         $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_BSFS)),--enable-bsfs=$(x))
151 endif
152
153 ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_PROTOCOLS)),all)
154 FFMPEG_CONF_OPTS += --disable-protocols \
155         $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_PROTOCOLS)),--enable-protocol=$(x))
156 endif
157
158 ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_FILTERS)),all)
159 FFMPEG_CONF_OPTS += --disable-filters \
160         $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_FILTERS)),--enable-filter=$(x))
161 endif
162
163 ifeq ($(BR2_PACKAGE_FFMPEG_INDEVS),y)
164 FFMPEG_CONF_OPTS += --enable-indevs
165 else
166 FFMPEG_CONF_OPTS += --disable-indevs
167 endif
168
169 ifeq ($(BR2_PACKAGE_FFMPEG_OUTDEVS),y)
170 FFMPEG_CONF_OPTS += --enable-outdevs
171 else
172 FFMPEG_CONF_OPTS += --disable-outdevs
173 endif
174
175 ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
176 FFMPEG_CONF_OPTS += --enable-pthreads
177 else
178 FFMPEG_CONF_OPTS += --disable-pthreads
179 endif
180
181 ifeq ($(BR2_PACKAGE_ZLIB),y)
182 FFMPEG_CONF_OPTS += --enable-zlib
183 FFMPEG_DEPENDENCIES += zlib
184 else
185 FFMPEG_CONF_OPTS += --disable-zlib
186 endif
187
188 ifeq ($(BR2_PACKAGE_BZIP2),y)
189 FFMPEG_CONF_OPTS += --enable-bzlib
190 FFMPEG_DEPENDENCIES += bzip2
191 else
192 FFMPEG_CONF_OPTS += --disable-bzlib
193 endif
194
195 ifeq ($(BR2_PACKAGE_OPENSSL),y)
196 # openssl isn't license compatible with GPL
197 ifeq ($(BR2_PACKAGE_FFMPEG_GPL)x$(BR2_PACKAGE_FFMPEG_NONFREE),yx)
198 FFMPEG_CONF_OPTS += --disable-openssl
199 else
200 FFMPEG_CONF_OPTS += --enable-openssl
201 FFMPEG_DEPENDENCIES += openssl
202 endif
203 else
204 FFMPEG_CONF_OPTS += --disable-openssl
205 endif
206
207 ifeq ($(BR2_PACKAGE_LIBVORBIS),y)
208 FFMPEG_DEPENDENCIES += libvorbis
209 FFMPEG_CONF_OPTS += \
210         --enable-libvorbis \
211         --enable-muxer=ogg \
212         --enable-encoder=libvorbis
213 endif
214
215 ifeq ($(BR2_PACKAGE_LIBVA),y)
216 FFMPEG_CONF_OPTS += --enable-vaapi
217 FFMPEG_DEPENDENCIES += libva
218 else
219 FFMPEG_CONF_OPTS += --disable-vaapi
220 endif
221
222 ifeq ($(BR2_PACKAGE_OPUS),y)
223 FFMPEG_CONF_OPTS += --enable-libopus
224 FFMPEG_DEPENDENCIES += opus
225 else
226 FFMPEG_CONF_OPTS += --disable-libopus
227 endif
228
229 ifeq ($(BR2_PACKAGE_LIBVPX),y)
230 FFMPEG_CONF_OPTS += --enable-libvpx
231 FFMPEG_DEPENDENCIES += libvpx
232 else
233 FFMPEG_CONF_OPTS += --disable-libvpx
234 endif
235
236 # ffmpeg freetype support require fenv.h which is only
237 # available/working on glibc.
238 # The microblaze variant doesn't provide the needed exceptions
239 ifeq ($(BR2_PACKAGE_FREETYPE)$(BR2_TOOLCHAIN_USES_GLIBC)x$(BR2_microblaze),yyx)
240 FFMPEG_CONF_OPTS += --enable-libfreetype
241 FFMPEG_DEPENDENCIES += freetype
242 else
243 FFMPEG_CONF_OPTS += --disable-libfreetype
244 endif
245
246 ifeq ($(BR2_PACKAGE_FONTCONFIG),y)
247 FFMPEG_CONF_OPTS += --enable-fontconfig
248 FFMPEG_DEPENDENCIES += fontconfig
249 else
250 FFMPEG_CONF_OPTS += --disable-fontconfig
251 endif
252
253 ifeq ($(BR2_PACKAGE_X264)$(BR2_PACKAGE_FFMPEG_GPL),yy)
254 FFMPEG_CONF_OPTS += --enable-libx264
255 FFMPEG_DEPENDENCIES += x264
256 else
257 FFMPEG_CONF_OPTS += --disable-libx264
258 endif
259
260 ifeq ($(BR2_X86_CPU_HAS_MMX),y)
261 FFMPEG_CONF_OPTS += --enable-yasm
262 FFMPEG_DEPENDENCIES += host-yasm
263 else
264 FFMPEG_CONF_OPTS += --disable-yasm
265 FFMPEG_CONF_OPTS += --disable-mmx
266 endif
267
268 ifeq ($(BR2_X86_CPU_HAS_SSE),y)
269 FFMPEG_CONF_OPTS += --enable-sse
270 else
271 FFMPEG_CONF_OPTS += --disable-sse
272 endif
273
274 ifeq ($(BR2_X86_CPU_HAS_SSE2),y)
275 FFMPEG_CONF_OPTS += --enable-sse2
276 else
277 FFMPEG_CONF_OPTS += --disable-sse2
278 endif
279
280 ifeq ($(BR2_X86_CPU_HAS_SSE3),y)
281 FFMPEG_CONF_OPTS += --enable-sse3
282 else
283 FFMPEG_CONF_OPTS += --disable-sse3
284 endif
285
286 ifeq ($(BR2_X86_CPU_HAS_SSSE3),y)
287 FFMPEG_CONF_OPTS += --enable-ssse3
288 else
289 FFMPEG_CONF_OPTS += --disable-ssse3
290 endif
291
292 ifeq ($(BR2_X86_CPU_HAS_SSE4),y)
293 FFMPEG_CONF_OPTS += --enable-sse4
294 else
295 FFMPEG_CONF_OPTS += --disable-sse4
296 endif
297
298 ifeq ($(BR2_X86_CPU_HAS_SSE42),y)
299 FFMPEG_CONF_OPTS += --enable-sse42
300 else
301 FFMPEG_CONF_OPTS += --disable-sse42
302 endif
303
304 ifeq ($(BR2_X86_CPU_HAS_AVX),y)
305 FFMPEG_CONF_OPTS += --enable-avx
306 else
307 FFMPEG_CONF_OPTS += --disable-avx
308 endif
309
310 ifeq ($(BR2_X86_CPU_HAS_AVX2),y)
311 FFMPEG_CONF_OPTS += --enable-avx2
312 else
313 FFMPEG_CONF_OPTS += --disable-avx2
314 endif
315
316 # Explicitly disable everything that doesn't match for ARM
317 # FFMPEG "autodetects" by compiling an extended instruction via AS
318 # This works on compilers that aren't built for generic by default
319 ifeq ($(BR2_ARM_CPU_ARMV4),y)
320 FFMPEG_CONF_OPTS += --disable-armv5te
321 endif
322 ifeq ($(BR2_ARM_CPU_ARMV6)$(BR2_ARM_CPU_ARMV7A),y)
323 FFMPEG_CONF_OPTS += --enable-armv6
324 else
325 FFMPEG_CONF_OPTS += --disable-armv6 --disable-armv6t2
326 endif
327 ifeq ($(BR2_ARM_CPU_HAS_VFPV2),y)
328 FFMPEG_CONF_OPTS += --enable-vfp
329 else
330 FFMPEG_CONF_OPTS += --disable-vfp
331 endif
332 ifeq ($(BR2_ARM_CPU_HAS_NEON),y)
333 FFMPEG_CONF_OPTS += --enable-neon
334 endif
335
336 ifeq ($(BR2_MIPS_SOFT_FLOAT),y)
337 FFMPEG_CONF_OPTS += \
338         --disable-mipsfpu
339 else
340 FFMPEG_CONF_OPTS += \
341         --enable-mipsfpu
342 endif
343
344 ifeq ($(BR2_mips_32r2),y)
345 FFMPEG_CONF_OPTS += \
346         --enable-mips32r2
347 else
348 FFMPEG_CONF_OPTS += \
349         --disable-mips32r2
350 endif
351
352 ifeq ($(BR2_mips_64r2),y)
353 FFMPEG_CONF_OPTS += \
354         --enable-mipsdspr1 \
355         --enable-mipsdspr2
356 else
357 FFMPEG_CONF_OPTS += \
358         --disable-mipsdspr1 \
359         --disable-mipsdspr2
360 endif
361
362 ifeq ($(BR2_POWERPC_CPU_HAS_ALTIVEC),y)
363 FFMPEG_CONF_OPTS += --enable-altivec
364 else
365 FFMPEG_CONF_OPTS += --disable-altivec
366 endif
367
368 ifeq ($(BR2_STATIC_LIBS),)
369 FFMPEG_CONF_OPTS += --enable-pic
370 else
371 FFMPEG_CONF_OPTS += --disable-pic
372 endif
373
374 FFMPEG_CONF_OPTS += $(call qstrip,$(BR2_PACKAGE_FFMPEG_EXTRACONF))
375
376 ifneq ($(call qstrip,$(BR2_GCC_TARGET_CPU)),)
377 FFMPEG_CONF_OPTS += --cpu=$(BR2_GCC_TARGET_CPU)
378 else ifneq ($(call qstrip,$(BR2_GCC_TARGET_ARCH)),)
379 FFMPEG_CONF_OPTS += --cpu=$(BR2_GCC_TARGET_ARCH)
380 endif
381
382 # Override FFMPEG_CONFIGURE_CMDS: FFmpeg does not support --target and others
383 define FFMPEG_CONFIGURE_CMDS
384         (cd $(FFMPEG_SRCDIR) && rm -rf config.cache && \
385         $(TARGET_CONFIGURE_OPTS) \
386         $(TARGET_CONFIGURE_ARGS) \
387         $(FFMPEG_CONF_ENV) \
388         ./configure \
389                 --enable-cross-compile \
390                 --cross-prefix=$(TARGET_CROSS) \
391                 --sysroot=$(STAGING_DIR) \
392                 --host-cc="$(HOSTCC)" \
393                 --arch=$(BR2_ARCH) \
394                 --target-os="linux" \
395                 --disable-stripping \
396                 --pkg-config="$(PKG_CONFIG_HOST_BINARY)" \
397                 $(SHARED_STATIC_LIBS_OPTS) \
398                 $(FFMPEG_CONF_OPTS) \
399         )
400 endef
401
402 $(eval $(autotools-package))