blob: 782d913e6828f850a697689c220c1642790ed11d [file] [log] [blame]
Alexandre Belloni8dfd59d2013-06-05 23:53:30 +00001################################################################################
Luca Ceresoli13293402010-06-14 21:41:42 +02002#
3# ffmpeg
4#
Alexandre Belloni8dfd59d2013-06-05 23:53:30 +00005################################################################################
Gustavo Zacarias1b269dd2011-03-01 13:20:00 -03006
Bernd Kuhlsa3cf0572016-08-27 08:01:41 +02007FFMPEG_VERSION = 3.1.3
Jerzy Grzegorek0a854ce2015-10-14 12:34:22 +02008FFMPEG_SOURCE = ffmpeg-$(FFMPEG_VERSION).tar.xz
Gustavo Zacarias1b269dd2011-03-01 13:20:00 -03009FFMPEG_SITE = http://ffmpeg.org/releases
Luca Ceresoli13293402010-06-14 21:41:42 +020010FFMPEG_INSTALL_STAGING = YES
Luca Ceresoli13293402010-06-14 21:41:42 +020011
Luca Ceresolia17d8942013-02-07 11:02:33 +000012FFMPEG_LICENSE = LGPLv2.1+, libjpeg license
Luca Ceresolia20aae62014-10-02 12:11:01 +020013FFMPEG_LICENSE_FILES = LICENSE.md COPYING.LGPLv2.1
Luca Ceresolia17d8942013-02-07 11:02:33 +000014ifeq ($(BR2_PACKAGE_FFMPEG_GPL),y)
15FFMPEG_LICENSE += and GPLv2+
16FFMPEG_LICENSE_FILES += COPYING.GPLv2
17endif
18
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +020019FFMPEG_CONF_OPTS = \
Bernd Kuhls79449c22014-10-03 11:50:46 +020020 --prefix=/usr \
Bernd Kuhls62ab07e2014-01-02 18:59:44 +010021 --enable-avfilter \
Bernd Kuhls62ab07e2014-01-02 18:59:44 +010022 --disable-version3 \
23 --enable-logging \
Bernd Kuhls62ab07e2014-01-02 18:59:44 +010024 --enable-optimizations \
25 --disable-extra-warnings \
Bernd Kuhls62ab07e2014-01-02 18:59:44 +010026 --enable-avdevice \
27 --enable-avcodec \
28 --enable-avformat \
Bernd Kuhls62ab07e2014-01-02 18:59:44 +010029 --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 \
Bernd Kuhls62ab07e2014-01-02 18:59:44 +010039 --disable-dxva2 \
40 --enable-runtime-cpudetect \
41 --disable-hardcoded-tables \
42 --disable-memalign-hack \
Vicente Olivert Riera2893d2f2016-08-15 17:03:36 +020043 --disable-mipsdsp \
Vicente Olivert Rierab090dcb2015-10-14 16:58:22 +010044 --disable-mipsdspr2 \
Bernd Kuhls1ca32ad2015-07-24 20:13:47 +020045 --disable-msa \
Bernd Kuhls62ab07e2014-01-02 18:59:44 +010046 --enable-hwaccels \
47 --disable-avisynth \
48 --disable-frei0r \
49 --disable-libopencore-amrnb \
50 --disable-libopencore-amrwb \
Bernd Kuhls632df1d2015-10-17 14:31:58 +020051 --disable-libcdio \
Bernd Kuhls62ab07e2014-01-02 18:59:44 +010052 --disable-libdc1394 \
53 --disable-libfaac \
Bernd Kuhls62ab07e2014-01-02 18:59:44 +010054 --disable-libgsm \
Bernd Kuhls632df1d2015-10-17 14:31:58 +020055 --disable-libilbc \
Bernd Kuhls62ab07e2014-01-02 18:59:44 +010056 --disable-libnut \
57 --disable-libopenjpeg \
Bernd Kuhls62ab07e2014-01-02 18:59:44 +010058 --disable-libschroedinger \
Bernd Kuhls62ab07e2014-01-02 18:59:44 +010059 --disable-libvo-amrwbenc \
Bernd Kuhls62ab07e2014-01-02 18:59:44 +010060 --disable-symver \
Thomas De Schampheleire7164a322014-02-05 14:50:56 +010061 --disable-doc
Luca Ceresoli13293402010-06-14 21:41:42 +020062
Danomi Manchegoa9a5a812014-09-08 22:06:46 -040063FFMPEG_DEPENDENCIES += $(if $(BR2_PACKAGE_LIBICONV),libiconv) host-pkgconf
Bernd Kuhls62ab07e2014-01-02 18:59:44 +010064
Luca Ceresoli13293402010-06-14 21:41:42 +020065ifeq ($(BR2_PACKAGE_FFMPEG_GPL),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +020066FFMPEG_CONF_OPTS += --enable-gpl
Luca Ceresoli13293402010-06-14 21:41:42 +020067else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +020068FFMPEG_CONF_OPTS += --disable-gpl
Luca Ceresoli13293402010-06-14 21:41:42 +020069endif
70
71ifeq ($(BR2_PACKAGE_FFMPEG_NONFREE),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +020072FFMPEG_CONF_OPTS += --enable-nonfree
Luca Ceresoli13293402010-06-14 21:41:42 +020073else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +020074FFMPEG_CONF_OPTS += --disable-nonfree
Luca Ceresoli13293402010-06-14 21:41:42 +020075endif
76
Luca Ceresoli5253efa2010-06-14 21:41:43 +020077ifeq ($(BR2_PACKAGE_FFMPEG_FFMPEG),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +020078FFMPEG_CONF_OPTS += --enable-ffmpeg
Luca Ceresoli5253efa2010-06-14 21:41:43 +020079else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +020080FFMPEG_CONF_OPTS += --disable-ffmpeg
Luca Ceresoli5253efa2010-06-14 21:41:43 +020081endif
82
83ifeq ($(BR2_PACKAGE_FFMPEG_FFPLAY),y)
84FFMPEG_DEPENDENCIES += sdl
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +020085FFMPEG_CONF_OPTS += --enable-ffplay
Luca Ceresoli5253efa2010-06-14 21:41:43 +020086FFMPEG_CONF_ENV += SDL_CONFIG=$(STAGING_DIR)/usr/bin/sdl-config
87else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +020088FFMPEG_CONF_OPTS += --disable-ffplay
Luca Ceresoli5253efa2010-06-14 21:41:43 +020089endif
90
91ifeq ($(BR2_PACKAGE_FFMPEG_FFSERVER),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +020092FFMPEG_CONF_OPTS += --enable-ffserver
Luca Ceresoli5253efa2010-06-14 21:41:43 +020093else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +020094FFMPEG_CONF_OPTS += --disable-ffserver
Luca Ceresoli5253efa2010-06-14 21:41:43 +020095endif
96
Bernd Kuhlsf3765852014-10-14 20:28:24 +020097ifeq ($(BR2_PACKAGE_FFMPEG_AVRESAMPLE),y)
98FFMPEG_CONF_OPTS += --enable-avresample
99else
100FFMPEG_CONF_OPTS += --disable-avresample
101endif
102
Steve Kenton3b3b4f22014-12-01 18:55:35 -0600103ifeq ($(BR2_PACKAGE_FFMPEG_FFPROBE),y)
104FFMPEG_CONF_OPTS += --enable-ffprobe
105else
106FFMPEG_CONF_OPTS += --disable-ffprobe
107endif
108
Peter Korsgaard4ff34552010-10-07 09:54:00 +0200109ifeq ($(BR2_PACKAGE_FFMPEG_POSTPROC),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200110FFMPEG_CONF_OPTS += --enable-postproc
Peter Korsgaard4ff34552010-10-07 09:54:00 +0200111else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200112FFMPEG_CONF_OPTS += --disable-postproc
Peter Korsgaard4ff34552010-10-07 09:54:00 +0200113endif
114
115ifeq ($(BR2_PACKAGE_FFMPEG_SWSCALE),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200116FFMPEG_CONF_OPTS += --enable-swscale
Peter Korsgaard4ff34552010-10-07 09:54:00 +0200117else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200118FFMPEG_CONF_OPTS += --disable-swscale
Peter Korsgaard4ff34552010-10-07 09:54:00 +0200119endif
120
Luca Ceresoli56e4d692010-06-14 21:41:44 +0200121ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_ENCODERS)),all)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200122FFMPEG_CONF_OPTS += --disable-encoders \
Luca Ceresoli56e4d692010-06-14 21:41:44 +0200123 $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_ENCODERS)),--enable-encoder=$(x))
124endif
125
126ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_DECODERS)),all)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200127FFMPEG_CONF_OPTS += --disable-decoders \
Luca Ceresoli56e4d692010-06-14 21:41:44 +0200128 $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_DECODERS)),--enable-decoder=$(x))
129endif
130
131ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_MUXERS)),all)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200132FFMPEG_CONF_OPTS += --disable-muxers \
Luca Ceresoli56e4d692010-06-14 21:41:44 +0200133 $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_MUXERS)),--enable-muxer=$(x))
134endif
135
136ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_DEMUXERS)),all)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200137FFMPEG_CONF_OPTS += --disable-demuxers \
Luca Ceresoli56e4d692010-06-14 21:41:44 +0200138 $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_DEMUXERS)),--enable-demuxer=$(x))
139endif
140
141ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_PARSERS)),all)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200142FFMPEG_CONF_OPTS += --disable-parsers \
Luca Ceresoli56e4d692010-06-14 21:41:44 +0200143 $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_PARSERS)),--enable-parser=$(x))
144endif
145
146ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_BSFS)),all)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200147FFMPEG_CONF_OPTS += --disable-bsfs \
Bernd Kuhls62ab07e2014-01-02 18:59:44 +0100148 $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_BSFS)),--enable-bsfs=$(x))
Luca Ceresoli56e4d692010-06-14 21:41:44 +0200149endif
150
151ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_PROTOCOLS)),all)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200152FFMPEG_CONF_OPTS += --disable-protocols \
Luca Ceresoli56e4d692010-06-14 21:41:44 +0200153 $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_PROTOCOLS)),--enable-protocol=$(x))
154endif
155
156ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_FILTERS)),all)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200157FFMPEG_CONF_OPTS += --disable-filters \
Luca Ceresoli56e4d692010-06-14 21:41:44 +0200158 $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_FILTERS)),--enable-filter=$(x))
159endif
160
161ifeq ($(BR2_PACKAGE_FFMPEG_INDEVS),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200162FFMPEG_CONF_OPTS += --enable-indevs
Luca Ceresoli56e4d692010-06-14 21:41:44 +0200163else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200164FFMPEG_CONF_OPTS += --disable-indevs
Luca Ceresoli56e4d692010-06-14 21:41:44 +0200165endif
166
167ifeq ($(BR2_PACKAGE_FFMPEG_OUTDEVS),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200168FFMPEG_CONF_OPTS += --enable-outdevs
Luca Ceresoli56e4d692010-06-14 21:41:44 +0200169else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200170FFMPEG_CONF_OPTS += --disable-outdevs
Luca Ceresoli56e4d692010-06-14 21:41:44 +0200171endif
172
Thomas Petazzoni9eaad202010-12-13 17:27:44 +0100173ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200174FFMPEG_CONF_OPTS += --enable-pthreads
Thomas Petazzoni9eaad202010-12-13 17:27:44 +0100175else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200176FFMPEG_CONF_OPTS += --disable-pthreads
Luca Ceresoli13293402010-06-14 21:41:42 +0200177endif
178
179ifeq ($(BR2_PACKAGE_ZLIB),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200180FFMPEG_CONF_OPTS += --enable-zlib
Luca Ceresoli13293402010-06-14 21:41:42 +0200181FFMPEG_DEPENDENCIES += zlib
182else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200183FFMPEG_CONF_OPTS += --disable-zlib
Luca Ceresoli13293402010-06-14 21:41:42 +0200184endif
185
Bernd Kuhls62ab07e2014-01-02 18:59:44 +0100186ifeq ($(BR2_PACKAGE_BZIP2),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200187FFMPEG_CONF_OPTS += --enable-bzlib
Bernd Kuhls62ab07e2014-01-02 18:59:44 +0100188FFMPEG_DEPENDENCIES += bzip2
Arnout Vandecappelle (Essensium/Mind)4e20ad12012-01-22 13:04:16 +0100189else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200190FFMPEG_CONF_OPTS += --disable-bzlib
Arnout Vandecappelle (Essensium/Mind)4e20ad12012-01-22 13:04:16 +0100191endif
Bernd Kuhls62ab07e2014-01-02 18:59:44 +0100192
Bernd Kuhls632df1d2015-10-17 14:31:58 +0200193ifeq ($(BR2_PACKAGE_FDK_AAC)$(BR2_PACKAGE_FFMPEG_NONFREE),yy)
194FFMPEG_CONF_OPTS += --enable-libfdk-aac
195FFMPEG_DEPENDENCIES += fdk-aac
196else
197FFMPEG_CONF_OPTS += --disable-libfdk-aac
198endif
199
Bernd Kuhls5f7411e2015-10-17 21:38:56 +0200200ifeq ($(BR2_PACKAGE_GNUTLS),y)
201FFMPEG_CONF_OPTS += --enable-gnutls --disable-openssl
202FFMPEG_DEPENDENCIES += gnutls
203else
204FFMPEG_CONF_OPTS += --disable-gnutls
Bernd Kuhls62ab07e2014-01-02 18:59:44 +0100205ifeq ($(BR2_PACKAGE_OPENSSL),y)
Peter Korsgaard457b6462014-01-13 13:11:39 +0100206# openssl isn't license compatible with GPL
207ifeq ($(BR2_PACKAGE_FFMPEG_GPL)x$(BR2_PACKAGE_FFMPEG_NONFREE),yx)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200208FFMPEG_CONF_OPTS += --disable-openssl
Peter Korsgaard457b6462014-01-13 13:11:39 +0100209else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200210FFMPEG_CONF_OPTS += --enable-openssl
Bernd Kuhls62ab07e2014-01-02 18:59:44 +0100211FFMPEG_DEPENDENCIES += openssl
Peter Korsgaard457b6462014-01-13 13:11:39 +0100212endif
Bernd Kuhls62ab07e2014-01-02 18:59:44 +0100213else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200214FFMPEG_CONF_OPTS += --disable-openssl
Bernd Kuhls62ab07e2014-01-02 18:59:44 +0100215endif
Bernd Kuhls5f7411e2015-10-17 21:38:56 +0200216endif
Bernd Kuhls62ab07e2014-01-02 18:59:44 +0100217
Bernd Kuhlsaf127a62016-07-24 17:53:18 +0200218ifeq ($(BR2_PACKAGE_FFMPEG_GPL)$(BR2_PACKAGE_LIBEBUR128),yy)
219FFMPEG_DEPENDENCIES += libebur128
220endif
221
Bernd Kuhls632df1d2015-10-17 14:31:58 +0200222ifeq ($(BR2_PACKAGE_LIBOPENH264),y)
223FFMPEG_CONF_OPTS += --enable-libopenh264
224FFMPEG_DEPENDENCIES += libopenh264
225else
226FFMPEG_CONF_OPTS += --disable-libopenh264
227endif
228
Bernd Kuhls62ab07e2014-01-02 18:59:44 +0100229ifeq ($(BR2_PACKAGE_LIBVORBIS),y)
230FFMPEG_DEPENDENCIES += libvorbis
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200231FFMPEG_CONF_OPTS += \
Bernd Kuhls62ab07e2014-01-02 18:59:44 +0100232 --enable-libvorbis \
233 --enable-muxer=ogg \
234 --enable-encoder=libvorbis
235endif
236
Bernd Kuhls17240db2014-07-15 21:19:03 +0200237ifeq ($(BR2_PACKAGE_LIBVA),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200238FFMPEG_CONF_OPTS += --enable-vaapi
Bernd Kuhls17240db2014-07-15 21:19:03 +0200239FFMPEG_DEPENDENCIES += libva
240else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200241FFMPEG_CONF_OPTS += --disable-vaapi
Bernd Kuhls17240db2014-07-15 21:19:03 +0200242endif
243
Bernd Kuhlsc26132c2016-07-07 22:49:14 +0200244ifeq ($(BR2_PACKAGE_LIBVDPAU),y)
245FFMPEG_CONF_OPTS += --enable-vdpau
246FFMPEG_DEPENDENCIES += libvdpau
247else
248FFMPEG_CONF_OPTS += --disable-vdpau
249endif
250
Bernd Kuhlsd9ea4642016-08-15 17:03:39 +0200251# To avoid a circular dependency only use opencv if opencv itself does
252# not depend on ffmpeg.
253ifeq ($(BR2_PACKAGE_OPENCV_LIB_IMGPROC)x$(BR2_PACKAGE_OPENCV_WITH_FFMPEG),yx)
254FFMPEG_CONF_OPTS += --enable-libopencv
255FFMPEG_DEPENDENCIES += opencv
Bernd Kuhls1b698552016-09-05 16:51:20 +0200256else ifeq ($(BR2_PACKAGE_OPENCV3_LIB_IMGPROC)x$(BR2_PACKAGE_OPENCV3_WITH_FFMPEG),yx)
257FFMPEG_CONF_OPTS += --enable-libopencv
258FFMPEG_DEPENDENCIES += opencv3
Bernd Kuhlsd9ea4642016-08-15 17:03:39 +0200259else
260FFMPEG_CONF_OPTS += --disable-libopencv
261endif
262
David du Colombierad58c882014-09-30 15:28:05 +0200263ifeq ($(BR2_PACKAGE_OPUS),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200264FFMPEG_CONF_OPTS += --enable-libopus
David du Colombierad58c882014-09-30 15:28:05 +0200265FFMPEG_DEPENDENCIES += opus
266else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200267FFMPEG_CONF_OPTS += --disable-libopus
David du Colombierad58c882014-09-30 15:28:05 +0200268endif
269
David du Colombier8a966c82014-09-30 15:28:04 +0200270ifeq ($(BR2_PACKAGE_LIBVPX),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200271FFMPEG_CONF_OPTS += --enable-libvpx
David du Colombier8a966c82014-09-30 15:28:04 +0200272FFMPEG_DEPENDENCIES += libvpx
273else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200274FFMPEG_CONF_OPTS += --disable-libvpx
David du Colombier8a966c82014-09-30 15:28:04 +0200275endif
276
Bernd Kuhls0c142592015-08-01 16:20:41 +0200277ifeq ($(BR2_PACKAGE_LIBASS),y)
278FFMPEG_CONF_OPTS += --enable-libass
279FFMPEG_DEPENDENCIES += libass
280else
281FFMPEG_CONF_OPTS += --disable-libass
282endif
283
284ifeq ($(BR2_PACKAGE_LIBBLURAY),y)
285FFMPEG_CONF_OPTS += --enable-libbluray
286FFMPEG_DEPENDENCIES += libbluray
287else
288FFMPEG_CONF_OPTS += --disable-libbluray
289endif
290
291ifeq ($(BR2_PACKAGE_RTMPDUMP),y)
292FFMPEG_CONF_OPTS += --enable-librtmp
293FFMPEG_DEPENDENCIES += rtmpdump
294else
295FFMPEG_CONF_OPTS += --disable-librtmp
296endif
297
298ifeq ($(BR2_PACKAGE_LAME),y)
299FFMPEG_CONF_OPTS += --enable-libmp3lame
300FFMPEG_DEPENDENCIES += lame
301else
302FFMPEG_CONF_OPTS += --disable-libmp3lame
303endif
304
305ifeq ($(BR2_PACKAGE_LIBMODPLUG),y)
306FFMPEG_CONF_OPTS += --enable-libmodplug
307FFMPEG_DEPENDENCIES += libmodplug
308else
309FFMPEG_CONF_OPTS += --disable-libmodplug
310endif
311
312ifeq ($(BR2_PACKAGE_SPEEX),y)
313FFMPEG_CONF_OPTS += --enable-libspeex
314FFMPEG_DEPENDENCIES += speex
315else
316FFMPEG_CONF_OPTS += --disable-libspeex
317endif
318
319ifeq ($(BR2_PACKAGE_LIBTHEORA),y)
320FFMPEG_CONF_OPTS += --enable-libtheora
321FFMPEG_DEPENDENCIES += libtheora
322else
323FFMPEG_CONF_OPTS += --disable-libtheora
324endif
325
326ifeq ($(BR2_PACKAGE_WAVPACK),y)
327FFMPEG_CONF_OPTS += --enable-libwavpack
328FFMPEG_DEPENDENCIES += wavpack
329else
330FFMPEG_CONF_OPTS += --disable-libwavpack
331endif
332
Steve Kenton0ff42f12015-01-26 19:22:35 -0600333# ffmpeg freetype support require fenv.h which is only
Peter Korsgaard64a49802015-01-31 08:18:30 +0100334# available/working on glibc.
335# The microblaze variant doesn't provide the needed exceptions
336ifeq ($(BR2_PACKAGE_FREETYPE)$(BR2_TOOLCHAIN_USES_GLIBC)x$(BR2_microblaze),yyx)
Steve Kenton0ff42f12015-01-26 19:22:35 -0600337FFMPEG_CONF_OPTS += --enable-libfreetype
338FFMPEG_DEPENDENCIES += freetype
339else
340FFMPEG_CONF_OPTS += --disable-libfreetype
341endif
342
343ifeq ($(BR2_PACKAGE_FONTCONFIG),y)
344FFMPEG_CONF_OPTS += --enable-fontconfig
345FFMPEG_DEPENDENCIES += fontconfig
346else
347FFMPEG_CONF_OPTS += --disable-fontconfig
348endif
349
David du Colombier31820562014-10-05 18:29:57 +0200350ifeq ($(BR2_PACKAGE_X264)$(BR2_PACKAGE_FFMPEG_GPL),yy)
351FFMPEG_CONF_OPTS += --enable-libx264
352FFMPEG_DEPENDENCIES += x264
353else
354FFMPEG_CONF_OPTS += --disable-libx264
355endif
356
Bernd Kuhlsd6a69582015-11-01 19:47:29 +0100357ifeq ($(BR2_PACKAGE_X265)$(BR2_PACKAGE_FFMPEG_GPL),yy)
358FFMPEG_CONF_OPTS += --enable-libx265
359FFMPEG_DEPENDENCIES += x265
360else
361FFMPEG_CONF_OPTS += --disable-libx265
362endif
363
Bernd Kuhls62ab07e2014-01-02 18:59:44 +0100364ifeq ($(BR2_X86_CPU_HAS_MMX),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200365FFMPEG_CONF_OPTS += --enable-yasm
Bernd Kuhls8eb78ba2014-01-13 06:48:11 +0100366FFMPEG_DEPENDENCIES += host-yasm
Bernd Kuhls62ab07e2014-01-02 18:59:44 +0100367else
Bernd Kuhlsbfb8df22015-06-20 21:44:55 +0200368ifeq ($(BR2_x86_i586),y)
369# Needed to work around a bug with gcc 5.x:
370# error: 'asm' operand has impossible constraints
371FFMPEG_CONF_OPTS += --disable-inline-asm
372endif
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200373FFMPEG_CONF_OPTS += --disable-yasm
374FFMPEG_CONF_OPTS += --disable-mmx
Bernd Kuhls62ab07e2014-01-02 18:59:44 +0100375endif
376
377ifeq ($(BR2_X86_CPU_HAS_SSE),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200378FFMPEG_CONF_OPTS += --enable-sse
Bernd Kuhls62ab07e2014-01-02 18:59:44 +0100379else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200380FFMPEG_CONF_OPTS += --disable-sse
Bernd Kuhls62ab07e2014-01-02 18:59:44 +0100381endif
382
383ifeq ($(BR2_X86_CPU_HAS_SSE2),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200384FFMPEG_CONF_OPTS += --enable-sse2
Bernd Kuhls62ab07e2014-01-02 18:59:44 +0100385else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200386FFMPEG_CONF_OPTS += --disable-sse2
Bernd Kuhls62ab07e2014-01-02 18:59:44 +0100387endif
388
389ifeq ($(BR2_X86_CPU_HAS_SSE3),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200390FFMPEG_CONF_OPTS += --enable-sse3
Bernd Kuhls62ab07e2014-01-02 18:59:44 +0100391else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200392FFMPEG_CONF_OPTS += --disable-sse3
Bernd Kuhls62ab07e2014-01-02 18:59:44 +0100393endif
394
395ifeq ($(BR2_X86_CPU_HAS_SSSE3),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200396FFMPEG_CONF_OPTS += --enable-ssse3
Bernd Kuhls62ab07e2014-01-02 18:59:44 +0100397else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200398FFMPEG_CONF_OPTS += --disable-ssse3
Gustavo Zacarias3f6aa3e2011-02-28 11:18:21 -0300399endif
400
Bernd Kuhls0e8e3c22014-01-02 18:59:45 +0100401ifeq ($(BR2_X86_CPU_HAS_SSE4),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200402FFMPEG_CONF_OPTS += --enable-sse4
Bernd Kuhls0e8e3c22014-01-02 18:59:45 +0100403else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200404FFMPEG_CONF_OPTS += --disable-sse4
Bernd Kuhls0e8e3c22014-01-02 18:59:45 +0100405endif
406
407ifeq ($(BR2_X86_CPU_HAS_SSE42),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200408FFMPEG_CONF_OPTS += --enable-sse42
Bernd Kuhls0e8e3c22014-01-02 18:59:45 +0100409else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200410FFMPEG_CONF_OPTS += --disable-sse42
Bernd Kuhls0e8e3c22014-01-02 18:59:45 +0100411endif
412
Steven Noonan1cd92d22015-03-18 15:01:11 -0700413ifeq ($(BR2_X86_CPU_HAS_AVX),y)
414FFMPEG_CONF_OPTS += --enable-avx
415else
416FFMPEG_CONF_OPTS += --disable-avx
417endif
418
419ifeq ($(BR2_X86_CPU_HAS_AVX2),y)
420FFMPEG_CONF_OPTS += --enable-avx2
421else
422FFMPEG_CONF_OPTS += --disable-avx2
423endif
424
Gustavo Zacarias9e77eaf2012-12-21 02:40:31 +0000425# Explicitly disable everything that doesn't match for ARM
426# FFMPEG "autodetects" by compiling an extended instruction via AS
427# This works on compilers that aren't built for generic by default
Thomas Petazzoni0ac115d2014-10-21 22:26:49 +0200428ifeq ($(BR2_ARM_CPU_ARMV4),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200429FFMPEG_CONF_OPTS += --disable-armv5te
Gustavo Zacarias1b269dd2011-03-01 13:20:00 -0300430endif
Thomas Petazzoni0ac115d2014-10-21 22:26:49 +0200431ifeq ($(BR2_ARM_CPU_ARMV6)$(BR2_ARM_CPU_ARMV7A),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200432FFMPEG_CONF_OPTS += --enable-armv6
Gustavo Zacarias9e77eaf2012-12-21 02:40:31 +0000433else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200434FFMPEG_CONF_OPTS += --disable-armv6 --disable-armv6t2
Gustavo Zacarias1b269dd2011-03-01 13:20:00 -0300435endif
Thomas Petazzoni3300e002014-10-21 22:26:50 +0200436ifeq ($(BR2_ARM_CPU_HAS_VFPV2),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200437FFMPEG_CONF_OPTS += --enable-vfp
Gustavo Zacarias9e77eaf2012-12-21 02:40:31 +0000438else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200439FFMPEG_CONF_OPTS += --disable-vfp
Gustavo Zacarias1b269dd2011-03-01 13:20:00 -0300440endif
Peter Korsgaardce8a7d52012-12-13 23:25:30 +0100441ifeq ($(BR2_ARM_CPU_HAS_NEON),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200442FFMPEG_CONF_OPTS += --enable-neon
Thomas Petazzoniae7becf2016-08-10 23:29:03 +0200443else
444FFMPEG_CONF_OPTS += --disable-neon
Gustavo Zacarias1b269dd2011-03-01 13:20:00 -0300445endif
Gustavo Zacarias9e77eaf2012-12-21 02:40:31 +0000446
Thomas Petazzonifdd0f8d2016-08-10 23:29:04 +0200447ifeq ($(BR2_mips)$(BR2_mipsel)$(BR2_mips64)$(BR2_mips64el),y)
Bernd Kuhls0fff2502014-01-13 22:23:06 +0100448ifeq ($(BR2_MIPS_SOFT_FLOAT),y)
Vicente Olivert Riera9aee5572016-07-02 15:32:15 +0200449FFMPEG_CONF_OPTS += --disable-mipsfpu
Bernd Kuhls0fff2502014-01-13 22:23:06 +0100450else
Vicente Olivert Riera9aee5572016-07-02 15:32:15 +0200451FFMPEG_CONF_OPTS += --enable-mipsfpu
Bernd Kuhls0fff2502014-01-13 22:23:06 +0100452endif
Thomas Petazzonifdd0f8d2016-08-10 23:29:04 +0200453endif # MIPS
Bernd Kuhls0fff2502014-01-13 22:23:06 +0100454
Cody P Schafer40e58da2014-05-12 22:28:17 -0700455ifeq ($(BR2_POWERPC_CPU_HAS_ALTIVEC),y)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200456FFMPEG_CONF_OPTS += --enable-altivec
Mike Williams29a07682011-05-12 16:12:40 -0400457else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200458FFMPEG_CONF_OPTS += --disable-altivec
Mike Williams29a07682011-05-12 16:12:40 -0400459endif
Gustavo Zacarias1b269dd2011-03-01 13:20:00 -0300460
Thomas Petazzoni665e13c2014-12-03 22:41:29 +0100461ifeq ($(BR2_STATIC_LIBS),)
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200462FFMPEG_CONF_OPTS += --enable-pic
Danomi Manchego255aab72014-09-08 22:06:44 -0400463else
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200464FFMPEG_CONF_OPTS += --disable-pic
Bernd Kuhls62ab07e2014-01-02 18:59:44 +0100465endif
466
Vicente Olivert Riera30a87d32016-08-15 17:03:37 +0200467# Default to --cpu=generic for MIPS architecture, in order to avoid a
468# warning from ffmpeg's configure script.
469ifeq ($(BR2_mips)$(BR2_mipsel)$(BR2_mips64)$(BR2_mips64el),y)
470FFMPEG_CONF_OPTS += --cpu=generic
471else ifneq ($(call qstrip,$(BR2_GCC_TARGET_CPU)),)
Thomas Petazzoniae2850b2014-10-21 22:27:10 +0200472FFMPEG_CONF_OPTS += --cpu=$(BR2_GCC_TARGET_CPU)
Karoly Kaszad402daa2014-11-07 09:44:16 +0100473else ifneq ($(call qstrip,$(BR2_GCC_TARGET_ARCH)),)
Thomas Petazzoniae2850b2014-10-21 22:27:10 +0200474FFMPEG_CONF_OPTS += --cpu=$(BR2_GCC_TARGET_ARCH)
475endif
476
Vicente Olivert Riera30a87d32016-08-15 17:03:37 +0200477
Vicente Olivert Riera8849e802015-10-15 13:22:55 +0100478FFMPEG_CONF_OPTS += $(call qstrip,$(BR2_PACKAGE_FFMPEG_EXTRACONF))
479
Luca Ceresoli13293402010-06-14 21:41:42 +0200480# Override FFMPEG_CONFIGURE_CMDS: FFmpeg does not support --target and others
481define FFMPEG_CONFIGURE_CMDS
482 (cd $(FFMPEG_SRCDIR) && rm -rf config.cache && \
483 $(TARGET_CONFIGURE_OPTS) \
484 $(TARGET_CONFIGURE_ARGS) \
Luca Ceresoli13293402010-06-14 21:41:42 +0200485 $(FFMPEG_CONF_ENV) \
486 ./configure \
Bernd Kuhls79449c22014-10-03 11:50:46 +0200487 --enable-cross-compile \
Luca Ceresoli13293402010-06-14 21:41:42 +0200488 --cross-prefix=$(TARGET_CROSS) \
489 --sysroot=$(STAGING_DIR) \
Peter Korsgaarde18087a2011-01-01 11:49:01 +0100490 --host-cc="$(HOSTCC)" \
Luca Ceresoli13293402010-06-14 21:41:42 +0200491 --arch=$(BR2_ARCH) \
Bernd Kuhls62ab07e2014-01-02 18:59:44 +0100492 --target-os="linux" \
Bernd Kuhls12a3ecf2014-08-10 14:46:46 +0200493 --disable-stripping \
Danomi Manchegoa9a5a812014-09-08 22:06:46 -0400494 --pkg-config="$(PKG_CONFIG_HOST_BINARY)" \
Luca Ceresoli97a42962011-06-20 17:59:54 +0200495 $(SHARED_STATIC_LIBS_OPTS) \
Thomas De Schampheleireaaffd202014-09-27 21:32:44 +0200496 $(FFMPEG_CONF_OPTS) \
Luca Ceresoli13293402010-06-14 21:41:42 +0200497 )
498endef
499
Arnout Vandecappelle (Essensium/Mind)e1502eb2012-07-03 00:07:32 +0200500$(eval $(autotools-package))