Files
buildroot/package/ffmpeg/ffmpeg.mk
Bernd Kuhls acda85c858 package/ffmpeg: bump version to 9.0.2
Updated license hashes due to upstream commits:
https://git.videolan.org/?p=ffmpeg.git;a=commit;h=8d439b24839d486d1fcc858a2a5eb7ecd700e3a9
https://git.videolan.org/?p=ffmpeg.git;a=commit;h=8c920c4c396163e3b9a0b428dd550d3c986236aa

Removed patches 0005, 0006 & 0007 which are included in this release,
rebased remaining patches.

Added patch 0004 to fix a build error on armv5 which would be introduced
by this bump.

Removed configure option --disable-crystalhd due to upstream removal:
http://git.videolan.org/?p=ffmpeg.git;a=commitdiff;h=5b23b18d40ead8606c92d967279b3f43c94d8a60

Removed omx-related configure options due to upstream commit
f31675400b

Contrary to the commit description libpostproc was removed from ffmpeg
tree:
https://git.videolan.org/?p=ffmpeg.git;a=commit;h=8c920c4c396163e3b9a0b428dd550d3c986236aa
https://lists.ffmpeg.org/archives/list/ffmpeg-devel@ffmpeg.org/thread/YPPWZBQF42TJX2AQXWXDMHRRREAKQ7US/#6VMF7HDCEU45NJB5TYJEUKGRXVNQ7V6D

The libpostproc code was removed from upstream ffmpeg but is still
needed for hardware-based deinterlacing using vaapi in Kodi.
We re-add the optional libpostproc code by using the diff file created
by ffmpeg upstream maintainer and provided for download by Kodi.
Due to changes by the libpostproc patch we need to update the hash of
LICENSE.md. For details see
https://github.com/michaelni/libpostproc/blob/master/README.md

Added patch for tvheadend to fix build errors introduced by this bump.

Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
[Julien: replace "patch -p1" call with "$(APPLY_PATCHES)"]
Signed-off-by: Julien Olivain <ju.o@free.fr>
2026-11-07 12:16:10 +01:00

646 lines
16 KiB
Makefile

################################################################################
#
# ffmpeg
#
################################################################################
FFMPEG_VERSION = 9.0.2
FFMPEG_SOURCE = ffmpeg-$(FFMPEG_VERSION).tar.xz
FFMPEG_SITE = https://ffmpeg.org/releases
FFMPEG_INSTALL_STAGING = YES
FFMPEG_LICENSE = LGPL-2.1+, libjpeg license
FFMPEG_LICENSE_FILES = LICENSE.md COPYING.LGPLv2.1
ifeq ($(BR2_PACKAGE_FFMPEG_GPL),y)
FFMPEG_LICENSE += and GPL-2.0+
FFMPEG_LICENSE_FILES += COPYING.GPLv2
endif
FFMPEG_EXTRA_DOWNLOADS = \
https://github.com/xbmc/xbmc/raw/refs/tags/22.0rc1-Piers/tools/depends/target/ffmpeg/001-ffmpeg-all-libpostproc-plugin.patch
define FFMPEG_APPLY_POSTPROC_PATCH
$(APPLY_PATCHES) $(@D) $(FFMPEG_DL_DIR) \
001-ffmpeg-all-libpostproc-plugin.patch
endef
FFMPEG_PRE_PATCH_HOOKS += FFMPEG_APPLY_POSTPROC_PATCH
FFMPEG_CPE_ID_VENDOR = ffmpeg
FFMPEG_CONF_OPTS = \
--prefix=/usr \
--enable-avfilter \
--disable-version3 \
--enable-logging \
--enable-optimizations \
--disable-extra-warnings \
--enable-avdevice \
--enable-avcodec \
--enable-avformat \
--enable-network \
--disable-gray \
--enable-swscale-alpha \
--disable-small \
--disable-dxva2 \
--enable-runtime-cpudetect \
--disable-hardcoded-tables \
--disable-mipsdsp \
--disable-mipsdspr2 \
--disable-msa \
--enable-hwaccels \
--disable-cuda \
--disable-cuvid \
--disable-nvenc \
--disable-avisynth \
--disable-frei0r \
--disable-libopencore-amrnb \
--disable-libopencore-amrwb \
--disable-libdc1394 \
--disable-libgsm \
--disable-libilbc \
--disable-libvo-amrwbenc \
--disable-symver \
--disable-doc \
--disable-mmal
FFMPEG_DEPENDENCIES += host-pkgconf
ifeq ($(BR2_PACKAGE_FFMPEG_GPL),y)
FFMPEG_CONF_OPTS += --enable-gpl
else
FFMPEG_CONF_OPTS += --disable-gpl
endif
ifeq ($(BR2_PACKAGE_FFMPEG_NONFREE),y)
FFMPEG_CONF_OPTS += --enable-nonfree
else
FFMPEG_CONF_OPTS += --disable-nonfree
endif
ifeq ($(BR2_PACKAGE_FFMPEG_FFMPEG),y)
FFMPEG_CONF_OPTS += --enable-ffmpeg
else
FFMPEG_CONF_OPTS += --disable-ffmpeg
endif
ifeq ($(BR2_PACKAGE_FFMPEG_FFPLAY),y)
FFMPEG_DEPENDENCIES += sdl2
FFMPEG_CONF_OPTS += --enable-ffplay
FFMPEG_CONF_ENV += SDL_CONFIG=$(STAGING_DIR)/usr/bin/sdl2-config
else
FFMPEG_CONF_OPTS += --disable-ffplay
endif
ifeq ($(BR2_PACKAGE_JACK1),y)
FFMPEG_CONF_OPTS += --enable-libjack
FFMPEG_DEPENDENCIES += jack1
else ifeq ($(BR2_PACKAGE_JACK2),y)
FFMPEG_CONF_OPTS += --enable-libjack
FFMPEG_DEPENDENCIES += jack2
else
FFMPEG_CONF_OPTS += --disable-libjack
endif
ifeq ($(BR2_PACKAGE_PULSEAUDIO),y)
FFMPEG_DEPENDENCIES += pulseaudio
FFMPEG_CONF_OPTS += --enable-libpulse
else
FFMPEG_CONF_OPTS += --disable-libpulse
endif
ifeq ($(BR2_PACKAGE_LIBV4L),y)
FFMPEG_DEPENDENCIES += libv4l
FFMPEG_CONF_OPTS += --enable-libv4l2
else
FFMPEG_CONF_OPTS += --disable-libv4l2
endif
ifeq ($(BR2_PACKAGE_FFMPEG_FFPROBE),y)
FFMPEG_CONF_OPTS += --enable-ffprobe
else
FFMPEG_CONF_OPTS += --disable-ffprobe
endif
ifeq ($(BR2_PACKAGE_FFMPEG_XCBGRAB),y)
FFMPEG_CONF_OPTS += \
--enable-libxcb \
--enable-libxcb-shape \
--enable-libxcb-shm \
--enable-libxcb-xfixes
FFMPEG_DEPENDENCIES += libxcb
else
FFMPEG_CONF_OPTS += --disable-libxcb
endif
ifeq ($(BR2_PACKAGE_FFMPEG_POSTPROC),y)
FFMPEG_CONF_OPTS += --enable-postproc
else
FFMPEG_CONF_OPTS += --disable-postproc
endif
ifeq ($(BR2_PACKAGE_FFMPEG_SWSCALE),y)
FFMPEG_CONF_OPTS += --enable-swscale
else
FFMPEG_CONF_OPTS += --disable-swscale
endif
ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_ENCODERS)),all)
FFMPEG_CONF_OPTS += --disable-encoders \
$(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_ENCODERS)),--enable-encoder=$(x))
endif
ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_DECODERS)),all)
FFMPEG_CONF_OPTS += --disable-decoders \
$(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_DECODERS)),--enable-decoder=$(x))
endif
ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_MUXERS)),all)
FFMPEG_CONF_OPTS += --disable-muxers \
$(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_MUXERS)),--enable-muxer=$(x))
endif
ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_DEMUXERS)),all)
FFMPEG_CONF_OPTS += --disable-demuxers \
$(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_DEMUXERS)),--enable-demuxer=$(x))
endif
ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_PARSERS)),all)
FFMPEG_CONF_OPTS += --disable-parsers \
$(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_PARSERS)),--enable-parser=$(x))
endif
ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_BSFS)),all)
FFMPEG_CONF_OPTS += --disable-bsfs \
$(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_BSFS)),--enable-bsf=$(x))
endif
ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_PROTOCOLS)),all)
FFMPEG_CONF_OPTS += --disable-protocols \
$(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_PROTOCOLS)),--enable-protocol=$(x))
endif
ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_FILTERS)),all)
FFMPEG_CONF_OPTS += --disable-filters \
$(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_FILTERS)),--enable-filter=$(x))
endif
ifeq ($(BR2_PACKAGE_FFMPEG_INDEVS),y)
FFMPEG_CONF_OPTS += --enable-indevs
ifeq ($(BR2_PACKAGE_ALSA_LIB),y)
FFMPEG_CONF_OPTS += --enable-alsa
FFMPEG_DEPENDENCIES += alsa-lib
else
FFMPEG_CONF_OPTS += --disable-alsa
endif
else
FFMPEG_CONF_OPTS += --disable-indevs
endif
ifeq ($(BR2_PACKAGE_FFMPEG_OUTDEVS),y)
FFMPEG_CONF_OPTS += --enable-outdevs
ifeq ($(BR2_PACKAGE_ALSA_LIB),y)
FFMPEG_DEPENDENCIES += alsa-lib
endif
else
FFMPEG_CONF_OPTS += --disable-outdevs
endif
ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
FFMPEG_CONF_OPTS += --enable-pthreads
else
FFMPEG_CONF_OPTS += --disable-pthreads
endif
ifeq ($(BR2_PACKAGE_ZLIB),y)
FFMPEG_CONF_OPTS += --enable-zlib
FFMPEG_DEPENDENCIES += zlib
else
FFMPEG_CONF_OPTS += --disable-zlib
endif
ifeq ($(BR2_PACKAGE_BZIP2),y)
FFMPEG_CONF_OPTS += --enable-bzlib
FFMPEG_DEPENDENCIES += bzip2
else
FFMPEG_CONF_OPTS += --disable-bzlib
endif
ifeq ($(BR2_PACKAGE_FDK_AAC)$(BR2_PACKAGE_FFMPEG_NONFREE),yy)
FFMPEG_CONF_OPTS += --enable-libfdk-aac
FFMPEG_DEPENDENCIES += fdk-aac
else
FFMPEG_CONF_OPTS += --disable-libfdk-aac
endif
ifeq ($(BR2_PACKAGE_FFMPEG_GPL)$(BR2_PACKAGE_LIBCDIO_PARANOIA),yy)
FFMPEG_CONF_OPTS += --enable-libcdio
FFMPEG_DEPENDENCIES += libcdio-paranoia
else
FFMPEG_CONF_OPTS += --disable-libcdio
endif
ifeq ($(BR2_PACKAGE_GNUTLS),y)
FFMPEG_CONF_OPTS += --enable-gnutls --disable-openssl
FFMPEG_DEPENDENCIES += gnutls
else
FFMPEG_CONF_OPTS += --disable-gnutls
ifeq ($(BR2_PACKAGE_OPENSSL),y)
# openssl isn't license compatible with GPL
ifeq ($(BR2_PACKAGE_FFMPEG_GPL)x$(BR2_PACKAGE_FFMPEG_NONFREE),yx)
FFMPEG_CONF_OPTS += --disable-openssl
else
FFMPEG_CONF_OPTS += --enable-openssl
FFMPEG_DEPENDENCIES += openssl
endif
else
FFMPEG_CONF_OPTS += --disable-openssl
endif
endif
ifeq ($(BR2_PACKAGE_LIBDRM),y)
FFMPEG_CONF_OPTS += --enable-libdrm
FFMPEG_DEPENDENCIES += libdrm
else
FFMPEG_CONF_OPTS += --disable-libdrm
endif
ifeq ($(BR2_PACKAGE_LIBOPENH264),y)
FFMPEG_CONF_OPTS += --enable-libopenh264
FFMPEG_DEPENDENCIES += libopenh264
else
FFMPEG_CONF_OPTS += --disable-libopenh264
endif
ifeq ($(BR2_PACKAGE_LIBVORBIS),y)
FFMPEG_DEPENDENCIES += libvorbis
FFMPEG_CONF_OPTS += \
--enable-libvorbis \
--enable-muxer=ogg \
--enable-encoder=libvorbis
endif
ifeq ($(BR2_PACKAGE_LIBVA),y)
FFMPEG_CONF_OPTS += --enable-vaapi
FFMPEG_DEPENDENCIES += libva
else
FFMPEG_CONF_OPTS += --disable-vaapi
endif
ifeq ($(BR2_PACKAGE_LIBVDPAU),y)
FFMPEG_CONF_OPTS += --enable-vdpau
FFMPEG_DEPENDENCIES += libvdpau
else
FFMPEG_CONF_OPTS += --disable-vdpau
endif
# To avoid a circular dependency only use opencv if opencv itself does
# not depend on ffmpeg.
ifeq ($(BR2_PACKAGE_OPENCV4_LIB_IMGPROC)x$(BR2_PACKAGE_OPENCV4_WITH_FFMPEG),yx)
FFMPEG_CONF_OPTS += --enable-libopencv \
--extra-cflags=-I$(STAGING_DIR)/usr/include/opencv4
FFMPEG_DEPENDENCIES += opencv4
else
FFMPEG_CONF_OPTS += --disable-libopencv
endif
ifeq ($(BR2_PACKAGE_OPUS),y)
FFMPEG_CONF_OPTS += --enable-libopus
FFMPEG_DEPENDENCIES += opus
else
FFMPEG_CONF_OPTS += --disable-libopus
endif
ifeq ($(BR2_PACKAGE_LIBVPX),y)
FFMPEG_CONF_OPTS += --enable-libvpx
FFMPEG_DEPENDENCIES += libvpx
else
FFMPEG_CONF_OPTS += --disable-libvpx
endif
ifeq ($(BR2_PACKAGE_LIBASS),y)
FFMPEG_CONF_OPTS += --enable-libass
FFMPEG_DEPENDENCIES += libass
else
FFMPEG_CONF_OPTS += --disable-libass
endif
ifeq ($(BR2_PACKAGE_LIBBLURAY),y)
FFMPEG_CONF_OPTS += --enable-libbluray
FFMPEG_DEPENDENCIES += libbluray
else
FFMPEG_CONF_OPTS += --disable-libbluray
endif
ifeq ($(BR2_PACKAGE_LIBVPL),y)
FFMPEG_CONF_OPTS += --enable-libvpl --disable-libmfx
FFMPEG_DEPENDENCIES += libvpl
else ifeq ($(BR2_PACKAGE_INTEL_MEDIASDK),y)
FFMPEG_CONF_OPTS += --disable-libvpl --enable-libmfx
FFMPEG_DEPENDENCIES += intel-mediasdk
else
FFMPEG_CONF_OPTS += --disable-libvpl --disable-libmfx
endif
ifeq ($(BR2_PACKAGE_RTMPDUMP),y)
FFMPEG_CONF_OPTS += --enable-librtmp
FFMPEG_DEPENDENCIES += rtmpdump
else
FFMPEG_CONF_OPTS += --disable-librtmp
endif
ifeq ($(BR2_PACKAGE_LAME),y)
FFMPEG_CONF_OPTS += --enable-libmp3lame
FFMPEG_DEPENDENCIES += lame
else
FFMPEG_CONF_OPTS += --disable-libmp3lame
endif
ifeq ($(BR2_PACKAGE_LIBMODPLUG),y)
FFMPEG_CONF_OPTS += --enable-libmodplug
FFMPEG_DEPENDENCIES += libmodplug
else
FFMPEG_CONF_OPTS += --disable-libmodplug
endif
ifeq ($(BR2_PACKAGE_LIBOPENMPT),y)
FFMPEG_CONF_OPTS += --enable-libopenmpt
FFMPEG_DEPENDENCIES += libopenmpt
else
FFMPEG_CONF_OPTS += --disable-libopenmpt
endif
ifeq ($(BR2_PACKAGE_LIBSOXR),y)
FFMPEG_CONF_OPTS += --enable-libsoxr
FFMPEG_DEPENDENCIES += libsoxr
else
FFMPEG_CONF_OPTS += --disable-libsoxr
endif
ifeq ($(BR2_PACKAGE_SPEEX),y)
FFMPEG_CONF_OPTS += --enable-libspeex
FFMPEG_DEPENDENCIES += speex
else
FFMPEG_CONF_OPTS += --disable-libspeex
endif
ifeq ($(BR2_PACKAGE_LIBTHEORA),y)
FFMPEG_CONF_OPTS += --enable-libtheora
FFMPEG_DEPENDENCIES += libtheora
else
FFMPEG_CONF_OPTS += --disable-libtheora
endif
ifeq ($(BR2_PACKAGE_LIBICONV),y)
FFMPEG_CONF_OPTS += --enable-iconv
FFMPEG_DEPENDENCIES += libiconv
else
FFMPEG_CONF_OPTS += --disable-iconv
endif
ifeq ($(BR2_PACKAGE_LIBXML2),y)
FFMPEG_CONF_OPTS += --enable-libxml2
FFMPEG_DEPENDENCIES += libxml2
else
FFMPEG_CONF_OPTS += --disable-libxml2
endif
# ffmpeg freetype support require fenv.h which is only
# available/working on glibc.
# The microblaze variant doesn't provide the needed exceptions
ifeq ($(BR2_PACKAGE_FREETYPE)$(BR2_TOOLCHAIN_USES_GLIBC)x$(BR2_microblaze),yyx)
FFMPEG_CONF_OPTS += --enable-libfreetype
FFMPEG_DEPENDENCIES += freetype
else
FFMPEG_CONF_OPTS += --disable-libfreetype
endif
ifeq ($(BR2_PACKAGE_FONTCONFIG),y)
FFMPEG_CONF_OPTS += --enable-fontconfig
FFMPEG_DEPENDENCIES += fontconfig
else
FFMPEG_CONF_OPTS += --disable-fontconfig
endif
ifeq ($(BR2_PACKAGE_HARFBUZZ),y)
FFMPEG_CONF_OPTS += --enable-libharfbuzz
FFMPEG_DEPENDENCIES += harfbuzz
else
FFMPEG_CONF_OPTS += --disable-libharfbuzz
endif
ifeq ($(BR2_PACKAGE_LIBFRIBIDI),y)
FFMPEG_CONF_OPTS += --enable-libfribidi
FFMPEG_DEPENDENCIES += libfribidi
else
FFMPEG_CONF_OPTS += --disable-libfribidi
endif
ifeq ($(BR2_PACKAGE_OPENJPEG),y)
FFMPEG_CONF_OPTS += --enable-libopenjpeg
FFMPEG_DEPENDENCIES += openjpeg
else
FFMPEG_CONF_OPTS += --disable-libopenjpeg
endif
ifeq ($(BR2_PACKAGE_X264)$(BR2_PACKAGE_FFMPEG_GPL),yy)
FFMPEG_CONF_OPTS += --enable-libx264
FFMPEG_DEPENDENCIES += x264
else
FFMPEG_CONF_OPTS += --disable-libx264
endif
ifeq ($(BR2_PACKAGE_X265)$(BR2_PACKAGE_FFMPEG_GPL),yy)
FFMPEG_CONF_OPTS += --enable-libx265
FFMPEG_DEPENDENCIES += x265
else
FFMPEG_CONF_OPTS += --disable-libx265
endif
ifeq ($(BR2_PACKAGE_DAV1D),y)
FFMPEG_CONF_OPTS += --enable-libdav1d
FFMPEG_DEPENDENCIES += dav1d
else
FFMPEG_CONF_OPTS += --disable-libdav1d
endif
ifeq ($(BR2_X86_CPU_HAS_MMX),y)
FFMPEG_CONF_OPTS += --enable-x86asm
FFMPEG_DEPENDENCIES += host-nasm
else
FFMPEG_CONF_OPTS += --disable-x86asm
FFMPEG_CONF_OPTS += --disable-mmx
endif
ifeq ($(BR2_X86_CPU_HAS_SSE),y)
FFMPEG_CONF_OPTS += --enable-sse
else
FFMPEG_CONF_OPTS += --disable-sse
endif
ifeq ($(BR2_X86_CPU_HAS_SSE2),y)
FFMPEG_CONF_OPTS += --enable-sse2
else
FFMPEG_CONF_OPTS += --disable-sse2
endif
ifeq ($(BR2_X86_CPU_HAS_SSE3),y)
FFMPEG_CONF_OPTS += --enable-sse3
else
FFMPEG_CONF_OPTS += --disable-sse3
endif
ifeq ($(BR2_X86_CPU_HAS_SSSE3),y)
FFMPEG_CONF_OPTS += --enable-ssse3
else
FFMPEG_CONF_OPTS += --disable-ssse3
endif
ifeq ($(BR2_X86_CPU_HAS_SSE4),y)
FFMPEG_CONF_OPTS += --enable-sse4
else
FFMPEG_CONF_OPTS += --disable-sse4
endif
ifeq ($(BR2_X86_CPU_HAS_SSE42),y)
FFMPEG_CONF_OPTS += --enable-sse42
else
FFMPEG_CONF_OPTS += --disable-sse42
endif
ifeq ($(BR2_X86_CPU_HAS_AVX),y)
FFMPEG_CONF_OPTS += --enable-avx
else
FFMPEG_CONF_OPTS += --disable-avx
endif
ifeq ($(BR2_X86_CPU_HAS_AVX2),y)
FFMPEG_CONF_OPTS += --enable-avx2
else
FFMPEG_CONF_OPTS += --disable-avx2
endif
# Explicitly disable everything that doesn't match for ARM
# FFMPEG "autodetects" by compiling an extended instruction via AS
# This works on compilers that aren't built for generic by default
ifeq ($(BR2_ARM_CPU_ARMV4),y)
FFMPEG_CONF_OPTS += --disable-armv5te
endif
ifeq ($(BR2_ARM_CPU_ARMV6)$(BR2_ARM_CPU_ARMV7A),y)
FFMPEG_CONF_OPTS += --enable-armv6
else
FFMPEG_CONF_OPTS += --disable-armv6 --disable-armv6t2
endif
ifeq ($(BR2_ARM_CPU_HAS_VFPV2),y)
FFMPEG_CONF_OPTS += --enable-vfp
else
FFMPEG_CONF_OPTS += --disable-vfp
endif
ifeq ($(BR2_ARM_CPU_HAS_NEON),y)
FFMPEG_CONF_OPTS += --enable-neon
else ifeq ($(BR2_aarch64),y)
FFMPEG_CONF_OPTS += --enable-neon
else
FFMPEG_CONF_OPTS += --disable-neon
endif
ifeq ($(BR2_mips)$(BR2_mipsel)$(BR2_mips64)$(BR2_mips64el),y)
ifeq ($(BR2_MIPS_SOFT_FLOAT),y)
FFMPEG_CONF_OPTS += --disable-mipsfpu
else
FFMPEG_CONF_OPTS += --enable-mipsfpu
endif
# Fix build failure on several missing assembly instructions
FFMPEG_CONF_OPTS += --disable-asm
endif # MIPS
ifeq ($(BR2_POWERPC_CPU_HAS_ALTIVEC):$(BR2_powerpc64le),y:)
FFMPEG_CONF_OPTS += --enable-altivec
else ifeq ($(BR2_POWERPC_CPU_HAS_VSX):$(BR2_powerpc64le),y:y)
# On LE, ffmpeg AltiVec support needs VSX intrinsics, and VSX
# is an extension to AltiVec.
FFMPEG_CONF_OPTS += --enable-altivec
else
FFMPEG_CONF_OPTS += --disable-altivec
endif
# Fix build failure on several missing assembly instructions
ifeq ($(BR2_RISCV_32),y)
FFMPEG_CONF_OPTS += --disable-rvv --disable-asm
endif
# Uses __atomic_fetch_add_4
ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
FFMPEG_CONF_OPTS += --extra-libs=-latomic
endif
ifeq ($(BR2_STATIC_LIBS),)
FFMPEG_CONF_OPTS += --enable-pic
else
FFMPEG_CONF_OPTS += --disable-pic
endif
# Default to --cpu=generic for MIPS architecture, in order to avoid a
# warning from ffmpeg's configure script.
ifeq ($(BR2_mips)$(BR2_mipsel)$(BR2_mips64)$(BR2_mips64el),y)
FFMPEG_CONF_OPTS += --cpu=generic
else ifneq ($(GCC_TARGET_CPU),)
FFMPEG_CONF_OPTS += --cpu="$(GCC_TARGET_CPU)"
else ifneq ($(GCC_TARGET_ARCH),)
FFMPEG_CONF_OPTS += --cpu="$(GCC_TARGET_ARCH)"
endif
FFMPEG_CFLAGS = $(TARGET_CFLAGS)
FFMPEG_LDFLAGS = $(TARGET_LDFLAGS)
# workaround for static_assert on uclibc-ng < 1.0.42
FFMPEG_CFLAGS += -Dstatic_assert=_Static_assert
ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180),y)
FFMPEG_CONF_OPTS += --disable-optimizations
FFMPEG_CFLAGS += -O0
endif
ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_68485),y)
FFMPEG_CONF_OPTS += --disable-optimizations
FFMPEG_CFLAGS += -O0
endif
ifeq ($(BR2_ARM_INSTRUCTIONS_THUMB),y)
FFMPEG_CFLAGS += -marm
endif
ifeq ($(BR2_i386),y)
FFMPEG_LDFLAGS += -Wl,-z,notext
endif
FFMPEG_CONF_ENV += CFLAGS="$(FFMPEG_CFLAGS)" LDFLAGS="$(FFMPEG_LDFLAGS)"
FFMPEG_CONF_OPTS += $(call qstrip,$(BR2_PACKAGE_FFMPEG_EXTRACONF))
# Override FFMPEG_CONFIGURE_CMDS: FFmpeg does not support --target and others
define FFMPEG_CONFIGURE_CMDS
(cd $(FFMPEG_SRCDIR) && rm -rf config.cache && \
$(TARGET_CONFIGURE_OPTS) \
$(TARGET_CONFIGURE_ARGS) \
$(FFMPEG_CONF_ENV) \
./configure \
--enable-cross-compile \
--cross-prefix=$(TARGET_CROSS) \
--sysroot=$(STAGING_DIR) \
--host-cc="$(HOSTCC)" \
--arch=$(BR2_ARCH) \
--target-os="linux" \
--disable-stripping \
--pkg-config="$(PKG_CONFIG_HOST_BINARY)" \
$(SHARED_STATIC_LIBS_OPTS) \
$(FFMPEG_CONF_OPTS) \
)
endef
define FFMPEG_REMOVE_EXAMPLE_SRC_FILES
rm -rf $(TARGET_DIR)/usr/share/ffmpeg/examples
endef
FFMPEG_POST_INSTALL_TARGET_HOOKS += FFMPEG_REMOVE_EXAMPLE_SRC_FILES
$(eval $(autotools-package))