ffmpeg.mk 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580
  1. ################################################################################
  2. #
  3. # ffmpeg
  4. #
  5. ################################################################################
  6. FFMPEG_VERSION = 4.3.1
  7. FFMPEG_SOURCE = ffmpeg-$(FFMPEG_VERSION).tar.xz
  8. FFMPEG_SITE = http://ffmpeg.org/releases
  9. FFMPEG_INSTALL_STAGING = YES
  10. FFMPEG_LICENSE = LGPL-2.1+, libjpeg license
  11. FFMPEG_LICENSE_FILES = LICENSE.md COPYING.LGPLv2.1
  12. ifeq ($(BR2_PACKAGE_FFMPEG_GPL),y)
  13. FFMPEG_LICENSE += and GPL-2.0+
  14. FFMPEG_LICENSE_FILES += COPYING.GPLv2
  15. endif
  16. FFMPEG_CONF_OPTS = \
  17. --prefix=/usr \
  18. --enable-avfilter \
  19. --disable-version3 \
  20. --enable-logging \
  21. --enable-optimizations \
  22. --disable-extra-warnings \
  23. --enable-avdevice \
  24. --enable-avcodec \
  25. --enable-avformat \
  26. --enable-network \
  27. --disable-gray \
  28. --enable-swscale-alpha \
  29. --disable-small \
  30. --enable-dct \
  31. --enable-fft \
  32. --enable-mdct \
  33. --enable-rdft \
  34. --disable-crystalhd \
  35. --disable-dxva2 \
  36. --enable-runtime-cpudetect \
  37. --disable-hardcoded-tables \
  38. --disable-mipsdsp \
  39. --disable-mipsdspr2 \
  40. --disable-msa \
  41. --enable-hwaccels \
  42. --disable-cuda \
  43. --disable-cuvid \
  44. --disable-nvenc \
  45. --disable-avisynth \
  46. --disable-frei0r \
  47. --disable-libopencore-amrnb \
  48. --disable-libopencore-amrwb \
  49. --disable-libdc1394 \
  50. --disable-libgsm \
  51. --disable-libilbc \
  52. --disable-libvo-amrwbenc \
  53. --disable-symver \
  54. --disable-doc
  55. FFMPEG_DEPENDENCIES += host-pkgconf
  56. ifeq ($(BR2_PACKAGE_FFMPEG_GPL),y)
  57. FFMPEG_CONF_OPTS += --enable-gpl
  58. else
  59. FFMPEG_CONF_OPTS += --disable-gpl
  60. endif
  61. ifeq ($(BR2_PACKAGE_FFMPEG_NONFREE),y)
  62. FFMPEG_CONF_OPTS += --enable-nonfree
  63. else
  64. FFMPEG_CONF_OPTS += --disable-nonfree
  65. endif
  66. ifeq ($(BR2_PACKAGE_FFMPEG_FFMPEG),y)
  67. FFMPEG_CONF_OPTS += --enable-ffmpeg
  68. else
  69. FFMPEG_CONF_OPTS += --disable-ffmpeg
  70. endif
  71. ifeq ($(BR2_PACKAGE_FFMPEG_FFPLAY),y)
  72. FFMPEG_DEPENDENCIES += sdl2
  73. FFMPEG_CONF_OPTS += --enable-ffplay
  74. FFMPEG_CONF_ENV += SDL_CONFIG=$(STAGING_DIR)/usr/bin/sdl2-config
  75. else
  76. FFMPEG_CONF_OPTS += --disable-ffplay
  77. endif
  78. ifeq ($(BR2_PACKAGE_FFMPEG_AVRESAMPLE),y)
  79. FFMPEG_CONF_OPTS += --enable-avresample
  80. else
  81. FFMPEG_CONF_OPTS += --disable-avresample
  82. endif
  83. ifeq ($(BR2_PACKAGE_FFMPEG_FFPROBE),y)
  84. FFMPEG_CONF_OPTS += --enable-ffprobe
  85. else
  86. FFMPEG_CONF_OPTS += --disable-ffprobe
  87. endif
  88. ifeq ($(BR2_PACKAGE_FFMPEG_XCBGRAB),y)
  89. FFMPEG_CONF_OPTS += \
  90. --enable-libxcb \
  91. --enable-libxcb-shape \
  92. --enable-libxcb-shm \
  93. --enable-libxcb-xfixes
  94. FFMPEG_DEPENDENCIES += libxcb
  95. else
  96. FFMPEG_CONF_OPTS += --disable-libxcb
  97. endif
  98. ifeq ($(BR2_PACKAGE_FFMPEG_POSTPROC),y)
  99. FFMPEG_CONF_OPTS += --enable-postproc
  100. else
  101. FFMPEG_CONF_OPTS += --disable-postproc
  102. endif
  103. ifeq ($(BR2_PACKAGE_FFMPEG_SWSCALE),y)
  104. FFMPEG_CONF_OPTS += --enable-swscale
  105. else
  106. FFMPEG_CONF_OPTS += --disable-swscale
  107. endif
  108. ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_ENCODERS)),all)
  109. FFMPEG_CONF_OPTS += --disable-encoders \
  110. $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_ENCODERS)),--enable-encoder=$(x))
  111. endif
  112. ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_DECODERS)),all)
  113. FFMPEG_CONF_OPTS += --disable-decoders \
  114. $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_DECODERS)),--enable-decoder=$(x))
  115. endif
  116. ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_MUXERS)),all)
  117. FFMPEG_CONF_OPTS += --disable-muxers \
  118. $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_MUXERS)),--enable-muxer=$(x))
  119. endif
  120. ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_DEMUXERS)),all)
  121. FFMPEG_CONF_OPTS += --disable-demuxers \
  122. $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_DEMUXERS)),--enable-demuxer=$(x))
  123. endif
  124. ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_PARSERS)),all)
  125. FFMPEG_CONF_OPTS += --disable-parsers \
  126. $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_PARSERS)),--enable-parser=$(x))
  127. endif
  128. ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_BSFS)),all)
  129. FFMPEG_CONF_OPTS += --disable-bsfs \
  130. $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_BSFS)),--enable-bsf=$(x))
  131. endif
  132. ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_PROTOCOLS)),all)
  133. FFMPEG_CONF_OPTS += --disable-protocols \
  134. $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_PROTOCOLS)),--enable-protocol=$(x))
  135. endif
  136. ifneq ($(call qstrip,$(BR2_PACKAGE_FFMPEG_FILTERS)),all)
  137. FFMPEG_CONF_OPTS += --disable-filters \
  138. $(foreach x,$(call qstrip,$(BR2_PACKAGE_FFMPEG_FILTERS)),--enable-filter=$(x))
  139. endif
  140. ifeq ($(BR2_PACKAGE_FFMPEG_INDEVS),y)
  141. FFMPEG_CONF_OPTS += --enable-indevs
  142. ifeq ($(BR2_PACKAGE_ALSA_LIB),y)
  143. FFMPEG_CONF_OPTS += --enable-alsa
  144. FFMPEG_DEPENDENCIES += alsa-lib
  145. else
  146. FFMPEG_CONF_OPTS += --disable-alsa
  147. endif
  148. else
  149. FFMPEG_CONF_OPTS += --disable-indevs
  150. endif
  151. ifeq ($(BR2_PACKAGE_FFMPEG_OUTDEVS),y)
  152. FFMPEG_CONF_OPTS += --enable-outdevs
  153. ifeq ($(BR2_PACKAGE_ALSA_LIB),y)
  154. FFMPEG_DEPENDENCIES += alsa-lib
  155. endif
  156. else
  157. FFMPEG_CONF_OPTS += --disable-outdevs
  158. endif
  159. ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
  160. FFMPEG_CONF_OPTS += --enable-pthreads
  161. else
  162. FFMPEG_CONF_OPTS += --disable-pthreads
  163. endif
  164. ifeq ($(BR2_PACKAGE_ZLIB),y)
  165. FFMPEG_CONF_OPTS += --enable-zlib
  166. FFMPEG_DEPENDENCIES += zlib
  167. else
  168. FFMPEG_CONF_OPTS += --disable-zlib
  169. endif
  170. ifeq ($(BR2_PACKAGE_BZIP2),y)
  171. FFMPEG_CONF_OPTS += --enable-bzlib
  172. FFMPEG_DEPENDENCIES += bzip2
  173. else
  174. FFMPEG_CONF_OPTS += --disable-bzlib
  175. endif
  176. ifeq ($(BR2_PACKAGE_FDK_AAC)$(BR2_PACKAGE_FFMPEG_NONFREE),yy)
  177. FFMPEG_CONF_OPTS += --enable-libfdk-aac
  178. FFMPEG_DEPENDENCIES += fdk-aac
  179. else
  180. FFMPEG_CONF_OPTS += --disable-libfdk-aac
  181. endif
  182. ifeq ($(BR2_PACKAGE_FFMPEG_GPL)$(BR2_PACKAGE_LIBCDIO_PARANOIA),yy)
  183. FFMPEG_CONF_OPTS += --enable-libcdio
  184. FFMPEG_DEPENDENCIES += libcdio-paranoia
  185. else
  186. FFMPEG_CONF_OPTS += --disable-libcdio
  187. endif
  188. ifeq ($(BR2_PACKAGE_GNUTLS),y)
  189. FFMPEG_CONF_OPTS += --enable-gnutls --disable-openssl
  190. FFMPEG_DEPENDENCIES += gnutls
  191. else
  192. FFMPEG_CONF_OPTS += --disable-gnutls
  193. ifeq ($(BR2_PACKAGE_OPENSSL),y)
  194. # openssl isn't license compatible with GPL
  195. ifeq ($(BR2_PACKAGE_FFMPEG_GPL)x$(BR2_PACKAGE_FFMPEG_NONFREE),yx)
  196. FFMPEG_CONF_OPTS += --disable-openssl
  197. else
  198. FFMPEG_CONF_OPTS += --enable-openssl
  199. FFMPEG_DEPENDENCIES += openssl
  200. endif
  201. else
  202. FFMPEG_CONF_OPTS += --disable-openssl
  203. endif
  204. endif
  205. ifeq ($(BR2_PACKAGE_FFMPEG_GPL)$(BR2_PACKAGE_LIBEBUR128),yy)
  206. FFMPEG_DEPENDENCIES += libebur128
  207. endif
  208. ifeq ($(BR2_PACKAGE_LIBDRM),y)
  209. FFMPEG_CONF_OPTS += --enable-libdrm
  210. FFMPEG_DEPENDENCIES += libdrm
  211. else
  212. FFMPEG_CONF_OPTS += --disable-libdrm
  213. endif
  214. ifeq ($(BR2_PACKAGE_LIBOPENH264),y)
  215. FFMPEG_CONF_OPTS += --enable-libopenh264
  216. FFMPEG_DEPENDENCIES += libopenh264
  217. else
  218. FFMPEG_CONF_OPTS += --disable-libopenh264
  219. endif
  220. ifeq ($(BR2_PACKAGE_LIBVORBIS),y)
  221. FFMPEG_DEPENDENCIES += libvorbis
  222. FFMPEG_CONF_OPTS += \
  223. --enable-libvorbis \
  224. --enable-muxer=ogg \
  225. --enable-encoder=libvorbis
  226. endif
  227. ifeq ($(BR2_PACKAGE_LIBVA),y)
  228. FFMPEG_CONF_OPTS += --enable-vaapi
  229. FFMPEG_DEPENDENCIES += libva
  230. else
  231. FFMPEG_CONF_OPTS += --disable-vaapi
  232. endif
  233. ifeq ($(BR2_PACKAGE_LIBVDPAU),y)
  234. FFMPEG_CONF_OPTS += --enable-vdpau
  235. FFMPEG_DEPENDENCIES += libvdpau
  236. else
  237. FFMPEG_CONF_OPTS += --disable-vdpau
  238. endif
  239. ifeq ($(BR2_PACKAGE_RPI_USERLAND),y)
  240. FFMPEG_CONF_OPTS += --enable-mmal --enable-omx --enable-omx-rpi \
  241. --extra-cflags=-I$(STAGING_DIR)/usr/include/IL
  242. FFMPEG_DEPENDENCIES += rpi-userland
  243. else ifeq ($(BR2_PACKAGE_SF_OMX_IL),y)
  244. FFMPEG_CONF_OPTS += --disable-mmal --enable-omx --disable-omx-rpi \
  245. --extra-cflags=-I$(STAGING_DIR)/usr/include/omx-il
  246. FFMPEG_DEPENDENCIES += sf-omx-il
  247. else
  248. FFMPEG_CONF_OPTS += --disable-mmal --disable-omx --disable-omx-rpi
  249. endif
  250. # To avoid a circular dependency only use opencv if opencv itself does
  251. # not depend on ffmpeg.
  252. ifeq ($(BR2_PACKAGE_OPENCV3_LIB_IMGPROC)x$(BR2_PACKAGE_OPENCV3_WITH_FFMPEG),yx)
  253. FFMPEG_CONF_OPTS += --enable-libopencv
  254. FFMPEG_DEPENDENCIES += opencv3
  255. else
  256. FFMPEG_CONF_OPTS += --disable-libopencv
  257. endif
  258. ifeq ($(BR2_PACKAGE_OPUS),y)
  259. FFMPEG_CONF_OPTS += --enable-libopus
  260. FFMPEG_DEPENDENCIES += opus
  261. else
  262. FFMPEG_CONF_OPTS += --disable-libopus
  263. endif
  264. ifeq ($(BR2_PACKAGE_LIBVPX),y)
  265. FFMPEG_CONF_OPTS += --enable-libvpx
  266. FFMPEG_DEPENDENCIES += libvpx
  267. else
  268. FFMPEG_CONF_OPTS += --disable-libvpx
  269. endif
  270. ifeq ($(BR2_PACKAGE_LIBASS),y)
  271. FFMPEG_CONF_OPTS += --enable-libass
  272. FFMPEG_DEPENDENCIES += libass
  273. else
  274. FFMPEG_CONF_OPTS += --disable-libass
  275. endif
  276. ifeq ($(BR2_PACKAGE_LIBBLURAY),y)
  277. FFMPEG_CONF_OPTS += --enable-libbluray
  278. FFMPEG_DEPENDENCIES += libbluray
  279. else
  280. FFMPEG_CONF_OPTS += --disable-libbluray
  281. endif
  282. ifeq ($(BR2_PACKAGE_INTEL_MEDIASDK),y)
  283. FFMPEG_CONF_OPTS += --enable-libmfx
  284. FFMPEG_DEPENDENCIES += intel-mediasdk
  285. else
  286. FFMPEG_CONF_OPTS += --disable-libmfx
  287. endif
  288. ifeq ($(BR2_PACKAGE_RTMPDUMP),y)
  289. FFMPEG_CONF_OPTS += --enable-librtmp
  290. FFMPEG_DEPENDENCIES += rtmpdump
  291. else
  292. FFMPEG_CONF_OPTS += --disable-librtmp
  293. endif
  294. ifeq ($(BR2_PACKAGE_LAME),y)
  295. FFMPEG_CONF_OPTS += --enable-libmp3lame
  296. FFMPEG_DEPENDENCIES += lame
  297. else
  298. FFMPEG_CONF_OPTS += --disable-libmp3lame
  299. endif
  300. ifeq ($(BR2_PACKAGE_LIBMODPLUG),y)
  301. FFMPEG_CONF_OPTS += --enable-libmodplug
  302. FFMPEG_DEPENDENCIES += libmodplug
  303. else
  304. FFMPEG_CONF_OPTS += --disable-libmodplug
  305. endif
  306. ifeq ($(BR2_PACKAGE_SPEEX),y)
  307. FFMPEG_CONF_OPTS += --enable-libspeex
  308. FFMPEG_DEPENDENCIES += speex
  309. else
  310. FFMPEG_CONF_OPTS += --disable-libspeex
  311. endif
  312. ifeq ($(BR2_PACKAGE_LIBTHEORA),y)
  313. FFMPEG_CONF_OPTS += --enable-libtheora
  314. FFMPEG_DEPENDENCIES += libtheora
  315. else
  316. FFMPEG_CONF_OPTS += --disable-libtheora
  317. endif
  318. ifeq ($(BR2_PACKAGE_WAVPACK),y)
  319. FFMPEG_CONF_OPTS += --enable-libwavpack
  320. FFMPEG_DEPENDENCIES += wavpack
  321. else
  322. FFMPEG_CONF_OPTS += --disable-libwavpack
  323. endif
  324. ifeq ($(BR2_PACKAGE_LIBICONV),y)
  325. FFMPEG_CONF_OPTS += --enable-iconv
  326. FFMPEG_DEPENDENCIES += libiconv
  327. else
  328. FFMPEG_CONF_OPTS += --disable-iconv
  329. endif
  330. # ffmpeg freetype support require fenv.h which is only
  331. # available/working on glibc.
  332. # The microblaze variant doesn't provide the needed exceptions
  333. ifeq ($(BR2_PACKAGE_FREETYPE)$(BR2_TOOLCHAIN_USES_GLIBC)x$(BR2_microblaze),yyx)
  334. FFMPEG_CONF_OPTS += --enable-libfreetype
  335. FFMPEG_DEPENDENCIES += freetype
  336. else
  337. FFMPEG_CONF_OPTS += --disable-libfreetype
  338. endif
  339. ifeq ($(BR2_PACKAGE_FONTCONFIG),y)
  340. FFMPEG_CONF_OPTS += --enable-fontconfig
  341. FFMPEG_DEPENDENCIES += fontconfig
  342. else
  343. FFMPEG_CONF_OPTS += --disable-fontconfig
  344. endif
  345. ifeq ($(BR2_PACKAGE_OPENJPEG),y)
  346. FFMPEG_CONF_OPTS += --enable-libopenjpeg
  347. FFMPEG_DEPENDENCIES += openjpeg
  348. else
  349. FFMPEG_CONF_OPTS += --disable-libopenjpeg
  350. endif
  351. ifeq ($(BR2_PACKAGE_X264)$(BR2_PACKAGE_FFMPEG_GPL),yy)
  352. FFMPEG_CONF_OPTS += --enable-libx264
  353. FFMPEG_DEPENDENCIES += x264
  354. else
  355. FFMPEG_CONF_OPTS += --disable-libx264
  356. endif
  357. ifeq ($(BR2_PACKAGE_X265)$(BR2_PACKAGE_FFMPEG_GPL),yy)
  358. FFMPEG_CONF_OPTS += --enable-libx265
  359. FFMPEG_DEPENDENCIES += x265
  360. else
  361. FFMPEG_CONF_OPTS += --disable-libx265
  362. endif
  363. ifeq ($(BR2_PACKAGE_DAV1D),y)
  364. FFMPEG_CONF_OPTS += --enable-libdav1d
  365. FFMPEG_DEPENDENCIES += dav1d
  366. else
  367. FFMPEG_CONF_OPTS += --disable-libdav1d
  368. endif
  369. ifeq ($(BR2_X86_CPU_HAS_MMX),y)
  370. FFMPEG_CONF_OPTS += --enable-x86asm
  371. FFMPEG_DEPENDENCIES += host-nasm
  372. else
  373. FFMPEG_CONF_OPTS += --disable-x86asm
  374. FFMPEG_CONF_OPTS += --disable-mmx
  375. endif
  376. ifeq ($(BR2_X86_CPU_HAS_SSE),y)
  377. FFMPEG_CONF_OPTS += --enable-sse
  378. else
  379. FFMPEG_CONF_OPTS += --disable-sse
  380. endif
  381. ifeq ($(BR2_X86_CPU_HAS_SSE2),y)
  382. FFMPEG_CONF_OPTS += --enable-sse2
  383. else
  384. FFMPEG_CONF_OPTS += --disable-sse2
  385. endif
  386. ifeq ($(BR2_X86_CPU_HAS_SSE3),y)
  387. FFMPEG_CONF_OPTS += --enable-sse3
  388. else
  389. FFMPEG_CONF_OPTS += --disable-sse3
  390. endif
  391. ifeq ($(BR2_X86_CPU_HAS_SSSE3),y)
  392. FFMPEG_CONF_OPTS += --enable-ssse3
  393. else
  394. FFMPEG_CONF_OPTS += --disable-ssse3
  395. endif
  396. ifeq ($(BR2_X86_CPU_HAS_SSE4),y)
  397. FFMPEG_CONF_OPTS += --enable-sse4
  398. else
  399. FFMPEG_CONF_OPTS += --disable-sse4
  400. endif
  401. ifeq ($(BR2_X86_CPU_HAS_SSE42),y)
  402. FFMPEG_CONF_OPTS += --enable-sse42
  403. else
  404. FFMPEG_CONF_OPTS += --disable-sse42
  405. endif
  406. ifeq ($(BR2_X86_CPU_HAS_AVX),y)
  407. FFMPEG_CONF_OPTS += --enable-avx
  408. else
  409. FFMPEG_CONF_OPTS += --disable-avx
  410. endif
  411. ifeq ($(BR2_X86_CPU_HAS_AVX2),y)
  412. FFMPEG_CONF_OPTS += --enable-avx2
  413. else
  414. FFMPEG_CONF_OPTS += --disable-avx2
  415. endif
  416. # Explicitly disable everything that doesn't match for ARM
  417. # FFMPEG "autodetects" by compiling an extended instruction via AS
  418. # This works on compilers that aren't built for generic by default
  419. ifeq ($(BR2_ARM_CPU_ARMV4),y)
  420. FFMPEG_CONF_OPTS += --disable-armv5te
  421. endif
  422. ifeq ($(BR2_ARM_CPU_ARMV6)$(BR2_ARM_CPU_ARMV7A),y)
  423. FFMPEG_CONF_OPTS += --enable-armv6
  424. else
  425. FFMPEG_CONF_OPTS += --disable-armv6 --disable-armv6t2
  426. endif
  427. ifeq ($(BR2_ARM_CPU_HAS_VFPV2),y)
  428. FFMPEG_CONF_OPTS += --enable-vfp
  429. else
  430. FFMPEG_CONF_OPTS += --disable-vfp
  431. endif
  432. ifeq ($(BR2_ARM_CPU_HAS_NEON),y)
  433. FFMPEG_CONF_OPTS += --enable-neon
  434. else ifeq ($(BR2_aarch64),y)
  435. FFMPEG_CONF_OPTS += --enable-neon
  436. else
  437. FFMPEG_CONF_OPTS += --disable-neon
  438. endif
  439. ifeq ($(BR2_mips)$(BR2_mipsel)$(BR2_mips64)$(BR2_mips64el),y)
  440. ifeq ($(BR2_MIPS_SOFT_FLOAT),y)
  441. FFMPEG_CONF_OPTS += --disable-mipsfpu
  442. else
  443. FFMPEG_CONF_OPTS += --enable-mipsfpu
  444. endif
  445. # Fix build failure on "addi opcode not supported"
  446. ifeq ($(BR2_mips_32r6)$(BR2_mips_64r6),y)
  447. FFMPEG_CONF_OPTS += --disable-asm
  448. endif
  449. endif # MIPS
  450. ifeq ($(BR2_POWERPC_CPU_HAS_ALTIVEC),y)
  451. FFMPEG_CONF_OPTS += --enable-altivec
  452. else
  453. FFMPEG_CONF_OPTS += --disable-altivec
  454. endif
  455. # Uses __atomic_fetch_add_4
  456. ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
  457. FFMPEG_CONF_OPTS += --extra-libs=-latomic
  458. endif
  459. ifeq ($(BR2_STATIC_LIBS),)
  460. FFMPEG_CONF_OPTS += --enable-pic
  461. else
  462. FFMPEG_CONF_OPTS += --disable-pic
  463. endif
  464. # Default to --cpu=generic for MIPS architecture, in order to avoid a
  465. # warning from ffmpeg's configure script.
  466. ifeq ($(BR2_mips)$(BR2_mipsel)$(BR2_mips64)$(BR2_mips64el),y)
  467. FFMPEG_CONF_OPTS += --cpu=generic
  468. else ifneq ($(GCC_TARGET_CPU),)
  469. FFMPEG_CONF_OPTS += --cpu="$(GCC_TARGET_CPU)"
  470. else ifneq ($(GCC_TARGET_ARCH),)
  471. FFMPEG_CONF_OPTS += --cpu="$(GCC_TARGET_ARCH)"
  472. endif
  473. FFMPEG_CFLAGS = $(TARGET_CFLAGS)
  474. ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180),y)
  475. FFMPEG_CONF_OPTS += --disable-optimizations
  476. FFMPEG_CFLAGS += -O0
  477. endif
  478. FFMPEG_CONF_ENV += CFLAGS="$(FFMPEG_CFLAGS)"
  479. FFMPEG_CONF_OPTS += $(call qstrip,$(BR2_PACKAGE_FFMPEG_EXTRACONF))
  480. # Override FFMPEG_CONFIGURE_CMDS: FFmpeg does not support --target and others
  481. define FFMPEG_CONFIGURE_CMDS
  482. (cd $(FFMPEG_SRCDIR) && rm -rf config.cache && \
  483. $(TARGET_CONFIGURE_OPTS) \
  484. $(TARGET_CONFIGURE_ARGS) \
  485. $(FFMPEG_CONF_ENV) \
  486. ./configure \
  487. --enable-cross-compile \
  488. --cross-prefix=$(TARGET_CROSS) \
  489. --sysroot=$(STAGING_DIR) \
  490. --host-cc="$(HOSTCC)" \
  491. --arch=$(BR2_ARCH) \
  492. --target-os="linux" \
  493. --disable-stripping \
  494. --pkg-config="$(PKG_CONFIG_HOST_BINARY)" \
  495. $(SHARED_STATIC_LIBS_OPTS) \
  496. $(FFMPEG_CONF_OPTS) \
  497. )
  498. endef
  499. define FFMPEG_REMOVE_EXAMPLE_SRC_FILES
  500. rm -rf $(TARGET_DIR)/usr/share/ffmpeg/examples
  501. endef
  502. FFMPEG_POST_INSTALL_TARGET_HOOKS += FFMPEG_REMOVE_EXAMPLE_SRC_FILES
  503. $(eval $(autotools-package))